cocoa: making togglebox consistent with the standard button. Providing configuration to make the cocoa run in backwards compatible manner

git-svn-id: trunk@62250 -
This commit is contained in:
dmitry 2019-11-17 02:37:14 +00:00
parent 3f71fbb081
commit e4c13cf957
2 changed files with 6 additions and 1 deletions

View File

@ -242,6 +242,8 @@ var
// if set to true, then WS would not assign icons via TCocoaWSForm SetIcon
// The icon would have to be changed manually. By default LCL behaviour is used
CocoaIconUse: Boolean = false;
CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle;
CocoaToggleType : NSButtonType = NSPushOnPushOffButton;
{$ifdef COCOALOOPHIJACK}
// The flag is set to true once hi-jacked loop is finished (at the end of app)

View File

@ -346,6 +346,9 @@ procedure ControlSetTextWithChangeEvent(ctrl: NSControl; const text: string);
implementation
uses
CocoaInt;
const
VerticalScrollerVisible: array[TScrollStyle] of boolean = (
{ssNone } false,
@ -1900,7 +1903,7 @@ var
btn: NSButton;
cl: NSButtonCell;
begin
btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, NSTexturedRoundedBezelStyle, NSToggleButton);
btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, CocoaToggleBezel, CocoaToggleType);
cl := NSButtonCell(NSButton(btn).cell);
cl.setShowsStateBy(cl.showsStateBy or NSContentsCellMask);
Result := TLCLIntfHandle(btn);