1]UniGui的彈出信息MessageDlg的原型定義如下:
procedure MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; CallBack: TUniDialogCallBackAnonProc);
其中DlgType(對話框架的類型)
1、mtConfirmation
2、mtCustom
3、mtError
4、mtInformation
5、mtWarning
示例如下
procedure TMainForm.UniThemeButton1Click(Sender: TObject); begin
 MessageDlg('This is a confirmation!', mtConfirmation, [mbOK],nil);
  UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("確認")');

 MessageDlg('This is information!', mtInformation, [mbOK],nil);
  UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("信息")'); 
         
 
          MessageDlg('This is a warning!', mtWarning, [mbOK],nil);
 UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("警告")'); 
 
           MessageDlg('This is an Error!', mtError, [mbOK],nil);
  UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("錯誤")');
end; 
        最后一個參數的使用方法:
//mbYes,mbYesNo, mbYesNoCancel, mbOk ,mbOkCancel MessageDlg('是否?', mtConfirmation, mbYesNoCancel, procedure(Sender: TComponent; Res: Integer) begin Case Res of mrYes: // 點Yes后執行的語句 begin caption := 'mrYes' end; mrNo: // 點No后執行的語句 begin caption := 'mrNo' end; mrCancel: // 點Cancel后執行的語句 begin caption := 'Mrcancel' end; end; end);

 
        更多信息參見官網說明:
2]類似地 Prompt獲得數據//uniGUIDialogs.Prompt
 
        procedure Prompt(const AMsg: string; const AValue: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; CallBack: TUniPromptCallBackAnonProc; MultiLines: Boolean = False); overload;
Prompt('Please enter a text', '默認輸入值', mtInformation, mbOkCancel, procedure(Sender: TComponent; AResult: Integer; AText: string) begin Case AResult of mrOk: // 點Ok后執行的語句 begin caption := AText + 'Ok' end; mrCancel: // 點Cancel后執行的語句 begin caption := AText + 'Mrcancel' end; end; end, true // 是否多行 );
 
UniSweetAlert1.Show();
總是說我字少 總是說我字少 總是說我字少 總是說我字少 總是說我字少總是說我字少 總是說我字少 總是說我字少 總是說我字少 總是說我字少

