add more pure virtuals to wxBrushBase; fix the GetColour() functions to return a wxColour object and not a reference; remove from docs the non-existent SetColour(const wxString&) overloads

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-03-28 16:47:58 +00:00
parent 1f1d2182ff
commit 231b9591aa
37 changed files with 79 additions and 75 deletions

View File

@@ -44,7 +44,14 @@ class WXDLLIMPEXP_CORE wxBrushBase: public wxGDIObject
public:
virtual ~wxBrushBase() { }
virtual void SetColour(const wxColour& col) = 0;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
virtual void SetStyle(wxBrushStyle style) = 0;
virtual void SetStipple(const wxBitmap& stipple) = 0;
virtual wxColour GetColour() const = 0;
virtual wxBrushStyle GetStyle() const = 0;
virtual wxBitmap *GetStipple() const = 0;
virtual bool IsHatch() const
{ return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); }

View File

@@ -46,7 +46,7 @@ public:
void SetJoin(wxPenJoin join);
void SetCap(wxPenCap cap);
wxColour& GetColour() const;
wxColour GetColour() const;
int GetWidth() const;
wxPenStyle GetStyle() const;
wxPenJoin GetJoin() const;

View File

@@ -41,8 +41,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxBrushStyle GetStyle() const;
wxColour& GetColour() const;
wxBrushStyle GetStyle() const;
wxColour GetColour() const;
wxBitmap *GetStipple() const;
void SetColour(const wxColour& col);

View File

@@ -51,7 +51,7 @@ public:
void SetDashes(int number_of_dashes, const wxDash *dash);
void SetStipple(const wxBitmap& stipple);
wxColour &GetColour() const;
wxColour GetColour() const;
wxPenCap GetCap() const;
wxPenJoin GetJoin() const;
wxPenStyle GetStyle() const;

View File

@@ -32,8 +32,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxBrushStyle GetStyle() const;
wxColour &GetColour() const;
wxBrushStyle GetStyle() const;
wxColour GetColour() const;
wxBitmap *GetStipple() const;
void SetColour( const wxColour& col );

View File

@@ -40,7 +40,7 @@ public:
void SetDashes( int number_of_dashes, const wxDash *dash );
void SetStipple(const wxBitmap& stipple);
wxColour &GetColour() const;
wxColour GetColour() const;
wxPenCap GetCap() const;
wxPenJoin GetJoin() const;
wxPenStyle GetStyle() const;

View File

@@ -42,8 +42,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxBrushStyle GetStyle() const;
wxColour &GetColour() const;
wxBrushStyle GetStyle() const;
wxColour GetColour() const;
wxBitmap *GetStipple() const;
void SetColour( const wxColour& col );

View File

@@ -54,7 +54,7 @@ public:
void SetDashes( int number_of_dashes, const wxDash *dash );
void SetStipple(const wxBitmap& stipple);
wxColour &GetColour() const;
wxColour GetColour() const;
wxPenCap GetCap() const;
wxPenJoin GetJoin() const;
wxPenStyle GetStyle() const;

View File

@@ -38,8 +38,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
const wxColour& GetColour() const ;
virtual wxBrushStyle GetStyle() const ;
wxColour GetColour() const;
wxBrushStyle GetStyle() const ;
wxBitmap *GetStipple() const ;
protected:

View File

@@ -43,7 +43,7 @@ public:
void SetJoin(wxPenJoin join) ;
void SetCap(wxPenCap cap) ;
wxColour& GetColour() const ;
wxColour GetColour() const ;
int GetWidth() const;
wxPenStyle GetStyle() const;
wxPenJoin GetJoin() const;

View File

@@ -40,8 +40,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const;
virtual wxBrushStyle GetStyle() const;
wxColour &GetColour() const;
wxBrushStyle GetStyle() const;
wxColour GetColour() const;
wxBitmap *GetStipple() const;
void SetColour(const wxColour& col);

View File

@@ -50,7 +50,7 @@ public:
void SetDashes(int number_of_dashes, const wxDash *dash);
void SetStipple(const wxBitmap& stipple);
wxColour &GetColour() const;
wxColour GetColour() const;
wxPenCap GetCap() const;
wxPenJoin GetJoin() const;
wxPenStyle GetStyle() const;

View File

@@ -40,7 +40,7 @@ public:
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
wxColour GetColour() const;
virtual wxBrushStyle GetStyle() const;
wxBrushStyle GetStyle() const;
wxBitmap *GetStipple() const;
// return the HBRUSH for this brush

View File

