X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5ea767eb8f7950caa42e06803ff38869b449c8b..418b74a078f6502deff7ad4a4d562b9cc496774d:/src/os2/window.cpp diff --git a/src/os2/window.cpp b/src/os2/window.cpp index ce34797831..3c6e0b747e 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -27,6 +27,8 @@ #include "wx/app.h" #include "wx/panel.h" #include "wx/layout.h" + #include "wx/checkbox.h" + #include "wx/combobox.h" #include "wx/dialog.h" #include "wx/frame.h" #include "wx/listbox.h" @@ -34,6 +36,7 @@ #include "wx/msgdlg.h" #include "wx/scrolwin.h" #include "wx/radiobox.h" + #include "wx/radiobut.h" #include "wx/slider.h" #include "wx/statbox.h" #include "wx/statusbr.h" @@ -506,6 +509,14 @@ bool wxWindowOS2::Enable( if ( hWnd ) ::WinEnableWindow(hWnd, (BOOL)bEnable); + // + // The logic below doesn't apply to the top level windows -- otherwise + // showing a modal dialog would result in total greying out (and ungreying + // out later) of everything which would be really ugly + // + if (IsTopLevel()) + return TRUE; + wxWindowList::Node* pNode = GetChildren().GetFirst(); while (pNode) @@ -2969,6 +2980,26 @@ MRESULT wxWindowOS2::OS2WindowProc( case WM_CONTROL: switch(SHORT2FROMMP(wParam)) { + case BN_PAINT: + { + HWND hWnd = ::WinWindowFromID((HWND)GetHwnd(), SHORT1FROMMP(wParam)); + wxWindowOS2* pWin = wxFindWinFromHandle(hWnd); + + if (!pWin) + { + bProcessed = FALSE; + break; + } + if (pWin->IsKindOf(CLASSINFO(wxBitmapButton))) + { + wxBitmapButton* pBitmapButton = wxDynamicCast(pWin, wxBitmapButton); + + pBitmapButton->OS2OnDraw((WXDRAWITEMSTRUCT *)lParam); + } + return 0; + } + break; + case BKN_PAGESELECTEDPENDING: { PPAGESELECTNOTIFY pPage = (PPAGESELECTNOTIFY)lParam; @@ -4593,7 +4624,10 @@ void wxWindowOS2::MoveChildren( int nDiff ) { - if (GetAutoLayout()) + // + // We want to handle top levels ourself, manually + // + if (!IsTopLevel() && GetAutoLayout()) { Layout(); }