Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TMainForm.GetYesNoConfirmationProc(aMessage: string; aProc: TInputCloseDialogProc);
- begin
- TDialogService.PreferredMode := TDialogService.TPreferredMode.Platform;
- TDialogService.MessageDialog(aMessage,
- TMsgDlgType.mtConfirmation,
- [ TMsgDlgBtn.mbOK, TMsgDlgBtn.mbCancel ],
- TMsgDlgBtn.mbOK, 0,
- aProc );
- end;
- // Example usage:
- procedure TMainForm.ListViewOrderDetailsDoupleTap(const AItem: TListViewItem);
- begin
- var txtQty: TListItemText := TListItemText(AItem.View.FindDrawable('txtQty'));
- var txtSku: TListItemText := TListItemText(AItem.View.FindDrawable('txtSku'));
- var aConfirm: string := format('Please confirm that you wish to submit the following SKU: %s',[txtSku.Text]);
- var aProc: TInputCloseDialogProc :=
- procedure(const AResult: TModalResult)
- begin
- if AResult = mrOk then
- begin
- var canScan: boolean := true;
- var dividerPos: integer := Pos('/',txtQty.Text);
- var amountPickedValue: string := Copy(txtQty.Text,dividerPos+1).Trim;
- if ((dividerPos > 0) and (amountPickedValue.Contains('--'))) then
- begin
- var aValue: string := txtSku.Text;
- VerifyQuantity(aValue);
- canScan := false;
- end;
- if canScan then RequestScan(fSession.User,GetStringPage,txtSku.Text);
- end;
- end;
- GetYesNoConfirmationProc(aConfirm,aProc);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement