Respect styles translated to WS_EX_XXX in wxMSW wxCheckBox and wxRadioButton.
Take into account the window styles that translate to extended Windows styles at MSW level. Also override MSWGetStyle() in these classes, just as in most (all?) other ones, for consistency instead of doing wx-to-MSW styles translation directly in Create(). Notice that as a side effect of this change, border styles now work for wxCheckBox which wasn't the case before. It's not clear if this is really wanted but OTOH there doesn't seem to be any real reason to forbid them neither. Closes #14674. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -104,7 +104,18 @@ bool wxCheckBox::Create(wxWindow *parent,
|
||||
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
|
||||
return false;
|
||||
|
||||
long msStyle = WS_TABSTOP;
|
||||
WXDWORD exstyle;
|
||||
WXDWORD msStyle = MSWGetStyle(style, &exstyle);
|
||||
|
||||
msStyle |= wxMSWButton::GetMultilineStyle(label);
|
||||
|
||||
return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle);
|
||||
}
|
||||
|
||||
WXDWORD wxCheckBox::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
// buttons never have an external border, they draw their own one
|
||||
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
|
||||
|
||||
if ( style & wxCHK_3STATE )
|
||||
msStyle |= BS_3STATE;
|
||||
@@ -116,9 +127,7 @@ bool wxCheckBox::Create(wxWindow *parent,
|
||||
msStyle |= BS_LEFTTEXT | BS_RIGHT;
|
||||
}
|
||||
|
||||
msStyle |= wxMSWButton::GetMultilineStyle(label);
|
||||
|
||||
return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, 0);
|
||||
return msStyle;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user