]>
git.saurik.com Git - wxWidgets.git/blob - src/common/wincmn.cpp
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 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
22 #include "wx/window.h"
24 // Do Update UI processing for child controls
26 // TODO: should this be implemented for the child window rather
27 // than the parent? Then you can override it e.g. for wxCheckBox
28 // to do the Right Thing rather than having to assume a fixed number
29 // of control classes.
30 #include "wx/checkbox.h"
31 #include "wx/radiobut.h"
33 void wxWindow::UpdateWindowUI()
35 wxWindowID id
= GetId();
38 wxUpdateUIEvent
event(id
);
39 event
.m_eventObject
= this;
41 if (this->GetEventHandler()->ProcessEvent(event
))
43 if (event
.GetSetEnabled())
44 this->Enable(event
.GetEnabled());
46 if (event
.GetSetText() && this->IsKindOf(CLASSINFO(wxControl
)))
47 ((wxControl
*)this)->SetLabel(event
.GetText());
49 if (this->IsKindOf(CLASSINFO(wxCheckBox
)))
51 if (event
.GetSetChecked())
52 ((wxCheckBox
*) this)->SetValue(event
.GetChecked());
54 // @@@ No radio buttons in wxGTK yet
56 else if (this->IsKindOf(CLASSINFO(wxRadioButton
)))
58 if (event
.GetSetChecked())
59 ((wxRadioButton
*) this)->SetValue(event
.GetChecked());