Delphi

Async InputQuery doesn't handle Cancel button

我们两清 提交于 2021-02-07 14:29:19
问题 I'm using a simple call to TDialogServiceAsync.InputQuery() with a single input. It just ignores both the Cancel button and the window's X close button. But the Ok button works fine. This is my code: uses FMX.DialogService.Async; procedure TForm1.Button1Click(Sender: TObject); begin TDialogServiceAsync.InputQuery('Title', ['Insert value'], ['bla bla'], procedure(const AResult: TModalResult; const AValues: array of string) begin if Aresult = mrOk then ShowMessage('Ok!'); if Aresult = mrCancel

Getting the Size of a Class or Object in the same format as a File Size?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 14:15:58
问题 How can I best determine the Size of a Class from Memory? Here is a basic sample class to work with - Note the variables serve no purpose other than for the example: type TMyClass = class public fString1: string; fString2: string; fInteger1: Integer; fInteger2: Integer; constructor Create; destructor Destroy; override; end; What I would like to do is return the same size as if it were a file on disk. So if I saved TMyClass to File and the Size of the File was 2.4kb for example, I would like

Incrementing Delphi XE project version number from command line

回眸只為那壹抹淺笑 提交于 2021-02-07 13:47:57
问题 I have a Delphi XE project and I'm trying to change the version number of the program before building it with MSBuild. Version number information is located in the DPROJ file but if I change these values the version number does not change. I think the reason for this is that when you change version number in the IDE, Delphi saves the changes to both DPROJ and RES files. Is there a way to compile the RES file from the command line with the changes in DPROJ file? I found this question which

Custom component creation - how to add small icon representing component in Tool Palette?

蓝咒 提交于 2021-02-07 13:34:45
问题 Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette. I've read that I should name my two other BMP files which are contained in DCR file like this: MyComponentName16 [for 16x16 BMP file]

Custom component creation - how to add small icon representing component in Tool Palette?

北城余情 提交于 2021-02-07 13:34:20
问题 Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette. I've read that I should name my two other BMP files which are contained in DCR file like this: MyComponentName16 [for 16x16 BMP file]

Custom component creation - how to add small icon representing component in Tool Palette?

浪尽此生 提交于 2021-02-07 13:34:11
问题 Please bear in mind that I've read all the instructions I could find about adding component icon to my custom component. And I am able to do this when we talk about the icon size which is 24x24 pixels. I see the icon when a component is dropped on the form. However I can not see the small 16x16 icon which should be displayed when browsing Tool Palette. I've read that I should name my two other BMP files which are contained in DCR file like this: MyComponentName16 [for 16x16 BMP file]

How to parse a json string response using Delphi

青春壹個敷衍的年華 提交于 2021-02-07 12:32:29
问题 I have a rest server returning the next json string: response:='{"result":["[{\"email\":\"XXX@gmail.com\",\"regid\":\"12312312312312312313213w\"},{\"email\":\"YYYY@gmail.com\",\"regid\":\"AAAAAAA\"}]"]}'; I´d like to parse the response to get a list of all email and regid items. I have tried the next code but I am getting an AV at (TJSONPair(LItem).JsonString.Value='email') Any help will be appreciated. Thanks in advance, Luiz var LResult:TJSONArray; LJsonresponse:TJSONObject; i:integer;

安装 CodeTyphon

坚强是说给别人听的谎言 提交于 2021-02-07 11:51:47
一直想找个开源的可以商用的 Delphi 的替代品,能跨平台了最好。开始时试过 Lazarus ,和 D7 还真是挺像的,不过用惯了 XE ,还是想找个习惯相似的IDE,扒拉下论坛后发现了 CodeTyphon ,就想着试一下。 下载 下载就不多说了,网上很容易找到,而且官方 wiki 写得也很好,英文好的可以直接看,像我这样的英语渣渣,还是有必要慢慢去啃的。 CodeTyphon 下载后只有一个 CodeTyphonIns.zip 的压缩包,无论是 Windows 、 Linux 还是 MacOS ,安装包都是它,因为不管在哪个平台上安装,都是要编译的。 安装 解压 CodeTyphonIns.zip 得到 CodeTyphonIns 在 Windows 平台,以管理员方式运行 install.bat ;在类 unix 平台,先 cd CodeTyphonIns ,再 sudo ./install.sh 出现以下界面,输入 0 ==================================================== CodeTyphon Studio Version 7.30 (GEN 7) Installation for Linux-Solaris-Openindiana-MacOS FreeBSD-NetBSD-OpenBSD-DragonFly =====

How to assign a function, returned by another function, to a function variable? The result rather than the generating function itself

て烟熏妆下的殇ゞ 提交于 2021-02-07 11:22:05
问题 A function is returning an anonymous function. I would like to assign the result to a variable. However the compiler thinks that I am trying to assign the function and not the result of the function. How can I resolve this? program Project9; {$APPTYPE CONSOLE} type TMyEvent = reference to function: string; var v1: TMyEvent; function GetHandler: TMyEvent; begin Result := function: string begin Result := ''; end; end; begin v1 := GetHandler; // <- Incompatible types: 'TMyEvent' and 'Procedure'

No OnKeyDown event for Return key on Delphi Android 10.3.3

倾然丶 夕夏残阳落幕 提交于 2021-02-07 11:01:27
问题 I am in the process of upgrading from Delphi 10.2.3 to 10.3.3. My android apps are now not generating an OnKeyDown event from the virtual keyboard for the Return key. I have confirmed this using a very basic newly created project so it is nothing to do with the conversion from 10.2.3 it seems. Any ideas would be appreciated. QA at embarcadero have come back with the following response: "According to this documentation - Handle keyboard actions or this - KeyEvent : When handling keyboard