1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: common (to all ports) wxWindow functions
4 // Author: Julian Smart, Vadim Zeitlin
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/window.h"
15 // Do Update UI processing for child controls
17 // TODO: should this be implemented for the child window rather
18 // than the parent? Then you can override it e.g. for wxCheckBox
19 // to do the Right Thing rather than having to assume a fixed number
20 // of control classes.
21 #include "wx/checkbox.h"
22 #include "wx/radiobut.h"
24 void wxWindow::UpdateWindowUI()
26 wxWindowID id
= GetId();
29 wxUpdateUIEvent
event(id
);
30 event
.m_eventObject
= this;
32 if (this->GetEventHandler()->ProcessEvent(event
))
34 if (event
.GetSetEnabled())
35 this->Enable(event
.GetEnabled());
37 if (event
.GetSetText() && this->IsKindOf(CLASSINFO(wxControl
)))
38 ((wxControl
*)this)->SetLabel(event
.GetText());
40 if (this->IsKindOf(CLASSINFO(wxCheckBox
)))
42 if (event
.GetSetChecked())
43 ((wxCheckBox
*) this)->SetValue(event
.GetChecked());
45 // @@@ No radio buttons in wxGTK yet
47 else if (this->IsKindOf(CLASSINFO(wxRadioButton
)))
49 if (event
.GetSetChecked())
50 ((wxRadioButton
*) this)->SetValue(event
.GetChecked());