Use wxCONTROL_PRESSED instead of wxCONTROL_SELECTED in wxOSX renderer code.
wxCONTROL_SELECTED is supposed to only apply to the selected items in a listbox and similar cases whereas the buttons use wxCONTROL_PRESSED flag to indicate whether they are toggled. Correct the code in wxRendererMac to use the latter, for consistency with the other platforms. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -185,7 +185,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
|
||||
drawInfo.version = 0;
|
||||
drawInfo.kind = kThemeListHeaderButton;
|
||||
drawInfo.state = (flags & wxCONTROL_DISABLED) ? kThemeStateInactive : kThemeStateActive;
|
||||
drawInfo.value = (flags & wxCONTROL_SELECTED) ? kThemeButtonOn : kThemeButtonOff;
|
||||
drawInfo.value = (flags & wxCONTROL_PRESSED) ? kThemeButtonOn : kThemeButtonOff;
|
||||
drawInfo.adornment = kThemeAdornmentNone;
|
||||
|
||||
// The down arrow is drawn automatically, change it to an up arrow if needed.
|
||||
@@ -195,7 +195,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
|
||||
HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
|
||||
|
||||
// If we don't want any arrows we need to draw over the one already there
|
||||
if ( (flags & wxCONTROL_SELECTED) && (sortArrow == wxHDR_SORT_ICON_NONE) )
|
||||
if ( (flags & wxCONTROL_PRESSED) && (sortArrow == wxHDR_SORT_ICON_NONE) )
|
||||
{
|
||||
// clip to the header rectangle
|
||||
CGContextSaveGState( cgContext );
|
||||
@@ -211,12 +211,12 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
|
||||
// Reserve room for the arrows before writing the label, and turn off the
|
||||
// flags we've already handled
|
||||
wxRect newRect(rect);
|
||||
if ( (flags & wxCONTROL_SELECTED) && (sortArrow != wxHDR_SORT_ICON_NONE) )
|
||||
if ( (flags & wxCONTROL_PRESSED) && (sortArrow != wxHDR_SORT_ICON_NONE) )
|
||||
{
|
||||
newRect.width -= 12;
|
||||
sortArrow = wxHDR_SORT_ICON_NONE;
|
||||
}
|
||||
flags &= ~wxCONTROL_SELECTED;
|
||||
flags &= ~wxCONTROL_PRESSED;
|
||||
|
||||
return DrawHeaderButtonContents(win, dc, newRect, flags, sortArrow, params);
|
||||
}
|
||||
@@ -424,7 +424,7 @@ wxRendererMac::DrawMacThemeButton(wxWindow *win,
|
||||
drawInfo.version = 0;
|
||||
drawInfo.kind = kind;
|
||||
drawInfo.state = (flags & wxCONTROL_DISABLED) ? kThemeStateInactive : kThemeStateActive;
|
||||
drawInfo.value = (flags & wxCONTROL_SELECTED) ? kThemeButtonOn : kThemeButtonOff;
|
||||
drawInfo.value = (flags & wxCONTROL_PRESSED) ? kThemeButtonOn : kThemeButtonOff;
|
||||
if (flags & wxCONTROL_UNDETERMINED)
|
||||
drawInfo.value = kThemeButtonMixed;
|
||||
drawInfo.adornment = adornment;
|
||||
@@ -442,7 +442,7 @@ wxRendererMac::DrawCheckBox(wxWindow *win,
|
||||
int flags)
|
||||
{
|
||||
if (flags & wxCONTROL_CHECKED)
|
||||
flags |= wxCONTROL_SELECTED;
|
||||
flags |= wxCONTROL_PRESSED;
|
||||
|
||||
int kind;
|
||||
|
||||
@@ -594,7 +594,7 @@ void wxRendererMac::DrawRadioBitmap(wxWindow* win, wxDC& dc,
|
||||
kind = kThemeRadioButton;
|
||||
|
||||
if (flags & wxCONTROL_CHECKED)
|
||||
flags |= wxCONTROL_SELECTED;
|
||||
flags |= wxCONTROL_PRESSED;
|
||||
|
||||
DrawMacThemeButton(win, dc, rect, flags,
|
||||
kind, kThemeAdornmentNone);
|
||||
|
||||
Reference in New Issue
Block a user