]> git.saurik.com Git - wxWidgets.git/commitdiff
replaced m_isRadioButton with a virtual function
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2002 14:17:23 +0000 (14:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2002 14:17:23 +0000 (14:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/radiobut.h
include/wx/gtk/window.h
include/wx/gtk1/radiobut.h
include/wx/gtk1/window.h
src/gtk/radiobut.cpp
src/gtk/window.cpp
src/gtk1/radiobut.cpp
src/gtk1/window.cpp

index 04137acfe1c39d5a2091ad7842efc0c5120a4e9c..ef01bd838bb7fd70b7d222322da01841e23e1d14 100644 (file)
 class wxRadioButton: public wxControl
 {
 public:
-    inline wxRadioButton() {}
-    inline wxRadioButton( wxWindow *parent, wxWindowID id,
-           const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
-           const wxValidator& validator = wxDefaultValidator,
-           const wxString& name = wxRadioButtonNameStr )
+    wxRadioButton() { }
+    wxRadioButton( wxWindow *parent,
+                   wxWindowID id,
+                   const wxString& label,
+                   const wxPoint& pos = wxDefaultPosition,
+                   const wxSize& size = wxDefaultSize,
+                   long style = 0,
+                   const wxValidator& validator = wxDefaultValidator,
+                   const wxString& name = wxRadioButtonNameStr )
     {
         Create( parent, id, label, pos, size, style, validator, name );
     }
-    bool Create(wxWindow *parent, wxWindowID id,
-           const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
-           const wxValidator& validator = wxDefaultValidator,
-           const wxString& name = wxRadioButtonNameStr );
+
+    bool Create( wxWindow *parent,
+                 wxWindowID id,
+                 const wxString& label,
+                 const wxPoint& pos = wxDefaultPosition,
+                 const wxSize& size = wxDefaultSize,
+                 long style = 0,
+                 const wxValidator& validator = wxDefaultValidator,
+                 const wxString& name = wxRadioButtonNameStr );
+
     virtual void SetLabel(const wxString& label);
     virtual void SetValue(bool val);
     virtual bool GetValue() const;
-    bool Enable( bool enable );
-    
-  // implementation
-    
+    virtual bool Enable( bool enable );
+
+    // implementation
+
+    virtual bool IsRadioButton() const { return TRUE; }
+
     GSList *m_radioButtonGroup;
     void ApplyWidgetStyle();
     bool IsOwnGtkWindow( GdkWindow *window );
     void OnInternalIdle();
-    
+
     bool m_blockEvent;
-    
+
 protected:
     virtual wxSize DoGetBestSize() const;
 
index f9116d3d20268f49b575c947035c71ae2334e73c..5917cf4384050bc4095101d73e3594531d9c0679 100644 (file)
@@ -180,6 +180,9 @@ public:
     // is this window transparent for the mouse events (as wxStaticBox is)?
     virtual bool IsTransparentForMouse() const { return FALSE; }
 
+    // is this a radiobutton (used by radiobutton code itself only)?
+    virtual bool IsRadioButton() const { return FALSE; }
+
     // position and size of the window
     int                  m_x, m_y;
     int                  m_width, m_height;
@@ -214,7 +217,6 @@ public:
     bool                 m_hasVMT:1;
     bool                 m_sizeSet:1;
     bool                 m_resizing:1;
-    bool                 m_isRadioButton:1;     // faster than IS_KIND_OF
     bool                 m_isFrame:1;           // faster than IS_KIND_OF
     bool                 m_acceptsFocus:1;      // true if not static
     bool                 m_hasFocus:1;          // true if == FindFocus()
index 04137acfe1c39d5a2091ad7842efc0c5120a4e9c..ef01bd838bb7fd70b7d222322da01841e23e1d14 100644 (file)
 class wxRadioButton: public wxControl
 {
 public:
-    inline wxRadioButton() {}
-    inline wxRadioButton( wxWindow *parent, wxWindowID id,
-           const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
-           const wxValidator& validator = wxDefaultValidator,
-           const wxString& name = wxRadioButtonNameStr )
+    wxRadioButton() { }
+    wxRadioButton( wxWindow *parent,
+                   wxWindowID id,
+                   const wxString& label,
+                   const wxPoint& pos = wxDefaultPosition,
+                   const wxSize& size = wxDefaultSize,
+                   long style = 0,
+                   const wxValidator& validator = wxDefaultValidator,
+                   const wxString& name = wxRadioButtonNameStr )
     {
         Create( parent, id, label, pos, size, style, validator, name );
     }
-    bool Create(wxWindow *parent, wxWindowID id,
-           const wxString& label,
-           const wxPoint& pos = wxDefaultPosition,
-           const wxSize& size = wxDefaultSize, long style = 0,
-           const wxValidator& validator = wxDefaultValidator,
-           const wxString& name = wxRadioButtonNameStr );
+
+    bool Create( wxWindow *parent,
+                 wxWindowID id,
+                 const wxString& label,
+                 const wxPoint& pos = wxDefaultPosition,
+                 const wxSize& size = wxDefaultSize,
+                 long style = 0,
+                 const wxValidator& validator = wxDefaultValidator,
+                 const wxString& name = wxRadioButtonNameStr );
+
     virtual void SetLabel(const wxString& label);
     virtual void SetValue(bool val);
     virtual bool GetValue() const;
-    bool Enable( bool enable );
-    
-  // implementation
-    
+    virtual bool Enable( bool enable );
+
+    // implementation
+
+    virtual bool IsRadioButton() const { return TRUE; }
+
     GSList *m_radioButtonGroup;
     void ApplyWidgetStyle();
     bool IsOwnGtkWindow( GdkWindow *window );
     void OnInternalIdle();
-    
+
     bool m_blockEvent;
-    
+
 protected:
     virtual wxSize DoGetBestSize() const;
 
index f9116d3d20268f49b575c947035c71ae2334e73c..5917cf4384050bc4095101d73e3594531d9c0679 100644 (file)
@@ -180,6 +180,9 @@ public:
     // is this window transparent for the mouse events (as wxStaticBox is)?
     virtual bool IsTransparentForMouse() const { return FALSE; }
 
+    // is this a radiobutton (used by radiobutton code itself only)?
+    virtual bool IsRadioButton() const { return FALSE; }
+
     // position and size of the window
     int                  m_x, m_y;
     int                  m_width, m_height;
@@ -214,7 +217,6 @@ public:
     bool                 m_hasVMT:1;
     bool                 m_sizeSet:1;
     bool                 m_resizing:1;
-    bool                 m_isRadioButton:1;     // faster than IS_KIND_OF
     bool                 m_isFrame:1;           // faster than IS_KIND_OF
     bool                 m_acceptsFocus:1;      // true if not static
     bool                 m_hasFocus:1;          // true if == FindFocus()
index 92b78d42235c8f1200cbe60fa23d1a0c905f4b24..c523b49eef16aaea9bda4be91bab55f262cdef3b 100644 (file)
@@ -64,13 +64,17 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
 
 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
   
-bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
-  const wxPoint& pos,  const wxSize& size, long style,
-  const wxValidator& validator, const wxString& name )
+bool wxRadioButton::Create( wxWindow *parent,
+                            wxWindowID id,
+                            const wxString& label,
+                            const wxPoint& pos,
+                            const wxSize& size,
+                            long style,
+                            const wxValidator& validator,
+                            const wxString& name )
 {
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
-    m_isRadioButton = TRUE;
     
     m_blockEvent = FALSE;
 
@@ -94,10 +98,11 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
         while (node)
         {
             wxWindow *child = node->GetData();
-            if (child->m_isRadioButton)
+            if (child->IsRadioButton())
             {
                 chief = (wxRadioButton*) child;
-                if (child->HasFlag(wxRB_GROUP)) break;
+                if (child->HasFlag(wxRB_GROUP))
+                    break;
             }
             node = node->GetPrevious();
         }
index a566c9ebdbbefdc3fae3411bbe901ff54bd4584c..de255ce94482666a14b7ec46b63d566a738794bc 100644 (file)
@@ -2263,7 +2263,6 @@ void wxWindowGTK::Init()
 
     m_insertCallback = (wxInsertChildFunction) NULL;
 
-    m_isRadioButton = FALSE;
     m_isFrame = FALSE;
     m_acceptsFocus = FALSE;
     m_hasFocus = FALSE;
index 92b78d42235c8f1200cbe60fa23d1a0c905f4b24..c523b49eef16aaea9bda4be91bab55f262cdef3b 100644 (file)
@@ -64,13 +64,17 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
 
 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton,wxControl)
   
-bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& label,
-  const wxPoint& pos,  const wxSize& size, long style,
-  const wxValidator& validator, const wxString& name )
+bool wxRadioButton::Create( wxWindow *parent,
+                            wxWindowID id,
+                            const wxString& label,
+                            const wxPoint& pos,
+                            const wxSize& size,
+                            long style,
+                            const wxValidator& validator,
+                            const wxString& name )
 {
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
-    m_isRadioButton = TRUE;
     
     m_blockEvent = FALSE;
 
@@ -94,10 +98,11 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
         while (node)
         {
             wxWindow *child = node->GetData();
-            if (child->m_isRadioButton)
+            if (child->IsRadioButton())
             {
                 chief = (wxRadioButton*) child;
-                if (child->HasFlag(wxRB_GROUP)) break;
+                if (child->HasFlag(wxRB_GROUP))
+                    break;
             }
             node = node->GetPrevious();
         }
index a566c9ebdbbefdc3fae3411bbe901ff54bd4584c..de255ce94482666a14b7ec46b63d566a738794bc 100644 (file)
@@ -2263,7 +2263,6 @@ void wxWindowGTK::Init()
 
     m_insertCallback = (wxInsertChildFunction) NULL;
 
-    m_isRadioButton = FALSE;
     m_isFrame = FALSE;
     m_acceptsFocus = FALSE;
     m_hasFocus = FALSE;