]> git.saurik.com Git - wxWidgets.git/commitdiff
initialize wxBitmapButton members
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2002 11:57:39 +0000 (11:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2002 11:57:39 +0000 (11:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/bmpbuttn.h
include/wx/gtk1/bmpbuttn.h
src/gtk/bmpbuttn.cpp
src/gtk1/bmpbuttn.cpp

index 92eda41c8c466f7b4a0ad722885ac115350ba2be..04532e2b2b2aace3ed9af8a6600e2e4d56cfef33 100644 (file)
@@ -22,7 +22,8 @@
 class wxBitmapButton: public wxBitmapButtonBase
 {
 public:
 class wxBitmapButton: public wxBitmapButtonBase
 {
 public:
-    wxBitmapButton();
+    wxBitmapButton() { Init(); }
+
     wxBitmapButton(wxWindow *parent,
                    wxWindowID id,
                    const wxBitmap& bitmap,
     wxBitmapButton(wxWindow *parent,
                    wxWindowID id,
                    const wxBitmap& bitmap,
@@ -32,8 +33,11 @@ public:
                    const wxValidator& validator = wxDefaultValidator,
                    const wxString& name = wxButtonNameStr)
     {
                    const wxValidator& validator = wxDefaultValidator,
                    const wxString& name = wxButtonNameStr)
     {
+        Init();
+
         Create(parent, id, bitmap, pos, size, style, validator, name);
     }
         Create(parent, id, bitmap, pos, size, style, validator, name);
     }
+
     bool Create(wxWindow *parent,
                 wxWindowID id,
                 const wxBitmap& bitmap,
     bool Create(wxWindow *parent,
                 wxWindowID id,
                 const wxBitmap& bitmap,
@@ -43,13 +47,13 @@ public:
                 const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxButtonNameStr);
 
                 const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxButtonNameStr);
 
-    virtual void SetDefault();
-    virtual bool Enable(bool enable = TRUE);
-
     void SetLabel( const wxString &label );
     wxString GetLabel() const;
     virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
 
     void SetLabel( const wxString &label );
     wxString GetLabel() const;
     virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
 
+    virtual void SetDefault();
+    virtual bool Enable(bool enable = TRUE);
+
     // implementation
     // --------------
 
     // implementation
     // --------------
 
@@ -59,12 +63,14 @@ public:
     void EndSelect();
     void ApplyWidgetStyle();
 
     void EndSelect();
     void ApplyWidgetStyle();
 
-    bool         m_hasFocus;
-    bool         m_isSelected;
+    bool         m_hasFocus:1;
+    bool         m_isSelected:1;
 
 protected:
     virtual void OnSetBitmap();
 
 
 protected:
     virtual void OnSetBitmap();
 
+    void Init();
+
 private:
     DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 };
 private:
     DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 };
index 92eda41c8c466f7b4a0ad722885ac115350ba2be..04532e2b2b2aace3ed9af8a6600e2e4d56cfef33 100644 (file)
@@ -22,7 +22,8 @@
 class wxBitmapButton: public wxBitmapButtonBase
 {
 public:
 class wxBitmapButton: public wxBitmapButtonBase
 {
 public:
-    wxBitmapButton();
+    wxBitmapButton() { Init(); }
+
     wxBitmapButton(wxWindow *parent,
                    wxWindowID id,
                    const wxBitmap& bitmap,
     wxBitmapButton(wxWindow *parent,
                    wxWindowID id,
                    const wxBitmap& bitmap,
@@ -32,8 +33,11 @@ public:
                    const wxValidator& validator = wxDefaultValidator,
                    const wxString& name = wxButtonNameStr)
     {
                    const wxValidator& validator = wxDefaultValidator,
                    const wxString& name = wxButtonNameStr)
     {
+        Init();
+
         Create(parent, id, bitmap, pos, size, style, validator, name);
     }
         Create(parent, id, bitmap, pos, size, style, validator, name);
     }
+
     bool Create(wxWindow *parent,
                 wxWindowID id,
                 const wxBitmap& bitmap,
     bool Create(wxWindow *parent,
                 wxWindowID id,
                 const wxBitmap& bitmap,
@@ -43,13 +47,13 @@ public:
                 const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxButtonNameStr);
 
                 const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxButtonNameStr);
 
-    virtual void SetDefault();
-    virtual bool Enable(bool enable = TRUE);
-
     void SetLabel( const wxString &label );
     wxString GetLabel() const;
     virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
 
     void SetLabel( const wxString &label );
     wxString GetLabel() const;
     virtual void SetLabel( const wxBitmap& bitmap ) { SetBitmapLabel(bitmap); }
 
+    virtual void SetDefault();
+    virtual bool Enable(bool enable = TRUE);
+
     // implementation
     // --------------
 
     // implementation
     // --------------
 
@@ -59,12 +63,14 @@ public:
     void EndSelect();
     void ApplyWidgetStyle();
 
     void EndSelect();
     void ApplyWidgetStyle();
 
-    bool         m_hasFocus;
-    bool         m_isSelected;
+    bool         m_hasFocus:1;
+    bool         m_isSelected:1;
 
 protected:
     virtual void OnSetBitmap();
 
 
 protected:
     virtual void OnSetBitmap();
 
+    void Init();
+
 private:
     DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 };
 private:
     DECLARE_DYNAMIC_CLASS(wxBitmapButton)
 };
index 25567ce3690b931e64f300b954cef86a27bef3b2..4f28995d7b4729a7efda9f40287adc5c23a8028a 100644 (file)
@@ -109,13 +109,20 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
 
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
-wxBitmapButton::wxBitmapButton()
+void wxBitmapButton::Init()
 {
 {
+    m_hasFocus =
+    m_isSelected = FALSE;
 }
 
 }
 
-bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-                             const wxPoint &pos, const wxSize &size,
-                             long style, const wxValidator& validator, const wxString &name )
+bool wxBitmapButton::Create( wxWindow *parent,
+                             wxWindowID id,
+                             const wxBitmap& bitmap,
+                             const wxPoint& pos,
+                             const wxSize& size,
+                             long style,
+                             const wxValidator& validator,
+                             const wxString &name )
 {
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 {
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
index 25567ce3690b931e64f300b954cef86a27bef3b2..4f28995d7b4729a7efda9f40287adc5c23a8028a 100644 (file)
@@ -109,13 +109,20 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma
 
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
 
-wxBitmapButton::wxBitmapButton()
+void wxBitmapButton::Init()
 {
 {
+    m_hasFocus =
+    m_isSelected = FALSE;
 }
 
 }
 
-bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
-                             const wxPoint &pos, const wxSize &size,
-                             long style, const wxValidator& validator, const wxString &name )
+bool wxBitmapButton::Create( wxWindow *parent,
+                             wxWindowID id,
+                             const wxBitmap& bitmap,
+                             const wxPoint& pos,
+                             const wxSize& size,
+                             long style,
+                             const wxValidator& validator,
+                             const wxString &name )
 {
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 {
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;