Ga naar inhoud

TP2WBootstrapDialog

TP2WBootstrapDialog is a sleek, responsive, and user-friendly dialog box with an unlimited number of custom buttons.

You can use TP2WBootstrapDialog both asynchronously...

procedure TForm1.ShowAsync;
begin
  P2WBootstrapDialog1.Show(procedure(buttonId: TMsgDlgBtn)
  begin
    if buttonId = mbCancel then
      console.log('user clicked the X button or pressed Escape')
    else
      console.log(P2WBootstrapDialog1.Buttons.ButtonById(buttonId).Text);
  end);
end;

...or with a blocking call:

procedure TForm1.ShowAndWait; async;
var
  buttonId: TMsgDlgBtn;
begin
  buttonId := await(TMsgDlgBtn, P2WBootstrapDialog1.ShowModal);
  if buttonId = mbCancel then
    console.log('user clicked the X button or pressed Escape')
  else
    console.log(P2WBootstrapDialog1.Buttons.ButtonById(buttonId).Text);
end;