projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No changes, just move time functions from wx/stopwatch.h to wx/time.h.
[wxWidgets.git]
/
src
/
dfb
/
brush.cpp
diff --git
a/src/dfb/brush.cpp
b/src/dfb/brush.cpp
index f3d4f8c78cb80fb198c6adf63f4d9355eb353e05..620a04aed90c6267e312bb1de945ae4b117f5f13 100644
(file)
--- a/
src/dfb/brush.cpp
+++ b/
src/dfb/brush.cpp
@@
-26,10
+26,10
@@
// wxBrush
//-----------------------------------------------------------------------------
// wxBrush
//-----------------------------------------------------------------------------
-class wxBrushRefData
: public wxObject
RefData
+class wxBrushRefData
: public wxGDI
RefData
{
public:
{
public:
- wxBrushRefData(const wxColour& clr = wxNullColour,
int style = wx
SOLID)
+ wxBrushRefData(const wxColour& clr = wxNullColour,
wxBrushStyle style = wxBRUSHSTYLE_
SOLID)
{
m_colour = clr;
SetStyle(style);
{
m_colour = clr;
SetStyle(style);
@@
-41,19
+41,21
@@
public:
m_style = data.m_style;
}
m_style = data.m_style;
}
- void SetStyle(int style)
+ virtual bool IsOk() const { return m_colour.IsOk(); }
+
+ void SetStyle(wxBrushStyle style)
{
if ( style != wxSOLID && style != wxTRANSPARENT )
{
{
if ( style != wxSOLID && style != wxTRANSPARENT )
{
- wxFAIL_MSG(
_
T("only wxSOLID and wxTRANSPARENT styles are supported") );
- style = wxSOLID;
+ wxFAIL_MSG(
wx
T("only wxSOLID and wxTRANSPARENT styles are supported") );
+ style = wx
BRUSHSTYLE_
SOLID;
}
m_style = style;
}
wxColour m_colour;
}
m_style = style;
}
wxColour m_colour;
-
int
m_style;
+
wxBrushStyle
m_style;
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
@@
-62,14
+64,21
@@
public:
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
-wxBrush::wxBrush(const wxColour &colour,
int
style)
+wxBrush::wxBrush(const wxColour &colour,
wxBrushStyle
style)
{
m_refData = new wxBrushRefData(colour, style);
}
{
m_refData = new wxBrushRefData(colour, style);
}
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+wxBrush::wxBrush(const wxColour& col, int style)
+{
+ m_refData = new wxBrushRefData(col, (wxBrushStyle)style);
+}
+#endif
+
wxBrush::wxBrush(const wxBitmap &stippleBitmap)
{
wxBrush::wxBrush(const wxBitmap &stippleBitmap)
{
- wxFAIL_MSG(
"brushes with stipple bitmaps not implemented"
);
+ wxFAIL_MSG(
wxT("brushes with stipple bitmaps not implemented")
);
m_refData = new wxBrushRefData(*wxBLACK);
}
m_refData = new wxBrushRefData(*wxBLACK);
}
@@
-80,36
+89,23
@@
bool wxBrush::operator==(const wxBrush& brush) const
return m_refData == brush.m_refData;
}
return m_refData == brush.m_refData;
}
-bool wxBrush::Ok() const
-{
- return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
-}
-
-int wxBrush::GetStyle() const
+wxBrushStyle wxBrush::GetStyle() const
{
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return 0;
- }
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
return M_BRUSHDATA->m_style;
}
-wxColour
&
wxBrush::GetColour() const
+wxColour wxBrush::GetColour() const
{
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return wxNullColour;
- }
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxFAIL_MSG(
"brushes with stipple bitmaps not implemented"
);
+ wxFAIL_MSG(
wxT("brushes with stipple bitmaps not implemented")
);
return &wxNullBitmap;
}
return &wxNullBitmap;
}
@@
-125,7
+121,7
@@
void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
M_BRUSHDATA->m_colour.Set(r, g, b);
}
M_BRUSHDATA->m_colour.Set(r, g, b);
}
-void wxBrush::SetStyle(
int
style)
+void wxBrush::SetStyle(
wxBrushStyle
style)
{
AllocExclusive();
M_BRUSHDATA->SetStyle(style);
{
AllocExclusive();
M_BRUSHDATA->SetStyle(style);
@@
-133,15
+129,15
@@
void wxBrush::SetStyle(int style)
void wxBrush::SetStipple(const wxBitmap& WXUNUSED(stipple))
{
void wxBrush::SetStipple(const wxBitmap& WXUNUSED(stipple))
{
- wxFAIL_MSG(
"brushes with stipple bitmaps not implemented"
);
+ wxFAIL_MSG(
wxT("brushes with stipple bitmaps not implemented")
);
}
}
-wx
ObjectRefData *wxBrush::Create
RefData() const
+wx
GDIRefData *wxBrush::CreateGDI
RefData() const
{
return new wxBrushRefData;
}
{
return new wxBrushRefData;
}
-wx
ObjectRefData *wxBrush::CloneRefData(const wxObject
RefData *data) const
+wx
GDIRefData *wxBrush::CloneGDIRefData(const wxGDI
RefData *data) const
{
return new wxBrushRefData(*(wxBrushRefData *)data);
}
{
return new wxBrushRefData(*(wxBrushRefData *)data);
}