X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/774468bd68541b568f2aeeaf8fe77d6141f2927a..c921fd5994d6d22b08ec98512eb59ee6f8939460:/src/os2/window.cpp diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 3c6e0b747e..99bd6f5a51 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -33,6 +33,7 @@ #include "wx/frame.h" #include "wx/listbox.h" #include "wx/button.h" + #include "wx/bmpbuttn.h" #include "wx/msgdlg.h" #include "wx/scrolwin.h" #include "wx/radiobox.h" @@ -1453,14 +1454,7 @@ void wxWindowOS2::SetDropTarget( wxDropTarget* pDropTarget ) { - if (m_dropTarget != 0) - { - m_dropTarget->Revoke(m_hWnd); - delete m_dropTarget; - } m_dropTarget = pDropTarget; - if (m_dropTarget != 0) - m_dropTarget->Register(m_hWnd); } // end of wxWindowOS2::SetDropTarget #endif @@ -2233,6 +2227,8 @@ static void wxYieldForCommandsOnly() { wxTheApp->DoMessage((WXMSG*)&vMsg); } + if (vMsg.msg == WM_QUIT) + ::WinPostMsg(NULL, WM_QUIT, 0, 0); } #endif // wxUSE_MENUS_NATIVE @@ -2426,6 +2422,14 @@ bool wxWindowOS2::OS2ProcessMessage( pBtn->OS2Command(BN_CLICKED, 0 /* unused */); return TRUE; } + else if (!IsTopLevel()) + { + // + // if not a top level window, let parent + // handle it + // + return FALSE; + } // else: but if it does not it makes sense to make // it work like a TAB - and that's what we do. // Note that Ctrl-Enter always works this way. @@ -2814,6 +2818,11 @@ MRESULT wxWindowOS2::OS2WindowProc( ,&nX ,&nY ); + if (!pWin->IsOfStandardClass()) + { + if (uMsg == WM_BUTTON1DOWN && pWin->AcceptsFocus() ) + pWin->SetFocus(); + } bProcessed = pWin->HandleMouseEvent( uMsg ,nX ,nY @@ -3514,7 +3523,6 @@ bool wxWindowOS2::HandleDestroy() #if wxUSE_DRAG_AND_DROP if (m_dropTarget != NULL) { - m_dropTarget->Revoke(m_hWnd); delete m_dropTarget; m_dropTarget = NULL; } @@ -3971,6 +3979,21 @@ void wxWindowOS2::OnSysColourChanged( // painting // --------------------------------------------------------------------------- +void wxWindow::OnPaint ( + wxPaintEvent& rEvent +) +{ + HDC hDC = (HDC)wxPaintDC::FindDCInCache((wxWindow*) rEvent.GetEventObject()); + + if (hDC != 0) + { + OS2DefWindowProc( (WXUINT)WM_PAINT + ,(WXWPARAM)hDC + ,(WXLPARAM)0 + ); + } +} // end of wxWindow::OnPaint + bool wxWindowOS2::HandlePaint() { HRGN hRgn;