add support for wxCONTROL_ISDEFAULT to wxRendererMSW::DrawPushButton() (modified patch 1572887)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -209,22 +209,30 @@ wxRendererMSW::DrawComboBoxDropButton(wxWindow * WXUNUSED(win),
|
|||||||
void
|
void
|
||||||
wxRendererMSW::DrawPushButton(wxWindow * WXUNUSED(win),
|
wxRendererMSW::DrawPushButton(wxWindow * WXUNUSED(win),
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rectOrig,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
RECT r;
|
wxRect rect(rectOrig);
|
||||||
r.left = rect.GetLeft();
|
|
||||||
r.top = rect.GetTop();
|
|
||||||
r.bottom = rect.y + rect.height;
|
|
||||||
r.right = rect.x + rect.width;
|
|
||||||
|
|
||||||
int style = DFCS_BUTTONPUSH;
|
int style = DFCS_BUTTONPUSH;
|
||||||
if ( flags & wxCONTROL_DISABLED )
|
if ( flags & wxCONTROL_DISABLED )
|
||||||
style |= DFCS_INACTIVE;
|
style |= DFCS_INACTIVE;
|
||||||
if ( flags & wxCONTROL_PRESSED )
|
if ( flags & wxCONTROL_PRESSED )
|
||||||
style |= DFCS_PUSHED | DFCS_FLAT;
|
style |= DFCS_PUSHED | DFCS_FLAT;
|
||||||
|
if ( flags & wxCONTROL_ISDEFAULT )
|
||||||
|
{
|
||||||
|
// DrawFrameControl() doesn't seem to support default buttons so we
|
||||||
|
// have to draw the border ourselves
|
||||||
|
wxDCPenChanger pen(dc, *wxBLACK_PEN);
|
||||||
|
wxDCBrushChanger brush(dc, *wxTRANSPARENT_BRUSH);
|
||||||
|
dc.DrawRectangle(rect);
|
||||||
|
rect.Inflate(1);
|
||||||
|
}
|
||||||
|
|
||||||
::DrawFrameControl(GetHdcOf(dc), &r, DFC_BUTTON, style);
|
RECT rc;
|
||||||
|
wxCopyRectToRECT(rect, rc);
|
||||||
|
|
||||||
|
::DrawFrameControl(GetHdcOf(dc), &rc, DFC_BUTTON, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
Reference in New Issue
Block a user