zoukankan      html  css  js  c++  java
  • DPF.Android.Native.Components.v2.8.1 for delphi xe6 使用DPFJAlertDialog遇到的问题

    使用DPFJAlertDialog控件时发现DPFJAlertDialog1Click不能捕获到对话框到底按了那个按键,上网搜索后找到了解决方法:

    打开DPF.Android.JAlertDialog.pas文件,找到procedure TAlertDialogOnClickListener.onClick( P1: JDialogInterface; P2: Integer )

    然后按下面的方法修改就可以。

    procedure TAlertDialogOnClickListener.onClick( P1: JDialogInterface; P2: Integer );
    begin
      FDPFJAlertDialog.FClickedIndex := P2;
      FDPFJAlertDialog.FOnClick(FDPFJAlertDialog, P2, nil);//增加这行
      P1.dismiss;
    end;

    另外,发现.DPFJAlertDialog1Click中的ButtonIndex不是从0开始,在android 4.42运行时发现第一个按键是-1,第二个按键是-2,其它版本android没有测试。

    //**********************************************************

    procedure TFProgressDialog.DPFJAlertDialog1Click(Sender: TObject;
      ButtonIndex: Integer; TextResults: TArrayOfString);
    begin
      DPFJButton1.Text:=ButtonIndex.ToString;
    end;

    procedure TFProgressDialog.DPFJButton1Click( Sender: TObject );
    begin
      Timer1.Enabled := false;
         CallInUIThreadAndWaitFinishing(
         procedure
         begin
           DPFJAlertDialog1.ShowMessageDialog( '', 'Progress Dialog Canceled!', ['Yes','No'] )
         end );
    end;

  • 相关阅读:
    26 playbooke(二)
    25 playbook(一)
    23 ansible模块2
    23 ansible模块(一)
    22 Ansible相关工具、ansible、ansible-vault、ansible-console、ansible-galaxy
    21 Ansible安装与主机清单的编写
    Druid.jar包
    Servlet--request
    mysql-myini配置
    global,tornado的write_error,tornado的中间件的写法
  • 原文地址:https://www.cnblogs.com/qiufeng2014/p/3833082.html
Copyright © 2011-2022 走看看