Delphi

How to avoid the ding sound when Escape is pressed while a TEdit is focused?

萝らか妹 提交于 2021-02-08 20:12:34
问题 In code I have developed some years ago I have been using this a lot to close the current form on pressing the Escape key at any moment: procedure TSomeForm.FormKeyPress(Sender: TObject; var Key: Char); begin if key = #27 then close; end; This behaviour is defined for the TForm. The form's KeyPreview property is be set to True to let the form react to key presses before any other components. It all works perfectly well for the best part of the program, however, when the Escape key is pressed

How to avoid the ding sound when Escape is pressed while a TEdit is focused?

血红的双手。 提交于 2021-02-08 20:11:53
问题 In code I have developed some years ago I have been using this a lot to close the current form on pressing the Escape key at any moment: procedure TSomeForm.FormKeyPress(Sender: TObject; var Key: Char); begin if key = #27 then close; end; This behaviour is defined for the TForm. The form's KeyPreview property is be set to True to let the form react to key presses before any other components. It all works perfectly well for the best part of the program, however, when the Escape key is pressed

Firemonkey TEdit height

橙三吉。 提交于 2021-02-08 15:45:08
问题 I'm using Delphi Seattle and my application is for Windows Desktop. I'm trying to change the font size of a TEdit. Consequently the height was also modified. At design time everything works well, but when I run my application TEdit ignores the height modification and the text is cut. I've tried to find FixedHeight as suggested here, but I couldn't find this property. Is it possible to change TEdit Heigth? 回答1: This can be solved by overriding the control’s AdjustFixedSize method. As explained

Angular HttpClient authorization header created but disappearing

不问归期 提交于 2021-02-08 15:36:13
问题 Problem I am trying to send Request Headers, specifically, an authorization header. The authorization Header should look something like this: Authorization: Basic NTY2MTI0Og== In a list of headers. Where Basic indicates that it is encoded with base64. I'm positive it does get added to the get request made in Angular: Request in Angular. Although I'm not sure what op is. (btw, I'm not yet allowed to embed the image) This is what it should look like: From the standard Datasnap Delphi project

How to implement the scanline access of TBitmap correctly?

帅比萌擦擦* 提交于 2021-02-08 15:26:10
问题 I am trying to access the scanline of a Bitmap according to an article on Embarcadero. Using scanlines like for y := 0 to n do begin line := bitmap.scanline [y]; for x := 0 to n do line [x] := value; I have implemented before. I noticed that accessing a scanline takes relatively much time and the article mentioned above offers a solution to that. I am not able to implement it correctly. My code is: unit SCTester; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,

Project version settings keep reverting back

醉酒当歌 提交于 2021-02-08 14:44:19
问题 I have a simple project in Delphi 10.1 Berlin. In the project settings, I have at one point checked on "Pre-Release". Now I have two things that no matter how many times I change them, I come back and it's not saved. These are: Pre-Release checkbox (gets re-checked again) Module Version's Release number (changes from 0 to 1 ) Note in the screenshot that the "File Version" down below shows the correct version number from when I saved it, 0.2.0 . But above, the Release number has changed to 1 .

Project version settings keep reverting back

核能气质少年 提交于 2021-02-08 14:41:48
问题 I have a simple project in Delphi 10.1 Berlin. In the project settings, I have at one point checked on "Pre-Release". Now I have two things that no matter how many times I change them, I come back and it's not saved. These are: Pre-Release checkbox (gets re-checked again) Module Version's Release number (changes from 0 to 1 ) Note in the screenshot that the "File Version" down below shows the correct version number from when I saved it, 0.2.0 . But above, the Release number has changed to 1 .

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

ぃ、小莉子 提交于 2021-02-08 14:15:44
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

穿精又带淫゛_ 提交于 2021-02-08 14:15:15
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name

Why are some properties repeated when TRttiContext.GetType is called on a VCL Control?

﹥>﹥吖頭↗ 提交于 2021-02-08 14:14:28
问题 Why are some properties repeated (such as Action and Align ) where others are not ( AlignWithMargins ) when TRttiContext.GetType is called on a VCL Control? uses System.RTTI, System.Generics.Collections, System.Generics.Defaults; //.... procedure TForm11.btnShowPropertiesClick(Sender: TObject); var R: TRttiContext; Props: TArray<TRttiProperty>; Prop : TRttiProperty; begin memo1.Clear; R := TRttiContext.Create; Props := R.GetType(Sender.ClassType).GetProperties; //Sort properties by name