No changes, just do wxButton fields initialization in Init() in wxMSW.

Add a helper function called from ctors and initialize m_imageData in it
instead of doing it in each ctor -- this will be more important when we add
more wxButton members.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-02-27 12:47:36 +00:00
parent 3b5651af39
commit 6af59fe7f4

View File

@@ -19,7 +19,7 @@
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{ {
public: public:
wxButton() { m_imageData = NULL; } wxButton() { Init(); }
wxButton(wxWindow *parent, wxButton(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& label = wxEmptyString, const wxString& label = wxEmptyString,
@@ -29,7 +29,7 @@ public:
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr) const wxString& name = wxButtonNameStr)
{ {
m_imageData = NULL; Init();
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
@@ -97,6 +97,11 @@ protected:
bool m_authNeeded; bool m_authNeeded;
private: private:
void Init()
{
m_imageData = NULL;
}
// Switches button into owner-drawn mode: this is used if we need to draw // Switches button into owner-drawn mode: this is used if we need to draw
// something not supported by the native control, such as using non default // something not supported by the native control, such as using non default
// colours or a bitmap on pre-XP systems. // colours or a bitmap on pre-XP systems.