mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 23:12:39 +02:00
cocoa: send LM_CLICKED for button clicks and LM_CHANGED for checkbox change
git-svn-id: trunk@34125 -
This commit is contained in:
parent
1f95690d16
commit
66e6e42951
@ -94,6 +94,12 @@ type
|
|||||||
function ResetCursorRects: Boolean;
|
function ResetCursorRects: Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ IButtonCallback }
|
||||||
|
|
||||||
|
IButtonCallback = interface(ICommonCallback)
|
||||||
|
procedure ButtonClick;
|
||||||
|
end;
|
||||||
|
|
||||||
{ IWindowCallback }
|
{ IWindowCallback }
|
||||||
|
|
||||||
IWindowCallback = interface(ICommonCallBack)
|
IWindowCallback = interface(ICommonCallBack)
|
||||||
@ -124,7 +130,7 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure actionButtonClick(sender: NSObject); message 'actionButtonClick:';
|
procedure actionButtonClick(sender: NSObject); message 'actionButtonClick:';
|
||||||
public
|
public
|
||||||
callback : ICommonCallback;
|
callback: IButtonCallback;
|
||||||
function initWithFrame(frameRect: NSRect): id; override;
|
function initWithFrame(frameRect: NSRect): id; override;
|
||||||
function acceptsFirstResponder: Boolean; override;
|
function acceptsFirstResponder: Boolean; override;
|
||||||
procedure mouseDown(event: NSEvent); override;
|
procedure mouseDown(event: NSEvent); override;
|
||||||
@ -139,7 +145,7 @@ type
|
|||||||
{ TCocoaTextField }
|
{ TCocoaTextField }
|
||||||
|
|
||||||
TCocoaTextField = objcclass(NSTextField)
|
TCocoaTextField = objcclass(NSTextField)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
function acceptsFirstResponder: Boolean; override;
|
function acceptsFirstResponder: Boolean; override;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
@ -156,7 +162,7 @@ type
|
|||||||
{ TCocoaTextView }
|
{ TCocoaTextView }
|
||||||
|
|
||||||
TCocoaTextView = objcclass(NSTextView)
|
TCocoaTextView = objcclass(NSTextView)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
function acceptsFirstResponder: Boolean; override;
|
function acceptsFirstResponder: Boolean; override;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
@ -171,7 +177,7 @@ type
|
|||||||
procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
|
procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
|
||||||
procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
|
procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
|
||||||
public
|
public
|
||||||
callback : IWindowCallback;
|
callback: IWindowCallback;
|
||||||
function acceptsFirstResponder: Boolean; override;
|
function acceptsFirstResponder: Boolean; override;
|
||||||
procedure mouseUp(event: NSEvent); override;
|
procedure mouseUp(event: NSEvent); override;
|
||||||
procedure mouseDown(event: NSEvent); override;
|
procedure mouseDown(event: NSEvent); override;
|
||||||
@ -184,7 +190,7 @@ type
|
|||||||
{ TCocoaCustomControl }
|
{ TCocoaCustomControl }
|
||||||
|
|
||||||
TCocoaCustomControl = objcclass(NSControl)
|
TCocoaCustomControl = objcclass(NSControl)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
procedure drawRect(dirtyRect: NSRect); override;
|
procedure drawRect(dirtyRect: NSRect); override;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
@ -192,7 +198,7 @@ type
|
|||||||
{ TCocoaScrollView }
|
{ TCocoaScrollView }
|
||||||
|
|
||||||
TCocoaScrollView = objcclass(NSScrollView)
|
TCocoaScrollView = objcclass(NSScrollView)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -203,7 +209,7 @@ type
|
|||||||
|
|
||||||
TCocoaComboBoxList = class(TStringList)
|
TCocoaComboBoxList = class(TStringList)
|
||||||
private
|
private
|
||||||
fOwner : TCocoaComboBox;
|
FOwner: TCocoaComboBox;
|
||||||
protected
|
protected
|
||||||
procedure Changed; override;
|
procedure Changed; override;
|
||||||
public
|
public
|
||||||
@ -221,9 +227,9 @@ type
|
|||||||
{ TCocoaComboBox }
|
{ TCocoaComboBox }
|
||||||
|
|
||||||
TCocoaComboBox = objcclass(NSComboBox, NSComboBoxDataSourceProtocol, NSComboBoxDelegateProtocol)
|
TCocoaComboBox = objcclass(NSComboBox, NSComboBoxDataSourceProtocol, NSComboBoxDelegateProtocol)
|
||||||
callback : IComboboxCallBack;
|
callback: IComboboxCallBack;
|
||||||
list : TCocoaComboBoxList;
|
list: TCocoaComboBoxList;
|
||||||
resultNS : NSString; //use to return values to combo
|
resultNS: NSString; //use to return values to combo
|
||||||
function comboBox_objectValueForItemAtIndex_(combo: TCocoaComboBox; row: NSInteger): id;
|
function comboBox_objectValueForItemAtIndex_(combo: TCocoaComboBox; row: NSInteger): id;
|
||||||
message 'comboBox:objectValueForItemAtIndex:';
|
message 'comboBox:objectValueForItemAtIndex:';
|
||||||
function numberOfItemsInComboBox(combo: TCocoaComboBox): NSInteger;
|
function numberOfItemsInComboBox(combo: TCocoaComboBox): NSInteger;
|
||||||
@ -239,7 +245,7 @@ type
|
|||||||
{ TCocoaScrollBar }
|
{ TCocoaScrollBar }
|
||||||
|
|
||||||
TCocoaScrollBar = objcclass(NSScroller)
|
TCocoaScrollBar = objcclass(NSScroller)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -251,16 +257,16 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure Changed; override;
|
procedure Changed; override;
|
||||||
public
|
public
|
||||||
Owner : TCocoaListView;
|
Owner: TCocoaListView;
|
||||||
constructor Create(AOwner: TCocoaListView);
|
constructor Create(AOwner: TCocoaListView);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaListView }
|
{ TCocoaListView }
|
||||||
|
|
||||||
TCocoaListView = objcclass(NSTableView, NSTableViewDataSourceProtocol)
|
TCocoaListView = objcclass(NSTableView, NSTableViewDataSourceProtocol)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
list : TCocoaStringList;
|
list: TCocoaStringList;
|
||||||
resultNS : NSString; //use to return values to combo
|
resultNS: NSString; //use to return values to combo
|
||||||
function numberOfRowsInTableView(aTableView: NSTableView): NSInteger; message 'numberOfRowsInTableView:';
|
function numberOfRowsInTableView(aTableView: NSTableView): NSInteger; message 'numberOfRowsInTableView:';
|
||||||
function tableView_objectValueForTableColumn_row(tableView: NSTableView;
|
function tableView_objectValueForTableColumn_row(tableView: NSTableView;
|
||||||
objectValueForTableColumn: NSTableColumn; row: NSInteger):id;
|
objectValueForTableColumn: NSTableColumn; row: NSInteger):id;
|
||||||
@ -272,7 +278,7 @@ type
|
|||||||
{ TCocoaGroupBox }
|
{ TCocoaGroupBox }
|
||||||
|
|
||||||
TCocoaGroupBox = objcclass(NSBox)
|
TCocoaGroupBox = objcclass(NSBox)
|
||||||
callback : ICommonCallback;
|
callback: ICommonCallback;
|
||||||
procedure resetCursorRects; override;
|
procedure resetCursorRects; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -306,14 +312,15 @@ end;
|
|||||||
|
|
||||||
procedure TCocoaButton.actionButtonClick(sender: NSObject);
|
procedure TCocoaButton.actionButtonClick(sender: NSObject);
|
||||||
begin
|
begin
|
||||||
callback.MouseClick(1);
|
// this is the action handler of button
|
||||||
//todo: simulate MouseUp
|
callback.ButtonClick;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCocoaButton.initWithFrame(frameRect: NSRect): id;
|
function TCocoaButton.initWithFrame(frameRect: NSRect): id;
|
||||||
begin
|
begin
|
||||||
Result:=inherited initWithFrame(frameRect);
|
Result := inherited initWithFrame(frameRect);
|
||||||
if Assigned(Result) then begin
|
if Assigned(Result) then
|
||||||
|
begin
|
||||||
setTarget(Self);
|
setTarget(Self);
|
||||||
setAction(objcselector('actionButtonClick:'));
|
setAction(objcselector('actionButtonClick:'));
|
||||||
end;
|
end;
|
||||||
@ -321,14 +328,14 @@ end;
|
|||||||
|
|
||||||
function TCocoaButton.acceptsFirstResponder: Boolean;
|
function TCocoaButton.acceptsFirstResponder: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaButton.mouseUp(event: NSEvent);
|
procedure TCocoaButton.mouseUp(event: NSEvent);
|
||||||
var
|
var
|
||||||
mp : NSPoint;
|
mp: NSPoint;
|
||||||
begin
|
begin
|
||||||
mp:=event.locationInWindow;
|
mp := event.locationInWindow;
|
||||||
callback.MouseUp(round(mp.x), round(mp.y));
|
callback.MouseUp(round(mp.x), round(mp.y));
|
||||||
inherited mouseUp(event);
|
inherited mouseUp(event);
|
||||||
end;
|
end;
|
||||||
@ -343,7 +350,7 @@ procedure TCocoaButton.mouseDown(event: NSEvent);
|
|||||||
var
|
var
|
||||||
mp : NSPoint;
|
mp : NSPoint;
|
||||||
begin
|
begin
|
||||||
mp:=event.locationInWindow;
|
mp := event.locationInWindow;
|
||||||
callback.MouseDown(round(mp.x), round(mp.y));
|
callback.MouseDown(round(mp.x), round(mp.y));
|
||||||
inherited mouseDown(event);
|
inherited mouseDown(event);
|
||||||
end;
|
end;
|
||||||
|
@ -34,7 +34,7 @@ uses
|
|||||||
// widgetset
|
// widgetset
|
||||||
WSButtons, WSLCLClasses, WSProc,
|
WSButtons, WSLCLClasses, WSProc,
|
||||||
// LCL Carbon
|
// LCL Carbon
|
||||||
CocoaWSStdCtrls, CocoaUtils;
|
CocoaWSCommon, CocoaWSStdCtrls, CocoaUtils;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -70,12 +70,12 @@ implementation
|
|||||||
class function TCocoaWSBitBtn.CreateHandle(const AWinControl: TWinControl;
|
class function TCocoaWSBitBtn.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn: NSButton;
|
||||||
begin
|
begin
|
||||||
btn:=AllocButton(AWinControl, AParams, NSRoundedBezelStyle, NSMomentaryPushInButton);
|
btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, NSRoundedBezelStyle, NSMomentaryPushInButton);
|
||||||
if Assigned(btn) then
|
if Assigned(btn) then
|
||||||
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
||||||
Result:=TLCLIntfHandle(btn);
|
Result := TLCLIntfHandle(btn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -38,6 +38,8 @@ type
|
|||||||
function ResetCursorRects: Boolean; virtual;
|
function ResetCursorRects: Boolean; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TLCLCommonCallBackClass = class of TLCLCommonCallBack;
|
||||||
|
|
||||||
{ TCocoaWSWinControl }
|
{ TCocoaWSWinControl }
|
||||||
|
|
||||||
TCocoaWSWinControl=class(TWSWinControl)
|
TCocoaWSWinControl=class(TWSWinControl)
|
||||||
|
@ -146,6 +146,14 @@ type
|
|||||||
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
|
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TLCLButtonCallback }
|
||||||
|
|
||||||
|
TLCLButtonCallback = class(TLCLCommonCallback, IButtonCallback)
|
||||||
|
public
|
||||||
|
procedure ButtonClick; virtual;
|
||||||
|
end;
|
||||||
|
TLCLButtonCallBackClass = class of TLCLButtonCallBack;
|
||||||
|
|
||||||
{ TCocoaWSButton }
|
{ TCocoaWSButton }
|
||||||
|
|
||||||
TCocoaWSButton = class(TWSButton)
|
TCocoaWSButton = class(TWSButton)
|
||||||
@ -154,12 +162,19 @@ type
|
|||||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TLCLCheckBoxCallback }
|
||||||
|
|
||||||
|
TLCLCheckBoxCallback = class(TLCLButtonCallBack)
|
||||||
|
public
|
||||||
|
procedure ButtonClick; override;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCocoaWSCustomCheckBox }
|
{ TCocoaWSCustomCheckBox }
|
||||||
|
|
||||||
TCocoaWSCustomCheckBox = class(TWSCustomCheckBox)
|
TCocoaWSCustomCheckBox = class(TWSCustomCheckBox)
|
||||||
published
|
published
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -188,20 +203,20 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function AllocTextView(ATarget: TWinControl; const AParams: TCreateParams; fieldEditor: Boolean): NSTextView;
|
function AllocTextView(ATarget: TWinControl; const AParams: TCreateParams; fieldEditor: Boolean): NSTextView;
|
||||||
function AllocButton(ATarget: TWinControl; const AParams: TCreateParams; btnBezel: NSBezelStyle; btnType: NSButtonType): NSButton;
|
function AllocButton(const ATarget: TWinControl; const ACallBackClass: TLCLButtonCallBackClass; const AParams: TCreateParams; btnBezel: NSBezelStyle; btnType: NSButtonType): NSButton;
|
||||||
function AllocTextField(ATarget: TWinControl; const AParams: TCreateParams): TCocoaTextField;
|
function AllocTextField(ATarget: TWinControl; const AParams: TCreateParams): TCocoaTextField;
|
||||||
function AllocSecureTextField(ATarget: TWinControl; const AParams: TCreateParams): TCocoaSecureTextField;
|
function AllocSecureTextField(ATarget: TWinControl; const AParams: TCreateParams): TCocoaSecureTextField;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function AllocButton(ATarget: TWinControl; const AParams: TCreateParams; btnBezel: NSBezelStyle; btnType: NSButtonType): NSButton;
|
function AllocButton(const ATarget: TWinControl; const ACallBackClass: TLCLButtonCallBackClass; const AParams: TCreateParams; btnBezel: NSBezelStyle; btnType: NSButtonType): NSButton;
|
||||||
var
|
var
|
||||||
cap: NSString;
|
cap: NSString;
|
||||||
begin
|
begin
|
||||||
Result:=TCocoaButton.alloc.lclInitWithCreateParams(AParams);
|
Result := TCocoaButton.alloc.lclInitWithCreateParams(AParams);
|
||||||
if Assigned(Result) then
|
if Assigned(Result) then
|
||||||
begin
|
begin
|
||||||
TCocoaButton(Result).callback:=TLCLCommonCallback.Create(Result, ATarget);
|
TCocoaButton(Result).callback := ACallBackClass.Create(Result, ATarget);
|
||||||
Result.initWithFrame(CreateParamsToNSRect(AParams));
|
Result.initWithFrame(CreateParamsToNSRect(AParams));
|
||||||
cap := NSStringUTF8(AParams.Caption);
|
cap := NSStringUTF8(AParams.Caption);
|
||||||
Result.setTitle(cap);
|
Result.setTitle(cap);
|
||||||
@ -240,6 +255,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TLCLButtonCallback }
|
||||||
|
|
||||||
|
procedure TLCLButtonCallback.ButtonClick;
|
||||||
|
begin
|
||||||
|
SendSimpleMessage(Target, LM_CLICKED);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TLCLCheckBoxCallback }
|
||||||
|
|
||||||
|
procedure TLCLCheckBoxCallback.ButtonClick;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
SendSimpleMessage(Target, LM_CHANGED);
|
||||||
|
// todo: win32 has something about dbcheckbox handling here. so maybe we need to handle it special too
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLCLComboboxCallback }
|
{ TLCLComboboxCallback }
|
||||||
|
|
||||||
procedure TLCLComboboxCallback.ComboBoxWillPopUp;
|
procedure TLCLComboboxCallback.ComboBoxWillPopUp;
|
||||||
@ -278,9 +309,9 @@ end;
|
|||||||
class function TCocoaWSButton.CreateHandle(const AWinControl: TWinControl;
|
class function TCocoaWSButton.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn: NSButton;
|
||||||
begin
|
begin
|
||||||
btn:=AllocButton(AWinControl, AParams, NSRoundedBezelStyle, NSMomentaryPushInButton);
|
btn := AllocButton(AWinControl, TLCLButtonCallback, AParams, NSRoundedBezelStyle, NSMomentaryPushInButton);
|
||||||
if Assigned(btn) then
|
if Assigned(btn) then
|
||||||
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
||||||
Result:=TLCLIntfHandle(btn);
|
Result:=TLCLIntfHandle(btn);
|
||||||
@ -320,12 +351,12 @@ end;
|
|||||||
class function TCocoaWSCustomCheckBox.CreateHandle(const AWinControl: TWinControl;
|
class function TCocoaWSCustomCheckBox.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn: NSButton;
|
||||||
begin
|
begin
|
||||||
btn:=AllocButton(AWinControl, AParams, 0, NSSwitchButton);
|
btn := AllocButton(AWinControl, TLCLCheckBoxCallBack, AParams, 0, NSSwitchButton);
|
||||||
if Assigned(btn) then
|
if Assigned(btn) then
|
||||||
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
AddViewToNSObject(btn, NSObject(AParams.WndParent), AParams.X, AParams.Y);
|
||||||
Result:=TLCLIntfHandle(btn);
|
Result := TLCLIntfHandle(btn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -369,10 +400,10 @@ end;
|
|||||||
class function TCocoaWSRadioButton.CreateHandle(const AWinControl: TWinControl;
|
class function TCocoaWSRadioButton.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn: NSButton;
|
||||||
begin
|
begin
|
||||||
btn:=AllocButton(AWinControl, AParams, 0, NSRadioButton);
|
btn := AllocButton(AWinControl, TLCLCheckBoxCallBack, AParams, 0, NSRadioButton);
|
||||||
Result:=TLCLIntfHandle(btn);
|
Result := TLCLIntfHandle(btn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaWSCustomEdit }
|
{ TCocoaWSCustomEdit }
|
||||||
@ -709,13 +740,13 @@ end;
|
|||||||
class function TCocoaWSToggleBox.CreateHandle(const AWinControl:TWinControl;
|
class function TCocoaWSToggleBox.CreateHandle(const AWinControl:TWinControl;
|
||||||
const AParams:TCreateParams):TLCLIntfHandle;
|
const AParams:TCreateParams):TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn: NSButton;
|
||||||
cl : NSButtonCell;
|
cl: NSButtonCell;
|
||||||
begin
|
begin
|
||||||
btn:=AllocButton(AWinControl, AParams, NSTexturedRoundedBezelStyle, NSToggleButton);
|
btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, NSTexturedRoundedBezelStyle, NSToggleButton);
|
||||||
cl:=NSButtonCell(NSButton(btn).cell);
|
cl := NSButtonCell(NSButton(btn).cell);
|
||||||
cl.setShowsStateBy(cl.showsStateBy or NSContentsCellMask);
|
cl.setShowsStateBy(cl.showsStateBy or NSContentsCellMask);
|
||||||
Result:=TLCLIntfHandle(btn);
|
Result := TLCLIntfHandle(btn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaWSScrollBar }
|
{ TCocoaWSScrollBar }
|
||||||
|
Loading…
Reference in New Issue
Block a user