Jump to content

how to use Prompt without callback like desktop


IRWANTO82

Recommended Posts

hi,

is "Prompt" can run without call back like desktop ?

i tested it, it must using callback.

sample UniButton1Click, prompt doesnt appear

sample UniButton2Cick with callback, it's showup

ServerModule asycnrequest set true;

Version:1.90.0 build 1564

 

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  sFileNameNew, sFileName : string;
begin
  if Prompt(
    'Masukkan nama file yang baru' + '<br>' +
    sFileName + '<BR>' +
    '<br>',
    sFileName,
    TMsgDlgType.mtConfirmation,
    mbOKCancel,
    sFileNameNew,
    True
  ) = 2 then  // 1 ok, 2 cancel
    Exit;

  ShowMessage('show after prompt');
end;

procedure TMainForm.UniButton2Click(Sender: TObject);
var
  sFileNameNew, sFileName : string;
begin
  Prompt(
    'Masukkan nama file yang baru' + '<br>' +
    sFileName + '<BR>' +
    '<br>',
    sFileName,
    TMsgDlgType.mtConfirmation,
    mbOKCancel,

    procedure (Sender: TComponent; AResult: Integer; AText: string)
    begin
      if AResult = mrOK then
      begin
        ShowMessageN(AText);
      end;
    end
  );

end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...