delphi-xe2

Observers property in TComponent

我只是一个虾纸丫 提交于 2019-12-09 04:41:15
问题 Hi Delphi XE2 TComponent has a new "Observers" property. Unfortunately the help entries for this are empty. Does anybody know what this new property is good for and how to use it? Edit: Well i know that it is related to LiveBindings, but I would love to know a bit more about it, and since I have no access to XE2 source code, I can't investigate myself. 回答1: It is related to LiveBindings. A rather cool but extensive subject, explained in the new DocWiki for XE2. 回答2: The Delphi implementation

How to detect when form resizing starts and stops?

℡╲_俬逩灬. 提交于 2019-12-09 04:39:26
问题 I'm working with some real-time drawing on a sizable form. When the user resizes the form, I do not want to apply size change to my graphics rendering until the user has released the mouse button, thus resizing is finished. How do I detect this and only resize my rendering once the user has finished resizing the form? Because right now, if I use the OnResize event of my form, it will constantly re-render everything for every pixel the mouse has moved. I have tried the mouse down/up events and

Howto add menu item to Mac OS Finder in Delphi XE2

拈花ヽ惹草 提交于 2019-12-09 02:08:08
问题 I'm working on Delphi XE2 application targetting Mac OS and Windows. And I want to have integration into context menu. For windows this is simple task. But for Mac OS I dont know how to do this. I've read Providing a Service documentation and tried similar code in Delphi but with no luck. Look at simple code for Finder integration trials. App.dpr program App; uses SysUtils, {$IFDEF MACOS} AppKit, CocoaTypes, CoreFoundation, CoreServices, Foundation, Mach, ObjCRuntime, ObjectiveC, OCMarshal,

Blurred Delphi Form Icon in Windows 7 Taskbar

百般思念 提交于 2019-12-09 01:38:10
问题 I have an application having 2 Forms, each Form and Application have individual Icon. On Form1BitBtn1.Click Form2 is Shown-Nonmodaly and on Form1BitBtn2.Click Form1 is closed. On Form2BitBtn1.Click Form2 is Closed and Form2BitBtn2.Click Form1 is closed. It works fine. But the problem is that in Windows 7 Taskbar the Form1 Icon is Blurred and another problem is that when Form2 is shown using Form1BitBtn1.Click the application shows only Form1 Icon but not Form2 Icon. Please help me. Here is

What is the canonical way to write a hasher function for TEqualityComparer.Construct?

前提是你 提交于 2019-12-08 22:22:20
问题 Consider the following record: TMyRecord = record b: Boolean; // 3 bytes of padding in here with default record alignment settings i: Integer; end; I wish to implement IEqualityComparer<TMyRecord> . In order to do so I want to call TEqualityComparer<TMyRecord>.Construct . This needs to be supplied with a TEqualityComparison<TMyRecord> which presents no problems to me. However, Construct also requires a THasher<TMyRecord> and I would like to know the canonical method for implementing that. The

how to make a transparent form when a VCL Style is enabled?

泪湿孤枕 提交于 2019-12-08 15:59:22
问题 I'm using the following code to make a form transparent, but when the application has a VCL style enabled the form is paint with the background color of the VCL style instead of be transparent. uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs; type TForm1 = class(TForm) procedure FormShow(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } procedure CreateParams(var

Disabling the form still allow childs controls to receive input

会有一股神秘感。 提交于 2019-12-08 15:12:23
问题 I'm having a lot of headache in the last days with delphi, what im trying to do is a lot simple, block the interface at somepoint and enable after some other point. But as simply as it sound i couldn't figure out why somethings are allowed by design, so to clarify: 1) create a project 2) in the form put a edit and a button, tab order of the edit must be first 3) configure the OnExit event of the edit and write: Enabled := False; 4) configure the OnClick event of the button and write:

How to define a breakpoint whenever an object field value changes?

删除回忆录丶 提交于 2019-12-08 14:46:58
问题 As an example, given the code extract below, I would like to define a breakpoint that triggers whenever the object field value changes and optionally, breaks on a condition ( False or True in this case). type TForm1 = class(TForm) EnableButton: TButton; DisableButton: TButton; procedure EnableButtonClick(Sender: TObject); procedure DisableButtonClick(Sender: TObject); private FValue: Boolean; // <== Would like to define a breakpoint here whenever FValue changes. public end; var Form1: TForm1;

Detect all situations where form is minimized

隐身守侯 提交于 2019-12-08 13:13:24
问题 I need to detect when a form is minimized (to hide overlay form). I intercept WM_SYSCOMMAND message and it works fine if I click the form's minimize button, but this event seems not to be fired if I use [Windows] + [M]. Also, WM_ACTIVATE and WM_ACTIVATEAPP are not triggered in this case. What event could I use and are there any other situations that I would have to detect? 回答1: As explained here, How to detect when the form is being maximized?, listen to the WM_SIZE messages. Declare in your

Please explain package use

自古美人都是妖i 提交于 2019-12-08 13:12:29
Please explain package use (in short sentences with small words (for Dummies)). I just moved from D7 to XE2 and packages seem much more prevelant, and I seem to need to qualify a lot more things. In D7 I would say uses windows and now I must say uses winapi.windows . I find that when I call MessageDlg() I can't pass in mtError , I need to qualify it. Before I go too far down the wrong road - what's the simple solution? Can I somehow continue to use my old code with package names which I suspect are terminal (that is, for packages A.B.C I have a uses C clause). Can I add one statement somewhere