X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a712ba3cfe27e8d39ee8fe8691ff67d1c96cb43..27c78e4552aaefac9a4db0d4453eff09cdfef2ad:/src/os2/window.cpp?ds=sidebyside diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 8b37718764..f9ebf96140 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: windows.cpp +// Name: src/os2/window.cpp // Purpose: wxWindow // Author: David Webster // Modified by: @@ -47,7 +47,7 @@ #include #endif -#if wxUSE_OWNER_DRAWN +#if wxUSE_OWNER_DRAWN #include "wx/ownerdrw.h" #endif @@ -410,9 +410,7 @@ bool wxWindowOS2::Create( wxWindow* pParent, pParent->AddChild(this); hParent = GetWinHwnd(pParent); - if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) || - pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) - ) + if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow))) ulCreateFlags |= WS_CLIPSIBLINGS; } @@ -576,15 +574,15 @@ void wxWindowOS2::Lower() ::WinSetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER | SWP_DEACTIVATE); } // end of wxWindowOS2::Lower -void wxWindowOS2::SetTitle( const wxString& rTitle ) +void wxWindowOS2::SetLabel( const wxString& label ) { - ::WinSetWindowText(GetHwnd(), (PSZ)rTitle.c_str()); -} // end of wxWindowOS2::SetTitle + ::WinSetWindowText(GetHwnd(), (PSZ)label.c_str()); +} // end of wxWindowOS2::SetLabel -wxString wxWindowOS2::GetTitle() const +wxString wxWindowOS2::GetLabel() const { return wxGetWindowText(GetHWND()); -} // end of wxWindowOS2::GetTitle +} // end of wxWindowOS2::GetLabel void wxWindowOS2::DoCaptureMouse() { @@ -595,7 +593,7 @@ void wxWindowOS2::DoCaptureMouse() ::WinSetCapture(HWND_DESKTOP, hWnd); m_bWinCaptured = true; } -} // end of wxWindowOS2::GetTitle +} // end of wxWindowOS2::DoCaptureMouse void wxWindowOS2::DoReleaseMouse() { @@ -1577,9 +1575,7 @@ void wxWindowOS2::DoMoveWindow( // which will cause the scrollbars to be displayed via the SetScrollbar // call in CWindow. // - if ( IsKindOf(CLASSINFO(wxGenericScrolledWindow)) || - IsKindOf(CLASSINFO(wxScrolledWindow)) - ) + if (IsKindOf(CLASSINFO(wxScrolledWindow))) { int nAdjustWidth = 0; int nAdjustHeight = 0; @@ -1813,7 +1809,7 @@ void wxWindowOS2::GetTextExtent( const wxString& rString, hPS = ::WinGetPS(GetHwnd()); - l = rString.Length(); + l = rString.length(); if (l > 0L) { pStr = (PCH)rString.c_str(); @@ -1821,12 +1817,12 @@ void wxWindowOS2::GetTextExtent( const wxString& rString, // // In world coordinates. // - bRc = ::GpiQueryTextBox( hPS - ,l - ,pStr - ,TXTBOX_COUNT // return maximum information - ,avPoint // array of coordinates points - ); + bRc = ::GpiQueryTextBox( hPS, + l, + pStr, + TXTBOX_COUNT,// return maximum information + avPoint // array of coordinates points + ); if (bRc) { vPtMin.x = avPoint[0].x; @@ -1914,9 +1910,7 @@ bool wxWindowOS2::IsMouseInWindow() const // --------------------------------------------------------------------------- // #if wxUSE_MENUS_NATIVE -bool wxWindowOS2::DoPopupMenu( wxMenu* pMenu, - int nX, - int nY ) +bool wxWindowOS2::DoPopupMenu( wxMenu* pMenu, int nX, int nY ) { HWND hWndOwner = GetHwnd(); HWND hWndParent = GetHwnd(); @@ -3824,14 +3818,12 @@ bool wxWindowOS2::HandleEraseBkgnd( WXHDC hDC ) return true; } // end of wxWindowOS2::HandleEraseBkgnd -void wxWindowOS2::OnEraseBackground( - wxEraseEvent& rEvent -) +void wxWindowOS2::OnEraseBackground(wxEraseEvent& rEvent) { - RECTL vRect; - HPS hPS = rEvent.m_dc->m_hPS; - APIRET rc; - LONG lColor = m_backgroundColour.GetPixel(); + RECTL vRect; + HPS hPS = rEvent.GetDC()->GetHPS(); + APIRET rc; + LONG lColor = m_backgroundColour.GetPixel(); rc = ::WinQueryWindowRect(GetHwnd(), &vRect); rc = ::WinFillRect(hPS, &vRect, lColor); @@ -3884,25 +3876,15 @@ bool wxWindowOS2::HandleGetMinMaxInfo( PSWP pSwp ) switch(pSwp->fl) { case SWP_MAXIMIZE: -#if !(defined(__WATCOMC__) && __WATCOMC__ < 1240 ) -// Open Watcom 1.3 had incomplete headers -// that's reported and should be fixed for OW 1.4 ::WinGetMaxPosition(GetHwnd(), pSwp); m_maxWidth = pSwp->cx; m_maxHeight = pSwp->cy; -#endif break; case SWP_MINIMIZE: -#if !(defined(__WATCOMC__) && __WATCOMC__ < 1240 ) -// Open Watcom 1.3 had incomplete headers -// that's reported and should be fixed for OW 1.4 ::WinGetMinPosition(GetHwnd(), pSwp, &vPoint); m_minWidth = pSwp->cx; m_minHeight = pSwp->cy; -#else - wxUnusedVar(vPoint); -#endif break; default: @@ -3961,7 +3943,7 @@ bool wxWindowOS2::HandleSysCommand( WXWPARAM wParam, // --------------------------------------------------------------------------- // mouse events // --------------------------------------------------------------------------- -//TODO!!! check against MSW +//TODO: check against MSW void wxWindowOS2::InitMouseEvent( wxMouseEvent& rEvent , int nX @@ -5126,7 +5108,7 @@ const wxChar* wxGetMessageName( int nMessage ) } static wxString s_szBuf; - s_szBuf.Printf(wxT(""), message); + s_szBuf.Printf(wxT(""), nMessage); return s_szBuf.c_str(); } // end of wxGetMessageName @@ -5167,25 +5149,21 @@ static void TranslateKbdEventToMouse( // Find the wxWindow at the current mouse position, returning the mouse // position. -wxWindow* wxFindWindowAtPointer( - wxPoint& WXUNUSED(rPt) -) +wxWindow* wxFindWindowAtPointer(wxPoint& WXUNUSED(rPt)) { return wxFindWindowAtPoint(wxGetMousePosition()); } -wxWindow* wxFindWindowAtPoint( - const wxPoint& rPt -) +wxWindow* wxFindWindowAtPoint(const wxPoint& rPt) { - POINTL vPt2; + POINTL vPt2; vPt2.x = rPt.x; vPt2.y = rPt.y; - HWND hWndHit = ::WinWindowFromPoint(HWND_DESKTOP, &vPt2, FALSE); - wxWindow* pWin = wxFindWinFromHandle((WXHWND)hWndHit) ; - HWND hWnd = hWndHit; + HWND hWndHit = ::WinWindowFromPoint(HWND_DESKTOP, &vPt2, FALSE); + wxWindow* pWin = wxFindWinFromHandle((WXHWND)hWndHit) ; + HWND hWnd = hWndHit; // // Try to find a window with a wxWindow associated with it