From 6f02a879ed7efc5fcf6328ff47a1352ec82812b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Feb 2006 21:47:09 +0000 Subject: [PATCH] make access specifiers for the virtual functions match their access in the base class (patch 1400131) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dataobj.h | 60 ++++++++++++------------ include/wx/generic/calctrl.h | 15 +++--- include/wx/generic/dcpsg.h | 68 +++++++++++++--------------- include/wx/generic/listctrl.h | 13 +++--- include/wx/generic/logg.h | 3 +- include/wx/generic/progdlgg.h | 6 +-- include/wx/gtk/bmpbuttn.h | 2 +- include/wx/gtk/brush.h | 2 +- include/wx/gtk/button.h | 5 +- include/wx/gtk/checkbox.h | 2 +- include/wx/gtk/choice.h | 4 +- include/wx/gtk/combobox.h | 2 +- include/wx/gtk/dataobj2.h | 44 ++++++++++-------- include/wx/gtk/dcclient.h | 4 +- include/wx/gtk/dcmemory.h | 5 +- include/wx/gtk/filedlg.h | 1 + include/wx/gtk/frame.h | 6 ++- include/wx/gtk/gauge.h | 4 +- include/wx/gtk/listbox.h | 23 ++++------ include/wx/gtk/menu.h | 10 ++-- include/wx/gtk/notebook.h | 7 ++- include/wx/gtk/pen.h | 2 +- include/wx/gtk/popupwin.h | 4 +- include/wx/gtk/radiobox.h | 3 +- include/wx/gtk/radiobut.h | 2 +- include/wx/gtk/taskbarpriv.h | 3 +- include/wx/gtk/textctrl.h | 2 +- include/wx/gtk/tglbtn.h | 8 +++- include/wx/gtk/toplevel.h | 8 ++-- include/wx/gtk/window.h | 10 ++-- include/wx/hash.h | 6 +-- include/wx/html/htmlwin.h | 4 +- include/wx/imagbmp.h | 9 ++-- include/wx/imaggif.h | 1 + include/wx/imagjpeg.h | 1 + include/wx/imagpcx.h | 1 + include/wx/imagpng.h | 1 + include/wx/imagpnm.h | 1 + include/wx/imagtiff.h | 3 +- include/wx/imagxpm.h | 1 + include/wx/mac/carbon/checkbox.h | 7 +-- include/wx/mac/carbon/choice.h | 7 +-- include/wx/mac/carbon/combobox.h | 7 +-- include/wx/mac/carbon/dataobj2.h | 43 +++++++++++------- include/wx/mac/carbon/dc.h | 13 +++--- include/wx/mac/carbon/dcclient.h | 6 ++- include/wx/mac/carbon/dcmemory.h | 5 +- include/wx/mac/carbon/dcprint.h | 2 +- include/wx/mac/carbon/filedlg.h | 3 +- include/wx/mac/carbon/frame.h | 12 +++-- include/wx/mac/carbon/listbox.h | 24 +++++----- include/wx/mac/carbon/mdi.h | 9 ++-- include/wx/mac/carbon/menu.h | 9 ++-- include/wx/mac/carbon/metafile.h | 3 +- include/wx/mac/carbon/msgdlg.h | 1 + include/wx/mac/carbon/notebook.h | 3 +- include/wx/mac/carbon/slider.h | 8 ++-- include/wx/mac/carbon/statbmp.h | 3 +- include/wx/mac/carbon/stattext.h | 3 +- include/wx/mac/carbon/toolbar.h | 5 +- include/wx/mac/carbon/window.h | 4 +- include/wx/msw/button.h | 2 +- include/wx/msw/checkbox.h | 2 +- include/wx/msw/checklst.h | 2 +- include/wx/msw/choice.h | 11 ++--- include/wx/msw/colordlg.h | 3 +- include/wx/msw/combobox.h | 2 +- include/wx/msw/control.h | 6 +-- include/wx/msw/datectrl.h | 2 +- include/wx/msw/dc.h | 14 +++--- include/wx/msw/dialog.h | 6 +-- include/wx/msw/enhmeta.h | 3 +- include/wx/msw/gauge95.h | 3 +- include/wx/msw/listbox.h | 37 +++++++-------- include/wx/msw/listctrl.h | 13 +++--- include/wx/msw/mdi.h | 5 +- include/wx/msw/menu.h | 10 ++-- include/wx/msw/notebook.h | 18 ++++---- include/wx/msw/popupwin.h | 8 ++-- include/wx/msw/scrolbar.h | 3 +- include/wx/msw/slider95.h | 4 +- include/wx/msw/statbmp.h | 2 +- include/wx/msw/statbox.h | 6 ++- include/wx/msw/statbr95.h | 7 ++- include/wx/msw/statline.h | 1 - include/wx/msw/stattext.h | 4 +- include/wx/msw/tbar95.h | 9 ++-- include/wx/msw/textctrl.h | 16 +++---- include/wx/msw/tglbtn.h | 2 +- include/wx/msw/toplevel.h | 18 ++++---- include/wx/msw/treectrl.h | 20 ++++---- include/wx/msw/window.h | 9 ++-- include/wx/richtext/richtextctrl.h | 1 + include/wx/richtext/richtexthtml.h | 10 ++-- include/wx/richtext/richtextstyles.h | 7 +-- include/wx/richtext/richtextxml.h | 8 ++-- include/wx/scrolwin.h | 13 +++--- include/wx/textctrl.h | 10 ++-- include/wx/treebook.h | 6 +-- include/wx/univ/button.h | 7 +-- include/wx/univ/checkbox.h | 11 +++-- include/wx/univ/combobox.h | 10 ++-- include/wx/univ/frame.h | 6 ++- include/wx/univ/listbox.h | 2 +- include/wx/univ/slider.h | 8 ++-- include/wx/univ/spinbutt.h | 8 ++-- include/wx/univ/statbmp.h | 5 +- include/wx/univ/statbox.h | 8 ++-- include/wx/univ/statusbr.h | 8 ++-- include/wx/univ/textctrl.h | 19 ++++---- include/wx/univ/toolbar.h | 9 ++-- include/wx/univ/toplevel.h | 9 ++-- include/wx/univ/window.h | 6 +-- include/wx/vector.h | 2 +- include/wx/x11/brush.h | 2 +- include/wx/x11/dataobj2.h | 44 ++++++++++-------- include/wx/x11/dcclient.h | 13 +++--- include/wx/x11/dcmemory.h | 5 +- include/wx/x11/pen.h | 2 +- include/wx/x11/toplevel.h | 11 +++-- include/wx/zipstrm.h | 19 ++++---- src/generic/datectlg.cpp | 3 +- src/generic/listctrl.cpp | 4 +- src/gtk/button.cpp | 9 ++-- src/mac/carbon/combobox.cpp | 2 + src/mac/carbon/frame.cpp | 11 +++++ src/mac/carbon/spinctrl.cpp | 18 ++++---- src/mac/carbon/toplevel.cpp | 7 +-- src/msw/accel.cpp | 7 +++ src/msw/ole/dataobj.cpp | 10 ++-- src/msw/ole/dropsrc.cpp | 4 +- src/univ/combobox.cpp | 10 ++-- src/univ/menu.cpp | 9 ++-- 133 files changed, 611 insertions(+), 533 deletions(-) diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 6f2b75456d..6c7c1d0d01 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -281,10 +281,6 @@ public: virtual size_t GetDataSize(const wxDataFormat& format) const; virtual bool GetDataHere(const wxDataFormat& format, void *buf) const; virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf); - -protected: - // returns the pointer to the object which supports this format or NULL - wxDataObjectSimple *GetObject(const wxDataFormat& format) const; #if defined(__WXMSW__) virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size, const wxDataFormat& format ); @@ -293,6 +289,10 @@ protected: virtual size_t GetBufferOffset( const wxDataFormat& format ); #endif +protected: + // returns the pointer to the object which supports this format or NULL + wxDataObjectSimple *GetObject(const wxDataFormat& format) const; + private: // the list of all (simple) data objects whose formats we support wxSimpleDataObjectList m_dataObjects; @@ -359,13 +359,19 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); - - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void *pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } #endif private: @@ -415,20 +421,9 @@ public: // get a reference to our array const wxArrayString& GetFilenames() const { return m_filenames; } - // the Get() functions do nothing for us - virtual size_t GetDataSize() const { return 0; } - virtual bool GetDataHere(void *WXUNUSED(buf)) const { return false; } - protected: wxArrayString m_filenames; -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - DECLARE_NO_COPY_CLASS(wxFileDataObjectBase) }; @@ -472,19 +467,24 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t size, const void *buf); + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } private: size_t m_size; void *m_data; - // virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } - DECLARE_NO_COPY_CLASS(wxCustomDataObject) }; diff --git a/include/wx/generic/calctrl.h b/include/wx/generic/calctrl.h index c3cd1eb23f..324e3bac40 100644 --- a/include/wx/generic/calctrl.h +++ b/include/wx/generic/calctrl.h @@ -163,6 +163,14 @@ public: void OnSysColourChanged(wxSysColourChangedEvent& event); +protected: + // override some base class virtuals + virtual wxSize DoGetBestSize() const; + virtual void DoGetPosition(int *x, int *y) const; + virtual void DoGetSize(int *width, int *height) const; + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); + virtual void DoMoveWindow(int x, int y, int width, int height); + private: // common part of all ctors void Init(); @@ -179,13 +187,6 @@ private: void OnYearChange(wxCommandEvent& event); void OnYearTextChange(wxCommandEvent& event); - // override some base class virtuals - virtual wxSize DoGetBestSize() const; - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoGetSize(int *width, int *height) const; - virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); - virtual void DoMoveWindow(int x, int y, int width, int height); - // (re)calc m_widthCol and m_heightRow void RecalcGeometry(); diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index e3186aabb4..ddd9888e68 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -44,35 +44,8 @@ public: virtual bool Ok() const; - bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE ); - bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; - - void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - void DoCrossHair(wxCoord x, wxCoord y) ; - void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc); - void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); - void DoDrawPoint(wxCoord x, wxCoord y); - void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); - void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); - void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); - void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20); - void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - -#if wxUSE_SPLINES - void DoDrawSpline(wxList *points); -#endif // wxUSE_SPLINES - bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, - wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); bool CanDrawBitmap() const { return true; } - void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y ); - void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false ); - - void DoDrawText(const wxString& text, wxCoord x, wxCoord y ); - void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); - void Clear(); void SetFont( const wxFont& font ); void SetPen( const wxPen& pen ); @@ -80,11 +53,8 @@ public: void SetLogicalFunction( int function ); void SetBackground( const wxBrush& brush ); - void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); void DestroyClippingRegion(); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { } - bool StartDoc(const wxString& message); void EndDoc(); void StartPage(); @@ -93,13 +63,6 @@ public: wxCoord GetCharHeight() const; wxCoord GetCharWidth() const; bool CanGetTextExtent() const { return true; } - void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, - wxCoord *descent = (wxCoord *) NULL, - wxCoord *externalLeading = (wxCoord *) NULL, - wxFont *theFont = (wxFont *) NULL ) const; - - void DoGetSize(int* width, int* height) const; - void DoGetSizeMM(int *width, int *height) const; // Resolution in pixels per logical inch wxSize GetPPI() const; @@ -130,6 +93,37 @@ private: static float ms_PSScaleFactor; protected: + bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE); + bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; + void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); + void DoCrossHair(wxCoord x, wxCoord y) ; + void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc); + void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); + void DoDrawPoint(wxCoord x, wxCoord y); + void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); + void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); + void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); + void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20); + void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); +#if wxUSE_SPLINES + void DoDrawSpline(wxList *points); +#endif // wxUSE_SPLINES + bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, + wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); + void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); + void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false); + void DoDrawText(const wxString& text, wxCoord x, wxCoord y); + void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); + void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { } + void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, + wxCoord *descent = NULL, + wxCoord *externalLeading = NULL, + wxFont *theFont = NULL) const; + void DoGetSize(int* width, int* height) const; + void DoGetSizeMM(int *width, int *height) const; FILE* m_pstream; // PostScript output stream wxString m_title; diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 5d4a4121c7..5eaaeb0fda 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -156,6 +156,8 @@ public: bool ScrollList( int dx, int dy ); bool SortItems( wxListCtrlCompare fn, long data ); bool Update( long item ); + // Must provide overload to avoid hiding it (and warnings about it) + virtual void Update() { wxControl::Update(); } // are we in report mode? bool InReportView() const { return HasFlag(wxLC_REPORT); } @@ -208,13 +210,9 @@ public: virtual wxDropTarget *GetDropTarget() const; #endif - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); - virtual bool ShouldInheritColours() const { return false; } virtual void SetFocus(); - virtual wxSize DoGetBestSize() const; - // implementation // -------------- @@ -229,6 +227,10 @@ public: wxCoord m_headerHeight; protected: + virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); + + virtual wxSize DoGetBestSize() const; + // return the text for the given column of the given item virtual wxString OnGetItemText(long item, long column) const; @@ -247,9 +249,6 @@ protected: friend class WXDLLEXPORT wxListMainWindow; private: - // Virtual function hiding supression - virtual void Update() { wxWindow::Update(); } - // create the header window void CreateHeaderWindow(); diff --git a/include/wx/generic/logg.h b/include/wx/generic/logg.h index c506e327f9..b9580939ad 100644 --- a/include/wx/generic/logg.h +++ b/include/wx/generic/logg.h @@ -28,10 +28,11 @@ class WXDLLEXPORT wxLogTextCtrl : public wxLog public: wxLogTextCtrl(wxTextCtrl *pTextCtrl); -private: +protected: // implement sink function virtual void DoLogString(const wxChar *szString, time_t t); +private: // the control we use wxTextCtrl *m_pTextCtrl; diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index bc29819495..dff9e2fc06 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -52,6 +52,8 @@ public: @returns true if ABORT button has not been pressed */ virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL); + // Must provide overload to avoid hiding it (and warnings about it) + virtual void Update() { wxDialog::Update(); } /* Can be called to continue after the cancel button has been pressed, but the program decided to continue the operation (e.g., user didn't @@ -150,10 +152,6 @@ private: class WXDLLEXPORT wxWindowDisabler *m_winDisabler; DECLARE_EVENT_TABLE() -private: - // Virtual function hiding supression - virtual void Update() { wxDialog::Update(); } - DECLARE_NO_COPY_CLASS(wxProgressDialog) }; diff --git a/include/wx/gtk/bmpbuttn.h b/include/wx/gtk/bmpbuttn.h index a6a6bc1b51..3af18cfeec 100644 --- a/include/wx/gtk/bmpbuttn.h +++ b/include/wx/gtk/bmpbuttn.h @@ -56,7 +56,6 @@ public: void NotFocus(); void StartSelect(); void EndSelect(); - void DoApplyWidgetStyle(GtkRcStyle *style); bool m_hasFocus:1; bool m_isSelected:1; @@ -64,6 +63,7 @@ public: protected: virtual void OnSetBitmap(); virtual wxSize DoGetBestSize() const; + void DoApplyWidgetStyle(GtkRcStyle *style); void Init(); diff --git a/include/wx/gtk/brush.h b/include/wx/gtk/brush.h index 911a4783fa..1eb28335a6 100644 --- a/include/wx/gtk/brush.h +++ b/include/wx/gtk/brush.h @@ -55,7 +55,7 @@ public: void SetStyle( int style ); void SetStipple( const wxBitmap& stipple ); -private: +protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/gtk/button.h b/include/wx/gtk/button.h index 95c74f0da3..a395a617ca 100644 --- a/include/wx/gtk/button.h +++ b/include/wx/gtk/button.h @@ -61,7 +61,6 @@ public: // implementation // -------------- - void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow( GdkWindow *window ); // Since this wxButton doesn't derive from wxButtonBase (why?) we need @@ -71,8 +70,12 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + // helper to allow access to protected member from GTK callback + void MoveWindow(int x, int y, int width, int height) { DoMoveWindow(x, y, width, height); } + protected: virtual wxSize DoGetBestSize() const; + void DoApplyWidgetStyle(GtkRcStyle *style); private: DECLARE_DYNAMIC_CLASS(wxButton) diff --git a/include/wx/gtk/checkbox.h b/include/wx/gtk/checkbox.h index e48a048938..a1ed20538c 100644 --- a/include/wx/gtk/checkbox.h +++ b/include/wx/gtk/checkbox.h @@ -47,7 +47,6 @@ public: // implementation // -------------- - void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow( GdkWindow *window ); void OnInternalIdle(); @@ -58,6 +57,7 @@ public: protected: virtual wxSize DoGetBestSize() const; + void DoApplyWidgetStyle(GtkRcStyle *style); void DoSet3StateValue(wxCheckBoxState state); wxCheckBoxState DoGet3StateValue() const; diff --git a/include/wx/gtk/choice.h b/include/wx/gtk/choice.h index 5b0526a275..28a5efdcc0 100644 --- a/include/wx/gtk/choice.h +++ b/include/wx/gtk/choice.h @@ -77,6 +77,8 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + virtual bool IsOwnGtkWindow( GdkWindow *window ); + protected: wxList m_clientList; // contains the client data for the items @@ -91,8 +93,6 @@ protected: virtual wxSize DoGetBestSize() const; - virtual bool IsOwnGtkWindow( GdkWindow *window ); - private: // common part of Create() and DoAppend() int GtkAddHelper(GtkWidget *menu, int pos, const wxString& item); diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index 4f551834ed..357a476a39 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -152,7 +152,6 @@ public: void EnableEvents(); GtkWidget* GetConnectWidget(); bool IsOwnGtkWindow( GdkWindow *window ); - void DoApplyWidgetStyle(GtkRcStyle *style); wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST @@ -160,6 +159,7 @@ public: GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); protected: + void DoApplyWidgetStyle(GtkRcStyle *style); virtual int DoAppend(const wxString& item); virtual int DoInsert(const wxString& item, int pos); diff --git a/include/wx/gtk/dataobj2.h b/include/wx/gtk/dataobj2.h index f612ffaf7d..afb922c85b 100644 --- a/include/wx/gtk/dataobj2.h +++ b/include/wx/gtk/dataobj2.h @@ -34,6 +34,19 @@ public: virtual size_t GetDataSize() const { return m_pngSize; } virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } protected: void Init() { m_pngData = (void *)NULL; m_pngSize = 0; } @@ -44,15 +57,6 @@ protected: void *m_pngData; void DoConvertToPng(); - -private: - // virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -70,15 +74,19 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); - -private: - // virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } }; #endif // _WX_GTK_DATAOBJ2_H_ diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index 700668aa31..2555d5b388 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -75,6 +75,8 @@ protected: wxCoord *descent = (wxCoord *) NULL, wxCoord *externalLeading = (wxCoord *) NULL, wxFont *theFont = (wxFont *) NULL) const; + virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); + virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); public: virtual wxCoord GetCharWidth() const; @@ -92,9 +94,7 @@ public: virtual void SetBackgroundMode( int mode ); virtual void SetPalette( const wxPalette& palette ); - virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); virtual void DestroyClippingRegion(); - virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); // Resolution in pixels per logical inch virtual wxSize GetPPI() const; diff --git a/include/wx/gtk/dcmemory.h b/include/wx/gtk/dcmemory.h index 93bfb09883..e950326b95 100644 --- a/include/wx/gtk/dcmemory.h +++ b/include/wx/gtk/dcmemory.h @@ -30,7 +30,6 @@ public: wxMemoryDC( wxDC *dc ); // Create compatible DC ~wxMemoryDC(); virtual void SelectObject( const wxBitmap& bitmap ); - void DoGetSize( int *width, int *height ) const; // these get reimplemented for mono-bitmaps to behave // more like their Win32 couterparts. They now interpret @@ -45,7 +44,9 @@ public: // implementation wxBitmap m_selected; -private: +protected: + void DoGetSize( int *width, int *height ) const; + DECLARE_DYNAMIC_CLASS(wxMemoryDC) }; diff --git a/include/wx/gtk/filedlg.h b/include/wx/gtk/filedlg.h index 44a07faa5a..096f50920d 100644 --- a/include/wx/gtk/filedlg.h +++ b/include/wx/gtk/filedlg.h @@ -51,6 +51,7 @@ public: //private: bool m_destroyed_by_delete; +protected: // override this from wxTLW since the native // form doesn't have any m_wxwindow virtual void DoSetSize(int x, int y, diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index 94949f2d67..5711e98338 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -54,8 +54,6 @@ public: virtual ~wxFrame(); #if wxUSE_STATUSBAR - virtual void PositionStatusBar(); - virtual wxStatusBar* CreateStatusBar(int number = 1, long style = wxST_SIZEGRIP|wxFULL_REPAINT_ON_RESIZE, wxWindowID id = 0, @@ -88,6 +86,10 @@ protected: // common part of all ctors void Init(); +#if wxUSE_STATUSBAR + virtual void PositionStatusBar(); +#endif // wxUSE_STATUSBAR + // override wxWindow methods to take into account tool/menu/statusbars virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize( int *width, int *height ) const; diff --git a/include/wx/gtk/gauge.h b/include/wx/gtk/gauge.h index 6b967c3bc8..e5150fb70a 100644 --- a/include/wx/gtk/gauge.h +++ b/include/wx/gtk/gauge.h @@ -74,6 +74,8 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + virtual wxVisualAttributes GetDefaultAttributes() const; // implementation // ------------- @@ -91,8 +93,6 @@ protected: virtual wxSize DoGetBestSize() const; - virtual wxVisualAttributes GetDefaultAttributes() const; - private: DECLARE_DYNAMIC_CLASS(wxGauge) }; diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index be7a4e444d..018dabc2d2 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -76,21 +76,9 @@ public: virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; - virtual void DoSetSelection(int n, bool select); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(int n, void* clientData); - virtual void* DoGetItemClientData(int n) const; - virtual void DoSetItemClientObject(int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(int n) const; - static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -100,7 +88,6 @@ public: int GtkGetIndex( GtkWidget *item ) const; GtkWidget *GetConnectWidget(); bool IsOwnGtkWindow( GdkWindow *window ); - void DoApplyWidgetStyle(GtkRcStyle *style); void OnInternalIdle(); #if wxUSE_TOOLTIPS @@ -121,6 +108,16 @@ public: protected: virtual wxSize DoGetBestSize() const; + virtual void DoSetSelection(int n, bool select); + virtual int DoAppend(const wxString& item); + virtual void DoInsertItems(const wxArrayString& items, int pos); + virtual void DoSetItems(const wxArrayString& items, void **clientData); + virtual void DoSetFirstItem(int n); + virtual void DoSetItemClientData(int n, void* clientData); + virtual void* DoGetItemClientData(int n) const; + virtual void DoSetItemClientObject(int n, wxClientData* clientData); + virtual wxClientData* DoGetItemClientObject(int n) const; + void DoApplyWidgetStyle(GtkRcStyle *style); // return the string label for the given item wxString GetRealLabel(struct _GList *item) const; diff --git a/include/wx/gtk/menu.h b/include/wx/gtk/menu.h index 0f010fab16..c72c8ff60d 100644 --- a/include/wx/gtk/menu.h +++ b/include/wx/gtk/menu.h @@ -69,11 +69,6 @@ public: virtual ~wxMenu(); - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - // TODO: virtual void SetTitle(const wxString& title); // implementation @@ -84,6 +79,11 @@ public: GtkWidget *m_owner; GtkAccelGroup *m_accel; +protected: + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); + private: // common code for all constructors: void Init(); diff --git a/include/wx/gtk/notebook.h b/include/wx/gtk/notebook.h index 2921c3583c..9724afdb11 100644 --- a/include/wx/gtk/notebook.h +++ b/include/wx/gtk/notebook.h @@ -103,10 +103,6 @@ public: void SetConstraintSizes(bool recurse); bool DoPhase(int phase); #endif - - // set all page's attributes - void DoApplyWidgetStyle(GtkRcStyle *style); - // report if window belongs to notebook bool IsOwnGtkWindow( GdkWindow *window ); @@ -127,6 +123,9 @@ public: bool m_inSwitchPage; protected: + // set all page's attributes + void DoApplyWidgetStyle(GtkRcStyle *style); + // remove one page from the notebook but do not destroy it virtual wxNotebookPage *DoRemovePage(size_t nPage); diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index 38ae0b9a98..eb26d53b80 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -63,7 +63,7 @@ public: int GetDashCount() const; wxDash* GetDash() const; -private: +protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/gtk/popupwin.h b/include/wx/gtk/popupwin.h index aa4f657982..b35eb73004 100644 --- a/include/wx/gtk/popupwin.h +++ b/include/wx/gtk/popupwin.h @@ -34,8 +34,6 @@ public: // implementation // -------------- - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual void OnInternalIdle(); @@ -46,6 +44,8 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void DoMoveWindow(int x, int y, int width, int height); + private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxPopupWindow) diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index f4a0bb123c..fedb790c06 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -114,7 +114,6 @@ public: void GtkDisableEvents(); void GtkEnableEvents(); bool IsOwnGtkWindow( GdkWindow *window ); - void DoApplyWidgetStyle(GtkRcStyle *style); #if wxUSE_TOOLTIPS void ApplyToolTip( GtkTooltips *tips, const wxChar *tip ); #endif // wxUSE_TOOLTIPS @@ -126,6 +125,8 @@ public: wxList m_boxes; protected: + void DoApplyWidgetStyle(GtkRcStyle *style); + // common part of all ctors void Init(); diff --git a/include/wx/gtk/radiobut.h b/include/wx/gtk/radiobut.h index 9a54dffa62..d9eea34fdb 100644 --- a/include/wx/gtk/radiobut.h +++ b/include/wx/gtk/radiobut.h @@ -51,13 +51,13 @@ public: virtual bool IsRadioButton() const { return TRUE; } - void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow( GdkWindow *window ); void OnInternalIdle(); bool m_blockEvent; protected: + void DoApplyWidgetStyle(GtkRcStyle *style); virtual wxSize DoGetBestSize() const; private: diff --git a/include/wx/gtk/taskbarpriv.h b/include/wx/gtk/taskbarpriv.h index 4c76862609..ac656ef5d7 100644 --- a/include/wx/gtk/taskbarpriv.h +++ b/include/wx/gtk/taskbarpriv.h @@ -28,7 +28,8 @@ public: bool IsProtocolSupported(); wxEvtHandler *m_invokingWindow; - + +protected: #if wxUSE_MENUS_NATIVE virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); #endif // wxUSE_MENUS_NATIVE diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index 29add9c07a..b912909563 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -139,7 +139,6 @@ public: GtkWidget* GetConnectWidget(); bool IsOwnGtkWindow( GdkWindow *window ); - void DoApplyWidgetStyle(GtkRcStyle *style); void CalculateScrollbar(); void OnInternalIdle(); @@ -174,6 +173,7 @@ public: protected: virtual wxSize DoGetBestSize() const; + void DoApplyWidgetStyle(GtkRcStyle *style); // common part of all ctors void Init(); diff --git a/include/wx/gtk/tglbtn.h b/include/wx/gtk/tglbtn.h index 50d981942a..0c542ac0c9 100644 --- a/include/wx/gtk/tglbtn.h +++ b/include/wx/gtk/tglbtn.h @@ -75,10 +75,12 @@ public: wxBitmap m_bitmap; void OnSetBitmap(); - void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow(GdkWindow *window); virtual void OnInternalIdle(); + +protected: + void DoApplyWidgetStyle(GtkRcStyle *style); virtual wxSize DoGetBestSize() const; private: @@ -129,10 +131,12 @@ public: // implementation bool m_blockEvent; - void DoApplyWidgetStyle(GtkRcStyle *style); bool IsOwnGtkWindow(GdkWindow *window); virtual void OnInternalIdle(); + +protected: + void DoApplyWidgetStyle(GtkRcStyle *style); virtual wxSize DoGetBestSize() const; private: diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index 2729119b50..304f312de2 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -78,10 +78,6 @@ public: // implementation from now on // -------------------------- - // move the window to the specified location and resize it: this is called - // from both DoSetSize() and DoSetClientSize() - virtual void DoMoveWindow(int x, int y, int width, int height); - // GTK callbacks virtual void GtkOnSize( int x, int y, int width, int height ); virtual void OnInternalIdle(); @@ -111,6 +107,10 @@ protected: // common part of all ctors void Init(); + // move the window to the specified location and resize it: this is called + // from both DoSetSize() and DoSetClientSize() + virtual void DoMoveWindow(int x, int y, int width, int height); + // override wxWindow methods to take into account tool/menu/statusbars virtual void DoSetSize(int x, int y, int width, int height, diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 53a89a0c53..9b0c3d9aba 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -91,10 +91,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; -#if wxUSE_MENUS_NATIVE - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); -#endif // wxUSE_MENUS_NATIVE - virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ); virtual void SetScrollPos( int orient, int pos, bool refresh = true ); @@ -226,6 +222,7 @@ public: // wxMDIFrame, wxNotebook etc. this is the callback that will get used. wxInsertChildFunction m_insertCallback; +protected: // implement the base class pure virtuals virtual void DoClientToScreen( int *x, int *y ) const; virtual void DoScreenToClient( int *x, int *y ) const; @@ -238,6 +235,10 @@ public: virtual void DoSetClientSize(int width, int height); virtual void DoMoveWindow(int x, int y, int width, int height); +#if wxUSE_MENUS_NATIVE + virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); +#endif // wxUSE_MENUS_NATIVE + virtual void DoCaptureMouse(); virtual void DoReleaseMouse(); @@ -245,7 +246,6 @@ public: virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS -protected: // common part of all ctors (not virtual because called from ctor) void Init(); diff --git a/include/wx/hash.h b/include/wx/hash.h index 6d84d476f8..07ece7d0aa 100644 --- a/include/wx/hash.h +++ b/include/wx/hash.h @@ -393,8 +393,6 @@ public: size_t GetCount() const { return wxHashTableBase::GetCount(); } protected: - virtual void DoDeleteContents( wxHashTableBase_Node* node ); - // copy helper void DoCopy( const wxHashTable& copy ); @@ -402,6 +400,8 @@ protected: // m_curr to it and m_currBucket to its bucket void GetNextNode( size_t bucketStart ); private: + virtual void DoDeleteContents( wxHashTableBase_Node* node ); + // current node Node* m_curr; @@ -525,7 +525,7 @@ private: eltype *Delete(long key) { return (eltype*)DoDelete(key, key); } \ eltype *Delete(long lhash, long key) \ { return (eltype*)DoDelete(key, lhash); } \ - protected: \ + private: \ virtual void DoDeleteContents( wxHashTableBase_Node* node ) \ { delete (eltype*)node->GetData(); } \ \ diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 807960b7ed..1fc783eb87 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -213,6 +213,8 @@ public: wxString ToText(); #endif // wxUSE_CLIPBOARD + virtual void OnInternalIdle(); + protected: void Init(); @@ -240,8 +242,6 @@ protected: void OnMouseLeave(wxMouseEvent& event); #endif // wxUSE_CLIPBOARD - virtual void OnInternalIdle(); - // Returns new filter (will be stored into m_DefaultFilter variable) virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} diff --git a/include/wx/imagbmp.h b/include/wx/imagbmp.h index 581dbb55c0..d452670793 100644 --- a/include/wx/imagbmp.h +++ b/include/wx/imagbmp.h @@ -61,9 +61,9 @@ public: #if wxUSE_STREAMS virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool DoCanRead( wxInputStream& stream ); protected: + virtual bool DoCanRead( wxInputStream& stream ); bool SaveDib(wxImage *image, wxOutputStream& stream, bool verbose, bool IsBmp, bool IsMask); bool DoLoadDib(wxImage *image, int width, int height, int bpp, int ncolors, @@ -96,8 +96,9 @@ public: virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool DoLoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index ); - virtual bool DoCanRead( wxInputStream& stream ); virtual int GetImageCount( wxInputStream& stream ); +protected: + virtual bool DoCanRead( wxInputStream& stream ); #endif // wxUSE_STREAMS private: @@ -124,6 +125,7 @@ public: // formats are almost identical), but we hide this fact at // the API level, since it is a mere implementation detail. +protected: #if wxUSE_STREAMS virtual bool DoCanRead( wxInputStream& stream ); #endif // wxUSE_STREAMS @@ -150,8 +152,9 @@ public: #if wxUSE_STREAMS virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose=true) ){return false ;}; virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool DoCanRead( wxInputStream& stream ); virtual int GetImageCount( wxInputStream& stream ); +protected: + virtual bool DoCanRead( wxInputStream& stream ); #endif // wxUSE_STREAMS private: diff --git a/include/wx/imaggif.h b/include/wx/imaggif.h index 1401f1baa8..493dbb09e6 100644 --- a/include/wx/imaggif.h +++ b/include/wx/imaggif.h @@ -33,6 +33,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif diff --git a/include/wx/imagjpeg.h b/include/wx/imagjpeg.h index 491f847bda..6a579864b9 100644 --- a/include/wx/imagjpeg.h +++ b/include/wx/imagjpeg.h @@ -34,6 +34,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif diff --git a/include/wx/imagpcx.h b/include/wx/imagpcx.h index 15871d6fc2..0e8693dca0 100644 --- a/include/wx/imagpcx.h +++ b/include/wx/imagpcx.h @@ -32,6 +32,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif // wxUSE_STREAMS diff --git a/include/wx/imagpng.h b/include/wx/imagpng.h index 091a9de46f..8edf80b879 100644 --- a/include/wx/imagpng.h +++ b/include/wx/imagpng.h @@ -44,6 +44,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif diff --git a/include/wx/imagpnm.h b/include/wx/imagpnm.h index 6f25e9d027..b9e46eea3f 100644 --- a/include/wx/imagpnm.h +++ b/include/wx/imagpnm.h @@ -31,6 +31,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif diff --git a/include/wx/imagtiff.h b/include/wx/imagtiff.h index 87b7fa0e9e..536cf3926c 100644 --- a/include/wx/imagtiff.h +++ b/include/wx/imagtiff.h @@ -34,8 +34,9 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); - virtual bool DoCanRead( wxInputStream& stream ); virtual int GetImageCount( wxInputStream& stream ); +protected: + virtual bool DoCanRead( wxInputStream& stream ); #endif private: diff --git a/include/wx/imagxpm.h b/include/wx/imagxpm.h index 23ae19285a..e47c873e63 100644 --- a/include/wx/imagxpm.h +++ b/include/wx/imagxpm.h @@ -31,6 +31,7 @@ public: #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); +protected: virtual bool DoCanRead( wxInputStream& stream ); #endif diff --git a/include/wx/mac/carbon/checkbox.h b/include/wx/mac/carbon/checkbox.h index b82499581e..0e2ac1563d 100644 --- a/include/wx/mac/carbon/checkbox.h +++ b/include/wx/mac/carbon/checkbox.h @@ -34,12 +34,13 @@ public: virtual void SetValue(bool); virtual bool GetValue() const; - void DoSet3StateValue(wxCheckBoxState val); - virtual wxCheckBoxState DoGet3StateValue() const; - virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; virtual void Command(wxCommandEvent& event); +protected: + void DoSet3StateValue(wxCheckBoxState val); + virtual wxCheckBoxState DoGet3StateValue() const; + DECLARE_DYNAMIC_CLASS(wxCheckBox) }; diff --git a/include/wx/mac/carbon/choice.h b/include/wx/mac/carbon/choice.h index 56de8da3e4..2b0ac93311 100644 --- a/include/wx/mac/carbon/choice.h +++ b/include/wx/mac/carbon/choice.h @@ -69,9 +69,6 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr); - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); virtual void Delete(int n); virtual void Clear(); @@ -87,14 +84,14 @@ public: protected: virtual wxSize DoGetBestSize() const ; + virtual int DoAppend(const wxString& item); + virtual int DoInsert(const wxString& item, int pos); -public: // for wxComboBox only virtual void DoSetItemClientData( int n, void* clientData ); virtual void* DoGetItemClientData( int n ) const; virtual void DoSetItemClientObject( int n, wxClientData* clientData ); virtual wxClientData* DoGetItemClientObject( int n ) const; -protected: // free all memory we have (used by Clear() and dtor) // prevent collision with some BSD definitions of macro Free() void FreeData(); diff --git a/include/wx/mac/carbon/combobox.h b/include/wx/mac/carbon/combobox.h index 0b05bb9697..2232caa777 100644 --- a/include/wx/mac/carbon/combobox.h +++ b/include/wx/mac/carbon/combobox.h @@ -29,9 +29,6 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase public: inline wxComboBox() {} virtual ~wxComboBox(); - // override the base class virtuals involved in geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); // forward these functions to all subcontrols virtual bool Enable(bool enable = true); @@ -129,6 +126,10 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST protected: + // override the base class virtuals involved in geometry calculations + virtual wxSize DoGetBestSize() const; + virtual void DoMoveWindow(int x, int y, int width, int height); + virtual int DoAppend(const wxString& item) ; virtual int DoInsert(const wxString& item, int pos) ; diff --git a/include/wx/mac/carbon/dataobj2.h b/include/wx/mac/carbon/dataobj2.h index 36c670b2aa..0708558a98 100644 --- a/include/wx/mac/carbon/dataobj2.h +++ b/include/wx/mac/carbon/dataobj2.h @@ -35,6 +35,19 @@ public: virtual size_t GetDataSize() const ; virtual bool GetDataHere(void *buf) const ; virtual bool SetData(size_t len, const void *buf); + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } protected : void Init() ; @@ -42,14 +55,6 @@ protected : void* m_pictHandle ; bool m_pictCreated ; -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -67,15 +72,19 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); - -private: - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } }; #endif // _WX_GTK_DATAOBJ2_H_ diff --git a/include/wx/mac/carbon/dc.h b/include/wx/mac/carbon/dc.h index 15d8b0c892..123f5569af 100644 --- a/include/wx/mac/carbon/dc.h +++ b/include/wx/mac/carbon/dc.h @@ -108,12 +108,6 @@ public: virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; - virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual bool CanDrawBitmap() const; virtual bool CanGetTextExtent() const; @@ -229,6 +223,13 @@ public: #endif protected: + virtual void DoGetTextExtent(const wxString& string, + wxCoord *x, wxCoord *y, + wxCoord *descent = NULL, + wxCoord *externalLeading = NULL, + wxFont *theFont = NULL) const; + virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; + virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE); diff --git a/include/wx/mac/carbon/dcclient.h b/include/wx/mac/carbon/dcclient.h index e8f9dc7e8a..993e01dacd 100644 --- a/include/wx/mac/carbon/dcclient.h +++ b/include/wx/mac/carbon/dcclient.h @@ -32,8 +32,8 @@ class WXDLLEXPORT wxWindowDC: public wxDC wxWindowDC(wxWindow *win); ~wxWindowDC(void); - virtual void DoGetSize( int *width, int *height ) const; protected : + virtual void DoGetSize( int *width, int *height ) const; wxWindow *m_window; }; @@ -49,6 +49,8 @@ class WXDLLEXPORT wxClientDC: public wxWindowDC wxClientDC(wxWindow *win); ~wxClientDC(void); + +protected: virtual void DoGetSize( int *width, int *height ) const; }; @@ -63,6 +65,8 @@ class WXDLLEXPORT wxPaintDC: public wxWindowDC wxPaintDC(wxWindow *win); ~wxPaintDC(void); + +protected: virtual void DoGetSize( int *width, int *height ) const; }; diff --git a/include/wx/mac/carbon/dcmemory.h b/include/wx/mac/carbon/dcmemory.h index 800dae556e..b5103a8e6e 100644 --- a/include/wx/mac/carbon/dcmemory.h +++ b/include/wx/mac/carbon/dcmemory.h @@ -23,8 +23,11 @@ class WXDLLEXPORT wxMemoryDC: public wxPaintDC wxMemoryDC( wxDC *dc ); // Create compatible DC ~wxMemoryDC(void); virtual void SelectObject( const wxBitmap& bitmap ); - virtual void DoGetSize( int *width, int *height ) const; wxBitmap GetSelectedObject() { return m_selected ; } + +protected: + virtual void DoGetSize( int *width, int *height ) const; + private: wxBitmap m_selected; }; diff --git a/include/wx/mac/carbon/dcprint.h b/include/wx/mac/carbon/dcprint.h index 2fe6362aef..b5641d8624 100644 --- a/include/wx/mac/carbon/dcprint.h +++ b/include/wx/mac/carbon/dcprint.h @@ -32,11 +32,11 @@ class WXDLLEXPORT wxPrinterDC: public wxDC virtual void StartPage(void) ; virtual void EndPage(void) ; wxPrintData& GetPrintData() { return m_printData; } - virtual void DoGetSize( int *width, int *height ) const; #if wxMAC_USE_CORE_GRAPHICS void MacSetCGContext( void * cg ) ; #endif protected: + virtual void DoGetSize( int *width, int *height ) const; wxPrintData m_printData ; wxNativePrinterDC* m_nativePrinterDC ; #endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/include/wx/mac/carbon/filedlg.h b/include/wx/mac/carbon/filedlg.h index 9e05caf1c6..95782bee6c 100644 --- a/include/wx/mac/carbon/filedlg.h +++ b/include/wx/mac/carbon/filedlg.h @@ -36,7 +36,8 @@ public: virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; } virtual int ShowModal(); - + +protected: // not supported for file dialog, RR virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height), diff --git a/include/wx/mac/carbon/frame.h b/include/wx/mac/carbon/frame.h index 14314745e8..306c9ff2ec 100644 --- a/include/wx/mac/carbon/frame.h +++ b/include/wx/mac/carbon/frame.h @@ -72,7 +72,6 @@ public: wxWindowID id = -1, const wxString& name = wxToolBarNameStr); - virtual void PositionToolBar(); virtual void SetToolBar(wxToolBar *toolbar); #endif // wxUSE_TOOLBAR @@ -82,8 +81,6 @@ public: long style = wxST_SIZEGRIP, wxWindowID id = 0, const wxString& name = wxStatusLineNameStr); - - virtual void PositionStatusBar(); #endif // wxUSE_STATUSBAR // tooltip management @@ -97,10 +94,19 @@ public: void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } wxWindow *GetLastFocus() const { return m_winLastFocused; } + void PositionBars(); + protected: // common part of all ctors void Init(); +#if wxUSE_TOOLBAR + virtual void PositionToolBar(); +#endif +#if wxUSE_STATUSBAR + virtual void PositionStatusBar(); +#endif + // override base class virtuals virtual void DoGetClientSize(int *width, int *height) const; virtual void DoSetClientSize(int width, int height); diff --git a/include/wx/mac/carbon/listbox.h b/include/wx/mac/carbon/listbox.h index 184fcaf2d9..0d55320f54 100644 --- a/include/wx/mac/carbon/listbox.h +++ b/include/wx/mac/carbon/listbox.h @@ -83,22 +83,9 @@ public: virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; - virtual void DoSetSelection(int n, bool select); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(int n, void* clientData); - virtual void* DoGetItemClientData(int n) const; - virtual void DoSetItemClientObject(int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(int n) const; - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; - // wxCheckListBox support static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -116,6 +103,17 @@ public: // events in the latter case bool MacIsSelectionSuppressed() const { return m_suppressSelection ; } protected: + virtual void DoSetSelection(int n, bool select); + virtual int DoAppend(const wxString& item); + virtual void DoInsertItems(const wxArrayString& items, int pos); + virtual void DoSetItems(const wxArrayString& items, void **clientData); + virtual void DoSetFirstItem(int n); + virtual void DoSetItemClientData(int n, void* clientData); + virtual void* DoGetItemClientData(int n) const; + virtual void DoSetItemClientObject(int n, wxClientData* clientData); + virtual wxClientData* DoGetItemClientObject(int n) const; + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void MacDelete( int n ) ; void MacInsert( int n , const wxString& item) ; void MacAppend( const wxString& item) ; diff --git a/include/wx/mac/carbon/mdi.h b/include/wx/mac/carbon/mdi.h index 8590685faa..2bb1d94beb 100644 --- a/include/wx/mac/carbon/mdi.h +++ b/include/wx/mac/carbon/mdi.h @@ -179,15 +179,14 @@ class WXDLLEXPORT wxMDIClientWindow: public wxWindow // Note: this is virtual, to allow overridden behaviour. virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); - // Gets the size available for subwindows after menu size, toolbar size - // and status bar size have been subtracted. If you want to manage your own - // toolbar(s), don't call SetToolBar. - void DoGetClientSize(int *width, int *height) const; - // Explicitly call default scroll behaviour void OnScroll(wxScrollEvent& event); protected: + // Gets the size available for subwindows after menu size, toolbar size + // and status bar size have been subtracted. If you want to manage your own + // toolbar(s), don't call SetToolBar. + void DoGetClientSize(int *width, int *height) const; DECLARE_EVENT_TABLE() }; diff --git a/include/wx/mac/carbon/menu.h b/include/wx/mac/carbon/menu.h index 8628d77d5c..4430389dec 100644 --- a/include/wx/mac/carbon/menu.h +++ b/include/wx/mac/carbon/menu.h @@ -31,10 +31,6 @@ public: virtual ~wxMenu(); - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); virtual void Attach(wxMenuBarBase *menubar) ; virtual void Break(); @@ -65,6 +61,11 @@ public: short MacGetMenuId() { return m_macMenuId ; } +protected: + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); + private: // common part of all ctors void Init(); diff --git a/include/wx/mac/carbon/metafile.h b/include/wx/mac/carbon/metafile.h index 7bf91023d1..93ff61d9e6 100644 --- a/include/wx/mac/carbon/metafile.h +++ b/include/wx/mac/carbon/metafile.h @@ -85,13 +85,14 @@ class WXDLLEXPORT wxMetafileDC: public wxDC // Should be called at end of drawing virtual wxMetafile *Close(void); - virtual void DoGetSize(int *width, int *height) const ; // Implementation inline wxMetafile *GetMetaFile(void) const { return m_metaFile; } inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } protected: + virtual void DoGetSize(int *width, int *height) const; + wxMetafile* m_metaFile; }; diff --git a/include/wx/mac/carbon/msgdlg.h b/include/wx/mac/carbon/msgdlg.h index bdffe148bd..c74734d9d2 100644 --- a/include/wx/mac/carbon/msgdlg.h +++ b/include/wx/mac/carbon/msgdlg.h @@ -39,6 +39,7 @@ public: int ShowModal(); +protected: // not supported for message dialog, RR virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height), diff --git a/include/wx/mac/carbon/notebook.h b/include/wx/mac/carbon/notebook.h index ae67da07cf..234fbf2aba 100644 --- a/include/wx/mac/carbon/notebook.h +++ b/include/wx/mac/carbon/notebook.h @@ -114,9 +114,10 @@ public: // base class virtuals // ------------------- virtual void Command(wxCommandEvent& event); + virtual wxInt32 MacControlHit(WXEVENTHANDLERREF handler, WXEVENTREF event); + protected: virtual wxNotebookPage *DoRemovePage(size_t page) ; - virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; // common part of all ctors void Init(); diff --git a/include/wx/mac/carbon/slider.h b/include/wx/mac/carbon/slider.h index 76d5687af8..e9702ea6fa 100644 --- a/include/wx/mac/carbon/slider.h +++ b/include/wx/mac/carbon/slider.h @@ -79,15 +79,15 @@ public: int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); + void Command(wxCommandEvent& event); + virtual wxInt32 MacControlHit(WXEVENTHANDLERREF handler, WXEVENTREF event); + void MacHandleControlClick(WXWidget control, wxInt16 controlpart, bool mouseStillDown); + protected: virtual wxSize DoGetBestSize() const; virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags); virtual void DoMoveWindow(int x, int y, int w, int h); - void Command(wxCommandEvent& event); - virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; - // Common processing to invert slider values based on wxSL_INVERSE virtual int ValueInvertOrNot(int value) const; diff --git a/include/wx/mac/carbon/statbmp.h b/include/wx/mac/carbon/statbmp.h index 33cc5bd495..4841947522 100644 --- a/include/wx/mac/carbon/statbmp.h +++ b/include/wx/mac/carbon/statbmp.h @@ -53,9 +53,10 @@ class WXDLLEXPORT wxStaticBitmap: public wxStaticBitmapBase // overriden base class virtuals virtual bool AcceptsFocus() const { return FALSE; } - virtual wxSize DoGetBestSize() const ; protected: + virtual wxSize DoGetBestSize() const; + wxBitmap m_bitmap; DECLARE_EVENT_TABLE() }; diff --git a/include/wx/mac/carbon/stattext.h b/include/wx/mac/carbon/stattext.h index dd127f745a..042d0d3f59 100644 --- a/include/wx/mac/carbon/stattext.h +++ b/include/wx/mac/carbon/stattext.h @@ -38,10 +38,11 @@ public: void SetLabel( const wxString &str ) ; bool SetFont( const wxFont &font ); + virtual bool AcceptsFocus() const { return FALSE; } + protected : virtual wxSize DoGetBestSize() const ; - virtual bool AcceptsFocus() const { return FALSE; } DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText) }; diff --git a/include/wx/mac/carbon/toolbar.h b/include/wx/mac/carbon/toolbar.h index a5fb9c3b85..ee979c767e 100644 --- a/include/wx/mac/carbon/toolbar.h +++ b/include/wx/mac/carbon/toolbar.h @@ -50,8 +50,6 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase virtual bool Show(bool show = true); virtual bool IsShown() const; - virtual void DoGetSize(int *width, int *height) const; - virtual wxSize DoGetBestSize() const ; virtual bool Realize(); virtual void SetToolBitmapSize(const wxSize& size); @@ -75,7 +73,8 @@ protected: // common part of all ctors void Init(); - // implement base class pure virtuals + virtual void DoGetSize(int *width, int *height) const; + virtual wxSize DoGetBestSize() const; virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); diff --git a/include/wx/mac/carbon/window.h b/include/wx/mac/carbon/window.h index 43368f9e3e..363767bdfc 100644 --- a/include/wx/mac/carbon/window.h +++ b/include/wx/mac/carbon/window.h @@ -82,9 +82,9 @@ public: int *externalLeading = NULL, const wxFont *theFont = NULL ) const; - +protected: virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); - +public: virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ); virtual void SetScrollPos( int orient, int pos, bool refresh = true ); diff --git a/include/wx/msw/button.h b/include/wx/msw/button.h index f777710dad..25f4ba1ad7 100644 --- a/include/wx/msw/button.h +++ b/include/wx/msw/button.h @@ -55,6 +55,7 @@ public: virtual bool SetForegroundColour(const wxColour &colour); virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; private: void MakeOwnerDrawn(); @@ -72,7 +73,6 @@ protected: // usually overridden base class virtuals virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const ; private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton) diff --git a/include/wx/msw/checkbox.h b/include/wx/msw/checkbox.h index 6a2a59da88..c61399154e 100644 --- a/include/wx/msw/checkbox.h +++ b/include/wx/msw/checkbox.h @@ -45,10 +45,10 @@ public: virtual bool MSWCommand(WXUINT param, WXWORD id); virtual void Command(wxCommandEvent& event); virtual bool SetForegroundColour(const wxColour& colour); + virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); protected: virtual wxSize DoGetBestSize() const; - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); virtual void DoSet3StateValue(wxCheckBoxState value); virtual wxCheckBoxState DoGet3StateValue() const; diff --git a/include/wx/msw/checklst.h b/include/wx/msw/checklst.h index 4b62d3ab31..23665f2793 100644 --- a/include/wx/msw/checklst.h +++ b/include/wx/msw/checklst.h @@ -71,12 +71,12 @@ public: // accessors size_t GetItemHeight() const { return m_nItemHeight; } -protected: // we create our items ourselves and they have non-standard size, // so we need to override these functions virtual wxOwnerDrawn *CreateLboxItem(size_t n); virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item); +protected: // this can't be called DoHitTest() because wxWindow already has this method int DoHitTestItem(wxCoord x, wxCoord y) const; diff --git a/include/wx/msw/choice.h b/include/wx/msw/choice.h index d3b6689687..e6207d187d 100644 --- a/include/wx/msw/choice.h +++ b/include/wx/msw/choice.h @@ -66,9 +66,6 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr); - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); virtual void Delete(int n); virtual void Clear(); @@ -85,11 +82,15 @@ public: virtual bool MSWCommand(WXUINT param, WXWORD id); WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual WXHBRUSH MSWControlColor(WXHDC hDC, WXHWND hWnd); + virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg); + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; protected: // common part of all ctors void Init() { m_lastAcceptedSelection = wxID_NONE; } + virtual int DoAppend(const wxString& item); + virtual int DoInsert(const wxString& item, int pos); virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoSetItemClientData( int n, void* clientData ); virtual void* DoGetItemClientData( int n ) const; @@ -103,10 +104,6 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); - virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg); - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - // update the height of the drop down list to fit the number of items we // have (without changing the visible height) void UpdateVisibleHeight(); diff --git a/include/wx/msw/colordlg.h b/include/wx/msw/colordlg.h index e7dc6d2f70..621ebcaa23 100644 --- a/include/wx/msw/colordlg.h +++ b/include/wx/msw/colordlg.h @@ -36,9 +36,8 @@ public: virtual int ShowModal(); - virtual void DoGetPosition( int *x, int *y ) const; - protected: + virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetSize(int *width, int *height) const; virtual void DoGetClientSize(int *width, int *height) const; virtual void DoSetSize(int x, int y, diff --git a/include/wx/msw/combobox.h b/include/wx/msw/combobox.h index 0ef87a536a..6259ab78fc 100644 --- a/include/wx/msw/combobox.h +++ b/include/wx/msw/combobox.h @@ -130,9 +130,9 @@ public: void OnUpdateDelete(wxUpdateUIEvent& event); void OnUpdateSelectAll(wxUpdateUIEvent& event); -protected: virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; +protected: // common part of all ctors void Init() { m_selectionOld = -1; } diff --git a/include/wx/msw/control.h b/include/wx/msw/control.h index 16c7419422..e5b8dc9b9f 100644 --- a/include/wx/msw/control.h +++ b/include/wx/msw/control.h @@ -68,6 +68,9 @@ public: // could call it virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd); + // default style for the control include WS_TABSTOP if it AcceptsFocus() + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const; @@ -111,9 +114,6 @@ protected: const wxString& label = wxEmptyString, WXDWORD exstyle = (WXDWORD)-1); - // default style for the control include WS_TABSTOP if it AcceptsFocus() - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - // call this from the derived class MSWControlColor() if you want to show // the control greyed out (and opaque) WXHBRUSH MSWControlColorDisabled(WXHDC pDC); diff --git a/include/wx/msw/datectrl.h b/include/wx/msw/datectrl.h index 6ca2c22b66..d4b8bc74fb 100644 --- a/include/wx/msw/datectrl.h +++ b/include/wx/msw/datectrl.h @@ -53,11 +53,11 @@ public: virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2); virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; -protected: virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); +protected: virtual wxSize DoGetBestSize() const; diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 1a2e82afbb..0095fa710d 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -72,12 +72,6 @@ public: virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; - virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual bool CanDrawBitmap() const; virtual bool CanGetTextExtent() const; @@ -160,6 +154,13 @@ protected: // classes wxDC() { Init(); } + virtual void DoGetTextExtent(const wxString& string, + wxCoord *x, wxCoord *y, + wxCoord *descent = NULL, + wxCoord *externalLeading = NULL, + wxFont *theFont = NULL) const; + virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; + virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE); @@ -301,6 +302,7 @@ public: SetHDC((WXHDC)NULL); } +protected: virtual void DoGetSize(int *w, int *h) const { wxFAIL_MSG( _T("no way to retrieve the size of generic DC") ); diff --git a/include/wx/msw/dialog.h b/include/wx/msw/dialog.h index 13c8c2b59a..6d26a72c9f 100644 --- a/include/wx/msw/dialog.h +++ b/include/wx/msw/dialog.h @@ -124,6 +124,9 @@ public: // use IsModal() wxDEPRECATED( bool IsModalShowing() const ); + // handle Escape here + virtual bool MSWProcessMessage(WXMSG* pMsg); + protected: // find the window to use as parent for this dialog if none has been // specified explicitly by the user @@ -142,9 +145,6 @@ protected: // return true if button was "clicked" or false if we don't have it bool EmulateButtonClickIfPresent(int id); - // handle Escape here - virtual bool MSWProcessMessage(WXMSG* pMsg); - private: wxWindow* m_oldFocus; bool m_endModalCalled; // allow for closing within InitDialog diff --git a/include/wx/msw/enhmeta.h b/include/wx/msw/enhmeta.h index 4fa8d1c8d0..1bfe8985c6 100644 --- a/include/wx/msw/enhmeta.h +++ b/include/wx/msw/enhmeta.h @@ -86,9 +86,10 @@ public: // obtain a pointer to the new metafile (caller should delete it) wxEnhMetaFile *Close(); -private: +protected: virtual void DoGetSize(int *width, int *height) const; +private: // size passed to ctor and returned by DoGetSize() int m_width, m_height; diff --git a/include/wx/msw/gauge95.h b/include/wx/msw/gauge95.h index 79ae164e66..26e7c18e35 100644 --- a/include/wx/msw/gauge95.h +++ b/include/wx/msw/gauge95.h @@ -51,8 +51,9 @@ public: virtual bool SetForegroundColour(const wxColour& col); virtual bool SetBackgroundColour(const wxColour& col); -protected: virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + +protected: virtual wxSize DoGetBestSize() const; diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index 25a35186ba..46acf9a572 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -87,21 +87,9 @@ public: virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; - virtual void DoSetSelection(int n, bool select); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(int n, void* clientData); - virtual void* DoGetItemClientData(int n) const; - virtual void DoSetItemClientObject(int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(int n) const; - // wxCheckListBox support #if wxUSE_OWNER_DRAWN bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item); @@ -124,6 +112,14 @@ public: // Windows callbacks bool MSWCommand(WXUINT param, WXWORD id); + WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + + // under XP when using "transition effect for menus and tooltips" if we + // return true for WM_PRINTCLIENT here then it causes noticable slowdown + virtual bool MSWShouldPropagatePrintChild() + { + return false; + } virtual wxVisualAttributes GetDefaultAttributes() const { @@ -137,7 +133,15 @@ public: } protected: - WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + virtual void DoSetSelection(int n, bool select); + virtual int DoAppend(const wxString& item); + virtual void DoInsertItems(const wxArrayString& items, int pos); + virtual void DoSetItems(const wxArrayString& items, void **clientData); + virtual void DoSetFirstItem(int n); + virtual void DoSetItemClientData(int n, void* clientData); + virtual void* DoGetItemClientData(int n) const; + virtual void DoSetItemClientObject(int n, wxClientData* clientData); + virtual wxClientData* DoGetItemClientObject(int n) const; // free memory (common part of Clear() and dtor) void Free(); @@ -147,13 +151,6 @@ protected: virtual wxSize DoGetBestSize() const; - // under XP when using "transition effect for menus and tooltips" if we - // return true for WM_PRINTCLIENT here then it causes noticable slowdown - virtual bool MSWShouldPropagatePrintChild() - { - return false; - } - #if wxUSE_OWNER_DRAWN // control items wxListBoxItemsArray m_aItems; diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index 8a09699b1a..480fa39c3d 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -365,13 +365,6 @@ public: // obsolete stuff, for compatibility only -- don't use wxDEPRECATED( int GetItemSpacing(bool isSmall) const); -protected: - // common part of all ctors - void Init(); - - // free memory taken by all internal data - void FreeAllInternalData(); - // convert our styles to Windows virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; @@ -380,6 +373,12 @@ protected: WXWPARAM wParam, WXLPARAM lParam); +protected: + // common part of all ctors + void Init(); + + // free memory taken by all internal data + void FreeAllInternalData(); wxTextCtrl* m_textCtrl; // The control used for editing a label wxImageList * m_imageListNormal; // The image list for normal icons diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 9f31e4543e..5bbaef70db 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -183,6 +183,7 @@ protected: virtual void DoSetClientSize(int width, int height); virtual void InternalSetMenuBar(); virtual bool IsMDIChild() const { return true; } + virtual void DetachMenuBar(); virtual WXHICON GetDefaultIcon() const; @@ -192,7 +193,6 @@ protected: private: bool m_needsInitialShow; // Show must be called in idle time after Creation bool m_needsResize; // flag which tells us to artificially resize the frame - virtual void DetachMenuBar() ; DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIChildFrame) @@ -220,10 +220,11 @@ public: // Explicitly call default scroll behaviour void OnScroll(wxScrollEvent& event); +protected: virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); -protected: + void Init() { m_scrollX = m_scrollY = 0; } int m_scrollX, m_scrollY; diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index d12c25c59c..89bc911dab 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -56,11 +56,6 @@ public: virtual ~wxMenu(); - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - virtual void Break(); virtual void SetTitle(const wxString& title); @@ -91,6 +86,11 @@ public: int FindAccel(int id) const; #endif // wxUSE_ACCEL +protected: + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); + private: // common part of all ctors void Init(); diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index 291c681ea9..2d4698f9db 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -181,13 +181,19 @@ public: } #endif // wxUSE_UXTHEME + // translate wxWin styles to the Windows ones + virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; + + // return the themed brush for painting our children + virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, WXHWND hWnd); + + // draw child background + virtual bool MSWPrintChild(WXHDC hDC, wxWindow *win); + protected: // common part of all ctors void Init(); - // translate wxWin styles to the Windows ones - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - // remove one page from the notebook, without deleting virtual wxNotebookPage *DoRemovePage(size_t nPage); @@ -206,12 +212,6 @@ protected: // creates the brush to be used for drawing the tab control background void UpdateBgBrush(); - // return the themed brush for painting our children - virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, WXHWND hWnd); - - // draw child background - virtual bool MSWPrintChild(WXHDC hDC, wxWindow *win); - // common part of QueryBgBitmap() and MSWPrintChild() // // if child == NULL, draw background for the entire notebook itself diff --git a/include/wx/msw/popupwin.h b/include/wx/msw/popupwin.h index 5e78d39eb1..69f5ef9641 100644 --- a/include/wx/msw/popupwin.h +++ b/include/wx/msw/popupwin.h @@ -28,16 +28,16 @@ public: virtual bool Show(bool show = true); -protected: - // popups handle the position like wxTopLevelWindow, not wxWindow - virtual void DoGetPosition(int *x, int *y) const; - // return the style to be used for the popup windows virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; // get the HWND to be used as parent of this window with CreateWindow() virtual WXHWND MSWGetParent() const; +protected: + // popups handle the position like wxTopLevelWindow, not wxWindow + virtual void DoGetPosition(int *x, int *y) const; + DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow) }; diff --git a/include/wx/msw/scrolbar.h b/include/wx/msw/scrolbar.h index 992604a64f..45e6dec23b 100644 --- a/include/wx/msw/scrolbar.h +++ b/include/wx/msw/scrolbar.h @@ -56,9 +56,10 @@ public: // override wxControl version to not use solid background here virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd); + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + protected: virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; int m_pageSize; int m_viewSize; diff --git a/include/wx/msw/slider95.h b/include/wx/msw/slider95.h index 580b77f89b..a1891f8d89 100644 --- a/include/wx/msw/slider95.h +++ b/include/wx/msw/slider95.h @@ -92,6 +92,8 @@ public: virtual bool Enable(bool show = true); virtual bool SetFont(const wxFont& font); + virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; + protected: // common part of all ctors void Init(); @@ -114,8 +116,6 @@ protected: virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - // the labels windows, if any wxSubwindows *m_labels; diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index db39bbb7bc..883b52ae37 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -52,11 +52,11 @@ public: virtual wxBitmap GetBitmap() const; virtual wxIcon GetIcon() const; + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; protected: virtual wxBorder GetDefaultBorder() const; virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; // ctor/dtor helpers void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; } diff --git a/include/wx/msw/statbox.h b/include/wx/msw/statbox.h index c6e3cf91ab..34bf7ccc12 100644 --- a/include/wx/msw/statbox.h +++ b/include/wx/msw/statbox.h @@ -38,17 +38,19 @@ public: /// Implementation only virtual void GetBordersForSizer(int *borderTop, int *borderOther) const; + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + protected: virtual wxSize DoGetBestSize() const; // choose the default border for this window virtual wxBorder GetDefaultBorder() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - #ifndef __WXWINCE__ +public: virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); +protected: // return the region with all the windows inside this static box excluded virtual WXHRGN MSWGetRegionWithoutChildren(); diff --git a/include/wx/msw/statbr95.h b/include/wx/msw/statbr95.h index 889ca70aca..e611e4a00a 100644 --- a/include/wx/msw/statbr95.h +++ b/include/wx/msw/statbr95.h @@ -57,6 +57,9 @@ public: virtual int GetBorderX() const; virtual int GetBorderY() const; + virtual WXLRESULT MSWWindowProc(WXUINT nMsg, + WXWPARAM wParam, + WXLPARAM lParam); protected: void CopyFieldsWidth(const int widths[]); void SetFieldsWidth(); @@ -64,10 +67,6 @@ protected: // override base class virtual void DoMoveWindow(int x, int y, int width, int height); - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, - WXWPARAM wParam, - WXLPARAM lParam); - private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar95) }; diff --git a/include/wx/msw/statline.h b/include/wx/msw/statline.h index e0c65f4654..48ba88254d 100644 --- a/include/wx/msw/statline.h +++ b/include/wx/msw/statline.h @@ -41,7 +41,6 @@ public: // overriden base class virtuals virtual bool AcceptsFocus() const { return false; } -protected: // usually overridden base class virtuals virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; diff --git a/include/wx/msw/stattext.h b/include/wx/msw/stattext.h index d9e8f0b742..284067079d 100644 --- a/include/wx/msw/stattext.h +++ b/include/wx/msw/stattext.h @@ -40,14 +40,14 @@ public: virtual void SetLabel(const wxString& label); virtual bool SetFont( const wxFont &font ); + virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; + protected: // implement/override some base class virtuals virtual wxBorder GetDefaultBorder() const; virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags = wxSIZE_AUTO); virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText) }; diff --git a/include/wx/msw/tbar95.h b/include/wx/msw/tbar95.h index ee0cca98df..508dad108a 100644 --- a/include/wx/msw/tbar95.h +++ b/include/wx/msw/tbar95.h @@ -70,6 +70,11 @@ public: static WXHBITMAP MapBitmap(WXHBITMAP bitmap, int width, int height); + // override WndProc mainly to process WM_SIZE + virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + protected: // common part of all ctors void Init(); @@ -98,12 +103,8 @@ protected: const wxString& longHelp); virtual wxToolBarToolBase *CreateTool(wxControl *control); - // override WndProc mainly to process WM_SIZE - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - // return the appropriate size and flags for the toolbar control virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; // handlers for various events bool HandleSize(WXWPARAM wParam, WXLPARAM lParam); diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index fac3a4db68..2202637d03 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -196,13 +196,17 @@ public: // called HideNativeCaret() before void OnSetFocus(wxFocusEvent& event); + // intercept WM_GETDLGCODE + virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); + + virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); + virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + virtual wxVisualAttributes GetDefaultAttributes() const; + protected: // common part of all ctors void Init(); - // intercept WM_GETDLGCODE - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - // return true if this control has a user-set limit on amount of text (i.e. // the limit is due to a previous call to SetMaxLength() and not built in) bool HasSpaceLimit(unsigned int *len) const; @@ -240,12 +244,8 @@ protected: // send TEXT_UPDATED event, return true if it was handled, false otherwise bool SendUpdateEvent(); - // override some base class virtuals - virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); virtual wxSize DoGetBestSize() const; - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - #if wxUSE_RICHEDIT // we're using RICHEDIT (and not simple EDIT) control if this field is not // 0, it also gives the version of the RICHEDIT control being used (1, 2 or @@ -257,8 +257,6 @@ protected: // text ourselves: we want this to be exactly 1 int m_updatesCount; - virtual wxVisualAttributes GetDefaultAttributes() const; - private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextCtrl) diff --git a/include/wx/msw/tglbtn.h b/include/wx/msw/tglbtn.h index fd59de8e23..a6dc795486 100644 --- a/include/wx/msw/tglbtn.h +++ b/include/wx/msw/tglbtn.h @@ -46,11 +46,11 @@ public: virtual bool MSWCommand(WXUINT param, WXWORD id); virtual void Command(wxCommandEvent& event); + virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; protected: virtual wxSize DoGetBestSize() const; virtual wxBorder GetDefaultBorder() const; - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton) diff --git a/include/wx/msw/toplevel.h b/include/wx/msw/toplevel.h index fb63cda2d9..3647a33b9b 100644 --- a/include/wx/msw/toplevel.h +++ b/include/wx/msw/toplevel.h @@ -92,6 +92,15 @@ public: virtual bool HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam); #endif + // translate wxWidgets flags to Windows ones + virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; + + // choose the right parent to use with CreateWindow() + virtual WXHWND MSWGetParent() const; + + // window proc for the frames + WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); + protected: // common part of all ctors void Init(); @@ -111,15 +120,6 @@ protected: // common part of Iconize(), Maximize() and Restore() void DoShowWindow(int nShowCmd); - // translate wxWidgets flags to Windows ones - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; - - // choose the right parent to use with CreateWindow() - virtual WXHWND MSWGetParent() const; - - // window proc for the frames - WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - // is the window currently iconized? bool m_iconized; diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 8fc4f90d27..59fa744586 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -251,16 +251,6 @@ protected: wxTextCtrl *m_textCtrl; // text control in which it is edited wxTreeItemId m_idEdited; // the item being edited -private: - // the common part of all ctors - void Init(); - - // helper functions - inline bool DoGetItem(wxTreeViewItem *tvItem) const; - inline void DoSetItem(wxTreeViewItem *tvItem); - - inline void DoExpand(const wxTreeItemId& item, int flag); - virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent, size_t pos, const wxString& text, @@ -273,6 +263,16 @@ private: wxTreeItemData *data = NULL); virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags); +private: + // the common part of all ctors + void Init(); + + // helper functions + inline bool DoGetItem(wxTreeViewItem *tvItem) const; + inline void DoSetItem(wxTreeViewItem *tvItem); + + inline void DoExpand(const wxTreeItemId& item, int flag); + int DoGetItemImageFromData(const wxTreeItemId& item, wxTreeItemIcon which) const; void DoSetItemImageFromData(const wxTreeItemId& item, diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 24dad15d5f..3b7ad3fb3c 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -97,10 +97,6 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; -#if wxUSE_MENUS_NATIVE - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); -#endif // wxUSE_MENUS_NATIVE - virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ); virtual void SetScrollPos( int orient, int pos, bool refresh = true ); @@ -403,6 +399,11 @@ public: virtual void OnInternalIdle(); protected: + +#if wxUSE_MENUS_NATIVE + virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); +#endif // wxUSE_MENUS_NATIVE + // the window handle WXHWND m_hWnd; diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index 61f0ddb250..e9425ea376 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -671,6 +671,7 @@ public: long GetFirstVisiblePosition() const; // Overrides +protected: virtual wxSize DoGetBestSize() const ; diff --git a/include/wx/richtext/richtexthtml.h b/include/wx/richtext/richtexthtml.h index 2bb4ca0a8e..7f93c00a91 100644 --- a/include/wx/richtext/richtexthtml.h +++ b/include/wx/richtext/richtexthtml.h @@ -30,11 +30,6 @@ public: : wxRichTextFileHandler(name, ext, type) { } -#if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); -#endif - /// Can we save using this handler? virtual bool CanSave() const { return true; } @@ -51,7 +46,10 @@ public: virtual void OutputParagraphFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxOutputStream& stream, bool start); protected: - +#if wxUSE_STREAMS + virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); + virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); +#endif }; #endif diff --git a/include/wx/richtext/richtextstyles.h b/include/wx/richtext/richtextstyles.h index 9c91a50830..067030083d 100644 --- a/include/wx/richtext/richtextstyles.h +++ b/include/wx/richtext/richtextstyles.h @@ -192,9 +192,6 @@ public: const wxSize& size = wxDefaultSize, long style = 0); ~wxRichTextStyleListBox(); - /// Returns the HTML for this item - virtual wxString OnGetItem(size_t n) const; - /// Creates a suitable HTML fragment for a definition wxString CreateHTML(wxRichTextStyleDefinition* def) const; @@ -226,6 +223,10 @@ public: // Convert units in tends of a millimetre to device units int ConvertTenthsMMToPixels(wxDC& dc, int units) const; +protected: + /// Returns the HTML for this item + virtual wxString OnGetItem(size_t n) const; + private: wxRichTextStyleSheet* m_styleSheet; diff --git a/include/wx/richtext/richtextxml.h b/include/wx/richtext/richtextxml.h index ac8f29563e..f0cef5b266 100644 --- a/include/wx/richtext/richtextxml.h +++ b/include/wx/richtext/richtextxml.h @@ -35,9 +35,6 @@ public: { } #if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); - /// Recursively export an object bool ExportXML(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextObject& obj, int level); @@ -66,7 +63,10 @@ public: wxString GetText(wxXmlNode *node, const wxString& param = wxEmptyString, bool translate = false); protected: - +#if wxUSE_STREAMS + virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); + virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); +#endif }; #endif diff --git a/include/wx/scrolwin.h b/include/wx/scrolwin.h index dcbc0ef320..4775724ba3 100644 --- a/include/wx/scrolwin.h +++ b/include/wx/scrolwin.h @@ -241,6 +241,7 @@ protected: { ScrollDoSetVirtualSize(x, y); } \ virtual wxSize GetBestVirtualSize() const \ { return ScrollGetBestVirtualSize(); } \ +protected: \ virtual wxSize GetWindowSizeForVirtualSize(const wxSize& size) const \ { return ScrollGetWindowSizeForVirtualSize(size); } @@ -282,6 +283,12 @@ public: long style = wxScrolledWindowStyle, const wxString& name = wxPanelNameStr); + // we need to return a special WM_GETDLGCODE value to process just the + // arrows but let the other navigation characters through +#ifdef __WXMSW__ + virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); +#endif // __WXMSW__ + WX_FORWARD_TO_SCROLL_HELPER() protected: @@ -289,12 +296,6 @@ protected: // wxScrollHelperEvtHandler::ProcessEvent() void OnPaint(wxPaintEvent& event); - // we need to return a special WM_GETDLGCODE value to process just the - // arrows but let the other navigation characters through -#ifdef __WXMSW__ - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); -#endif // __WXMSW__ - private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow) DECLARE_EVENT_TABLE() diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index aa37d4ba96..808239a853 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -378,11 +378,6 @@ public: virtual void SelectAll(); virtual void SetEditable(bool editable) = 0; - // override streambuf method -#if wxHAS_TEXT_WINDOW_STREAM - int overflow(int i); -#endif // wxHAS_TEXT_WINDOW_STREAM - // stream-like insertion operators: these are always available, whether we // were, or not, compiled with streambuf support wxTextCtrl& operator<<(const wxString& s); @@ -398,6 +393,11 @@ public: virtual bool ShouldInheritColours() const { return false; } protected: + // override streambuf method +#if wxHAS_TEXT_WINDOW_STREAM + int overflow(int i); +#endif // wxHAS_TEXT_WINDOW_STREAM + // the name of the last file loaded with LoadFile() which will be used by // SaveFile() by default wxString m_filename; diff --git a/include/wx/treebook.h b/include/wx/treebook.h index 7209e7c1fe..c7db5c2477 100644 --- a/include/wx/treebook.h +++ b/include/wx/treebook.h @@ -138,6 +138,9 @@ public: virtual bool DeleteAllPages(); protected: + // Implementation of a page removal. See DeletPage for comments. + wxTreebookPage *DoRemovePage(size_t pos); + // This subclass of wxBookCtrlBase accepts NULL page pointers (empty pages) virtual bool AllowNullPage() const { return true; } @@ -180,9 +183,6 @@ private: bool bSelect = false, int imageId = wxNOT_FOUND); - // Implementation of a page removal. See DeletPage for comments. - wxTreebookPage *DoRemovePage(size_t pos); - // Sets selection in the tree control and updates the page being shown. int DoSetSelection(size_t pos); diff --git a/include/wx/univ/button.h b/include/wx/univ/button.h index 7f271da14c..8e626cb137 100644 --- a/include/wx/univ/button.h +++ b/include/wx/univ/button.h @@ -100,17 +100,18 @@ public: virtual void Release(); virtual void Click(); -protected: virtual bool PerformAction(const wxControlAction& action, long numArg = -1, const wxString& strArg = wxEmptyString); + + virtual bool CanBeHighlighted() const { return true; } + +protected: virtual wxSize DoGetBestClientSize() const; virtual bool DoDrawBackground(wxDC& dc); virtual void DoDraw(wxControlRenderer *renderer); - virtual bool CanBeHighlighted() const { return true; } - // common part of all ctors void Init(); diff --git a/include/wx/univ/checkbox.h b/include/wx/univ/checkbox.h index 3367ccca0e..ba0abc8e77 100644 --- a/include/wx/univ/checkbox.h +++ b/include/wx/univ/checkbox.h @@ -97,18 +97,19 @@ public: // overridden base class virtuals virtual bool IsPressed() const { return m_isPressed; } + virtual bool PerformAction(const wxControlAction& action, + long numArg = -1, + const wxString& strArg = wxEmptyString); + + virtual bool CanBeHighlighted() const { return true; } + protected: virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)); virtual wxCheckBoxState DoGet3StateValue() const; - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); virtual void DoDraw(wxControlRenderer *renderer); virtual wxSize DoGetBestClientSize() const; - virtual bool CanBeHighlighted() const { return true; } - // get the size of the bitmap using either the current one or the default // one (query renderer then) virtual wxSize GetBitmapSize() const; diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 4e87c1c6ee..3d58e1fd6d 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -163,6 +163,11 @@ public: virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS + // we have our own input handler and our own actions + virtual bool PerformAction(const wxControlAction& action, + long numArg = 0l, + const wxString& strArg = wxEmptyString); + protected: // override the base class virtuals involved into geometry calculations virtual wxSize DoGetBestClientSize() const; @@ -171,11 +176,6 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); - // we have our own input handler and our own actions - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0l, - const wxString& strArg = wxEmptyString); - // event handlers void OnKey(wxKeyEvent& event); diff --git a/include/wx/univ/frame.h b/include/wx/univ/frame.h index a6e35a898a..1335647d82 100644 --- a/include/wx/univ/frame.h +++ b/include/wx/univ/frame.h @@ -54,7 +54,6 @@ public: virtual wxToolBar* CreateToolBar(long style = -1, wxWindowID id = wxID_ANY, const wxString& name = wxToolBarNameStr); - virtual void PositionToolBar(); #endif // wxUSE_TOOLBAR virtual int GetMinWidth() const; @@ -82,6 +81,11 @@ protected: virtual void PositionStatusBar(); #endif // wxUSE_MENUS +protected: +#if wxUSE_TOOLBAR + virtual void PositionToolBar(); +#endif // wxUSE_TOOLBAR + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxFrame) }; diff --git a/include/wx/univ/listbox.h b/include/wx/univ/listbox.h index 6ab126f1de..163b9b4f22 100644 --- a/include/wx/univ/listbox.h +++ b/include/wx/univ/listbox.h @@ -109,11 +109,11 @@ public: virtual bool IsSelected(int n) const { return m_selections.Index(n) != wxNOT_FOUND; } - virtual void DoSetSelection(int n, bool select); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; protected: + virtual void DoSetSelection(int n, bool select); virtual int DoAppendOnly(const wxString& item); virtual int DoAppend(const wxString& item); virtual void DoInsertItems(const wxArrayString& items, int pos); diff --git a/include/wx/univ/slider.h b/include/wx/univ/slider.h index 8f122cc18f..ac92c6a873 100644 --- a/include/wx/univ/slider.h +++ b/include/wx/univ/slider.h @@ -121,6 +121,10 @@ public: // for wxStdSliderButtonInputHandler wxScrollThumb& GetThumb() { return m_thumb; } + virtual bool PerformAction(const wxControlAction& action, + long numArg = 0, + const wxString& strArg = wxEmptyString); + protected: enum { @@ -132,10 +136,6 @@ protected: virtual void DoDraw(wxControlRenderer *renderer); virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0, - const wxString& strArg = wxEmptyString); - // event handlers void OnSize(wxSizeEvent& event); diff --git a/include/wx/univ/spinbutt.h b/include/wx/univ/spinbutt.h index e6f3fcb1d9..9be6520514 100644 --- a/include/wx/univ/spinbutt.h +++ b/include/wx/univ/spinbutt.h @@ -58,15 +58,15 @@ public: // for wxStdSpinButtonInputHandler const wxScrollArrows& GetArrows() { return m_arrows; } + virtual bool PerformAction(const wxControlAction& action, + long numArg = 0, + const wxString& strArg = wxEmptyString); + protected: virtual wxSize DoGetBestClientSize() const; virtual void DoDraw(wxControlRenderer *renderer); virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0, - const wxString& strArg = wxEmptyString); - // the common part of all ctors void Init(); diff --git a/include/wx/univ/statbmp.h b/include/wx/univ/statbmp.h index cf4eb7164c..a51a0f75a1 100644 --- a/include/wx/univ/statbmp.h +++ b/include/wx/univ/statbmp.h @@ -60,10 +60,11 @@ public: wxIcon GetIcon() const; virtual bool HasTransparentBackground() { return true; } - -private: + +protected: virtual void DoDraw(wxControlRenderer *renderer); +private: // the bitmap which we show wxBitmap m_bitmap; diff --git a/include/wx/univ/statbox.h b/include/wx/univ/statbox.h index f242c1bb03..333e1985dc 100644 --- a/include/wx/univ/statbox.h +++ b/include/wx/univ/statbox.h @@ -47,6 +47,10 @@ public: // take account of this virtual wxPoint GetBoxAreaOrigin() const; + // returning true from here ensures that we act as a container window for + // our children + virtual bool IsStaticBox() const { return true; } + protected: // draw the control virtual void DoDraw(wxControlRenderer *renderer); @@ -54,10 +58,6 @@ protected: // get the size of the border wxRect GetBorderGeometry() const; - // returning true from here ensures that we act as a container window for - // our children - virtual bool IsStaticBox() const { return true; } - private: DECLARE_DYNAMIC_CLASS(wxStaticBox) }; diff --git a/include/wx/univ/statusbr.h b/include/wx/univ/statusbr.h index ab038d6700..79116f1919 100644 --- a/include/wx/univ/statusbr.h +++ b/include/wx/univ/statusbr.h @@ -58,6 +58,10 @@ public: virtual int GetBorderX() const; virtual int GetBorderY() const; + // wxInputConsumer pure virtual + virtual wxWindow *GetInputWindow() const + { return wx_const_cast(wxStatusBar*, this); } + protected: // recalculate the field widths void OnSize(wxSizeEvent& event); @@ -65,10 +69,6 @@ protected: // draw the statusbar virtual void DoDraw(wxControlRenderer *renderer); - // wxInputConsumer pure virtual - virtual wxWindow *GetInputWindow() const - { return wxConstCast(this, wxStatusBar); } - // tell them about our preferred height virtual wxSize DoGetBestSize() const; diff --git a/include/wx/univ/textctrl.h b/include/wx/univ/textctrl.h index 503fc259db..667ee48b9e 100644 --- a/include/wx/univ/textctrl.h +++ b/include/wx/univ/textctrl.h @@ -219,9 +219,6 @@ public: virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const; - // ensure we have correct default border - virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; } - // perform an action virtual bool PerformAction(const wxControlAction& action, long numArg = -1, @@ -239,7 +236,17 @@ public: // only for wxStdTextCtrlInputHandler void RefreshSelection(); + // override wxScrollHelper method to prevent (auto)scrolling beyond the end + // of line + virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; + + // idle processing + virtual void OnInternalIdle(); + protected: + // ensure we have correct default border + virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; } + // override base class methods virtual void DoDrawBorder(wxDC& dc, const wxRect& rect); virtual void DoDraw(wxControlRenderer *renderer); @@ -425,10 +432,6 @@ protected: void OnChar(wxKeyEvent& event); void OnSize(wxSizeEvent& event); - // overrdie wxScrollHelper method to prevent (auto)scrolling beyond the end - // of line - virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; - // return the struct containing control-type dependent data struct wxTextSingleLineData& SData() { return *m_data.sdata; } struct wxTextMultiLineData& MData() { return *m_data.mdata; } @@ -442,8 +445,6 @@ protected: bool DoCut(); bool DoPaste(); - // idle processing - virtual void OnInternalIdle(); private: // all these methods are for multiline text controls only diff --git a/include/wx/univ/toolbar.h b/include/wx/univ/toolbar.h index 3444196742..0d350f9ded 100644 --- a/include/wx/univ/toolbar.h +++ b/include/wx/univ/toolbar.h @@ -66,7 +66,10 @@ public: virtual void SetMargins(int x, int y); void SetMargins(const wxSize& size) { SetMargins((int) size.x, (int) size.y); } - + + virtual bool PerformAction(const wxControlAction& action, + long numArg = -1, + const wxString& strArg = wxEmptyString); protected: // common part of all ctors void Init(); @@ -89,10 +92,6 @@ protected: const wxString& longHelp); virtual wxToolBarToolBase *CreateTool(wxControl *control); - // implement wxUniversal methods - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); virtual wxSize DoGetBestClientSize() const; virtual void DoSetSize(int x, int y, int width, int height, diff --git a/include/wx/univ/toplevel.h b/include/wx/univ/toplevel.h index 7193a7c5e8..4cb89dbf36 100644 --- a/include/wx/univ/toplevel.h +++ b/include/wx/univ/toplevel.h @@ -118,8 +118,6 @@ public: // implement base class pure virtuals virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual wxPoint GetClientAreaOrigin() const; - virtual void DoGetClientSize(int *width, int *height) const; - virtual void DoSetClientSize(int width, int height); virtual void SetIcon(const wxIcon& icon) { SetIcons( wxIconBundle( icon ) ); } virtual void SetIcons(const wxIconBundle& icons); @@ -139,12 +137,15 @@ public: virtual int GetMinWidth() const; virtual int GetMinHeight() const; + virtual wxWindow *GetInputWindow() const { return wx_const_cast(wxTopLevelWindow*, this); } + protected: + virtual void DoGetClientSize(int *width, int *height) const; + virtual void DoSetClientSize(int width, int height); + // handle titlebar button click event virtual void ClickTitleBarButton(long button); - virtual wxWindow *GetInputWindow() const { return (wxWindow*)this; } - // return wxTOPLEVEL_xxx combination based on current state of the frame long GetDecorationsStyle() const; diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index 8e32e29618..65f24a8000 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -106,8 +106,6 @@ public: // NB: all menu related functions are implemented in menu.cpp #if wxUSE_MENUS - virtual bool DoPopupMenu(wxMenu *menu, int x, int y); - // this is wxUniv-specific private method to be used only by wxMenu void DismissPopupMenu(); #endif // wxUSE_MENUS @@ -187,7 +185,9 @@ protected: // common part of all ctors void Init(); - // overridden base class virtuals +#if wxUSE_MENUS + virtual bool DoPopupMenu(wxMenu *menu, int x, int y); +#endif // wxUSE_MENUS // we deal with the scrollbars in these functions virtual void DoSetClientSize(int width, int height); diff --git a/include/wx/vector.h b/include/wx/vector.h index 57543bd0c6..8ffc4a74f1 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -132,7 +132,7 @@ public: }; #define WX_DECLARE_VECTORBASE(obj, cls)\ -private:\ +protected:\ virtual void Free(void *o)\ {\ delete (obj *) o;\ diff --git a/include/wx/x11/brush.h b/include/wx/x11/brush.h index 6f4f1536f8..1345c82305 100644 --- a/include/wx/x11/brush.h +++ b/include/wx/x11/brush.h @@ -52,7 +52,7 @@ public: void SetStyle( int style ); void SetStipple( const wxBitmap& stipple ); -private: +protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/x11/dataobj2.h b/include/wx/x11/dataobj2.h index fc83953ff2..1d4b877a21 100644 --- a/include/wx/x11/dataobj2.h +++ b/include/wx/x11/dataobj2.h @@ -34,6 +34,19 @@ public: virtual size_t GetDataSize() const { return m_pngSize; } virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } protected: void Init() { m_pngData = (void *)NULL; m_pngSize = 0; } @@ -44,15 +57,6 @@ protected: void *m_pngData; void DoConvertToPng(); - -private: - // virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -70,15 +74,19 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); - -private: - // virtual function hiding supression - size_t GetDataSize(const wxDataFormat& format) const - { return(wxDataObjectSimple::GetDataSize(format)); } - bool GetDataHere(const wxDataFormat& format, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } + // Must provide overloads to avoid hiding them (and warnings about it) + virtual size_t GetDataSize(const wxDataFormat&) const + { + return GetDataSize(); + } + virtual bool GetDataHere(const wxDataFormat&, void *buf) const + { + return GetDataHere(buf); + } + virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) + { + return SetData(len, buf); + } }; #endif // _WX_X11_DATAOBJ2_H_ diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index 1af2a6c739..7f939a3ec9 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -100,11 +100,6 @@ public: virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; virtual int GetDepth() const; virtual wxSize GetPPI() const; @@ -112,9 +107,16 @@ public: virtual void DestroyClippingRegion(); WXWindow GetWindow() const { return m_window; } + virtual void ComputeScaleAndOrigin(); + protected: // implementation // -------------- + virtual void DoGetTextExtent(const wxString& string, + wxCoord *x, wxCoord *y, + wxCoord *descent = NULL, + wxCoord *externalLeading = NULL, + wxFont *theFont = NULL) const; WXDisplay *m_display; WXWindow m_window; @@ -136,7 +138,6 @@ protected: void SetUpDC(); void Destroy(); - virtual void ComputeScaleAndOrigin(); private: DECLARE_DYNAMIC_CLASS(wxWindowDC) diff --git a/include/wx/x11/dcmemory.h b/include/wx/x11/dcmemory.h index 12d839d425..5fd1114288 100644 --- a/include/wx/x11/dcmemory.h +++ b/include/wx/x11/dcmemory.h @@ -21,12 +21,13 @@ public: wxMemoryDC( wxDC *dc ); // Create compatible DC ~wxMemoryDC(); virtual void SelectObject( const wxBitmap& bitmap ); - void DoGetSize( int *width, int *height ) const; // implementation wxBitmap m_selected; -private: +protected: + void DoGetSize( int *width, int *height ) const; + DECLARE_DYNAMIC_CLASS(wxMemoryDC) }; diff --git a/include/wx/x11/pen.h b/include/wx/x11/pen.h index d5c042a14d..3103d77f25 100644 --- a/include/wx/x11/pen.h +++ b/include/wx/x11/pen.h @@ -65,7 +65,7 @@ public: wxDash* GetDash() const; wxBitmap* GetStipple() const; -private: +protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/x11/toplevel.h b/include/wx/x11/toplevel.h index ac50971747..675fc4ad08 100644 --- a/include/wx/x11/toplevel.h +++ b/include/wx/x11/toplevel.h @@ -70,6 +70,12 @@ public: virtual bool SetShape(const wxRegion& region); + // For implementation purposes - sometimes decorations make the + // client area smaller + virtual wxPoint GetClientAreaOrigin() const; + + virtual void OnInternalIdle(); + protected: // common part of all ctors void Init(); @@ -77,13 +83,8 @@ protected: // set the icon for the window void DoSetIcon( const wxIcon& icon ); - // For implementation purposes - sometimes decorations make the - // client area smaller - virtual wxPoint GetClientAreaOrigin() const; - // For implementation of delayed resize events bool m_needResizeInIdle; - virtual void OnInternalIdle(); virtual void DoGetClientSize( int *width, int *height ) const; virtual void DoGetSize( int *width, int *height ) const; diff --git a/include/wx/zipstrm.h b/include/wx/zipstrm.h index c2963a9e6b..3dbab08dc0 100644 --- a/include/wx/zipstrm.h +++ b/include/wx/zipstrm.h @@ -222,9 +222,9 @@ protected: void Notify(); -private: wxArchiveEntry* DoClone() const { return ZipClone(); } +private: size_t ReadLocal(wxInputStream& stream, wxMBConv& conv); size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv) const; @@ -300,7 +300,11 @@ public: int GetLevel() const { return m_level; } void WXZIPFIX SetLevel(int level); - + + bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry); + bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream); + bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream); + protected: virtual size_t WXZIPFIX OnSysWrite(const void *buffer, size_t size); virtual wxFileOffset OnSysTell() const { return m_entrySize; } @@ -316,10 +320,6 @@ protected: { return m_offsetAdjustment != wxInvalidOffset; } private: - bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry); - bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream); - bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream); - bool IsOpened() const { return m_comp || m_pending; } bool DoCreate(wxZipEntry *entry, bool raw = false); @@ -364,6 +364,7 @@ public: virtual WXZIPFIX ~wxZipInputStream(); + bool WXZIPFIX OpenEntry(wxArchiveEntry& entry); bool OpenEntry(wxZipEntry& entry) { return DoOpen(&entry); } bool WXZIPFIX CloseEntry(); @@ -386,15 +387,13 @@ protected: virtual wxInputStream* WXZIPFIX OpenDecompressor(wxInputStream& stream); virtual bool WXZIPFIX CloseDecompressor(wxInputStream *decomp); + wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); } + private: void Init(); void Init(const wxString& file); wxInputStream& OpenFile(const wxString& archive); - wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); } - - bool WXZIPFIX OpenEntry(wxArchiveEntry& entry); - wxStreamError ReadLocal(bool readEndRec = false); wxStreamError ReadCentral(); diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index eda003e5f7..abcbacf408 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -128,9 +128,8 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator); - virtual void DoMoveWindow(int x, int y, int w, int h); - protected: + virtual void DoMoveWindow(int x, int y, int w, int h); void OnSize(wxSizeEvent& event); void OnMouseEnter(wxMouseEvent& event); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 62fd813fbe..3ebe7d921a 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -520,8 +520,6 @@ public: virtual ~wxListMainWindow(); - wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); } - bool HasFlag(int flag) const { return m_parent->HasFlag(flag); } // return true if this is a virtual list control @@ -780,6 +778,8 @@ public: wxListTextCtrl* m_textctrl; protected: + wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); } + // the total count of items in a virtual list control size_t m_countVirt; diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 35a665d9a0..89271ac2b4 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -86,10 +86,11 @@ gtk_button_style_set_callback( GtkWidget *m_widget, GtkStyle *WXUNUSED(style), w bottom_border += default_border->bottom; g_free( default_border ); } - win->DoMoveWindow( win->m_x-top_border, - win->m_y-left_border, - win->m_width+left_border+right_border, - win->m_height+top_border+bottom_border ); + win->MoveWindow( + win->m_x - top_border, + win->m_y - left_border, + win->m_width + left_border + right_border, + win->m_height + top_border + bottom_border); } return FALSE; diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 245bb7acd8..71a386b3da 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -210,6 +210,8 @@ protected: private: wxComboBox *m_cb; + friend class wxComboBox; + DECLARE_EVENT_TABLE() }; diff --git a/src/mac/carbon/frame.cpp b/src/mac/carbon/frame.cpp index 12853edfa4..399749a1b3 100644 --- a/src/mac/carbon/frame.cpp +++ b/src/mac/carbon/frame.cpp @@ -382,5 +382,16 @@ void wxFrame::PositionToolBar() } } } + +void wxFrame::PositionBars() +{ +#if wxUSE_STATUSBAR + PositionStatusBar(); +#endif +#if wxUSE_TOOLBAR + PositionToolBar(); +#endif +} + #endif diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index 70b6845265..14d61671ca 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -43,6 +43,15 @@ public: SetSizeHints(-1,-1); } + bool ProcessEvent(wxEvent &event) + { + // Hand button down events to wxSpinCtrl. Doesn't work. + if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event )) + return TRUE; + + return wxTextCtrl::ProcessEvent( event ); + } + protected: void OnTextChange(wxCommandEvent& event) { @@ -72,15 +81,6 @@ protected: event.Skip(); } - bool ProcessEvent(wxEvent &event) - { - // Hand button down events to wxSpinCtrl. Doesn't work. - if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event )) - return TRUE; - - return wxTextCtrl::ProcessEvent( event ); - } - private: wxSpinCtrl *m_spin; diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index e4405c5492..1857828a62 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -723,12 +723,7 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand wxFrame *frame = wxDynamicCast( toplevelWindow , wxFrame ) ; if ( frame ) { -#if wxUSE_STATUSBAR - frame->PositionStatusBar(); -#endif -#if wxUSE_TOOLBAR - frame->PositionToolBar(); -#endif + frame->PositionBars(); } wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ; diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 40924c0528..458a14a21b 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -162,6 +162,13 @@ WXHACCEL wxAcceleratorTable::GetHACCEL() const bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const { +#if 0 + // calling TranslateAccelerator() with child window doesn't do anything so + // it's probably a bug + wxASSERT_MSG( window->IsTopLevel(), + _T("TranslateAccelerator() needs a top level window") ); +#endif + MSG *msg = (MSG *)wxmsg; return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); } diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index b6da92aa47..2f71260198 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -75,14 +75,14 @@ public: wxIEnumFORMATETC(const wxDataFormat* formats, ULONG nCount); virtual ~wxIEnumFORMATETC() { delete [] m_formats; } - DECLARE_IUNKNOWN_METHODS; - // IEnumFORMATETC STDMETHODIMP Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched); STDMETHODIMP Skip(ULONG celt); STDMETHODIMP Reset(); STDMETHODIMP Clone(IEnumFORMATETC **ppenum); + DECLARE_IUNKNOWN_METHODS; + private: CLIPFORMAT *m_formats; // formats we can provide data in ULONG m_nCount, // number of formats we support @@ -106,8 +106,6 @@ public: // when this object is deleted - setting this flag enables such logic void SetDeleteFlag() { m_mustDelete = true; } - DECLARE_IUNKNOWN_METHODS; - // IDataObject STDMETHODIMP GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium); STDMETHODIMP GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium); @@ -119,6 +117,8 @@ public: STDMETHODIMP DUnadvise(DWORD dwConnection); STDMETHODIMP EnumDAdvise(IEnumSTATDATA **ppenumAdvise); + DECLARE_IUNKNOWN_METHODS; + private: wxDataObject *m_pDataObject; // pointer to C++ class we belong to @@ -1103,7 +1103,7 @@ class CFSTR_SHELLURLDataObject : public wxCustomDataObject { public: CFSTR_SHELLURLDataObject() : wxCustomDataObject(CFSTR_SHELLURL) {} -protected: + virtual size_t GetBufferOffset( const wxDataFormat& WXUNUSED(format) ) { return 0; diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index 1b5020da3a..91dcb37866 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -54,12 +54,12 @@ public: wxIDropSource(wxDropSource *pDropSource); virtual ~wxIDropSource() { } - DECLARE_IUNKNOWN_METHODS; - // IDropSource STDMETHODIMP QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState); STDMETHODIMP GiveFeedback(DWORD dwEffect); + DECLARE_IUNKNOWN_METHODS; + private: DWORD m_grfInitKeyState; // button which started the d&d operation wxDropSource *m_pDropSource; // pointer to C++ class we belong to diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index ba970585ed..f995bd06d0 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -127,6 +127,11 @@ public: virtual void SetSelection(int n) { DoSetSelection(n, true); } void SetSelection(int n, bool select) { DoSetSelection(n, select); } + // used to process wxUniv actions + bool PerformAction(const wxControlAction& action, + long numArg, + const wxString& strArg); + protected: // we shouldn't return height too big from here virtual wxSize DoGetBestClientSize() const; @@ -140,11 +145,6 @@ protected: // called whenever the user selects or activates a listbox item void OnSelect(wxCommandEvent& event); - // used to process wxUniv actions - bool PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg); - private: // has the mouse been released on this control? bool m_clicked; diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 22949bed1d..e8916af3a8 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -127,9 +127,6 @@ public: // override the base class version to dismiss any open submenus virtual void Dismiss(); - // notify the menu when the window disappears from screen - virtual void OnDismiss(); - // called when a submenu is dismissed void OnSubmenuDismiss(bool dismissParent); @@ -164,6 +161,8 @@ public: // don't dismiss the popup window if the parent menu was clicked virtual bool ProcessLeftDown(wxMouseEvent& event); + virtual bool SetCurrent(bool doit = true) { return wxPopupTransientWindow::SetCurrent(doit); }; + protected: // how did we perform this operation? enum InputMethod @@ -172,6 +171,9 @@ protected: WithMouse }; + // notify the menu when the window disappears from screen + virtual void OnDismiss(); + // draw the menu inside this window virtual void DoDraw(wxControlRenderer *renderer); @@ -186,7 +188,6 @@ protected: // set the current node and item withotu refreshing anything void SetCurrent(wxMenuItemList::compatibility_iterator node); - virtual bool SetCurrent(bool doit = true){return wxPopupTransientWindow::SetCurrent(doit);}; // change the current item refreshing the old and new items void ChangeCurrent(wxMenuItemList::compatibility_iterator node); -- 2.45.2