4
4
// Author: Julian Smart
5
5
// Modified by: VZ on 13.05.99: no more Default(), MSWOnXXX() reorganisation
7
// RCS-ID: $Id: window.cpp,v 1.730.2.4 2007/04/16 13:02:49 VZ Exp $
7
// RCS-ID: $Id: window.cpp 49475 2007-10-26 22:35:54Z RD $
8
8
// Copyright: (c) Julian Smart
9
9
// Licence: wxWindows licence
10
10
/////////////////////////////////////////////////////////////////////////////
1490
1516
if ( !m_frozenness++ )
1492
1518
if ( IsShown() )
1493
SendSetRedraw(GetHwnd(), false);
1522
// If this is a TLW, then freeze it's non-TLW children
1523
// instead. This is needed because on Windows a frozen TLW
1524
// lets window paint and mouse events pass through to other
1525
// Windows below this one in z-order.
1526
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
1528
node = node->GetNext() )
1530
wxWindow *child = node->GetData();
1531
if ( child->IsTopLevel() )
1537
else // This is not a TLW, so just freeze it.
1539
SendSetRedraw(GetHwnd(), false);
1503
1551
if ( IsShown() )
1505
SendSetRedraw(GetHwnd(), true);
1555
// If this is a TLW, then Thaw it's non-TLW children
1556
// instead. See Freeze.
1557
for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
1559
node = node->GetNext() )
1561
wxWindow *child = node->GetData();
1562
if ( child->IsTopLevel() )
1568
else // This is not a TLW, so just thaw it.
1570
SendSetRedraw(GetHwnd(), true);
1507
1573
// we need to refresh everything or otherwise the invalidated area
1508
1574
// is not going to be repainted
3236
3302
#endif // __WXWINCE__
3305
// If we want the default themed border then we need to draw it ourselves
3308
wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
3309
if (theme && GetBorder() == wxBORDER_THEME)
3311
// first ask the widget to calculate the border size
3312
rc.result = MSWDefWindowProc(message, wParam, lParam);
3315
// now alter the client size making room for drawing a themed border
3316
NCCALCSIZE_PARAMS *csparam = NULL;
3320
csparam = (NCCALCSIZE_PARAMS*)lParam;
3321
rect = csparam->rgrc[0];
3325
rect = *((RECT*)lParam);
3327
wxUxThemeHandle hTheme(this, L"EDIT");
3328
RECT rcClient = { 0, 0, 0, 0 };
3329
wxClientDC dc(this);
3331
if (theme->GetThemeBackgroundContentRect(
3332
hTheme, GetHdcOf(dc), EP_EDITTEXT, ETS_NORMAL,
3333
&rect, &rcClient) == S_OK)
3335
InflateRect(&rcClient, -1, -1);
3337
csparam->rgrc[0] = rcClient;
3339
*((RECT*)lParam) = rcClient;
3340
rc.result = WVR_REDRAW;
3348
wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
3349
if (theme && GetBorder() == wxBORDER_THEME)
3351
// first ask the widget to paint its non-client area, such as scrollbars, etc.
3352
rc.result = MSWDefWindowProc(message, wParam, lParam);
3355
wxUxThemeHandle hTheme(this, L"EDIT");
3356
wxWindowDC dc(this);
3358
// Clip the DC so that you only draw on the non-client area
3360
wxCopyRectToRECT(GetSize(), rcBorder);
3363
theme->GetThemeBackgroundContentRect(
3364
hTheme, GetHdcOf(dc), EP_EDITTEXT, ETS_NORMAL, &rcBorder, &rcClient);
3365
InflateRect(&rcClient, -1, -1);
3367
::ExcludeClipRect(GetHdcOf(dc), rcClient.left, rcClient.top,
3368
rcClient.right, rcClient.bottom);
3370
// Make sure the background is in a proper state
3371
if (theme->IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
3373
theme->DrawThemeParentBackground(GetHwnd(), GetHdcOf(dc), &rcBorder);
3379
nState = ETS_DISABLED;
3380
// should we check this?
3381
//else if ( ::GetWindowLong(GetHwnd(), GWL_STYLE) & ES_READONLY)
3382
// nState = ETS_READONLY;
3384
nState = ETS_NORMAL;
3385
theme->DrawThemeBackground(hTheme, GetHdcOf(dc), EP_EDITTEXT, nState, &rcBorder, NULL);
3390
#endif // wxUSE_UXTHEME
3239
3394
if ( !processed )