Fix appearance of custom drawn wxToggleButton in wxMSW.
Ensure that the owner-drawn toggle buttons are drawn in the pressed state when they are pressed, even if they are also selected or under mouse. Closes #11665. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76790 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -581,6 +581,7 @@ wxMSW:
|
|||||||
|
|
||||||
- Fix Cygwin 1.7 build.
|
- Fix Cygwin 1.7 build.
|
||||||
- Include x64 configurations in MSVC 8/9 project files too.
|
- Include x64 configurations in MSVC 8/9 project files too.
|
||||||
|
- Fix appearance of wxToggleButtons with non default colours (Artur Wieczorek).
|
||||||
|
|
||||||
|
|
||||||
3.0.1: (released 2014-06-15)
|
3.0.1: (released 2014-06-15)
|
||||||
|
@@ -831,7 +831,12 @@ wxAnyButton::State GetButtonState(wxAnyButton *btn, UINT state)
|
|||||||
if ( state & ODS_DISABLED )
|
if ( state & ODS_DISABLED )
|
||||||
return wxAnyButton::State_Disabled;
|
return wxAnyButton::State_Disabled;
|
||||||
|
|
||||||
if ( state & ODS_SELECTED )
|
// We need to check for the pressed state of the button itself before the
|
||||||
|
// other checks because even if it is selected or current, it it still
|
||||||
|
// pressed first and foremost.
|
||||||
|
const wxAnyButton::State btnState = btn->GetNormalState();
|
||||||
|
|
||||||
|
if ( btnState == wxAnyButton::State_Pressed || state & ODS_SELECTED )
|
||||||
return wxAnyButton::State_Pressed;
|
return wxAnyButton::State_Pressed;
|
||||||
|
|
||||||
if ( btn->HasCapture() || btn->IsMouseInWindow() )
|
if ( btn->HasCapture() || btn->IsMouseInWindow() )
|
||||||
@@ -840,7 +845,7 @@ wxAnyButton::State GetButtonState(wxAnyButton *btn, UINT state)
|
|||||||
if ( state & ODS_FOCUS )
|
if ( state & ODS_FOCUS )
|
||||||
return wxAnyButton::State_Focused;
|
return wxAnyButton::State_Focused;
|
||||||
|
|
||||||
return btn->GetNormalState();
|
return btnState;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawButtonText(HDC hdc,
|
void DrawButtonText(HDC hdc,
|
||||||
|
Reference in New Issue
Block a user