msflags |= WS_VISIBLE;
}
- return MSWCreate(wxCanvasClassName, NULL, pos, size, msflags, exstyle);
+ if ( !MSWCreate(wxCanvasClassName, NULL, pos, size, msflags, exstyle) )
+ return false;
+
+ InheritAttributes();
+
+ return true;
}
// ---------------------------------------------------------------------------
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;
}
wxASSERT_MSG( !theFont || theFont->Ok(),
_T("invalid font in GetTextExtent()") );
- const wxFont fontToUse(theFont ? *theFont : GetFont());
+ wxFont fontToUse;
+ if (theFont)
+ fontToUse = *theFont;
+ else
+ fontToUse = GetFont();
WindowHDC hdc(GetHwnd());
SelectInHDC selectFont(hdc, GetHfontOf(fontToUse));
point.y = y;
::ClientToScreen(hWnd, &point);
wxCurrentPopupMenu = menu;
+#if defined(__WXWINCE__)
UINT flags = 0;
-#if !defined(__WXWINCE__)
- flags = TPM_RIGHTBUTTON;
+#else
+ UINT flags = TPM_RIGHTBUTTON;
#endif
::TrackPopupMenu(hMenu, flags, point.x, point.y, 0, hWnd, NULL);
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;
}
return true;
}
}
+#else
+ wxUnusedVar(lParam);
#endif // wxUSE_TOOLTIPS
return false;
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;
{
TEXTMETRIC tm;
HDC dc = ::GetDC((HWND) wnd);
- HFONT fnt =0;
HFONT was = 0;
// the_font.UseResource();
// the_font.RealizeResource();
- fnt = (HFONT)the_font.GetResourceHandle(); // const_cast
+ HFONT fnt = (HFONT)the_font.GetResourceHandle(); // const_cast
if ( fnt )
was = (HFONT) SelectObject(dc,fnt);