From b2e10daccc99be6d3ca7a206c69e94d3bfe6b03d Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 22 Nov 2007 06:12:56 +0000 Subject: [PATCH] make DoSetSizeHints protected, remove parameter defaults git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aui/tabmdi.h | 11 ++++------- include/wx/generic/mdig.h | 13 +++++-------- include/wx/gtk/mdi.h | 13 +++++-------- include/wx/gtk/minifram.h | 2 +- include/wx/gtk/toplevel.h | 11 +++++------ include/wx/mac/carbon/slider.h | 10 +++++----- include/wx/motif/mdi.h | 9 +++------ include/wx/motif/toplevel.h | 7 +++---- include/wx/window.h | 8 ++++---- include/wx/x11/window.h | 7 +++---- 10 files changed, 38 insertions(+), 53 deletions(-) diff --git a/include/wx/aui/tabmdi.h b/include/wx/aui/tabmdi.h index b677a0fdf2..1084829cf0 100644 --- a/include/wx/aui/tabmdi.h +++ b/include/wx/aui/tabmdi.h @@ -169,13 +169,6 @@ public: virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} #endif - // no size hints - virtual void DoSetSizeHints(int WXUNUSED(minW), - int WXUNUSED(minH), - int WXUNUSED(maxW) = wxDefaultCoord, - int WXUNUSED(maxH) = wxDefaultCoord, - int WXUNUSED(incW) = wxDefaultCoord, - int WXUNUSED(incH) = wxDefaultCoord) {} #if wxUSE_TOOLBAR // no toolbar bars virtual wxToolBar* CreateToolBar(long WXUNUSED(style), @@ -209,6 +202,10 @@ protected: virtual void DoSetSize(int x, int y, int width, int height, int size_flags); virtual void DoMoveWindow(int x, int y, int width, int height); + // no size hints + virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH), + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW), int WXUNUSED(incH)) {} public: // This function needs to be called when a size change is confirmed, // we needed this function to prevent anybody from the outside diff --git a/include/wx/generic/mdig.h b/include/wx/generic/mdig.h index d43fc4130c..11f75518b6 100644 --- a/include/wx/generic/mdig.h +++ b/include/wx/generic/mdig.h @@ -152,14 +152,6 @@ public: virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} #endif - // no size hints - virtual void DoSetSizeHints( int WXUNUSED(minW), - int WXUNUSED(minH), - int WXUNUSED(maxW) = wxDefaultCoord, - int WXUNUSED(maxH) = wxDefaultCoord, - int WXUNUSED(incW) = wxDefaultCoord, - int WXUNUSED(incH) = wxDefaultCoord) {} - #if wxUSE_TOOLBAR // no toolbar bars virtual wxToolBar* CreateToolBar( long WXUNUSED(style), @@ -207,6 +199,11 @@ protected: virtual void DoMoveWindow(int x, int y, int width, int height); + // no size hints + virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH), + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW), int WXUNUSED(incH)) {} + // This function needs to be called when a size change is confirmed, // we needed this function to prevent any body from the outside // changing the panel... it messes the UI layout when we would allow it. diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index fb3521fa05..53a3cdeceb 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -118,14 +118,6 @@ public: virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} #endif - // no size hints - virtual void DoSetSizeHints( int WXUNUSED(minW), - int WXUNUSED(minH), - int WXUNUSED(maxW) = wxDefaultCoord, - int WXUNUSED(maxH) = wxDefaultCoord, - int WXUNUSED(incW) = wxDefaultCoord, - int WXUNUSED(incH) = wxDefaultCoord) {} - #if wxUSE_TOOLBAR // no toolbar virtual wxToolBar* CreateToolBar( long WXUNUSED(style), @@ -168,6 +160,11 @@ protected: int width, int height, int sizeFlags = wxSIZE_AUTO); + // no size hints + virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH), + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW), int WXUNUSED(incH)) {} + private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) diff --git a/include/wx/gtk/minifram.h b/include/wx/gtk/minifram.h index 15ecd86552..7cda4e3216 100644 --- a/include/wx/gtk/minifram.h +++ b/include/wx/gtk/minifram.h @@ -44,10 +44,10 @@ public: virtual void SetTitle( const wxString &title ); +protected: virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); -protected: virtual void DoGetClientSize(int* width, int* height) const; // implementation diff --git a/include/wx/gtk/toplevel.h b/include/wx/gtk/toplevel.h index f6f1b7c540..2224a9a2c5 100644 --- a/include/wx/gtk/toplevel.h +++ b/include/wx/gtk/toplevel.h @@ -106,12 +106,6 @@ public: // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle. int m_urgency_hint; - // give hints to the Window Manager for how the size - // of the TLW can be changed by dragging - virtual void DoSetSizeHints( int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, int incH = wxDefaultCoord ); - // return the size of the window without WM decorations void GTKDoGetSize(int *width, int *height) const; @@ -119,6 +113,11 @@ public: virtual bool IsDecorCacheable() const; protected: + // give hints to the Window Manager for how the size + // of the TLW can be changed by dragging + virtual void DoSetSizeHints( int minW, int minH, + int maxW, int maxH, + int incW, int incH); // common part of all ctors void Init(); diff --git a/include/wx/mac/carbon/slider.h b/include/wx/mac/carbon/slider.h index 5e176c61d3..4cd1a1d78a 100644 --- a/include/wx/mac/carbon/slider.h +++ b/include/wx/mac/carbon/slider.h @@ -74,11 +74,6 @@ public: int GetThumbLength() const ; void SetTick(int tickPos) ; - // set min/max size of the slider - virtual void DoSetSizeHints( int minW, int minH, - 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); @@ -88,6 +83,11 @@ protected: virtual void DoSetSize(int x, int y, int w, int h, int sizeFlags); virtual void DoMoveWindow(int x, int y, int w, int h); + // set min/max size of the slider + virtual void DoSetSizeHints( int minW, int minH, + int maxW, int maxH, + int incW, int incH); + // Common processing to invert slider values based on wxSL_INVERSE virtual int ValueInvertOrNot(int value) const; diff --git a/include/wx/motif/mdi.h b/include/wx/motif/mdi.h index 7266a0100d..fb2621f5a3 100644 --- a/include/wx/motif/mdi.h +++ b/include/wx/motif/mdi.h @@ -152,12 +152,6 @@ public: void ReleaseMouse(); void Raise(); void Lower(void); - void DoSetSizeHints(int minW = wxDefaultCoord, - int minH = wxDefaultCoord, - int maxW = wxDefaultCoord, - int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, - int incH = wxDefaultCoord); // MDI operations virtual void Maximize(); @@ -199,6 +193,9 @@ protected: void DoGetClientSize(int *width, int *height) const; void DoGetSize(int *width, int *height) const; void DoGetPosition(int *x, int *y) const ; + void DoSetSizeHints(int minW, int minH, + int maxW, int maxH, + int incW, int incH); }; /* The client window is a child of the parent MDI frame, and itself diff --git a/include/wx/motif/toplevel.h b/include/wx/motif/toplevel.h index 80e3f1d204..4144b83a3a 100644 --- a/include/wx/motif/toplevel.h +++ b/include/wx/motif/toplevel.h @@ -52,10 +52,6 @@ public: virtual wxString GetTitle() const { return m_title; } virtual void SetTitle( const wxString& title ) { m_title = title; } - virtual void DoSetSizeHints( int minW, int minH, - int maxW = -1, int maxH = -1, - int incW = -1, int incH = -1 ); - virtual bool SetShape( const wxRegion& region ); WXWidget GetShellWidget() const; @@ -66,6 +62,9 @@ protected: void PreDestroy(); virtual void DoGetPosition(int* x, int* y) const; + virtual void DoSetSizeHints(int minW, int minH, + int maxW, int maxH, + int incW, int incH); private: // really create the Motif widget for TLW diff --git a/include/wx/window.h b/include/wx/window.h index 39cea13986..b4008d2ec9 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -417,10 +417,6 @@ public: const wxSize& incSize=wxDefaultSize) { DoSetSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y, incSize.x, incSize.y); } - virtual void DoSetSizeHints( int minW, int minH, - int maxW, int maxH, - int incW, int incH ); - // Methods for setting virtual size hints // FIXME: What are virtual size hints? @@ -1495,6 +1491,10 @@ protected: // same as DoSetSize() for the client size virtual void DoSetClientSize(int width, int height) = 0; + virtual void DoSetSizeHints( int minW, int minH, + int maxW, int maxH, + int incW, int incH ); + // move the window to the specified location and resize it: this is called // from both DoSetSize() and DoSetClientSize() and would usually just // reposition this window except for composite controls which will want to diff --git a/include/wx/x11/window.h b/include/wx/x11/window.h index 8480c4760f..6c04d16eac 100644 --- a/include/wx/x11/window.h +++ b/include/wx/x11/window.h @@ -81,10 +81,6 @@ public: virtual void ScrollWindow( int dx, int dy, const wxRect* rect = (wxRect *) NULL ); - virtual void DoSetSizeHints(int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, int incH = wxDefaultCoord); - #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ); #endif // wxUSE_DRAG_AND_DROP @@ -179,6 +175,9 @@ protected: int sizeFlags = wxSIZE_AUTO); virtual void DoSetClientSize(int width, int height); virtual void DoMoveWindow(int x, int y, int width, int height); + virtual void DoSetSizeHints(int minW, int minH, + int maxW, int maxH, + int incW, int incH); virtual void DoCaptureMouse(); virtual void DoReleaseMouse(); -- 2.45.2