if InputQuery('请输入密码:', ['密码:', '重复密码:'], strResult) then
---------- Project10 ---------- Length of value array must be >= length of prompt array. ---------- 确定 ----------
----------------------------------------------
http://www.cnblogs.com/tulater/
//Date: 2021-04-20 //Parm: 消息内容;标题 //Desc: 弹出消息框 procedure TUniMainModule.ShowMsg(const nHint: string; const nError: Boolean; nTitle: string); begin with FSToast1 do begin Close := True; TimeOut := 5000;
if nError then begin if nTitle = '' then nTitle := sError; Error(nTitle, nHint, bottomRight); end else begin if nTitle = '' then nTitle := sHint; Info(nTitle, nHint, bottomRight); end; end; end;
//Date: 2021-04-20 //Parm: 消息;标题 //Desc: 提示对话框 procedure TUniMainModule.ShowDlg(const nMsg: string; const nError: Boolean; const nEvent: TButtonClickEvent; nTitle: string); begin with FSConfirm1 do begin ButtonTextConfirm := '确定'; ButtonTextCancel := '取消';
if nError then begin if nTitle = '' then nTitle := sError; //xxxxx
Alert(nTitle, nMsg, 'fa fa-ban', red, FSTheme1, procedure(nButton: TConfirmButton) begin if Assigned(nEvent) then begin case nButton of Ok: nEvent(ctYes); end; end; end); end else begin if nTitle = '' then nTitle := sHint; //xxxxx
Alert(nTitle, nMsg, 'fa fa-info', blue, FSTheme1, procedure(nButton: TConfirmButton) begin if Assigned(nEvent) then begin case nButton of Ok: nEvent(ctYes); end; end; end); end; end; end;
//Date: 2021-04-20 //Parm: 消息;标题 //Desc: 询问对话框 procedure TUniMainModule.QueryDlg(const nMsg: string; const nEvent: TButtonClickEvent; const nMask: string; nTitle: string); begin with FSConfirm1 do begin TypeColor := blue; Theme := FSTheme1; RTL := False; CloseIcon := False;
if ScreenMask.Enabled then ScreenMask.Text := nMask; //xxxxx
if nTitle = '' then nTitle := sAsk; //xxxxx
Question(nTitle, nMsg, 'fa fa-question-circle', procedure(nButton: TConfirmButton) //匿名回调函数 begin if Assigned(nEvent) then begin case nButton of Yes: nEvent(ctYes); No: nEvent(ctNo); end; end; end); end; end;
if nPwd then PromptType.TypePrompt := password else PromptType.TypePrompt := text;
Prompt(nTitle, nMsg, 'fa fa-keyboard-o', green, FSTheme1, procedure(nButton: TConfirmButton; nResult: string) begin if Assigned(nEvent) then begin if (nSize > 0) and (Length(nResult) > nSize) then nResult := Copy(nResult, 1, nSize); //xxxxx
case nButton of Yes: nEvent(ctYes, nResult); No: nEvent(ctNo, nResult); end; end; end ); end; end;
----------------------------------------------
生活愉快.