add more virtual border drawing functions used by frame decorations code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -289,7 +289,9 @@ protected:
|
|||||||
virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect);
|
||||||
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect);
|
||||||
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect);
|
||||||
virtual void DrawFrameBorder(wxDC& dc, wxRect *rect);
|
virtual void DrawBoxBorder(wxDC& dc, wxRect *rect);
|
||||||
|
virtual void DrawStaticBorder(wxDC& dc, wxRect *rect);
|
||||||
|
virtual void DrawExtraBorder(wxDC& dc, wxRect *rect);
|
||||||
|
|
||||||
|
|
||||||
// draw the frame with non-empty label inside the given rectText
|
// draw the frame with non-empty label inside the given rectText
|
||||||
|
@@ -366,12 +366,22 @@ void wxStdRenderer::DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
|
|||||||
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStdRenderer::DrawFrameBorder(wxDC& dc, wxRect *rect)
|
void wxStdRenderer::DrawBoxBorder(wxDC& dc, wxRect *rect)
|
||||||
{
|
{
|
||||||
DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight);
|
DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight);
|
||||||
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxStdRenderer::DrawStaticBorder(wxDC& dc, wxRect *rect)
|
||||||
|
{
|
||||||
|
DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStdRenderer::DrawExtraBorder(wxDC& dc, wxRect *rect)
|
||||||
|
{
|
||||||
|
DrawRect(dc, rect, m_penLightGrey);
|
||||||
|
}
|
||||||
|
|
||||||
void wxStdRenderer::DrawBorder(wxDC& dc,
|
void wxStdRenderer::DrawBorder(wxDC& dc,
|
||||||
wxBorder border,
|
wxBorder border,
|
||||||
const wxRect& rectTotal,
|
const wxRect& rectTotal,
|
||||||
@@ -388,11 +398,11 @@ void wxStdRenderer::DrawBorder(wxDC& dc,
|
|||||||
|
|
||||||
case wxBORDER_DOUBLE:
|
case wxBORDER_DOUBLE:
|
||||||
DrawAntiSunkenBorder(dc, &rect);
|
DrawAntiSunkenBorder(dc, &rect);
|
||||||
DrawRect(dc, &rect, m_penLightGrey);
|
DrawExtraBorder(dc, &rect);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxBORDER_STATIC:
|
case wxBORDER_STATIC:
|
||||||
DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight);
|
DrawStaticBorder(dc, &rect);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxBORDER_RAISED:
|
case wxBORDER_RAISED:
|
||||||
@@ -574,7 +584,7 @@ void wxStdRenderer::DrawFrame(wxDC& dc,
|
|||||||
}
|
}
|
||||||
else // no label
|
else // no label
|
||||||
{
|
{
|
||||||
DrawFrameBorder(dc, &rectFrame);
|
DrawBoxBorder(dc, &rectFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,11 +1266,10 @@ void wxStdRenderer::DrawFrameBorder(wxDC& dc, const wxRect& rect, int flags)
|
|||||||
|
|
||||||
wxRect r(rect);
|
wxRect r(rect);
|
||||||
|
|
||||||
DrawShadedRect(dc, &r, m_penLightGrey, m_penBlack);
|
DrawAntiSunkenBorder(dc, &r);
|
||||||
DrawShadedRect(dc, &r, m_penHighlight, m_penDarkGrey);
|
DrawExtraBorder(dc, &r);
|
||||||
DrawShadedRect(dc, &r, m_penLightGrey, m_penLightGrey);
|
|
||||||
if ( flags & wxTOPLEVEL_RESIZEABLE )
|
if ( flags & wxTOPLEVEL_RESIZEABLE )
|
||||||
DrawShadedRect(dc, &r, m_penLightGrey, m_penLightGrey);
|
DrawExtraBorder(dc, &r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStdRenderer::DrawFrameBackground(wxDC& dc, const wxRect& rect, int flags)
|
void wxStdRenderer::DrawFrameBackground(wxDC& dc, const wxRect& rect, int flags)
|
||||||
@@ -1388,8 +1397,7 @@ void wxStdRenderer::DrawFrameButton(wxDC& dc,
|
|||||||
{
|
{
|
||||||
DrawSunkenBorder(dc, &rectBtn);
|
DrawSunkenBorder(dc, &rectBtn);
|
||||||
|
|
||||||
rectBtn.x++;
|
rectBtn.Offset(1, 1);
|
||||||
rectBtn.y++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -58,12 +58,6 @@ public:
|
|||||||
int indexAccel = -1,
|
int indexAccel = -1,
|
||||||
wxRect *rectBounds = NULL);
|
wxRect *rectBounds = NULL);
|
||||||
|
|
||||||
virtual void DrawBorder(wxDC& dc,
|
|
||||||
wxBorder border,
|
|
||||||
const wxRect& rect,
|
|
||||||
int flags = 0,
|
|
||||||
wxRect *rectIn = NULL);
|
|
||||||
|
|
||||||
virtual void DrawButtonBorder(wxDC& dc,
|
virtual void DrawButtonBorder(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
int flags = 0,
|
int flags = 0,
|
||||||
@@ -220,8 +214,12 @@ protected:
|
|||||||
{ DrawSimpleBorder(dc, rect); }
|
{ DrawSimpleBorder(dc, rect); }
|
||||||
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
|
virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect)
|
||||||
{ DrawSimpleBorder(dc, rect); }
|
{ DrawSimpleBorder(dc, rect); }
|
||||||
virtual void DrawFrameBorder(wxDC& dc, wxRect *rect)
|
virtual void DrawBoxBorder(wxDC& dc, wxRect *rect)
|
||||||
{ DrawSimpleBorder(dc, rect); }
|
{ DrawSimpleBorder(dc, rect); }
|
||||||
|
virtual void DrawStaticBorder(wxDC& dc, wxRect *rect)
|
||||||
|
{ DrawSimpleBorder(dc, rect); }
|
||||||
|
virtual void DrawExtraBorder(wxDC& WXUNUSED(dc), wxRect * WXUNUSED(rect))
|
||||||
|
{ /* no extra borders for us */ }
|
||||||
|
|
||||||
// all our XPMs are of this size
|
// all our XPMs are of this size
|
||||||
static wxSize GetStdBmpSize() { return wxSize(8, 8); }
|
static wxSize GetStdBmpSize() { return wxSize(8, 8); }
|
||||||
@@ -664,40 +662,6 @@ wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMonoRenderer::DrawBorder(wxDC& dc,
|
|
||||||
wxBorder border,
|
|
||||||
const wxRect& rectTotal,
|
|
||||||
int WXUNUSED(flags),
|
|
||||||
wxRect *rectIn)
|
|
||||||
{
|
|
||||||
wxRect rect = rectTotal;
|
|
||||||
|
|
||||||
switch ( border )
|
|
||||||
{
|
|
||||||
case wxBORDER_DOUBLE:
|
|
||||||
DrawSimpleBorder(dc, &rect);
|
|
||||||
// fall through
|
|
||||||
|
|
||||||
case wxBORDER_SUNKEN:
|
|
||||||
case wxBORDER_STATIC:
|
|
||||||
case wxBORDER_RAISED:
|
|
||||||
case wxBORDER_SIMPLE:
|
|
||||||
DrawSimpleBorder(dc, &rect);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG(_T("unknown border type"));
|
|
||||||
// fall through
|
|
||||||
|
|
||||||
case wxBORDER_DEFAULT:
|
|
||||||
case wxBORDER_NONE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( rectIn )
|
|
||||||
*rectIn = rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxMonoRenderer::DrawButtonBorder(wxDC& dc,
|
void wxMonoRenderer::DrawButtonBorder(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
int flags,
|
int flags,
|
||||||
|
Reference in New Issue
Block a user