DBILITY

FMX InputQueryAsync 본문

delphi

FMX InputQueryAsync

DBILITY 2019. 7. 5. 17:09
반응형
InputQuery depreciated....

 
usess FMX.Platform;
procedure TForm1.Button1Click(Sender: TObject);
var
  TaskName: string;
  AsyncService: IFMXDialogServiceAsync;
begin
  try
//    InputQuery('작업을 입력하세요', ['작업관리'], [''],
//      procedure(const AResult: TModalResult; const AValues: array of string)
//      begin
//        if AResult = mrOk then
//          TaskName := AValues[0]
//        else
//          TaskName := '';
//
//        if not(TaskName.Trim = '') then
//        begin
//          FDQueryInsert.ParamByName('TASKNAME').AsString := TaskName;
//          FDQueryInsert.ExecSQL;
//          FDTable1.Refresh;
//          LinkFillControlToField1.BindList.FillList;
//        end;
//
//      end);

    if TPlatformServices.Current.SupportsPlatformService(IFMXDialogServiceAsync,
      IInterface(AsyncService)) then
    begin
      AsyncService.InputQueryAsync('작업을 입력하세요', ['작업관리'], [''],
        procedure(const AResult: TModalResult; const AValues: array of string)
        begin
          if AResult = mrOk then
            TaskName := AValues[0]
          else
            TaskName := '';

          if not(TaskName.Trim = '') then
          begin
            FDQueryInsert.ParamByName('TASKNAME').AsString := TaskName;
            FDQueryInsert.ExecSQL;
            FDTable1.Refresh;
            LinkFillControlToField1.BindList.FillList;
          end;

        end);
    end;

  except
    on E: Exception do
      ShowMessage(E.Message);
  end;

end;


반응형

'delphi' 카테고리의 다른 글

FMX 로또번호 생성기  (0) 2019.07.23
FMX 기기정보  (0) 2019.07.05
ToYcon  (0) 2019.06.29
SILK ICONS  (0) 2019.06.29
Comments