X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0367c1c0e82c6da38cea16c4bcef6583271789cc..4fcd60c72f6b90f5063f7000ff5a80a9004055a3:/src/os2/window.cpp?ds=sidebyside diff --git a/src/os2/window.cpp b/src/os2/window.cpp index fbcfcc1029..bd50f98ca9 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -1454,6 +1454,7 @@ void wxWindowOS2::DoMoveWindow( , int nHeight ) { +#if 0 // x and y coords should already be in os2 coordinates RECTL vRect; HWND hParent; wxWindow* pParent = GetParent(); @@ -1464,7 +1465,7 @@ void wxWindowOS2::DoMoveWindow( hParent = HWND_DESKTOP; ::WinQueryWindowRect(hParent, &vRect); nY = vRect.yTop - (nY + nHeight); - +#endif if ( !::WinSetWindowPos( GetHwnd() ,HWND_TOP ,(LONG)nX @@ -1638,29 +1639,6 @@ wxPoint wxWindowOS2::GetClientAreaOrigin() const return wxPoint(0, 0); } // end of wxWindowOS2::GetClientAreaOrigin -void wxWindowOS2::AdjustForParentClientOrigin( - int& rX -, int& rY -, int nSizeFlags -) -{ - // - // Don't do it for the dialogs/frames - they float independently of their - // parent - // - if (!IsTopLevel()) - { - wxWindow* pParent = GetParent(); - - if (!(nSizeFlags & wxSIZE_NO_ADJUSTMENTS) && pParent) - { - wxPoint vPoint(pParent->GetClientAreaOrigin()); - rX += vPoint.x; - rY += vPoint.y; - } - } -} // end of wxWindowOS2::AdjustForParentClientOrigin - // --------------------------------------------------------------------------- // text metrics // --------------------------------------------------------------------------- @@ -2005,17 +1983,9 @@ bool wxWindowOS2::OS2ProcessMessage( } else { - wxPanel* pPanel = wxDynamicCast(this, wxPanel); - wxButton* pBtn = NULL; - - if (pPanel) - { - // - // Panel may have a default button which should - // be activated by Enter - // - pBtn = pPanel->GetDefaultItem(); - } + wxButton* pBtn = wxDynamicCast( GetDefaultItem() + ,wxButton + ); if (pBtn && pBtn->IsEnabled()) { @@ -2892,32 +2862,6 @@ void wxWindowOS2::OnSetFocus( wxFocusEvent& rEvent ) { - // - // Panel wants to track the window which was the last to have focus in it, - // so we want to set ourselves as the window which last had focus - // - // Notice that it's also important to do it upwards the tree becaus - // otherwise when the top level panel gets focus, it won't set it back to - // us, but to some other sibling - // - wxWindow* pWin = this; - - while (pWin) - { - wxWindow* pParent = pWin->GetParent(); - wxPanel* pPanel = wxDynamicCast( pParent - ,wxPanel - ); - if (pPanel) - { - pPanel->SetLastFocus(pWin); - } - pWin = pParent; - } - - wxLogTrace(_T("focus"), _T("%s (0x%08x) gets focus"), - GetClassInfo()->GetClassName(), GetHandle()); - rEvent.Skip(); } // end of wxWindowOS2::OnSetFocus @@ -2948,16 +2892,14 @@ bool wxWindowOS2::HandleSetFocus( } #endif // wxUSE_CARET - // - // Panel wants to track the window which was the last to have focus in it - // - wxPanel* pPanel = wxDynamicCast( GetParent() - ,wxPanel - ); - if (pPanel) +#if wxUSE_TEXTCTRL + // If it's a wxTextCtrl don't send the event as it will be done + // after the control gets to process it from EN_FOCUS handler + if ( wxDynamicCastThis(wxTextCtrl) ) { - pPanel->SetLastFocus(this); + return FALSE; } +#endif // wxUSE_TEXTCTRL wxFocusEvent vEvent(wxEVT_SET_FOCUS, m_windowId);