X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4e7c2aa5822f9a6e97d8d7848b95ea2eadcd98b..520e470fdd0daef09c77938db642e4583933c90d:/src/msw/statbmp.cpp diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 14b4f94c9b..8cf17984c8 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -46,8 +46,8 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, SetName(name); if (parent) parent->AddChild(this); - m_backgroundColour = parent->GetDefaultBackgroundColour() ; - m_foregroundColour = parent->GetDefaultForegroundColour() ; + m_backgroundColour = parent->GetBackgroundColour() ; + m_foregroundColour = parent->GetForegroundColour() ; if ( id == -1 ) m_windowId = (int)NewControlId(); @@ -69,14 +69,23 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, // Use an ownerdraw button to produce a static bitmap, since there's // no ownerdraw static. // TODO: perhaps this should be a static item, with style SS_BITMAP. - HWND static_item = - CreateWindowEx(0, "BUTTON", "", BS_OWNERDRAW | WS_TABSTOP | WS_CHILD, - 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, - wxGetInstance(), NULL); - m_hWnd = (WXHWND) static_item; + m_hWnd = (WXHWND)CreateWindow + ( + "BUTTON", + "", + BS_OWNERDRAW | WS_TABSTOP | WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, + (HWND)parent->GetHWND(), + (HMENU)m_windowId, + wxGetInstance(), + NULL + ); // Subclass again for purposes of dialog editing mode - SubclassWin((WXHWND) static_item); + SubclassWin(m_hWnd); + + SetFont(* GetParent()->GetFont()); + SetSize(x, y, width, height); return TRUE; } @@ -93,6 +102,8 @@ void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y1 = currentY; + AdjustForParentClientOrigin(x1, y1, sizeFlags); + int actualWidth = width; int actualHeight = height;