X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/217c78b80b34f31b4341d6257e28077255d6eb93..c921fd5994d6d22b08ec98512eb59ee6f8939460:/src/os2/textctrl.cpp diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 3949c8f787..3b2b97719a 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -86,6 +86,10 @@ wxTextCtrl::wxTextCtrl() { } +wxTextCtrl::~wxTextCtrl() +{ +} + bool wxTextCtrl::Create( wxWindow* pParent , wxWindowID vId @@ -93,14 +97,13 @@ bool wxTextCtrl::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) { HWND hParent; int nTempy; + // // Base initialization // @@ -109,9 +112,7 @@ bool wxTextCtrl::Create( ,rPos ,rSize ,lStyle -#if wxUSE_VALIDATORS ,rValidator -#endif ,rsName )) return FALSE; @@ -125,6 +126,7 @@ bool wxTextCtrl::Create( } m_windowStyle = lStyle; + m_bIsMLE = FALSE; long lSstyle = WS_VISIBLE | WS_TABSTOP; @@ -200,7 +202,7 @@ bool wxTextCtrl::Create( // // Set font, position, size and initial value // - wxFont* pTextFont = new wxFont( 10 + wxFont* pTextFont = new wxFont( 8 ,wxMODERN ,wxNORMAL ,wxNORMAL @@ -218,8 +220,8 @@ bool wxTextCtrl::Create( ::WinQueryWindowPos(m_hWnd, &vSwp); SetXComp(vSwp.x); SetYComp(vSwp.y); - SetSize( vPos.x - ,vPos.y + SetSize( vPos.x - GetXComp() + ,vPos.y - GetYComp() ,rSize.x ,rSize.y ); @@ -1169,9 +1171,11 @@ void wxTextCtrl::AdjustSpaceLimit() bool wxTextCtrl::AcceptsFocus() const { // - // We don't want focus if we can't be edited + // We don't want focus if we can't be edited unless we're a multiline + // control because then it might be still nice to get focus from keyboard + // to be able to scroll it without mouse // - return IsEditable() && wxControl::AcceptsFocus(); + return (IsEditable() || IsMultiLine()) && wxControl::AcceptsFocus(); } // end of wxTextCtrl::Command wxSize wxTextCtrl::DoGetBestSize() const @@ -1231,6 +1235,29 @@ void wxTextCtrl::OnRedo( Redo(); } // end of wxTextCtrl::OnRedo +void wxTextCtrl::OnDelete( + wxCommandEvent& rEvent +) +{ + long lFrom; + long lTo; + + GetSelection( &lFrom + ,&lTo + ); + if (lFrom != -1 && lTo != -1) + Remove( lFrom + ,lTo + ); +} // end of wxTextCtrl::OnDelete + +void wxTextCtrl::OnSelectAll( + wxCommandEvent& rEvent +) +{ + SetSelection(-1, -1); +} // end of wxTextCtrl::OnSelectAll + void wxTextCtrl::OnUpdateCut( wxUpdateUIEvent& rEvent ) @@ -1266,6 +1293,26 @@ void wxTextCtrl::OnUpdateRedo( rEvent.Enable(CanRedo()); } // end of wxTextCtrl::OnUpdateRedo +void wxTextCtrl::OnUpdateDelete( + wxUpdateUIEvent& rEvent +) +{ + long lFrom; + long lTo; + + GetSelection( &lFrom + ,&lTo + ); + rEvent.Enable( lFrom != -1L && lTo != -1L && lFrom != lTo && IsEditable()) ; +} // end of wxTextCtrl::OnUpdateDelete + +void wxTextCtrl::OnUpdateSelectAll( + wxUpdateUIEvent& rEvent +) +{ + rEvent.Enable(GetLastPosition() > 0); +} // end of wxTextCtrl::OnUpdateSelectAll + bool wxTextCtrl::SetBackgroundColour( const wxColour& rColour )