common part of wxWindow class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1998-07-23 16:01:33 +00:00
parent 32c77a7133
commit 7ec1983bfa

52
src/common/wincmn.cpp Normal file
View File

@ -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
}
}
}