Implement wxRendererNative::DrawCollapseButton() for OSX.
The button can be painted using theme services.
This commit is contained in:
@@ -101,6 +101,13 @@ public:
|
|||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
int flags = 0) wxOVERRIDE;
|
int flags = 0) wxOVERRIDE;
|
||||||
|
|
||||||
|
virtual void DrawCollapseButton(wxWindow *win,
|
||||||
|
wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags = 0);
|
||||||
|
|
||||||
|
virtual wxSize GetCollapseButtonSize(wxWindow *win, wxDC& dc);
|
||||||
|
|
||||||
virtual void DrawItemSelectionRect(wxWindow *win,
|
virtual void DrawItemSelectionRect(wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -525,6 +532,43 @@ wxRendererMac::DrawPushButton(wxWindow *win,
|
|||||||
kind, kThemeAdornmentNone);
|
kind, kThemeAdornmentNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxRendererMac::DrawCollapseButton(wxWindow *win,
|
||||||
|
wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
int adornment = (flags & wxCONTROL_EXPANDED)
|
||||||
|
? kThemeAdornmentArrowUpArrow
|
||||||
|
: kThemeAdornmentArrowDownArrow;
|
||||||
|
|
||||||
|
DrawMacThemeButton(win, dc, rect, flags,
|
||||||
|
kThemeArrowButton, adornment);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSize wxRendererMac::GetCollapseButtonSize(wxWindow *WXUNUSED(win), wxDC& WXUNUSED(dc))
|
||||||
|
{
|
||||||
|
wxSize size;
|
||||||
|
SInt32 width, height;
|
||||||
|
OSStatus errStatus;
|
||||||
|
|
||||||
|
errStatus = GetThemeMetric(kThemeMetricDisclosureButtonWidth, &width);
|
||||||
|
if (errStatus == noErr)
|
||||||
|
{
|
||||||
|
size.SetWidth(width);
|
||||||
|
}
|
||||||
|
|
||||||
|
errStatus = GetThemeMetric(kThemeMetricDisclosureButtonHeight, &height);
|
||||||
|
if (errStatus == noErr)
|
||||||
|
{
|
||||||
|
size.SetHeight(height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// strict metrics size cutoff the button, increase the size
|
||||||
|
size.IncBy(1);
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wxRendererMac::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
|
wxRendererMac::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user