Print Page | Close Window

NSNativeButton as Default

Printed From: TMS Software
Category: FMX Components
Forum Name: FMX mCL
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=6442
Printed Date: 26 Jan 2020 at 11:19pm


Topic: NSNativeButton as Default
Posted By: Andrew Norman
Subject: NSNativeButton as Default
Date 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



Replies:
Posted By: Pieter Scheldeman
Date 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;


Posted By: Andrew Norman
Date Posted: 08 Apr 2016 at 11:28am
Works perfect, many thanks for your prompt response.

Andy



Print Page | Close Window