]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxTextCtrl::SetMaxLength for rich edit controls
authorJulian Smart <julian@anthemion.co.uk>
Sat, 31 Jul 2004 15:43:20 +0000 (15:43 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 31 Jul 2004 15:43:20 +0000 (15:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/text.tex
src/msw/textctrl.cpp

index 6f07c51e25ac0f14115f958e3a1d849a76b1a4cf..fd457f9746cfeb5e01fbfae2ae7f956bc9a3bef8 100644 (file)
@@ -257,6 +257,7 @@ wxMSW:
 - support for alpha channel in toolbar bitmaps (Jurgen Doornik)
 - wxFileDialog can now be moved and centered (Randall Fox)
 - restored (and improved) possibility to use wx with MFC broken in 2.5.2
 - support for alpha channel in toolbar bitmaps (Jurgen Doornik)
 - wxFileDialog can now be moved and centered (Randall Fox)
 - restored (and improved) possibility to use wx with MFC broken in 2.5.2
+- fixed wxTextCtrl::SetMaxLength for rich edit controls
 
 wxUniv/X11:
 
 
 wxUniv/X11:
 
@@ -265,6 +266,7 @@ wxUniv/X11:
 wxWinCE:
 
 - added automatized but customizable handling of native SmartPhone menus
 wxWinCE:
 
 - added automatized but customizable handling of native SmartPhone menus
+- fixed wxRadioBox and wxStaticBox
 
 wxHTML:
 
 
 wxHTML:
 
index 93129cdabc4406411e126b945682a8faee620dd0..7cc6e898e29bb067c8e8fc7fbce84bd7da2a520e 100644 (file)
@@ -1116,7 +1116,7 @@ already is filled up to the maximal length, a
 (giving it the possibility to show an explanatory message, for example) and the
 extra input is discarded.
 
 (giving it the possibility to show an explanatory message, for example) and the
 extra input is discarded.
 
-Note that this function may only be used with single line text controls.
+Note that under GTK+, this function may only be used with single line text controls.
 
 \wxheading{Compatibility}
 
 
 \wxheading{Compatibility}
 
index e742baa4b0c8b1fc4bea4c17392ba488018f504d..00ff8362af6cd72084de31905b68542170d070b1 100644 (file)
@@ -1532,6 +1532,11 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
 
 void wxTextCtrl::SetMaxLength(unsigned long len)
 {
 
 void wxTextCtrl::SetMaxLength(unsigned long len)
 {
+#if wxUSE_RICHEDIT
+    if (IsRich())
+        ::SendMessage(GetHwnd(), EM_EXLIMITTEXT, 0, (LPARAM) (DWORD) len);
+    else
+#endif
     ::SendMessage(GetHwnd(), EM_LIMITTEXT, len, 0);
 }
 
     ::SendMessage(GetHwnd(), EM_LIMITTEXT, len, 0);
 }
 
@@ -1551,6 +1556,11 @@ void wxTextCtrl::Redo()
 {
     if (CanRedo())
     {
 {
     if (CanRedo())
     {
+#if wxUSE_RICHEDIT
+        if (GetRichVersion() > 1)
+            ::SendMessage(GetHwnd(), EM_REDO, 0, 0);
+        else
+#endif
         // Same as Undo, since Undo undoes the undo, i.e. a redo.
         ::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
     }
         // Same as Undo, since Undo undoes the undo, i.e. a redo.
         ::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
     }
@@ -1563,6 +1573,11 @@ bool wxTextCtrl::CanUndo() const
 
 bool wxTextCtrl::CanRedo() const
 {
 
 bool wxTextCtrl::CanRedo() const
 {
+#if wxUSE_RICHEDIT
+    if (GetRichVersion() > 1)
+        return ::SendMessage(GetHwnd(), EM_CANREDO, 0, 0) != 0;
+    else
+#endif
     return ::SendMessage(GetHwnd(), EM_CANUNDO, 0, 0) != 0;
 }
 
     return ::SendMessage(GetHwnd(), EM_CANUNDO, 0, 0) != 0;
 }