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