@@ -45,7 +45,7 @@ public:
void SetJoin(wxPenJoin join);
void SetCap(wxPenCap cap);
wxColour& GetColour() const;
wxColour GetColour() const;
int GetWidth() const;
wxPenStyle GetStyle() const;
wxPenJoin GetJoin() const;

View File

@@ -36,7 +36,7 @@ public:
virtual void SetStipple(const wxBitmap& rStipple);
wxColour GetColour(void) const;
virtual wxBrushStyle GetStyle(void) const;
wxBrushStyle GetStyle(void) const;
wxBitmap* GetStipple(void) const;
int GetPS(void) const;

View File

@@ -58,7 +58,7 @@ public:
void SetCap(wxPenCap nCap);
void SetPS(HPS hPS);
wxColour& GetColour(void) const;
wxColour GetColour(void) const;
int GetWidth(void) const;
wxPenStyle GetStyle(void) const;
wxPenJoin GetJoin(void) const;

View File

@@ -42,7 +42,7 @@ public:
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
wxColour GetColour() const;
virtual wxBrushStyle GetStyle() const;
wxBrushStyle GetStyle() const;
wxBitmap *GetStipple() const;
// return the HBRUSH for this brush

View File

@@ -77,7 +77,7 @@ public:
virtual void SetJoin(wxPenJoin join) = 0;
virtual void SetCap(wxPenCap cap) = 0;
virtual wxColour& GetColour() const = 0;
virtual wxColour GetColour() const = 0;
virtual wxBitmap *GetStipple() const = 0;
virtual wxPenStyle GetStyle() const = 0;
virtual wxPenJoin GetJoin() const = 0;

View File

@@ -41,8 +41,8 @@ public:
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxBrushStyle GetStyle() const;
wxColour &GetColour() const;
wxBrushStyle GetStyle() const;
wxColour GetColour() const;
wxBitmap *GetStipple() const;
void SetColour( const wxColour& col );

View File

@@ -54,7 +54,7 @@ public:
void SetDashes( int number_of_dashes, const wxDash *dash );
void SetStipple( const wxBitmap& stipple );
wxColour &GetColour() const;
wxColour GetColour() const;
wxPenCap GetCap() const;
wxPenJoin GetJoin() const;
wxPenStyle GetStyle() const;

View File

