From c3dfaa10a67a46d8e50e297a068ac145dab90033 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 4 May 2002 11:57:39 +0000 Subject: [PATCH] initialize wxBitmapButton members git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/bmpbuttn.h | 18 ++++++++++++------ include/wx/gtk1/bmpbuttn.h | 18 ++++++++++++------ src/gtk/bmpbuttn.cpp | 15 +++++++++++---- src/gtk1/bmpbuttn.cpp | 15 +++++++++++---- 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/include/wx/gtk/bmpbuttn.h b/include/wx/gtk/bmpbuttn.h index 92eda41c8c..04532e2b2b 100644 --- a/include/wx/gtk/bmpbuttn.h +++ b/include/wx/gtk/bmpbuttn.h @@ -22,7 +22,8 @@ class wxBitmapButton: public wxBitmapButtonBase { public: - wxBitmapButton(); + wxBitmapButton() { Init(); } + wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, @@ -32,8 +33,11 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr) { + Init(); + Create(parent, id, bitmap, pos, size, style, validator, name); } + bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, @@ -43,13 +47,13 @@ public: 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); } + virtual void SetDefault(); + virtual bool Enable(bool enable = TRUE); + // implementation // -------------- @@ -59,12 +63,14 @@ public: void EndSelect(); void ApplyWidgetStyle(); - bool m_hasFocus; - bool m_isSelected; + bool m_hasFocus:1; + bool m_isSelected:1; protected: virtual void OnSetBitmap(); + void Init(); + private: DECLARE_DYNAMIC_CLASS(wxBitmapButton) }; diff --git a/include/wx/gtk1/bmpbuttn.h b/include/wx/gtk1/bmpbuttn.h index 92eda41c8c..04532e2b2b 100644 --- a/include/wx/gtk1/bmpbuttn.h +++ b/include/wx/gtk1/bmpbuttn.h @@ -22,7 +22,8 @@ class wxBitmapButton: public wxBitmapButtonBase { public: - wxBitmapButton(); + wxBitmapButton() { Init(); } + wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, @@ -32,8 +33,11 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr) { + Init(); + Create(parent, id, bitmap, pos, size, style, validator, name); } + bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, @@ -43,13 +47,13 @@ public: 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); } + virtual void SetDefault(); + virtual bool Enable(bool enable = TRUE); + // implementation // -------------- @@ -59,12 +63,14 @@ public: void EndSelect(); void ApplyWidgetStyle(); - bool m_hasFocus; - bool m_isSelected; + bool m_hasFocus:1; + bool m_isSelected:1; protected: virtual void OnSetBitmap(); + void Init(); + private: DECLARE_DYNAMIC_CLASS(wxBitmapButton) }; diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 25567ce369..4f28995d7b 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -109,13 +109,20 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma 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; diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 25567ce369..4f28995d7b 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -109,13 +109,20 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma 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; -- 2.45.2