Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

NSNativeButton as Default

 Post Reply Post Reply
Author
Andrew Norman View Drop Down
New Member
New Member
Avatar

Joined: 08 Apr 2016
Posts: 3
Post Options Post Options   Quote Andrew Norman Quote  Post ReplyReply Direct Link To This Post Topic: NSNativeButton as Default
    Posted: 08 Apr 2016 at 12:46am
Hi,

Is it possible to set a Native Button as default, i.e. it is coloured Blue 'before' clicking?

Many thanks

Andy
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3396
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 08 Apr 2016 at 10:11am
Hi, 

You can try the following code to accomplish this:

uses
  FMX.Platform.Mac, Macapi.AppKit;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXNativeNSButton1.BezelStyle := bbsRoundedBezelStyle;
end;

procedure TForm1.FormShow(Sender: TObject);
var
  h: TMacWindowHandle;
begin
  h := WindowHandleToPlatform(Self.Handle);
  h.Wnd.setDefaultButtonCell(TNSButtonCell.Wrap(TMSFMXNativeNSButton1.Button.cell));
end;
Back to Top
Andrew Norman View Drop Down
New Member
New Member
Avatar

Joined: 08 Apr 2016
Posts: 3
Post Options Post Options   Quote Andrew Norman Quote  Post ReplyReply Direct Link To This Post Posted: 08 Apr 2016 at 11:28am
Works perfect, many thanks for your prompt response.

Andy
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down