@@ -137,7 +137,7 @@ public:
@see SetColour()
*/
wxColour& GetColour() const;
virtual wxColour GetColour() const;
/**
Gets a pointer to the stipple bitmap. If the brush does not have a wxBRUSHSTYLE_STIPPLE
@@ -145,7 +145,7 @@ public:
@see SetStipple()
*/
wxBitmap* GetStipple() const;
virtual wxBitmap* GetStipple() const;
/**
Returns the brush style, one of the ::wxBrushStyle values.
@@ -174,9 +174,8 @@ public:
@see GetColour()
*/
void SetColour(wxColour& colour);
void SetColour(const wxString& colourName);
void SetColour(unsigned char red, unsigned char green, unsigned char blue);
virtual void SetColour(wxColour& colour);
virtual void SetColour(unsigned char red, unsigned char green, unsigned char blue);
//@}
/**
@@ -191,7 +190,7 @@ public:
@see wxBitmap
*/
void SetStipple(const wxBitmap& bitmap);
virtual void SetStipple(const wxBitmap& bitmap);
/**
Sets the brush style.
@@ -201,7 +200,7 @@ public:
@see GetStyle()
*/
void SetStyle(wxBrushStyle style);
virtual void SetStyle(wxBrushStyle style);
/**
Inequality operator.

View File

@@ -199,14 +199,14 @@ public:
@see SetCap()
*/
wxPenCap GetCap() const;
virtual wxPenCap GetCap() const;
/**
Returns a reference to the pen colour.
@see SetColour()
*/
wxColour GetColour() const;
virtual wxColour GetColour() const;
/**
Gets an array of dashes (defined as char in X, DWORD under Windows).
@@ -216,7 +216,7 @@ public:
@see SetDashes()
*/
int GetDashes(wxDash** dashes) const;
virtual int GetDashes(wxDash** dashes) const;
/**
Returns the pen join style, which may be one of @b wxJOIN_BEVEL, @b
@@ -225,28 +225,28 @@ public:
@see SetJoin()
*/
wxPenJoin GetJoin() const;
virtual wxPenJoin GetJoin() const;
/**
Gets a pointer to the stipple bitmap.
@see SetStipple()
*/
wxBitmap* GetStipple() const;
virtual wxBitmap* GetStipple() const;
/**
Returns the pen style.
@see wxPen(), SetStyle()
*/
wxPenStyle GetStyle() const;
virtual wxPenStyle GetStyle() const;
/**
Returns the pen width.
@see SetWidth()
*/
int GetWidth() const;
virtual int GetWidth() const;
/**
Returns @true if the pen is initialised.
@@ -260,7 +260,7 @@ public:
@see GetCap()
*/
void SetCap(wxPenCap capStyle);
virtual void SetCap(wxPenCap capStyle);
//@{
/**
@@ -268,10 +268,8 @@ public:
@see GetColour()
*/
void SetColour(wxColour& colour);
void SetColour(const wxString& colourName);
void SetColour(unsigned char red, unsigned char green,
unsigned char blue);
virtual void SetColour(wxColour& colour);
virtual void SetColour(unsigned char red, unsigned char green, unsigned char blue);
//@}
/**
@@ -283,7 +281,7 @@ public:
@see GetDashes()
*/
void SetDashes(int n, wxDash* dashes);
virtual void SetDashes(int n, wxDash* dashes);
/**
Sets the pen join style, which may be one of @b wxJOIN_BEVEL, @b wxJOIN_ROUND
@@ -292,28 +290,28 @@ public:
@see GetJoin()
*/
void SetJoin(wxPenJoin join_style);
virtual void SetJoin(wxPenJoin join_style);
/**
Sets the bitmap for stippling.
@see GetStipple()
*/
void SetStipple(wxBitmap* stipple);
virtual void SetStipple(wxBitmap* stipple);
/**
Set the pen style.
@see wxPen()
*/
void SetStyle(wxPenStyle style);
virtual void SetStyle(wxPenStyle style);
/**
Sets the pen width.
@see GetWidth()
*/
void SetWidth(int width);
virtual void SetWidth(int width);
/**
Inequality operator.
@@ -336,57 +334,57 @@ public:
};
/**
FIXME
An empty pen.
*/
wxPen wxNullPen;
/**
FIXME
Red pen.
*/
wxPen wxRED_PEN;
/**
FIXME
Cyan pen.
*/
wxPen wxCYAN_PEN;
/**
FIXME
Green pen.
*/
wxPen wxGREEN_PEN;
/**
FIXME
Black pen.
*/
wxPen wxBLACK_PEN;
/**
FIXME
White pen.
*/
wxPen wxWHITE_PEN;
/**
FIXME
Transparent pen.
*/
wxPen wxTRANSPARENT_PEN;
/**
FIXME
Black dashed pen.
*/
wxPen wxBLACK_DASHED_PEN;
/**
FIXME
Grey pen.
*/
wxPen wxGREY_PEN;
/**
FIXME
Medium-grey pen.
*/
wxPen wxMEDIUM_GREY_PEN;
/**
FIXME
Light-grey pen.
*/
wxPen wxLIGHT_GREY_PEN;

View File

@@ -327,7 +327,7 @@ void wxPen::SetStipple(const wxBitmap& Stipple)
M_PENDATA->SetStipple(Stipple);
}
wxColour& wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour);
}

View File

@@ -96,7 +96,7 @@ wxBrushStyle wxBrush::GetStyle() const
return M_BRUSHDATA->m_style;
}
wxColour& wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -183,7 +183,7 @@ int wxPen::GetWidth() const
return 1;
}
wxColour &wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -109,7 +109,7 @@ wxBrushStyle wxBrush::GetStyle() const
return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -230,7 +230,7 @@ int wxPen::GetWidth() const
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -116,7 +116,7 @@ wxBrushStyle wxBrush::GetStyle() const
return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -230,7 +230,7 @@ int wxPen::GetWidth() const
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -138,7 +138,7 @@ wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const
// wxBrush accessors
// ----------------------------------------------------------------------------
const wxColour& wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -162,7 +162,7 @@ bool wxPen::operator==(const wxPen& pen) const
return m_refData ? penData && *M_PENDATA == *penData : !penData;
}
wxColour& wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -182,7 +182,7 @@ wxBrushStyle wxBrush::GetStyle() const
return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -251,7 +251,7 @@ int wxPen::GetWidth() const
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -540,7 +540,7 @@ void wxPen::SetCap(wxPenCap cap)
M_PENDATA->SetCap(cap);
}
wxColour& wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -479,7 +479,7 @@ void wxPen::SetCap(
RealizeResource();
} // end of wxPen::SetCap
wxColour& wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );

View File

@@ -117,7 +117,7 @@ wxBrushStyle wxBrush::GetStyle() const
return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
wxColour wxBrush::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );

View File

@@ -223,7 +223,7 @@ int wxPen::GetWidth() const
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
wxColour wxPen::GetColour() const
{
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );