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 ...
随机推荐
- Scheme语言--简单介绍
一年前事实上有时间看完SICP这本书,后来由于种种原因,一直没有继续再学.由于SICP中使用Scheme确实应用不多.在Java,C++的语言眼里,Scheme确实非常另类.现在MIT已经放弃了使用S ...
- 理解 iOS 和 macOS 的内存管理
在 iOS 和 macOS 应用的开发中,无论是使用 Objective-C 还是使用 swift 都是通过引用计数策略来进行内存管理的,但是在日常开发中80%(这里,我瞎说的,8020 原则嘛
- android module 模块共用远程包
在项目有多模块,需要使用到同一个第三方包时,引入报错,个人解决方法如下 1. 在模块build.gradle 文件中配置maven远程地址 可从app下的build.gradle文件里复制 allpr ...
- WPF MVVM模式中,通过命令实现窗体拖动、跳转以及显隐控制
原文:WPF MVVM模式中,通过命令实现窗体拖动.跳转以及显隐控制 在WPF中使用MVVM模式,可以让我们的程序实现界面与功能的分离,方便开发,易于维护.但是,很多初学者会在使用MVVM的过程中遇到 ...
- HDU 1598 find the most comfortable road (罗列+Kruskal) 并检查集合
Problem Description XX星有很多城市,城市之间通过一种奇怪的快速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流.每条SARS都对行驶 ...
- Python 爬虫 —— BeautifulSoup
from bs4 import BeautifulSoup % 首字母大写,显然这是一个类 1. BeautifulSoup 类 HTML 解析类(parser) r = requests.get(. ...
- 目标检测的图像特征提取(一)HOG特点
1.HOG特点: 方向梯度直方图(Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检測的特征描写叙述子.它通过计算和统计图像局部区 ...
- Android 动画具体解释Frame动画 (Drawable Animation)
Frame动画像gif画画,通过一些静态的图片,以实现动画效果. Android sdk该AnimationDrawable就是专门针对Frame动画,当然Frame动画也可在java代码或者xml中 ...
- js 看图识国家
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...
- How do you create a DynamicResourceBinding that supports Converters, StringFormat?
原文 How do you create a DynamicResourceBinding that supports Converters, StringFormat? 2 down vote ac ...