style |= WS_VISIBLE;
}
- // choose the position for the control
+ // choose the position for the control: we have a problem with default size
+ // here as we can't calculate the best size before the control exists
+ // (DoGetBestSize() may need to use m_hWnd), so just choose the minimal
+ // possible but non 0 size because 0 window width/height result in problems
+ // elsewhere
int x = pos.x == wxDefaultCoord ? 0 : pos.x,
y = pos.y == wxDefaultCoord ? 0 : pos.y,
- w = size.x == wxDefaultCoord ? 0 : size.x,
- h = size.y == wxDefaultCoord ? 0 : size.y;
+ w = size.x == wxDefaultCoord ? 1 : size.x,
+ h = size.y == wxDefaultCoord ? 1 : size.y;
// ... and adjust it to account for a possible parent frames toolbar
AdjustForParentClientOrigin(x, y);
{
HDC hdc = (HDC)pDC;
if ( m_hasFgCol )
+ {
::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
+ if ( !colBg.Ok() )
+ colBg = GetBackgroundColour();
+ }
if ( colBg.Ok() )
{
::SetBkMode((HDC)pDC, TRANSPARENT);
-#if wxUSE_UXTHEME && wxUSE_NOTEBOOK
- if ( wxUxThemeEngine::GetIfActive() )
- {
- for ( wxWindow *win = this; win; win = win->GetParent() )
- {
- wxNotebook *nbook = wxDynamicCast(win, wxNotebook);
- if ( nbook )
- {
- // return value may be NULL but it is ok: if the first parent
- // notebook doesn't use themes, then we don't have to process
- // this message at all, so let default processing take place
- return nbook->GetThemeBackgroundBrush(pDC, this);
- }
- }
- }
-#endif // wxUSE_UXTHEME
+ hbr = MSWGetBgBrush(pDC);
- return MSWAlwaysDrawBg() ? 0 : ::GetStockObject(NULL_BRUSH);
+ return hbr ? hbr : MSWGetDefaultBgBrush();
}
WXHBRUSH wxControl::MSWControlColorDisabled(WXHDC pDC)