moved Arrow_ constants to the base class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-09-20 15:38:18 +00:00
parent 3ef4e126a2
commit 0428ac8c47
3 changed files with 108 additions and 79 deletions

View File

@@ -89,6 +89,55 @@ void wxStdRenderer::DrawShadedRect(wxDC& dc, wxRect *rect,
rect->Inflate(-1);
}
// ----------------------------------------------------------------------------
// translate various flags into corresponding renderer constants
// ----------------------------------------------------------------------------
/* static */
void wxStdRenderer::GetIndicatorsFromFlags(int flags,
IndicatorState& state,
IndicatorStatus& status)
{
if ( flags & wxCONTROL_SELECTED )
state = flags & wxCONTROL_DISABLED ? IndicatorState_SelectedDisabled
: IndicatorState_Selected;
else if ( flags & wxCONTROL_DISABLED )
state = IndicatorState_Disabled;
else if ( flags & wxCONTROL_PRESSED )
state = IndicatorState_Pressed;
else
state = IndicatorState_Normal;
status = flags & wxCONTROL_CHECKED ? IndicatorStatus_Checked
: flags & wxCONTROL_UNDETERMINED
? IndicatorStatus_Undetermined
: IndicatorStatus_Unchecked;
}
/* static */
wxStdRenderer::ArrowDirection wxStdRenderer::GetArrowDirection(wxDirection dir)
{
switch ( dir )
{
case wxLEFT:
return Arrow_Left;
case wxRIGHT:
return Arrow_Right;
case wxUP:
return Arrow_Up;
case wxDOWN:
return Arrow_Down;
default:
wxFAIL_MSG(_T("unknown arrow direction"));
}
return Arrow_Max;
}
// ----------------------------------------------------------------------------
// background
// ----------------------------------------------------------------------------
@@ -560,27 +609,6 @@ void wxStdRenderer::DrawCheckItem(wxDC& dc,
// check and radio bitmaps
// ----------------------------------------------------------------------------
/* static */
void wxStdRenderer::GetIndicatorsFromFlags(int flags,
IndicatorState& state,
IndicatorStatus& status)
{
if ( flags & wxCONTROL_SELECTED )
state = flags & wxCONTROL_DISABLED ? IndicatorState_SelectedDisabled
: IndicatorState_Selected;
else if ( flags & wxCONTROL_DISABLED )
state = IndicatorState_Disabled;
else if ( flags & wxCONTROL_PRESSED )
state = IndicatorState_Pressed;
else
state = IndicatorState_Normal;
status = flags & wxCONTROL_CHECKED ? IndicatorStatus_Checked
: flags & wxCONTROL_UNDETERMINED
? IndicatorStatus_Undetermined
: IndicatorStatus_Unchecked;
}
void wxStdRenderer::DrawCheckButton(wxDC& dc,
const wxString& label,
const wxBitmap& bitmap,
@@ -738,6 +766,23 @@ wxRect wxStdRenderer::GetTextClientArea(const wxTextCtrl *text,
#endif // wxUSE_TEXTCTRL
// ----------------------------------------------------------------------------
// scrollbars drawing
// ----------------------------------------------------------------------------
void wxStdRenderer::DrawScrollbarArrow(wxDC& dc,
wxDirection dir,
const wxRect& rect,
int flags)
{
DrawArrow(dc, dir, rect, flags);
}
void wxStdRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect)
{
DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect);
}
// ----------------------------------------------------------------------------
// scrollbars geometry
// ----------------------------------------------------------------------------