Add support for right-aligned checkboxes to wxOSX

Honour wxALIGN_RIGHT style.

Closes #17380.
This commit is contained in:
John Roberts 2016-02-27 16:31:47 +01:00 committed by Vadim Zeitlin
parent 2072bfa00e
commit e14b589e8e
3 changed files with 4 additions and 2 deletions

View File

@ -234,3 +234,4 @@ wxOSX/Cocoa:
- Don't generate wxEVT_TEXT_ENTER for controls without wxTE_PROCESS_ENTER.
- Implement wxToolTip::SetDelay() (David Vanderson).
- Correct positioning of popup menus relative to mouse pointer (John Roberts).
- Add support for right-aligned checkboxes (John Roberts).

View File

@ -56,8 +56,7 @@ enum wxCheckBoxState
It can only be done from code. Using this flags allows the user to
set the checkbox to the third state by clicking.
@style{wxALIGN_RIGHT}
Makes the text appear on the left of the checkbox. Not implemented
in wxOSX.
Makes the text appear on the left of the checkbox.
@endStyleTable
@beginEventEmissionTable{wxCommandEvent}

View File

@ -28,6 +28,8 @@ wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
[v setButtonType:NSSwitchButton];
if (style & wxALIGN_RIGHT)
[v setImagePosition:NSImageRight];
if (style & wxCHK_3STATE)
[v setAllowsMixedState:YES];