]> git.saurik.com Git - wxWidgets.git/blame - src/common/wincmn.cpp
IsModified() function now works correctly
[wxWidgets.git] / src / common / wincmn.cpp
CommitLineData
7ec1983b
VZ
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// Do Update UI processing for child controls
13
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"
20
21void wxWindow::UpdateWindowUI()
22{
23 wxWindowID id = GetId();
24 if (id > 0)
25 {
26 wxUpdateUIEvent event(id);
27 event.m_eventObject = this;
28
29 if (this->GetEventHandler()->ProcessEvent(event))
30 {
31 if (event.GetSetEnabled())
32 this->Enable(event.GetEnabled());
33
34 if (event.GetSetText() && this->IsKindOf(CLASSINFO(wxControl)))
35 ((wxControl*)this)->SetLabel(event.GetText());
36
37 if (this->IsKindOf(CLASSINFO(wxCheckBox)))
38 {
39 if (event.GetSetChecked())
40 ((wxCheckBox *) this)->SetValue(event.GetChecked());
41 }
42 // @@@ No radio buttons in wxGTK yet
43#ifndef __WXGTK__
44 else if (this->IsKindOf(CLASSINFO(wxRadioButton)))
45 {
46 if (event.GetSetChecked())
47 ((wxRadioButton *) this)->SetValue(event.GetChecked());
48 }
49#endif
50 }
51 }
52}