// draw the focus rectangle around the label contained in the given rect
//
// only wxCONTROL_SELECTED makes sense in flags here
- virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0;
+ virtual void DrawFocusRect(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0) = 0;
// Draw a native wxChoice
- virtual void DrawChoice(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0) = 0;
+ virtual void DrawChoice(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0) = 0;
// Draw a native wxComboBox
- virtual void DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0) = 0;
+ virtual void DrawComboBox(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0) = 0;
// Draw a native wxTextCtrl frame
- virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0) = 0;
+ virtual void DrawTextCtrl(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0) = 0;
// Draw a native wxRadioButton (just the graphical portion)
- virtual void DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0) = 0;
+ virtual void DrawOptionButton(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0) = 0;
// geometry functions
// ------------------
virtual void DrawCheckBox(wxWindow *win,
wxDC& dc,
const wxRect& rect,
- int flags = 0 )
+ int flags = 0)
{ m_rendererNative.DrawCheckBox( win, dc, rect, flags ); }
virtual wxSize GetCheckBoxSize(wxWindow *win)
virtual void DrawPushButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
- int flags = 0 )
+ int flags = 0)
{ m_rendererNative.DrawPushButton( win, dc, rect, flags ); }
virtual void DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,
- int flags = 0 )
+ int flags = 0)
{ m_rendererNative.DrawItemSelectionRect( win, dc, rect, flags ); }
- virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0)
+ virtual void DrawFocusRect(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0)
{ m_rendererNative.DrawFocusRect( win, dc, rect, flags ); }
- virtual void DrawChoice(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0)
+ virtual void DrawChoice(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0)
{ m_rendererNative.DrawChoice( win, dc, rect, flags); }
- virtual void DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0)
+ virtual void DrawComboBox(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0)
{ m_rendererNative.DrawComboBox( win, dc, rect, flags); }
- virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0)
+ virtual void DrawTextCtrl(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0)
{ m_rendererNative.DrawTextCtrl( win, dc, rect, flags); }
- virtual void DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0)
- { m_rendererNative.DrawRadioButton( win, dc, rect, flags); }
+ virtual void DrawOptionButton(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags = 0)
+ { m_rendererNative.DrawOptionButton( win, dc, rect, flags); }
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win)
{ return m_rendererNative.GetSplitterParams(win); }
virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
- virtual void DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
+ virtual void DrawOptionButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
x = margin + rect.x;
y = rect.y + wxMax(1, (rect.height - h) / 2);
-
+
if (params->m_labelText.empty())
{
// use the alignment flags
}
dc.DrawBitmap(params->m_labelBitmap, x, y, true);
}
-
+
// Draw a label if one is given
if ( params && !params->m_labelText.empty() )
{
// FIXME: Implement
}
-void wxRendererGeneric::DrawRadioButton(wxWindow* WXUNUSED(win), wxDC& WXUNUSED(dc),
+void wxRendererGeneric::DrawOptionButton(wxWindow* WXUNUSED(win), wxDC& WXUNUSED(dc),
const wxRect& WXUNUSED(rect), int WXUNUSED(flags))
{
// FIXME: Implement
const wxRect& rect,
int flags = 0);
- virtual void DrawChoice(wxWindow* win,
- wxDC& dc,
- const wxRect& rect,
+ virtual void DrawChoice(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
int flags=0);
- virtual void DrawComboBox(wxWindow* win,
- wxDC& dc,
- const wxRect& rect,
+ virtual void DrawComboBox(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
int flags=0);
- virtual void DrawTextCtrl(wxWindow* win,
- wxDC& dc,
- const wxRect& rect,
+ virtual void DrawTextCtrl(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
int flags=0);
- virtual void DrawRadioButton(wxWindow* win,
- wxDC& dc,
- const wxRect& rect,
+ virtual void DrawOptionButton(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
int flags=0);
virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0);
static GdkWindow* wxGetGdkWindowForDC(wxWindow* win, wxDC& dc)
{
GdkWindow* gdk_window = NULL;
-
+
#if wxUSE_GRAPHICS_CONTEXT
if ( dc.IsKindOf( CLASSINFO(wxGCDC) ) )
gdk_window = win->GTKGetDrawingWindow();
"button",
dc.LogicalToDeviceX(rect.x) - x_diff, rect.y, rect.width, rect.height
);
-
+
return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
}
int wxRendererGTK::GetHeaderButtonHeight(wxWindow *WXUNUSED(win))
{
GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
-
+
GtkRequisition req;
GTK_WIDGET_GET_CLASS(button)->size_request(button, &req);
-
+
return req.height;
}
NULL,
button,
"button",
- dc.LogicalToDeviceX(rect.x),
- dc.LogicalToDeviceY(rect.y),
- rect.width,
+ dc.LogicalToDeviceX(rect.x),
+ dc.LogicalToDeviceY(rect.y),
+ rect.width,
rect.height
);
}
int flags )
{
GtkWidget *tree = wxGTKPrivate::GetTreeWidget();
-
+
GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
wxASSERT_MSG( gdk_window,
wxT("cannot use wxRendererNative on wxDC of this type") );
x_diff = rect.width;
GtkStateType state = GTK_STATE_NORMAL;
-
+
if (flags & wxCONTROL_SELECTED)
{
// the wxCONTROL_FOCUSED state is deduced
{
if (flags & wxCONTROL_SELECTED)
state = GTK_STATE_SELECTED;
-
+
gtk_paint_focus( tree->style,
gdk_window,
state,
GtkStateType state = GTK_STATE_NORMAL;
if ( flags & wxCONTROL_DISABLED )
state = GTK_STATE_INSENSITIVE;
-
+
if (flags & wxCONTROL_CURRENT )
GTK_WIDGET_SET_FLAGS( entry, GTK_HAS_FOCUS );
else
gtk_paint_shadow
(
- entry->style,
+ entry->style,
gdk_window,
state,
GTK_SHADOW_OUT,
dc.LogicalToDeviceX(rect.x),
dc.LogicalToDeviceY(rect.y),
rect.width,
- rect.height
+ rect.height
);
}
GtkStateType state = GTK_STATE_NORMAL;
if ( flags & wxCONTROL_DISABLED )
state = GTK_STATE_INSENSITIVE;
-
+
if (flags & wxCONTROL_CURRENT )
GTK_WIDGET_SET_FLAGS( combo, GTK_HAS_FOCUS );
else
gtk_paint_shadow
(
- combo->style,
+ combo->style,
gdk_window,
state,
GTK_SHADOW_OUT,
dc.LogicalToDeviceX(rect.x),
dc.LogicalToDeviceY(rect.y),
rect.width,
- rect.height
+ rect.height
);
wxRect r = rect;
gtk_paint_arrow
(
- combo->style,
+ combo->style,
gdk_window,
state,
GTK_SHADOW_OUT,
gtk_paint_box
(
- combo->style,
+ combo->style,
gdk_window,
state,
GTK_SHADOW_ETCHED_OUT,
DrawComboBox( win, dc, rect, flags );
}
-
+
// Draw a themed radio button
-void wxRendererGTK::DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
+void wxRendererGTK::DrawOptionButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
{
GtkWidget *button = wxGTKPrivate::GetRadioButtonWidget();
GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
-
+
GtkShadowType shadow_type = GTK_SHADOW_OUT;
if ( flags & wxCONTROL_CHECKED )
shadow_type = GTK_SHADOW_IN;
else if ( flags & wxCONTROL_UNDETERMINED )
shadow_type = GTK_SHADOW_ETCHED_IN;
-
+
GtkStateType state = GTK_STATE_NORMAL;
if ( flags & wxCONTROL_DISABLED )
state = GTK_STATE_INSENSITIVE;
NULL,
button,
"radiobutton",
- dc.LogicalToDeviceX(rect.x),
- dc.LogicalToDeviceY(rect.y),
+ dc.LogicalToDeviceX(rect.x),
+ dc.LogicalToDeviceY(rect.y),
rect.width, rect.height
);
}
virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
- virtual void DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
+ virtual void DrawOptionButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
private:
void DrawMacThemeButton(wxWindow *win,
drawInfo.adornment = adornment;
if (flags & wxCONTROL_FOCUSED)
drawInfo.adornment |= kThemeAdornmentFocus;
-
+
HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
}
}
flags |= wxCONTROL_SELECTED;
int kind;
-
+
if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL ||
(win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
kind = kThemeCheckBoxSmall;
const wxRect& rect, int flags)
{
int kind;
-
+
if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL ||
(win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
kind = kThemePopupButtonSmall;
const wxRect& rect, int flags)
{
int kind;
-
+
if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL ||
(win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
kind = kThemeComboBoxSmall;
DrawMacThemeButton(win, dc, rect, flags, kind, kThemeAdornmentNone);
}
-void wxRendererMac::DrawRadioButton(wxWindow* win, wxDC& dc,
+void wxRendererMac::DrawOptionButton(wxWindow* win, wxDC& dc,
const wxRect& rect, int flags)
{
int kind;
-
+
if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL ||
(win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
kind = kThemeRadioButtonSmall;
dc.SetBrush( *wxWHITE_BRUSH );
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle(rect);
-
+
dc.SetBrush( *wxTRANSPARENT_BRUSH );
HIRect hiRect = CGRectMake( x, y, w, h );