Delphi

Painting issue of panels with Styles when using DoubleBuffered=true

醉酒当歌 提交于 2021-02-10 07:11:52
问题 This may be an embarcadero VCL problem, but using the latest Delphi (10.4.1) I came across the following problem. I am use to set DoubleBuffering to true in the FormCreate, but noted that this creates a painting issue of the panels when: the panel is located inside of a groupbox a Radiobutton is added to the panel in below image it can be seen that once DoubleBuffering is set to true, the painting of the panels get 'messed-up'. From left to right, Windows, Cyan Dusk and Cyan Dusk with

Painting issue of panels with Styles when using DoubleBuffered=true

隐身守侯 提交于 2021-02-10 07:05:44
问题 This may be an embarcadero VCL problem, but using the latest Delphi (10.4.1) I came across the following problem. I am use to set DoubleBuffering to true in the FormCreate, but noted that this creates a painting issue of the panels when: the panel is located inside of a groupbox a Radiobutton is added to the panel in below image it can be seen that once DoubleBuffering is set to true, the painting of the panels get 'messed-up'. From left to right, Windows, Cyan Dusk and Cyan Dusk with

Delphi FMX TCheckbox/TRadiobutton Autosize

痞子三分冷 提交于 2021-02-10 06:46:26
问题 I want dynamically created Checkboxes and Radiobuttons (in FMX, not VCL) with a fixed Width to change their Heigth based on their containing text. My Checkboxes and Radiobuttons have WordWrap enabled. So I want to get something like the TLabel does, when AutoSize and WordWrap are enabled. I've already managed to get close to this: procedure TFMenu.Button1Click(Sender: TObject); var ctr: Integer; hostingComponent: TComponent; begin hostingComponent := Form1; { in my case a Frame or Panel or

In Delphi IDE, can I change default control properties

此生再无相见时 提交于 2021-02-10 05:14:15
问题 In Delphi (old version 7, but probably applies to newer as well), each control you add such as button/memo/text... , will have default properties. Memo will contain a single line with it's name, they will have different colors etc. Can I change this so that controls have certain defaults ? Example, I may want my memo fields to always be courier new 8 pt. Similar to style sheets / templates. I know that I can subclass to my own type, but I would prefer other solution. Other ideas welcome. I do

how to (correctly) use an enumerated type with livebindings (TObjectBindSourceAdapter)

此生再无相见时 提交于 2021-02-09 11:01:51
问题 I'm using TObjectBindSourceAdapter to use livebindings with an object. One of the properties of the object i'm using with TObjectBindSourceAdapter has an enumerated type, but the field in the adapter is never generated when i use an enumerated type in my object The Only solution i have found for now is to define the enumerated type as an integer in my object and typecast it. This seems to work fine but you have to keep type casting from and back the enumerated type and integers. Here is some

Import IORegistryEntrySearchCFProperty from Macapi.IOKit in Delphi for OSX64

拥有回忆 提交于 2021-02-09 10:42:31
问题 I used this import definition in OSX32 successfully: uses MacApi.ObjectiveC, MacApi.Foundation, Macapi.CoreFoundation, Macapi.Mach, Macapi.IOKit; type io_iterator_t = io_object_t; io_name_t = array[0..127] of AnsiChar; function IORegistryEntrySearchCFProperty(entry: io_registry_entry_t; plane: io_name_t; key: CFStringRef; allocator: CFAllocatorRef; options: IOOptionBits): CFTypeRef; cdecl; external libIOKit name _PU + 'IORegistryEntrySearchCFProperty'; function IOServiceGetMatchingServices

DBGrid - How to set an individual background color?

时光毁灭记忆、已成空白 提交于 2021-02-09 09:26:25
问题 I am using Delphi 10.2.3 and want to change the background color of a DBgrid. For example I have a text column and an integer column. Depending on the text I want to change the color of the integer cell (in the same row) if the value is non-zero. I got some ideas from how to color DBGrid special cell? So I know how to change the color of a cell in OnDrawColumnCell. I can change the background of the text. But I still didn't figure out how to change the color of another cell. Certainly it is

DBGrid - How to set an individual background color?

旧巷老猫 提交于 2021-02-09 09:23:52
问题 I am using Delphi 10.2.3 and want to change the background color of a DBgrid. For example I have a text column and an integer column. Depending on the text I want to change the color of the integer cell (in the same row) if the value is non-zero. I got some ideas from how to color DBGrid special cell? So I know how to change the color of a cell in OnDrawColumnCell. I can change the background of the text. But I still didn't figure out how to change the color of another cell. Certainly it is

DBGrid - How to set an individual background color?

时间秒杀一切 提交于 2021-02-09 09:23:47
问题 I am using Delphi 10.2.3 and want to change the background color of a DBgrid. For example I have a text column and an integer column. Depending on the text I want to change the color of the integer cell (in the same row) if the value is non-zero. I got some ideas from how to color DBGrid special cell? So I know how to change the color of a cell in OnDrawColumnCell. I can change the background of the text. But I still didn't figure out how to change the color of another cell. Certainly it is

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

和自甴很熟 提交于 2021-02-08 20:27:19
问题 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