unit ButtonMenu;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, BarButton,
Winapi.ShellAPI;
type
TContextMenue =
class(TForm)
procedure btnSetCaptionClick(Sender : TObject);
procedure btnSetShortCutClick(Sender : TObject);
public
FBB : TBarButton;
end;
var
ContextMenue : TContextMenue;
implementation
{$R *.fmx}
procedure TContextMenue.btnSetCaptionClick(Sender : TObject);
var
S :
String;
begin
if InputQuery('
New button name.', '
Enter a new name.', S)
then
begin
FBB.Text := S;
end;
end;
procedure TContextMenue.btnSetShortCutClick(Sender : TObject);
var
openDlg : TOpenDialog;
begin
openDlg := TOpenDialog.Create(self);
if (openDlg.Execute)
then
begin
ShowMessage('
File : ' + openDlg.FileName);
FBB.Shortcut := openDlg.FileName;
FBB.Text := ExtractFileName(OpenDlg.FileName);
end
else
begin
ShowMessage('
Assigning file was cancelled');
end;
openDlg.Free;
end;
end.