]> git.saurik.com Git - wxWidgets.git/blob - src/common/wincmn.cpp
3486f2b6bd06642fe5a1cf3f9e96e5206710bd67
[wxWidgets.git] / src / common / wincmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: windows.cpp
3 // Purpose: common (to all ports) wxWindow functions
4 // Author: Julian Smart, Vadim Zeitlin
5 // Modified by:
6 // Created: 13/07/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 #include "wx/frame.h"
23 #include "wx/defs.h"
24 #include "wx/window.h"
25
26 // Do Update UI processing for child controls
27
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"
34
35 void wxWindow::UpdateWindowUI()
36 {
37 wxWindowID id = GetId();
38 if (id > 0)
39 {
40 wxUpdateUIEvent event(id);
41 event.m_eventObject = this;
42
43 if (this->GetEventHandler()->ProcessEvent(event))
44 {
45 if (event.GetSetEnabled())
46 this->Enable(event.GetEnabled());
47
48 if (event.GetSetText() && this->IsKindOf(CLASSINFO(wxControl)))
49 ((wxControl*)this)->SetLabel(event.GetText());
50
51 if (this->IsKindOf(CLASSINFO(wxCheckBox)))
52 {
53 if (event.GetSetChecked())
54 ((wxCheckBox *) this)->SetValue(event.GetChecked());
55 }
56 // @@@ No radio buttons in wxGTK yet
57 #ifndef __WXGTK__
58 else if (this->IsKindOf(CLASSINFO(wxRadioButton)))
59 {
60 if (event.GetSetChecked())
61 ((wxRadioButton *) this)->SetValue(event.GetChecked());
62 }
63 #endif
64 }
65 }
66 }