Einzelnen Beitrag anzeigen

Benutzerbild von Jonas Shinaniganz
Jonas Shinaniganz

Registriert seit: 30. Aug 2011
249 Beiträge
 
Delphi XE5 Ultimate
 
#5

AW: Firemonkey, Create -> App Freeze

  Alt 10. Mär 2012, 21:40
Denke nein, habe HD Formular ausgewählt, hier die ganze Form:

Delphi-Quellcode:
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.
  Mit Zitat antworten Zitat