1. made it possible to use wxUpdateUIEvent with wxTextCtrl under wxGTK

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
This commit is contained in:
Vadim Zeitlin
1999-11-10 17:40:02 +00:00
parent 957d856c81
commit 26bf1ce0bc
4 changed files with 38 additions and 24 deletions

View File

@@ -1,6 +1,13 @@
wxWindows 2 Change Log 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 NOTE: for changes after wxWindows 2.1.0 b4, please see the CVS
change log. change log.

View File

@@ -37,6 +37,7 @@
#include "wx/window.h" #include "wx/window.h"
#include "wx/checkbox.h" #include "wx/checkbox.h"
#include "wx/radiobut.h" #include "wx/radiobut.h"
#include "wx/textctrl.h"
#include "wx/settings.h" #include "wx/settings.h"
#include "wx/dialog.h" #include "wx/dialog.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
@@ -1179,10 +1180,7 @@ void wxWindowBase::GetPositionConstraint(int *x, int *y) const
// of control classes. // of control classes.
void wxWindowBase::UpdateWindowUI() void wxWindowBase::UpdateWindowUI()
{ {
wxWindowID id = GetId(); wxUpdateUIEvent event(GetId());
if ( id > 0 )
{
wxUpdateUIEvent event(id);
event.m_eventObject = this; event.m_eventObject = this;
if ( GetEventHandler()->ProcessEvent(event) ) if ( GetEventHandler()->ProcessEvent(event) )
@@ -1194,8 +1192,14 @@ void wxWindowBase::UpdateWindowUI()
{ {
wxControl *control = wxDynamicCast(this, wxControl); wxControl *control = wxDynamicCast(this, wxControl);
if ( control ) if ( control )
{
wxTextCtrl *text = wxDynamicCast(control, wxTextCtrl);
if ( text )
text->SetValue(event.GetText());
else
control->SetLabel(event.GetText()); control->SetLabel(event.GetText());
} }
}
#if wxUSE_CHECKBOX #if wxUSE_CHECKBOX
wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox); wxCheckBox *checkbox = wxDynamicCast(this, wxCheckBox);
@@ -1215,7 +1219,6 @@ void wxWindowBase::UpdateWindowUI()
} }
#endif // wxUSE_RADIOBUTTON #endif // wxUSE_RADIOBUTTON
} }
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -963,4 +963,6 @@ void wxTextCtrl::OnInternalIdle()
if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget))) if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
gdk_window_set_cursor( window, cursor.GetCursor() ); gdk_window_set_cursor( window, cursor.GetCursor() );
} }
UpdateWindowUI();
} }

View File

@@ -963,4 +963,6 @@ void wxTextCtrl::OnInternalIdle()
if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget))) if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
gdk_window_set_cursor( window, cursor.GetCursor() ); gdk_window_set_cursor( window, cursor.GetCursor() );
} }
UpdateWindowUI();
} }