From 6b0d8a01d184b8d410238677b2cfc0e3059e1268 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 4 Jun 2002 18:09:20 +0000 Subject: [PATCH] added default parameter values to the overloaded Show() and Enable() versions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/button.h | 22 +++++++------- include/wx/gtk/checkbox.h | 8 ++--- include/wx/gtk/radiobox.h | 14 ++++----- include/wx/gtk/radiobut.h | 6 ++-- include/wx/gtk/textctrl.h | 10 ++----- include/wx/gtk1/button.h | 22 +++++++------- include/wx/gtk1/checkbox.h | 8 ++--- include/wx/gtk1/radiobox.h | 14 ++++----- include/wx/gtk1/radiobut.h | 6 ++-- include/wx/gtk1/textctrl.h | 10 ++----- include/wx/mac/radiobox.h | 8 ++--- include/wx/motif/radiobox.h | 28 ++++++++--------- include/wx/msw/radiobox.h | 4 +-- include/wx/x11/textctrl.h | 60 ++++++++++++++++++------------------- 14 files changed, 106 insertions(+), 114 deletions(-) diff --git a/include/wx/gtk/button.h b/include/wx/gtk/button.h index c239f5b7a1..0fb15ad031 100644 --- a/include/wx/gtk/button.h +++ b/include/wx/gtk/button.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.h +// Name: wx/gtk/button.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKBUTTONH__ @@ -39,7 +39,7 @@ class wxButton: public wxControl { public: wxButton(); - inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label, + wxButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, @@ -47,23 +47,25 @@ public: { Create(parent, id, label, pos, size, style, validator, name); } - ~wxButton(); + virtual ~wxButton(); + bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr); + virtual void SetDefault(); - void SetLabel( const wxString &label ); - bool Enable( bool enable ); + virtual void SetLabel( const wxString &label ); + virtual bool Enable( bool enable = TRUE ); static wxSize GetDefaultSize(); - + // implementation // -------------- - - void ApplyWidgetStyle(); - + + void ApplyWidgetStyle(); + protected: virtual wxSize DoGetBestSize() const; diff --git a/include/wx/gtk/checkbox.h b/include/wx/gtk/checkbox.h index 0e8cf389b1..408c860413 100644 --- a/include/wx/gtk/checkbox.h +++ b/include/wx/gtk/checkbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.h +// Name: wx/gtk/checkbox.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -42,8 +42,8 @@ public: void SetValue( bool state ); bool GetValue() const; - void SetLabel( const wxString& label ); - bool Enable( bool enable ); + virtual void SetLabel( const wxString& label ); + virtual bool Enable( bool enable = TRUE ); // implementation // -------------- @@ -54,7 +54,7 @@ public: GtkWidget *m_widgetCheckbox; GtkWidget *m_widgetLabel; - + bool m_blockEvent; protected: diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index d1c29dd7bd..dc3792341a 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h +// Name: wx/gtk/radiobox.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -42,7 +42,7 @@ public: Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name ); } - ~wxRadioBox(); + virtual ~wxRadioBox(); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, @@ -81,10 +81,10 @@ public: #endif // WXWIN_COMPATIBILITY_2_2 // we have to override those to avoid virtual function name hiding - wxString GetLabel() const { return wxControl::GetLabel(); } - void SetLabel( const wxString& label ); - bool Show( bool show ); - bool Enable( bool enable ); + virtual wxString GetLabel() const { return wxControl::GetLabel(); } + virtual void SetLabel( const wxString& label ); + virtual bool Show( bool show = TRUE ); + virtual bool Enable( bool enable = TRUE ); // implementation // -------------- diff --git a/include/wx/gtk/radiobut.h b/include/wx/gtk/radiobut.h index ef01bd838b..32d1a9e189 100644 --- a/include/wx/gtk/radiobut.h +++ b/include/wx/gtk/radiobut.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.h +// Name: wx/gtk/radiobut.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ public: virtual void SetLabel(const wxString& label); virtual void SetValue(bool val); virtual bool GetValue() const; - virtual bool Enable( bool enable ); + virtual bool Enable( bool enable = TRUE ); // implementation diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index 34df4e6839..4ecb366c80 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.h +// Name: wx/gtk/textctrl.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 @@ -15,12 +15,6 @@ #pragma interface "textctrl.h" #endif -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class wxTextCtrl; - //----------------------------------------------------------------------------- // wxTextCtrl //----------------------------------------------------------------------------- @@ -114,7 +108,7 @@ public: virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); - virtual bool Enable( bool enable ); + virtual bool Enable( bool enable = TRUE ); // Implementation from now on void OnDropFiles( wxDropFilesEvent &event ); diff --git a/include/wx/gtk1/button.h b/include/wx/gtk1/button.h index c239f5b7a1..0fb15ad031 100644 --- a/include/wx/gtk1/button.h +++ b/include/wx/gtk1/button.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.h +// Name: wx/gtk/button.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKBUTTONH__ @@ -39,7 +39,7 @@ class wxButton: public wxControl { public: wxButton(); - inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label, + wxButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, @@ -47,23 +47,25 @@ public: { Create(parent, id, label, pos, size, style, validator, name); } - ~wxButton(); + virtual ~wxButton(); + bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr); + virtual void SetDefault(); - void SetLabel( const wxString &label ); - bool Enable( bool enable ); + virtual void SetLabel( const wxString &label ); + virtual bool Enable( bool enable = TRUE ); static wxSize GetDefaultSize(); - + // implementation // -------------- - - void ApplyWidgetStyle(); - + + void ApplyWidgetStyle(); + protected: virtual wxSize DoGetBestSize() const; diff --git a/include/wx/gtk1/checkbox.h b/include/wx/gtk1/checkbox.h index 0e8cf389b1..408c860413 100644 --- a/include/wx/gtk1/checkbox.h +++ b/include/wx/gtk1/checkbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.h +// Name: wx/gtk/checkbox.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -42,8 +42,8 @@ public: void SetValue( bool state ); bool GetValue() const; - void SetLabel( const wxString& label ); - bool Enable( bool enable ); + virtual void SetLabel( const wxString& label ); + virtual bool Enable( bool enable = TRUE ); // implementation // -------------- @@ -54,7 +54,7 @@ public: GtkWidget *m_widgetCheckbox; GtkWidget *m_widgetLabel; - + bool m_blockEvent; protected: diff --git a/include/wx/gtk1/radiobox.h b/include/wx/gtk1/radiobox.h index d1c29dd7bd..dc3792341a 100644 --- a/include/wx/gtk1/radiobox.h +++ b/include/wx/gtk1/radiobox.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h +// Name: wx/gtk/radiobox.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -42,7 +42,7 @@ public: Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name ); } - ~wxRadioBox(); + virtual ~wxRadioBox(); bool Create(wxWindow *parent, wxWindowID id, const wxString& title, @@ -81,10 +81,10 @@ public: #endif // WXWIN_COMPATIBILITY_2_2 // we have to override those to avoid virtual function name hiding - wxString GetLabel() const { return wxControl::GetLabel(); } - void SetLabel( const wxString& label ); - bool Show( bool show ); - bool Enable( bool enable ); + virtual wxString GetLabel() const { return wxControl::GetLabel(); } + virtual void SetLabel( const wxString& label ); + virtual bool Show( bool show = TRUE ); + virtual bool Enable( bool enable = TRUE ); // implementation // -------------- diff --git a/include/wx/gtk1/radiobut.h b/include/wx/gtk1/radiobut.h index ef01bd838b..32d1a9e189 100644 --- a/include/wx/gtk1/radiobut.h +++ b/include/wx/gtk1/radiobut.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.h +// Name: wx/gtk/radiobut.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ public: virtual void SetLabel(const wxString& label); virtual void SetValue(bool val); virtual bool GetValue() const; - virtual bool Enable( bool enable ); + virtual bool Enable( bool enable = TRUE ); // implementation diff --git a/include/wx/gtk1/textctrl.h b/include/wx/gtk1/textctrl.h index 34df4e6839..4ecb366c80 100644 --- a/include/wx/gtk1/textctrl.h +++ b/include/wx/gtk1/textctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.h +// Name: wx/gtk/textctrl.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 @@ -15,12 +15,6 @@ #pragma interface "textctrl.h" #endif -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class wxTextCtrl; - //----------------------------------------------------------------------------- // wxTextCtrl //----------------------------------------------------------------------------- @@ -114,7 +108,7 @@ public: virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); - virtual bool Enable( bool enable ); + virtual bool Enable( bool enable = TRUE ); // Implementation from now on void OnDropFiles( wxDropFilesEvent &event ); diff --git a/include/wx/mac/radiobox.h b/include/wx/mac/radiobox.h index 632495c5df..21910dc6f9 100644 --- a/include/wx/mac/radiobox.h +++ b/include/wx/mac/radiobox.h @@ -58,10 +58,10 @@ public: virtual int GetRowCount() const ; - bool Enable(bool enable); - wxString GetLabel() const; - void SetLabel(const wxString& label) ; - bool Show(bool show); + virtual bool Enable(bool enable = TRUE); + virtual wxString GetLabel() const; + virtual void SetLabel(const wxString& label) ; + virtual bool Show(bool show = TRUE); // Other external functions void Command(wxCommandEvent& event); diff --git a/include/wx/motif/radiobox.h b/include/wx/motif/radiobox.h index 09ad45314c..591f88e21c 100644 --- a/include/wx/motif/radiobox.h +++ b/include/wx/motif/radiobox.h @@ -26,10 +26,10 @@ class WXDLLEXPORT wxBitmap ; class WXDLLEXPORT wxRadioBox : public wxControl { DECLARE_DYNAMIC_CLASS(wxRadioBox) - + public: wxRadioBox(); - + wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, @@ -38,37 +38,37 @@ public: { Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); } - + ~wxRadioBox(); - + bool Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, int majorDim = 0, long style = wxRA_HORIZONTAL, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - + int FindString(const wxString& s) const; void SetSelection(int N); int GetSelection() const; wxString GetString(int N) const; - + void SetLabel(const wxString& label) { wxControl::SetLabel(label); }; void SetLabel(int item, const wxString& label) ; wxString GetLabel(int item) const; wxString GetLabel() const { return wxControl::GetLabel(); }; - bool Enable(bool enable); + virtual bool Enable(bool enable = TRUE); void Enable(int item, bool enable); void Show(int item, bool show) ; - bool Show(bool show) ; - + virtual bool Show(bool show = TRUE) ; + virtual wxString GetStringSelection() const; virtual bool SetStringSelection(const wxString& s); virtual int GetCount() const { return m_noItems; } ; void Command(wxCommandEvent& event); - + int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } - + // Implementation virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeBackgroundColour(); @@ -78,19 +78,19 @@ public: WXWidget GetFrameWidget() const { return m_frameWidget; } inline WXWidget* GetRadioButtons() const { return m_radioButtons; } inline void SetSel(int i) { m_selectedButton = i; } - + protected: int m_majorDim ; int m_noItems; int m_noRowsOrCols; int m_selectedButton; - + WXWidget m_formWidget; WXWidget m_labelWidget; WXWidget m_frameWidget; WXWidget* m_radioButtons; wxString* m_radioButtonLabels; - + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); diff --git a/include/wx/msw/radiobox.h b/include/wx/msw/radiobox.h index f97606b44a..1ba95def67 100644 --- a/include/wx/msw/radiobox.h +++ b/include/wx/msw/radiobox.h @@ -66,9 +66,9 @@ public: virtual int GetColumnCount() const; virtual int GetRowCount() const; - bool Show(bool show); + virtual bool Show(bool show = TRUE); void SetFocus(); - bool Enable(bool enable); + virtual bool Enable(bool enable = TRUE); void SetLabelFont(const wxFont& WXUNUSED(font)) {}; void SetButtonFont(const wxFont& font) { SetFont(font); } diff --git a/include/wx/x11/textctrl.h b/include/wx/x11/textctrl.h index 37348e0cdd..61d313a51e 100644 --- a/include/wx/x11/textctrl.h +++ b/include/wx/x11/textctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.h +// Name: wx/x11/textctrl.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 @@ -43,9 +43,9 @@ class wxSourceUndoStep: public wxObject { public: wxSourceUndoStep( wxSourceUndo type, int y1, int y2, wxTextCtrl *owner ); - + void Undo(); - + wxSourceUndo m_type; int m_y1; int m_y2; @@ -63,7 +63,7 @@ public: { m_text = text; } - + wxString m_text; }; @@ -102,12 +102,12 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); - + // required for scrolling with wxScrollHelper // ------------------------------------------ virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } - + // implement base class pure virtuals // ---------------------------------- @@ -123,11 +123,11 @@ public: // more readable flag testing methods // ---------------------------------- - + bool IsSingleLine() const { return !(GetWindowStyle() & wxTE_MULTILINE); } bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; } bool WrapLines() const { return FALSE; } - + // If the return values from and to are the same, there is no selection. virtual void GetSelection(long* from, long* to) const; @@ -182,7 +182,7 @@ public: virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); - virtual bool Enable( bool enable ); + virtual bool Enable( bool enable = TRUE ); void OnCut(wxCommandEvent& event); void OnCopy(wxCommandEvent& event); @@ -210,36 +210,36 @@ public: virtual bool ScrollPages(int pages); // not part of the wxTextCtrl API from now on.. - + void SetLanguage( wxSourceLanguage lang = wxSOURCE_LANG_NONE ); void Delete(); void DeleteLine(); - + void Indent(); void Unindent(); - + bool HasSelection(); void ClearSelection(); - + int GetCursorX() { return m_cursorX; } int GetCursorY() { return m_cursorY; } bool IsModified() { return m_modified; } bool OverwriteMode() { return m_overwrite; } // implementation from now on... - + int PosToPixel( int line, int pos ); int PixelToPos( int line, int pixel ); void SearchForBrackets(); - + void DoChar( char c ); void DoBack(); void DoDelete(); void DoReturn(); void DoDClick(); - + wxString GetNextToken( wxString &line, size_t &pos ); void DrawLinePart( wxDC &dc, int x, int y, const wxString &toDraw, const wxString &origin, const wxColour &colour); @@ -251,12 +251,12 @@ public: void OnIdle( wxIdleEvent &event ); void OnSetFocus( wxFocusEvent& event ); void OnKillFocus( wxFocusEvent& event ); - + void RefreshLine( int n ); void RefreshDown( int n ); void MoveCursor( int new_x, int new_y, bool shift = FALSE, bool centre = FALSE ); void MyAdjustScrollbars(); - + protected: // common part of all ctors void Init(); @@ -271,38 +271,38 @@ protected: wxColour m_sourceColour; wxColour m_commentColour; wxColour m_stringColour; - + int m_cursorX; int m_cursorY; - + int m_selStartX,m_selStartY; int m_selEndX,m_selEndY; - + int m_lineHeight; int m_charWidth; - + int m_longestLine; - + bool m_overwrite; bool m_modified; bool m_editable; bool m_ignoreInput; - + wxArrayString m_keywords; wxColour m_keywordColour; - + wxArrayString m_defines; wxColour m_defineColour; - + wxArrayString m_variables; wxColour m_variableColour; - + wxSourceLanguage m_lang; - + wxList m_undos; - + bool m_capturing; - + int m_bracketX; int m_bracketY; -- 2.45.2