]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/textctrl.cpp
Only call use uppercase letter if control, alt, or shift is held down,
[wxWidgets.git] / src / os2 / textctrl.cpp
index 3949c8f7872e9cd48c3713876b1cc80d27008af8..3b2b97719ae88dcd3cc30684b3c86ecc72de1200 100644 (file)
@@ -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
 )