From 7ec1983bfaad5d89027165e90b8431859d0a9c83 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Jul 1998 16:01:33 +0000 Subject: [PATCH] common part of wxWindow class git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp new file mode 100644 index 0000000000..9783cb3ca3 --- /dev/null +++ b/src/common/wincmn.cpp @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: windows.cpp +// Purpose: common (to all ports) wxWindow functions +// Author: Julian Smart, Vadim Zeitlin +// Modified by: +// Created: 13/07/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart and Markus Holzem +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +// Do Update UI processing for child controls + +// TODO: should this be implemented for the child window rather +// than the parent? Then you can override it e.g. for wxCheckBox +// to do the Right Thing rather than having to assume a fixed number +// of control classes. +#include "wx/checkbox.h" +#include "wx/radiobut.h" + +void wxWindow::UpdateWindowUI() +{ + wxWindowID id = GetId(); + if (id > 0) + { + wxUpdateUIEvent event(id); + event.m_eventObject = this; + + if (this->GetEventHandler()->ProcessEvent(event)) + { + if (event.GetSetEnabled()) + this->Enable(event.GetEnabled()); + + if (event.GetSetText() && this->IsKindOf(CLASSINFO(wxControl))) + ((wxControl*)this)->SetLabel(event.GetText()); + + if (this->IsKindOf(CLASSINFO(wxCheckBox))) + { + if (event.GetSetChecked()) + ((wxCheckBox *) this)->SetValue(event.GetChecked()); + } + // @@@ No radio buttons in wxGTK yet +#ifndef __WXGTK__ + else if (this->IsKindOf(CLASSINFO(wxRadioButton))) + { + if (event.GetSetChecked()) + ((wxRadioButton *) this)->SetValue(event.GetChecked()); + } +#endif + } + } +}