From 4707b84cd074ff2ae9ada99579f864eb300f8774 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Wed, 24 Sep 2008 23:29:43 +0000 Subject: [PATCH] ifacecheck fixes to c*.h headers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/clntdata.h | 2 +- interface/wx/clrpicker.h | 4 ++-- interface/wx/cmdproc.h | 8 ++++---- interface/wx/cmndata.h | 27 +++++++++++++------------- interface/wx/colordlg.h | 2 +- interface/wx/colour.h | 42 ++++++++++++++++++++++++++-------------- interface/wx/combo.h | 18 ++++++++--------- interface/wx/config.h | 3 +-- interface/wx/control.h | 2 +- interface/wx/cshelp.h | 17 ++++++++-------- 10 files changed, 69 insertions(+), 56 deletions(-) diff --git a/interface/wx/clntdata.h b/interface/wx/clntdata.h index ed81d4b13d..dea129e018 100644 --- a/interface/wx/clntdata.h +++ b/interface/wx/clntdata.h @@ -128,7 +128,7 @@ public: /** Get string client data. */ - const wxString GetData() const; + const wxString& GetData() const; /** Set string client data. diff --git a/interface/wx/clrpicker.h b/interface/wx/clrpicker.h index 986f56b2cb..af52b96cc4 100644 --- a/interface/wx/clrpicker.h +++ b/interface/wx/clrpicker.h @@ -50,7 +50,7 @@ public: Initializes the object and calls Create() with all the parameters. */ wxColourPickerCtrl(wxWindow* parent, wxWindowID id, - const wxColour& colour = wxBLACK, + const wxColour& colour = *wxBLACK, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLRP_DEFAULT_STYLE, @@ -81,7 +81,7 @@ public: creation failed. */ bool Create(wxWindow* parent, wxWindowID id, - const wxColour& colour = wxBLACK, + const wxColour& colour = *wxBLACK, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLRP_DEFAULT_STYLE, diff --git a/interface/wx/cmdproc.h b/interface/wx/cmdproc.h index 9c0c1e909c..1698d9e7b7 100644 --- a/interface/wx/cmdproc.h +++ b/interface/wx/cmdproc.h @@ -35,7 +35,7 @@ public: Must be supplied for the command processor to display the command name in the application's edit menu. */ - wxCommand(bool canUndo = false, const wxString& name = NULL); + wxCommand(bool canUndo = false, const wxString& name = wxEmptyString); /** Destructor. @@ -56,7 +56,7 @@ public: processor that the action is not undoable and should not be added to the command history. */ - bool Do(); + virtual bool Do(); /** Returns the command name. @@ -68,7 +68,7 @@ public: How you implement this command is totally application dependent, but typical strategies include: - + - Perform an inverse operation on the last modified piece of data in the document. When redone, a copy of data stored in command is pasted back or some operation reapplied. This relies on the fact that you @@ -85,7 +85,7 @@ public: processor that the action is not redoable and no change should be made to the command history. */ - bool Undo(); + virtual bool Undo(); }; diff --git a/interface/wx/cmndata.h b/interface/wx/cmndata.h index b80af16af7..72b00a26d6 100644 --- a/interface/wx/cmndata.h +++ b/interface/wx/cmndata.h @@ -54,7 +54,7 @@ public: The default value is black. */ - wxColour& GetColour(); + const wxColour& GetColour() const; /** Determines whether "effects" are enabled under Windows. This refers to @@ -122,7 +122,7 @@ public: /** Assignment operator for the font data. */ - void operator =(const wxFontData& data); + wxFontData& operator =(const wxFontData& data); }; @@ -152,12 +152,12 @@ public: /** Copy constructor. */ - wxPageSetupDialogData(wxPageSetupDialogData& data); + wxPageSetupDialogData(const wxPageSetupDialogData& data); /** Construct an object from a print data object. */ - wxPageSetupDialogData(wxPrintData& printData); + wxPageSetupDialogData(const wxPrintData& printData); /** Destructor. @@ -265,7 +265,8 @@ public: /** Returns a reference to the print data associated with this object. */ - wxPrintData GetPrintData(); + wxPrintData& GetPrintData(); + const wxPrintData& GetPrintData() const; /** Returns @true if the print data associated with the dialog data is @@ -315,7 +316,7 @@ public: @see wxPrintData::SetPaperId() */ - void SetPaperId(wxPaperSize& id); + void SetPaperId(wxPaperSize id); /** Sets the paper size in millimetres. If a corresponding paper id is @@ -332,12 +333,12 @@ public: /** Assigns print data to this object. */ - void operator =(const wxPrintData& data); + wxPageSetupDialogData& operator =(const wxPrintData& data); /** Assigns page setup data to this object. */ - void operator =(const wxPageSetupDialogData& data); + wxPageSetupDialogData& operator =(const wxPageSetupDialogData& data); }; @@ -402,7 +403,7 @@ public: The default value is @true. */ - void SetChooseFull(const bool flag); + void SetChooseFull(bool flag); /** Sets the default colour for the colour dialog. @@ -423,7 +424,7 @@ public: /** Assignment operator for the colour data. */ - void operator =(const wxColourData& data); + wxColourData& operator =(const wxColourData& data); /** @todo document these */ @@ -570,7 +571,7 @@ public: Returns the printer name. If the printer name is the empty string, it indicates that the default printer should be used. */ - const wxString GetPrinterName() const; + const wxString& GetPrinterName() const; /** Returns the current print quality. This can be a positive integer, @@ -686,12 +687,12 @@ public: /** Copy constructor. */ - wxPrintDialogData(wxPrintDialogData& dialogData); + wxPrintDialogData(const wxPrintDialogData& dialogData); /** Construct an object from a print dialog data object. */ - wxPrintDialogData(wxPrintData& printData); + wxPrintDialogData(const wxPrintData& printData); /** Destructor. diff --git a/interface/wx/colordlg.h b/interface/wx/colordlg.h index 33abe1b0ca..74a4516463 100644 --- a/interface/wx/colordlg.h +++ b/interface/wx/colordlg.h @@ -47,7 +47,7 @@ public: /** Returns the colour data associated with the colour dialog. */ - wxColourData GetColourData(); + wxColourData& GetColourData(); /** Shows the dialog, returning wxID_OK if the user pressed OK, and diff --git a/interface/wx/colour.h b/interface/wx/colour.h index 209929c39a..33558722b0 100644 --- a/interface/wx/colour.h +++ b/interface/wx/colour.h @@ -6,6 +6,20 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + + +/** + Flags for wxColour -> wxString conversion (see wxColour::GetAsString). + + @{ +*/ +#define wxC2S_NAME 1 //!< Return colour name, when possible. +#define wxC2S_CSS_SYNTAX 2 //!< Return colour in rgb(r,g,b) syntax. +#define wxC2S_HTML_SYNTAX 4 //!< Return colour in #rrggbb syntax. + +//@} + + /** @class wxColour @@ -81,29 +95,29 @@ public: /** Converts this colour to a wxString using the given flags. - The supported flags are wxC2S_NAME, to obtain the colour name (e.g. - wxColour(255,0,0) == "red"), wxC2S_CSS_SYNTAX, to obtain the colour in - the "rgb(r,g,b)" or "rgba(r,g,b,a)" syntax (e.g. - wxColour(255,0,0,85) == "rgba(255,0,0,0.333)"), and wxC2S_HTML_SYNTAX, - to obtain the colour as "#" followed by 6 hexadecimal digits (e.g. - wxColour(255,0,0) == "#FF0000"). + The supported flags are @c wxC2S_NAME, to obtain the colour name + (e.g. wxColour(255,0,0) == "red"), @c wxC2S_CSS_SYNTAX, to obtain + the colour in the "rgb(r,g,b)" or "rgba(r,g,b,a)" syntax + (e.g. wxColour(255,0,0,85) == "rgba(255,0,0,0.333)"), and + @c wxC2S_HTML_SYNTAX, to obtain the colour as "#" followed by 6 + hexadecimal digits (e.g. wxColour(255,0,0) == "#FF0000"). This function never fails and always returns a non-empty string but asserts if the colour has alpha channel (i.e. is non opaque) but - wxC2S_CSS_SYNTAX (which is the only one supporting alpha) is not + @c wxC2S_CSS_SYNTAX (which is the only one supporting alpha) is not specified in flags. @since 2.7.0 */ - wxString GetAsString(long flags); + virtual wxString GetAsString(long flags = wxC2S_NAME | wxC2S_CSS_SYNTAX) const; /** - Returns a pixel value which is platform-dependent. On Windows, a COLORREF is - returned. + Returns a pixel value which is platform-dependent. + On Windows, a COLORREF is returned. On X, an allocated pixel value is returned. - -1 is returned if the pixel is invalid (on X, unallocated). + If the pixel is invalid (on X, unallocated), @c -1 is returned. */ - long GetPixel() const; + int GetPixel() const; /** Returns the green intensity. @@ -148,7 +162,7 @@ public: Tests the inequality of two colours by comparing individual red, green, blue colours and alpha values. */ - bool operator !=(const wxColour& colour); + bool operator !=(const wxColour& colour) const; //@{ /** @@ -164,7 +178,7 @@ public: Tests the equality of two colours by comparing individual red, green, blue colours and alpha values. */ - bool operator ==(const wxColour& colour); + bool operator ==(const wxColour& colour) const; }; diff --git a/interface/wx/combo.h b/interface/wx/combo.h index 4744d8810d..ca1a7e441d 100644 --- a/interface/wx/combo.h +++ b/interface/wx/combo.h @@ -337,8 +337,8 @@ public: @see Create(), wxValidator */ - wxComboCtrl(wxWindow* parent, wxWindowID id, - const wxString& value = "", + wxComboCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, + const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -373,8 +373,8 @@ public: should call or replace this function. See wxComboCtrl() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& value = "", + bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, + const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -430,7 +430,7 @@ public: @return A reference to the disabled state bitmap. */ - const wxBitmap GetBitmapDisabled() const; + const wxBitmap& GetBitmapDisabled() const; /** Returns button mouse hover bitmap that has been set with @@ -438,7 +438,7 @@ public: @return A reference to the mouse hover state bitmap. */ - const wxBitmap GetBitmapHover() const; + const wxBitmap& GetBitmapHover() const; /** Returns default button bitmap that has been set with @@ -446,7 +446,7 @@ public: @return A reference to the normal state bitmap. */ - const wxBitmap GetBitmapNormal() const; + const wxBitmap& GetBitmapNormal() const; /** Returns depressed button bitmap that has been set with @@ -454,7 +454,7 @@ public: @return A reference to the depressed state bitmap. */ - const wxBitmap GetBitmapPressed() const; + const wxBitmap& GetBitmapPressed() const; /** Returns current size of the dropdown button. @@ -516,7 +516,7 @@ public: Returns area covered by the text field (includes everything except borders and the dropdown button). */ - const wxRect GetTextRect() const; + const wxRect& GetTextRect() const; /** Returns text representation of the current value. For writable combo diff --git a/interface/wx/config.h b/interface/wx/config.h index 7c71b949bf..4455f57a6a 100644 --- a/interface/wx/config.h +++ b/interface/wx/config.h @@ -329,8 +329,7 @@ public: const wxString& vendorName = wxEmptyString, const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, - long style = 0, - const wxMBConv& conv = wxConvAuto()); + long style = 0); /** Empty but ensures that dtor of all derived classes is virtual. diff --git a/interface/wx/control.h b/interface/wx/control.h index e60d68f58f..3feb1b59b4 100644 --- a/interface/wx/control.h +++ b/interface/wx/control.h @@ -40,7 +40,7 @@ public: /** Returns the control's label without mnemonics. */ - const wxString GetLabelText(); + wxString GetLabelText() const; /** Returns the given @a label string without mnemonics. diff --git a/interface/wx/cshelp.h b/interface/wx/cshelp.h index e581c6fa95..cb24c27ec3 100644 --- a/interface/wx/cshelp.h +++ b/interface/wx/cshelp.h @@ -111,8 +111,8 @@ public: @since 2.7.0 */ - virtual bool ShowHelpAtPoint(wxWindowBase* window, const wxPoint point, - wxHelpEvent::Origin origin); + virtual bool ShowHelpAtPoint(wxWindowBase* window, const wxPoint& point, + wxHelpEvent::Origin origin); }; @@ -210,11 +210,13 @@ public: /** Puts the application into context-sensitive help mode. @a window is the window which will be used to catch events; if @NULL, the top window - will be used. Returns @true if the application was successfully put - into context-sensitive help mode. This function only returns when the - event loop has finished. + will be used. + + Returns @true if the application was successfully put into + context-sensitive help mode. + This function only returns when the event loop has finished. */ - bool BeginContextHelp(wxWindow* window = NULL); + bool BeginContextHelp(wxWindow* window); /** Ends context-sensitive help mode. Not normally called by the @@ -245,9 +247,6 @@ public: class wxContextHelpButton : public wxBitmapButton { public: - /// Default constructor. - wxContextHelpButton(); - /** Constructor, creating and showing a context help button. -- 2.45.2