]>
git.saurik.com Git - wxWidgets.git/blob - src/common/wincmn.cpp
9783cb3ca330c2660d1099eea200aa068f859c57
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 /////////////////////////////////////////////////////////////////////////////
12 // Do Update UI processing for child controls
14 // TODO: should this be implemented for the child window rather
15 // than the parent? Then you can override it e.g. for wxCheckBox
16 // to do the Right Thing rather than having to assume a fixed number
17 // of control classes.
18 #include "wx/checkbox.h"
19 #include "wx/radiobut.h"
21 void wxWindow::UpdateWindowUI()
23 wxWindowID id
= GetId();
26 wxUpdateUIEvent
event(id
);
27 event
.m_eventObject
= this;
29 if (this->GetEventHandler()->ProcessEvent(event
))
31 if (event
.GetSetEnabled())
32 this->Enable(event
.GetEnabled());
34 if (event
.GetSetText() && this->IsKindOf(CLASSINFO(wxControl
)))
35 ((wxControl
*)this)->SetLabel(event
.GetText());
37 if (this->IsKindOf(CLASSINFO(wxCheckBox
)))
39 if (event
.GetSetChecked())
40 ((wxCheckBox
*) this)->SetValue(event
.GetChecked());
42 // @@@ No radio buttons in wxGTK yet
44 else if (this->IsKindOf(CLASSINFO(wxRadioButton
)))
46 if (event
.GetSetChecked())
47 ((wxRadioButton
*) this)->SetValue(event
.GetChecked());