]> git.saurik.com Git - wxWidgets.git/commitdiff
1. made it possible to use wxUpdateUIEvent with wxTextCtrl under wxGTK
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Nov 1999 17:40:02 +0000 (17:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Nov 1999 17:40:02 +0000 (17:40 +0000)
2. ... and with controls with id < 0 under all others as well

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/wincmn.cpp
src/gtk/textctrl.cpp
src/gtk1/textctrl.cpp

index 3c0a6f86ccc1c472447ec4f3b4e434af676c7159..8bb007806ad065255c4dda249e974fc006daedb2 100644 (file)
@@ -1,6 +1,13 @@
 wxWindows 2 Change Log
 ----------------------
 
+next release (2.1.12 or 2.2?)
+-----------------------------
+
+wxGTK:
+
+- you can use UpdateUI handlers with wxTextCtrl
+
 NOTE: for changes after wxWindows 2.1.0 b4, please see the CVS
 change log.
 
index 5f7b55bbebbb53ca322d7515c18dc5750f764c5a..26181e21b21c92728be9f5e1a50e669c9a113acd 100644 (file)
@@ -37,6 +37,7 @@
     #include "wx/window.h"
     #include "wx/checkbox.h"
     #include "wx/radiobut.h"
+    #include "wx/textctrl.h"
     #include "wx/settings.h"
     #include "wx/dialog.h"
 #endif //WX_PRECOMP
@@ -1179,42 +1180,44 @@ void wxWindowBase::GetPositionConstraint(int *x, int *y) const
 // of control classes.
 void wxWindowBase::UpdateWindowUI()
 {
-    wxWindowID id = GetId();
-    if ( id > 0 )
+    wxUpdateUIEvent event(GetId());
+    event.m_eventObject = this;
+
+    if ( GetEventHandler()->ProcessEvent(event) )
     {
-        wxUpdateUIEvent event(id);
-        event.m_eventObject = this;
+        if ( event.GetSetEnabled() )
+            Enable(event.GetEnabled());
 
-        if ( GetEventHandler()->ProcessEvent(event) )
+        if ( event.GetSetText() )
         {
-            if ( event.GetSetEnabled() )
-                Enable(event.GetEnabled());
-
-            if ( event.GetSetText() )
+            wxControl *control = wxDynamicCast(this, wxControl);
+            if ( control )
             {
-                wxControl *control = wxDynamicCast(this, wxControl);
-                if ( control )
+                wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl);
+                if ( text )
+                    text->SetValue(event.GetText());
+                else
                     control->SetLabel(event.GetText());
             }
+        }
 
 #if wxUSE_CHECKBOX
-            wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
-            if ( checkbox )
-            {
-                if ( event.GetSetChecked() )
-                    checkbox->SetValue(event.GetChecked());
-            }
+        wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
+        if ( checkbox )
+        {
+            if ( event.GetSetChecked() )
+                checkbox->SetValue(event.GetChecked());
+        }
 #endif // wxUSE_CHECKBOX
 
 #if wxUSE_RADIOBUTTON
-            wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
-            if ( radiobtn )
-            {
-                if ( event.GetSetChecked() )
-                    radiobtn->SetValue(event.GetChecked());
-            }
-#endif // wxUSE_RADIOBUTTON
+        wxRadioButton *radiobtn = wxDynamicCast(this, wxRadioButton);
+        if ( radiobtn )
+        {
+            if ( event.GetSetChecked() )
+                radiobtn->SetValue(event.GetChecked());
         }
+#endif // wxUSE_RADIOBUTTON
     }
 }
 
index ec0d15875c183cf529f981bdf8e3bbbcba0ee8c2..fd5d34bc5876ed0708d4778c0556e2c221561cac 100644 (file)
@@ -963,4 +963,6 @@ void wxTextCtrl::OnInternalIdle()
         if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
             gdk_window_set_cursor( window, cursor.GetCursor() );
     }
+
+    UpdateWindowUI();
 }
index ec0d15875c183cf529f981bdf8e3bbbcba0ee8c2..fd5d34bc5876ed0708d4778c0556e2c221561cac 100644 (file)
@@ -963,4 +963,6 @@ void wxTextCtrl::OnInternalIdle()
         if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
             gdk_window_set_cursor( window, cursor.GetCursor() );
     }
+
+    UpdateWindowUI();
 }