vcl

Why TForm.Handle is a getter instead of a field?

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:00:39
问题 I was debugging a complicated bug recently. It was caused by accessing a non-existing Form.Handle (garbaged pointer). The bug revealed itself in rather unexpected way for me - accessing Forms Handle caused resizes and repaints. I would expect accessing Form.Handle by a garbage pointer would just return some garbage THandle. Expecting that the Handle is created once on form creation and stays the same till the Form is destroyed. The question Why is it so, that TForm.Handle is not a field that

Why TForm.Handle is a getter instead of a field?

别来无恙 提交于 2019-12-02 06:37:28
I was debugging a complicated bug recently. It was caused by accessing a non-existing Form.Handle (garbaged pointer). The bug revealed itself in rather unexpected way for me - accessing Forms Handle caused resizes and repaints. I would expect accessing Form.Handle by a garbage pointer would just return some garbage THandle. Expecting that the Handle is created once on form creation and stays the same till the Form is destroyed. The question Why is it so, that TForm.Handle is not a field that gets initialized on form creation and is accessed via property Handle: Integer read FHandle; , but is a

Seeking floorplan design VCL toolbar

空扰寡人 提交于 2019-12-02 04:53:21
问题 I'm looking for a VCL component for C++ builder. It should preferably have a toolbar with drag & drop functionality. I want to define a building or area (which might not be rectangular) and split it into "rooms" (or areas, or whatever you want to call them). And I want to be able to put "doorways" (or passages, etc) from a room into its neighbours. is there such a thing? Preferably free. Thanks. In case anyone wants to know the answer, I have verified with TMS that the diagram studio can

Delphi: Detect when a new form has been created

自古美人都是妖i 提交于 2019-12-02 03:22:36
问题 I'd like to detect when a new form has been created. Now I use the Screen.ActiveFormChange event and check for new forms in Screen.CustomForms but ActiveFormChange is fired after the OnShow event of the form. I'd like to detect the form even before OnShow was fired. Is there any way to do this without modifying the Vcl.Forms unit? I'd like to detect all forms (also Delphi modal messages etc.) therefore inheriting all forms from a custom class is not possible (correct me if I am wrong).

Conditional directive to identify C++ Builder personalities

三世轮回 提交于 2019-12-02 00:32:25
问题 I have a Delphi component which I want to install and have it available at the component palette in Delphi but not in C++ Builder. In BDS/RAD 2006 and above I can either have it installed for both personalities or none. I need to do so because this component uses 3rd party libraries that doesn't support C++ Builder. I have looked at jedi.inc mentioned here but I'm not able to find the combination to be able to register the component in Delphi personalities only. The component should also work

Seeking floorplan design VCL toolbar

情到浓时终转凉″ 提交于 2019-12-02 00:27:36
I'm looking for a VCL component for C++ builder. It should preferably have a toolbar with drag & drop functionality. I want to define a building or area (which might not be rectangular) and split it into "rooms" (or areas, or whatever you want to call them). And I want to be able to put "doorways" (or passages, etc) from a room into its neighbours. is there such a thing? Preferably free. Thanks. In case anyone wants to know the answer, I have verified with TMS that the diagram studio can indeed do this. Although they said "You can use TMS Diagram Studio for that, it’s not that complicated to

Delphi: Detect when a new form has been created

匆匆过客 提交于 2019-12-01 23:02:02
I'd like to detect when a new form has been created. Now I use the Screen.ActiveFormChange event and check for new forms in Screen.CustomForms but ActiveFormChange is fired after the OnShow event of the form. I'd like to detect the form even before OnShow was fired. Is there any way to do this without modifying the Vcl.Forms unit? I'd like to detect all forms (also Delphi modal messages etc.) therefore inheriting all forms from a custom class is not possible (correct me if I am wrong). Alternatively, is it possible to detect that a new component was added to some TComponent.FComponents list?

Creating a new component by combining two controls (TEdit and TTrackBar) in Delphi VCL

假如想象 提交于 2019-12-01 17:52:16
I am developing a Delphi 10.1 VCL application for Windows. For integer or float input I need a number input field which is connected with a slider. When the user changes the number in the input field the slider position changes accordingly. When the user changes the slider position the number in the number field is updated. I can solve this by using a TEdit and a TTrackBar and add the necessary update functionality in their OnChange event handlers. The problem is that I need many of such inputs on different forms. Therefore I would like to create a new component which combines the two controls

How can I simulate the press of a button?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 17:44:29
I want to test some forms. Is there a way to simulate the press of an Ok (or Cancel) button so that the button is pressed and fires the event handlers that are associated with it? The cleanest approach is to call the Click method of the button. This is better than the alternatives for these reasons: You could read the OnClick property, check that it was not nil, and then call the method. But that seems rather pointless since the Click method already does just that. There's no point duplicating this code. And you could call the event handler directly, but that would require your code to have

How to make a single component support both VCL and FMX?

狂风中的少年 提交于 2019-12-01 16:14:39
I have a TComponent which controls some of the UI. This component is designed to support both VCL and Firemonkey by using conditionals. Such conditionals instruct my component whether to accept a VCL control or an FMX control. It's currently expected that this conditional is defined on the application level to instruct the component in run-time whether it's to manage a VCL or FMX control. I'd like to publish my component into the IDE with support for both VCL and FMX, sharing the same unit with conditionals. However, depending on whether VCL or FMX is currently in use, the property names/types