BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground)
EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
+#ifdef __WXWINCE__
EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
+#endif
END_EVENT_TABLE()
// ===========================================================================
return;
}
- if ( x == wxDefaultPosition.x && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+ if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
x = currentX;
- if ( y == wxDefaultPosition.y && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+ if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
y = currentY;
AdjustForParentClientOrigin(x, y, sizeFlags);
wxSize size = wxDefaultSize;
- if ( width == wxDefaultSize.x )
+ if ( width == wxDefaultCoord )
{
if ( sizeFlags & wxSIZE_AUTO_WIDTH )
{
}
}
- if ( height == wxDefaultSize.y )
+ if ( height == wxDefaultCoord )
{
if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
{
- if ( size.x == wxDefaultSize.x )
+ if ( size.x == wxDefaultCoord )
{
size = DoGetBestSize();
}
::GetClientRect(GetHwnd(), &rectClient);
// if the size is already ok, stop here (rectClient.left = top = 0)
- if ( (rectClient.right == width || width == wxDefaultSize.x) &&
- (rectClient.bottom == height || height == wxDefaultSize.y) )
+ if ( (rectClient.right == width || width == wxDefaultCoord) &&
+ (rectClient.bottom == height || height == wxDefaultCoord) )
{
break;
}
bool nonDefault = false;
- if ( pos.x == wxDefaultPosition.x )
+ if ( pos.x == wxDefaultCoord )
{
// if x is set to CW_USEDEFAULT, y parameter is ignored anyhow so we
// can just as well set it to CW_USEDEFAULT as well
// neither because it is not handled as a special value by Windows then
// and so we have to choose some default value for it
x = pos.x;
- y = pos.y == wxDefaultPosition.y ? DEFAULT_Y : pos.y;
+ y = pos.y == wxDefaultCoord ? DEFAULT_Y : pos.y;
nonDefault = true;
}
// However, on PocketPC devices, we must use the default
// size if possible.
#ifdef _WIN32_WCE
- if (size.x == wxDefaultSize.x)
+ if (size.x == wxDefaultCoord)
w = CW_USEDEFAULT;
else
w = size.x;
- if (size.y == wxDefaultSize.y)
+ if (size.y == wxDefaultCoord)
h = CW_USEDEFAULT;
else
h = size.y;
#else
- if ( size.x == wxDefaultSize.x || size.y == wxDefaultSize.y)
+ if ( size.x == wxDefaultCoord || size.y == wxDefaultCoord)
{
nonDefault = true;
}
bool wxWindowMSW::HandleSetFocus(WXHWND hwnd)
{
+ // Strangly enough, some controls get set focus events when they are being
+ // deleted, even if they already had focus before.
+ if ( m_isBeingDeleted )
+ {
+ return false;
+ }
+
// notify the parent keeping track of focus for the kbd navigation
// purposes that we got it
wxChildFocusEvent eventFocus((wxWindow *)this);
bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
{
#ifdef __WXWINCE__
+ wxUnusedVar(mmInfo);
return false;
#else
MINMAXINFO *info = (MINMAXINFO *)mmInfo;
maxWidth = GetMaxWidth(),
maxHeight = GetMaxHeight();
- if ( minWidth != wxDefaultSize.x )
+ if ( minWidth != wxDefaultCoord )
{
info->ptMinTrackSize.x = minWidth;
rc = true;
}
- if ( minHeight != wxDefaultSize.y )
+ if ( minHeight != wxDefaultCoord )
{
info->ptMinTrackSize.y = minHeight;
rc = true;
}
- if ( maxWidth != wxDefaultSize.x )
+ if ( maxWidth != wxDefaultCoord )
{
info->ptMaxTrackSize.x = maxWidth;
rc = true;
}
- if ( maxHeight != wxDefaultSize.y )
+ if ( maxHeight != wxDefaultCoord )
{
info->ptMaxTrackSize.y = maxHeight;
rc = true;
#endif // __WXWINCE__
+#ifdef __WXWINCE__
+
+#if wxUSE_STATBOX
+static void wxAdjustZOrder(wxWindow* parent)
+{
+ if (parent->IsKindOf(CLASSINFO(wxStaticBox)))
+ {
+ // Set the z-order correctly
+ SetWindowPos((HWND) parent->GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+ }
+
+ wxWindowList::compatibility_iterator current = parent->GetChildren().GetFirst();
+ while (current)
+ {
+ wxWindow *childWin = current->GetData();
+ wxAdjustZOrder(childWin);
+ current = current->GetNext();
+ }
+}
+#endif
+
+// We need to adjust the z-order of static boxes in WinCE, to
+// make 'contained' controls visible
+void wxWindowMSW::OnInitDialog( wxInitDialogEvent& event )
+{
+#if wxUSE_STATBOX
+ wxAdjustZOrder(this);
+#endif
+
+ event.Skip();
+}
+#endif
+