Refactoring: no real changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22823 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-08-13 21:34:21 +00:00
parent 4410d619c5
commit f96b10c283
2 changed files with 9 additions and 37 deletions

View File

@@ -16,12 +16,9 @@
#pragma interface "radiobut.h" #pragma interface "radiobut.h"
#endif #endif
#include "wx/control.h"
class WXDLLEXPORT wxRadioButton: public wxControl class WXDLLEXPORT wxRadioButton: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxRadioButton) DECLARE_DYNAMIC_CLASS(wxRadioButton)
protected:
public: public:
wxRadioButton(); wxRadioButton();
~wxRadioButton() { RemoveFromCycle(); } ~wxRadioButton() { RemoveFromCycle(); }
@@ -49,12 +46,10 @@ public:
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
// *this function is an implementation detail* // *this function is an implementation detail*
// clears the selection in the readiobuttons in the cycle // clears the selection in the radiobuttons in the cycle
// and returns the old selection (if any) // and returns the old selection (if any)
wxRadioButton* ClearSelections(); wxRadioButton* ClearSelections();
private: private:

View File

@@ -25,12 +25,8 @@
#ifdef __VMS__ #ifdef __VMS__
#pragma message disable nosimpint #pragma message disable nosimpint
#endif #endif
#include <Xm/Label.h>
#include <Xm/LabelG.h>
#include <Xm/ToggleB.h> #include <Xm/ToggleB.h>
#include <Xm/ToggleBG.h> #include <Xm/ToggleBG.h>
#include <Xm/RowColumn.h>
#include <Xm/Form.h>
#ifdef __VMS__ #ifdef __VMS__
#pragma message enable nosimpint #pragma message enable nosimpint
#endif #endif
@@ -53,20 +49,8 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
SetName(name); if( !CreateControl( parent, id, pos, size, style, validator, name ) )
SetValidator(validator); return false;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_font = parent->GetFont();
if (parent) parent->AddChild(this);
if ( id == -1 )
m_windowId = (int)NewControlId();
else
m_windowId = id;
m_windowStyle = style ;
Widget parentWidget = (Widget) parent->GetClientWidget(); Widget parentWidget = (Widget) parent->GetClientWidget();
@@ -88,14 +72,17 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
XmNindicatorType, XmONE_OF_MANY, // diamond-shape XmNindicatorType, XmONE_OF_MANY, // diamond-shape
NULL); NULL);
XtAddCallback (radioButtonWidget, XmNvalueChangedCallback, (XtCallbackProc) wxRadioButtonCallback, XtAddCallback (radioButtonWidget,
(XtPointer) this); XmNvalueChangedCallback,
(XtCallbackProc)wxRadioButtonCallback,
(XtPointer)this);
m_mainWidget = (WXWidget) radioButtonWidget; m_mainWidget = (WXWidget) radioButtonWidget;
XtManageChild (radioButtonWidget); XtManageChild (radioButtonWidget);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, size.x, size.y);
ChangeBackgroundColour(); ChangeBackgroundColour();
@@ -150,11 +137,6 @@ void wxRadioButton::Command (wxCommandEvent & event)
ProcessCommand (event); ProcessCommand (event);
} }
void wxRadioButton::ChangeFont(bool keepOriginalSize)
{
wxWindow::ChangeFont(keepOriginalSize);
}
void wxRadioButton::ChangeBackgroundColour() void wxRadioButton::ChangeBackgroundColour()
{ {
wxWindow::ChangeBackgroundColour(); wxWindow::ChangeBackgroundColour();
@@ -167,11 +149,6 @@ void wxRadioButton::ChangeBackgroundColour()
NULL); NULL);
} }
void wxRadioButton::ChangeForegroundColour()
{
wxWindow::ChangeForegroundColour();
}
void wxRadioButtonCallback (Widget w, XtPointer clientData, void wxRadioButtonCallback (Widget w, XtPointer clientData,
XmToggleButtonCallbackStruct * cbs) XmToggleButtonCallbackStruct * cbs)
{ {