]> git.saurik.com Git - wxWidgets.git/blame - src/common/wincmn.cpp
Removed redundant makefiles and AIAI icons. Changed dynamic sample source name from
[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
f701d7ab
JS
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
14
15#ifdef __BORLANDC__
16#pragma hdrstop
17#endif
18
19#include "wx/frame.h"
20
439b3bf1
VZ
21#include "wx/defs.h"
22#include "wx/window.h"
23
7ec1983b
VZ
24// Do Update UI processing for child controls
25
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"
32
33void wxWindow::UpdateWindowUI()
34{
35 wxWindowID id = GetId();
36 if (id > 0)
37 {
38 wxUpdateUIEvent event(id);
39 event.m_eventObject = this;
40
41 if (this->GetEventHandler()->ProcessEvent(event))
42 {
43 if (event.GetSetEnabled())
44 this->Enable(event.GetEnabled());
45
46 if (event.GetSetText() && this->IsKindOf(CLASSINFO(wxControl)))
47 ((wxControl*)this)->SetLabel(event.GetText());
48
49 if (this->IsKindOf(CLASSINFO(wxCheckBox)))
50 {
51 if (event.GetSetChecked())
52 ((wxCheckBox *) this)->SetValue(event.GetChecked());
53 }
54 // @@@ No radio buttons in wxGTK yet
55#ifndef __WXGTK__
56 else if (this->IsKindOf(CLASSINFO(wxRadioButton)))
57 {
58 if (event.GetSetChecked())
59 ((wxRadioButton *) this)->SetValue(event.GetChecked());
60 }
61#endif
62 }
63 }
64}