1. corrected some owner-drawn buttons bugs
2. added generation of event for EVT_SPINCTRL handler to wxSpinCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -305,7 +305,7 @@ static void DrawRect(HDC hdc, const RECT& r)
|
||||
void wxButton::MakeOwnerDrawn()
|
||||
{
|
||||
long style = GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||
if ( !(style & BS_OWNERDRAW) )
|
||||
if ( (style & BS_OWNERDRAW) != BS_OWNERDRAW )
|
||||
{
|
||||
// make it so
|
||||
style |= BS_OWNERDRAW;
|
||||
@@ -475,6 +475,12 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
|
||||
DrawFocusRect(hdc, &rectFocus);
|
||||
}
|
||||
|
||||
if ( pushed )
|
||||
{
|
||||
// the label is shifted by 1 pixel to create "pushed" effect
|
||||
OffsetRect(&rectBtn, 1, 1);
|
||||
}
|
||||
|
||||
DrawButtonText(hdc, &rectBtn, GetLabel(),
|
||||
state & ODS_DISABLED ? GetSysColor(COLOR_GRAYTEXT)
|
||||
: colFg);
|
||||
|
Reference in New Issue
Block a user