Delphi berlin ShowMessage的改进与使用
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet,
FireDAC.Comp.Client, System.Rtti, FMX.Grid.Style, Data.Bind.EngExt,
Fmx.Bind.DBEngExt, Fmx.Bind.Grid, System.Bindings.Outputs, Fmx.Bind.Editors,
Data.Bind.Components, Data.Bind.Grid, Data.Bind.DBScope, FMX.ScrollBox,
FMX.Grid,FMX.DialogService.Async;
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
procedure ShowMessageDialogCallBack(Sender: TObject; const AResult: TModalResult);
end;
Form2: TForm2;
begin
//在移动平台下异步执行,在windows,osx上同步执行,查看源码,会发现具体实现中判断了是否是android
//与ios,是的话,通过TDialogServiceAsnyc这个类来显示异步对话框
ShowMessage('Hello world.');
//如果要在Windows及os X上也异步显示对话框,则需要直接用TDialogServiceAsnyc来显示
// TDialogServiceAsync.ShowMessage('Hello world async.');
end;
begin
//直接显示异步对话框,并通过匿名函数实现回调,当用户点击确定按钮时,执行该匿名函数
//在所有平台下测试的结果,都是异步执行的,换句话说,在Windows及osX上也不是模态显示。
TDialogServiceAsync.ShowMessage('Hello world',
procedure (const AResule:TModalResult)
begin
ShowMessage('Click ok');
end
);
end;
begin
//通过回调事先写好的事件函数,来异步显示对话框,即当用户按下确定按钮时,执行
//ShowMessageDialogCallBack.
//在所有平台下测试的结果,都是异步执行的,换句话说,在Windows及osX上也不是模态显示。
TDialogServiceAsync.ShowMessage('Test',ShowMessageDialogCallBack,nil);
end;
const AResult: TModalResult);
begin
showMessage('Call Back.');
end;
Delphi berlin ShowMessage的改进与使用的更多相关文章
- [教学] Delphi Berlin 10.1 开发 Windows 10 平板 App 远程调试
Delphi Berlin 10.1 开发 Windows 10 平板 App 远程调试安装步骤: 准备电脑: 一台开发电脑,安装 Delphi 开发环境 一台平板电脑,安装 PAServer,安装方 ...
- Delphi Berlin 10.1 for iOS 成生 info.plist 顺序改变了
在 Delphi Seattle 10 update 1 版本(含之前版本),只要 Project > Build 会立即生成 info.plist 如果需要修改 info.plist 可以利用 ...
- delphi Berlin Could not load SSL library.
delphi Berlin Could not load SSL library. TIdSSLIOHandlerSocketOpenSSL 解决办法:下载合适的版本文件libssl32.dll Id ...
- 13 Amazing Component Sets Driving Success In Delphi Berlin On Android And IOS
There are quite a few Firemonkey component sets available for Delphi Berlin which can get you ahead ...
- Delphi Berlin 10.1.2 FMX用TMessageManager处理自定义消息
看FMX代码,发现有两种消息处理的实现方式,一种是用TMessageManager来实现自定义的消息,另外一种象TEdit中的实现,直接声明消息方法. 早前,看过文章说TMessageManage ...
- Delphi Berlin 10.1 for 小米平板2 (Win 10) 电子罗盘测试
Windows 10 下没有 Sensor.HeadingXSensor.HeadingYSensor.HeadingZ 需改用 Sensor.CompMagHeading
- Delphi Berlin 窗体代码分离风格 回到Delphi7传统风格
回到Delphi7传统风格 Floating Form Designer You can now detach the form designer in both, VCL and FireMonke ...
- Delphi 10.1.2 berlin开发跨平台APP的几点经验
1.ios不允许app有退出功能,所以不能调用Application.Terminate. 2.info.plist文件的自定义:info.plist文件是由info.plist.TemplateiO ...
- c++builder delphi 调用dll dll编写
c++builder动态调用dll // 定义 typedef int __stdcall MyFunction (int x, char *str); ; String dllName = &quo ...
随机推荐
- Centos root权限的变化
方法一:更改 /etc/sudoers 文件, 找到以下一行,把前面的凝视(#)去掉 ## Allows people in group wheel to run all commands %whee ...
- KMP算法具体解释(贴链接)
---------------------------------------------------------------------------------------------------- ...
- SQL基础问题整理
在程序中,数据库操作是必不可少的部分,所以我们要备足数据库相关知识才能去应付程序中出现的种种问题.基于此,我特地在国外网站.博客上整理了一些问题,并附带了答案和解释.参考.为了保证“原汁原味”,我就保 ...
- 【从翻译mos文章】采用高速全扫描索引(index ffs) 为了避免全表扫描
采用高速全扫描索引(index ffs) 为了避免全表扫描 参考原始: Index Fast Full Scan Usage To Avoid Full Table Scans (Doc ID 701 ...
- myeclipse 8.6 software and workspace center is currently not available
Myeclipse安装EGit插件的时候偏偏遇到software and workspace center is currently not available 不用打开myeclipse conf ...
- 如何用JS获取“ul”下边的“li”的个数
<script type="text/javascript"> function OnbtnClick() { var txtCount=document.getEle ...
- 在.net core 的webapi项目中将对象序列化成json
问题:vs2017 15.7.6创建一个基于.net core 2.1的webapi项目,默认生成的控制器继承自ControllerBase类 在此情况下无法使用Json()方法 将一个对象转成jso ...
- C++于public、protected和private说明(From MSDN)
public(C# 參考): https://msdn.microsoft.com/zh-cn/library/yzh058ae.aspx protected(C# 參考):https://msdn. ...
- delphi xe 之路(14)使用FireMonkeyStyle(一共30篇)
FireMonkey使用Style来控制控件的显示方式. 每个控件都有一个StyleLookup属性,FireMonkey就是通过控件的这个属性来在当前窗体的StyleBook控件中查找匹配的Styl ...
- sigsuspend sigprocmask函数的用法
一个进程的信号屏蔽字规定了当前堵塞而不能递送给该进程的信号集.调用函数sigprocmask能够检測或更改其信号屏蔽字,或者在一个步骤中同一时候运行这两个操作. #include <signal ...