From: Paul Cornett Date: Tue, 2 Oct 2012 15:57:03 +0000 (+0000) Subject: make more Init() functions private X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/95dc31e001327d85048f5ab21498e4d3255831b2?hp=f33a5bc61cb4f1ad6e4b43dec0f0fa4a2cfe1743 make more Init() functions private git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/animate.h b/include/wx/gtk/animate.h index 8a568a7057..20ff1d4edd 100644 --- a/include/wx/gtk/animate.h +++ b/include/wx/gtk/animate.h @@ -95,8 +95,6 @@ public: Create(parent, id, anim, pos, size, style, name); } - void Init(); - bool Create(wxWindow *parent, wxWindowID id, const wxAnimation& anim = wxNullAnimation, const wxPoint& pos = wxDefaultPosition, @@ -146,6 +144,9 @@ protected: // internal vars private: typedef wxAnimationCtrlBase base_type; + + void Init(); + DECLARE_DYNAMIC_CLASS(wxAnimationCtrl) DECLARE_EVENT_TABLE() }; diff --git a/include/wx/gtk/collpane.h b/include/wx/gtk/collpane.h index 78c4f26648..f0b6af1ab0 100644 --- a/include/wx/gtk/collpane.h +++ b/include/wx/gtk/collpane.h @@ -35,11 +35,6 @@ public: Create(parent, winid, label, pos, size, style, val, name); } - void Init() - { - m_bIgnoreNextChange = false; - } - bool Create(wxWindow *parent, wxWindowID winid, const wxString& label, @@ -69,6 +64,11 @@ public: // used by GTK callbacks wxString m_strLabel; private: + void Init() + { + m_bIgnoreNextChange = false; + } + void OnSize(wxSizeEvent&); virtual void AddChildGTK(wxWindowGTK* child); GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; diff --git a/include/wx/gtk/dataobj2.h b/include/wx/gtk/dataobj2.h index 7629027b33..27fb43eb53 100644 --- a/include/wx/gtk/dataobj2.h +++ b/include/wx/gtk/dataobj2.h @@ -49,7 +49,6 @@ public: } protected: - void Init() { m_pngData = NULL; m_pngSize = 0; } void Clear() { free(m_pngData); } void ClearAll() { Clear(); Init(); } @@ -57,6 +56,9 @@ protected: void *m_pngData; void DoConvertToPng(); + +private: + void Init() { m_pngData = NULL; m_pngSize = 0; } }; // ---------------------------------------------------------------------------- diff --git a/include/wx/gtk/dcscreen.h b/include/wx/gtk/dcscreen.h index e5c1fea746..83084aeadc 100644 --- a/include/wx/gtk/dcscreen.h +++ b/include/wx/gtk/dcscreen.h @@ -25,7 +25,7 @@ public: virtual void DoGetSize(int *width, int *height) const; -protected: +private: void Init(); DECLARE_ABSTRACT_CLASS(wxScreenDCImpl) diff --git a/include/wx/gtk/dvrenderers.h b/include/wx/gtk/dvrenderers.h index 9901bec0cb..b9119a9533 100644 --- a/include/wx/gtk/dvrenderers.h +++ b/include/wx/gtk/dvrenderers.h @@ -142,10 +142,9 @@ public: virtual GtkCellRendererText *GtkGetTextRenderer() const; -protected: +private: bool Init(wxDataViewCellMode mode, int align); -private: // Called from GtkGetTextRenderer() to really create the renderer if // necessary. void GtkInitTextRenderer(); diff --git a/include/wx/gtk/filectrl.h b/include/wx/gtk/filectrl.h index 8147b79bc0..0af8939ee7 100644 --- a/include/wx/gtk/filectrl.h +++ b/include/wx/gtk/filectrl.h @@ -90,7 +90,6 @@ public: virtual ~wxGtkFileCtrl() {} - void Init(); bool Create( wxWindow *parent, wxWindowID id, const wxString& defaultDirectory = wxEmptyString, @@ -134,6 +133,9 @@ protected: wxGtkFileChooser m_fc; wxString m_wildCard; +private: + void Init(); + DECLARE_DYNAMIC_CLASS( wxGtkFileCtrl ) }; diff --git a/include/wx/gtk/filepicker.h b/include/wx/gtk/filepicker.h index 51ef90f66b..68a59090e0 100644 --- a/include/wx/gtk/filepicker.h +++ b/include/wx/gtk/filepicker.h @@ -176,13 +176,6 @@ public: // overrides FILEDIRBTN_OVERRIDES protected: - // common part of all ctors - void Init() - { - m_dialog = NULL; - m_bIgnoreNextChange = false; - } - wxDialog *m_dialog; public: // used by the GTK callback only @@ -192,6 +185,12 @@ public: // used by the GTK callback only void GTKUpdatePath(const char *gtkpath); private: + void Init() + { + m_dialog = NULL; + m_bIgnoreNextChange = false; + } + DECLARE_DYNAMIC_CLASS(wxDirButton) }; diff --git a/include/wx/gtk/font.h b/include/wx/gtk/font.h index 41c19a63f2..bb0c5ec7b0 100644 --- a/include/wx/gtk/font.h +++ b/include/wx/gtk/font.h @@ -119,15 +119,14 @@ public: protected: virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); - // common part of all ctors - void Init(); - virtual wxGDIRefData* CreateGDIRefData() const; virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const; virtual wxFontFamily DoGetFamily() const; private: + void Init(); + DECLARE_DYNAMIC_CLASS(wxFont) }; diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index f65f85ee62..397ad76c56 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -64,9 +64,6 @@ public: virtual bool SendIdleEvents(wxIdleEvent& event); protected: - // common part of all ctors - void Init(); - // override wxWindow methods to take into account tool/menu/statusbars virtual void DoGetClientSize( int *width, int *height ) const; @@ -76,6 +73,8 @@ protected: #endif // wxUSE_MENUS_NATIVE private: + void Init(); + long m_fsSaveFlag; DECLARE_DYNAMIC_CLASS(wxFrame) diff --git a/include/wx/gtk/gauge.h b/include/wx/gtk/gauge.h index 728d6b7782..53c2cea372 100644 --- a/include/wx/gtk/gauge.h +++ b/include/wx/gtk/gauge.h @@ -71,15 +71,14 @@ public: m_gaugePos; protected: - // common part of all ctors - void Init() { m_rangeMax = m_gaugePos = 0; } - // set the gauge value to the value of m_gaugePos void DoSetGauge(); virtual wxSize DoGetBestSize() const; private: + void Init() { m_rangeMax = m_gaugePos = 0; } + DECLARE_DYNAMIC_CLASS(wxGauge) }; diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index dcb4b01d15..761f7758ac 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -67,11 +67,11 @@ public: virtual void OnInternalIdle(); protected: - void Init(); virtual void DoGetClientSize(int* width, int* height) const; private: friend class wxMDIChildFrame; + void Init(); DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) }; diff --git a/include/wx/gtk/notebook.h b/include/wx/gtk/notebook.h index 2d116acdd0..878bbc4dd3 100644 --- a/include/wx/gtk/notebook.h +++ b/include/wx/gtk/notebook.h @@ -107,9 +107,6 @@ public: bool DoPhase(int phase); #endif - // common part of all ctors - void Init(); - // Called by GTK event handler when the current page is definitely changed. void GTKOnPageChanged(); @@ -138,6 +135,7 @@ private: // the padding set by SetPadding() int m_padding; + void Init(); virtual void AddChildGTK(wxWindowGTK* child); DECLARE_DYNAMIC_CLASS(wxNotebook) diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index 336a5cfa2e..5d061c5b33 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -158,9 +158,6 @@ protected: virtual void DoFreeze(); virtual void DoThaw(); - // common part of all ctors - void Init(); - // Widgets that use the style->base colour for the BG colour should // override this and return true. virtual bool UseGTKStyleBase() const { return true; } @@ -179,6 +176,8 @@ protected: void GTKSetJustification(); private: + void Init(); + // overridden wxTextEntry virtual methods virtual GtkEditable *GetEditable() const; virtual GtkEntry *GetEntry() const; diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 1b69ba287b..768f2e14f5 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -128,9 +128,6 @@ protected: virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH); - // common part of all ctors - void Init(); - // move the window to the specified location and resize it virtual void DoMoveWindow(int x, int y, int width, int height); @@ -148,6 +145,7 @@ protected: bool m_deferShow; private: + void Init(); wxSize& GetCachedDecorSize(); // size hint increments