vcl

How to recompile a specific unit from the VCL?

邮差的信 提交于 2019-11-27 23:56:08
I want to apply a fix from QC to a Delphi 2009 unit (DBClient as it happens). I know I need to copy the unit to another directory and make the change to the copy. How do I then get Delphi to compile that unit and use it in favour of the DCU that already exists? If you don't want to modify the original .Pas file, I do this by copy the .Pas file into my application folder, then choose built project, it will create new dcu file in my application folder, which will be used instead of the original one. It's kind of a last resort (and not supported by CodeGear), but I do something similar to

Changing component class at run-time on demand

让人想犯罪 __ 提交于 2019-11-27 19:29:27
My Question is similar to the idea here: Replacing a component class in delphi . But I need to change a specific component(s) class on demand. Here is some pseudo demo code: unit Unit1; TForm1 = class(TForm) ImageList1: TImageList; ImageList2: TImageList; private ImageList3: TImageList; end; procedure TForm1.FormCreate(Sender: TObject); begin ImageList3 := TImageList.Create(Self); // all instances of TImageList run as usual end; procedure TForm1.Button1Click(Sender: TObject); begin Unit2.MakeSuperImageList(ImageList2); Unit2.MakeSuperImageList(ImageList3); // from now on ONLY ImageList2 and

Using TOwnedCollection descendant in Delphi

本小妞迷上赌 提交于 2019-11-27 18:40:47
问题 I'm trying to create a custom component with a collection property. However if I try to open the collection editor during design time by clicking "..." button in object inspector, nothing happens. What I am missing? Here's my TCollection descendant: TMyCollection = class(TOwnedCollection) private function GetItem(Index: Integer): TMyCollectionItem; procedure SetItem(Index: Integer; const Value: TMyCollectionItem); public function Add : TMyCollectionItem; property Items[Index: Integer]:

Delphi: Why VCL is not thread-safe? How can be?

岁酱吖の 提交于 2019-11-27 15:25:55
问题 Everywhere is noticed that VCL is not thread-safe and we must synchronize access to it. So it's VCL faults that is not thread-safe. How VCL itself can be thread-safe? 回答1: What, precisely, does "thread-safe" mean to you? What about someone else? Every time I see this brought up, it ends up boiling down to this: "I want VCL to be thread-safe so I don't have to think about threading and synchronization issues. I want to write my code as if it is still single-threaded." No matter how much work

Delphi Change main form while application is running

家住魔仙堡 提交于 2019-11-27 13:46:39
I have this problem. When I hide my main form, then the taskbar icon of my application is also hidden. I saw a new question about this problem as well and the answers didn't really help. They suggested to minimize it, but I do not want to minimize the application. Is it possible to change the main form while the application is already running? for instance. I have two forms. when I want to hide the one form and show the other form, then the taskbar icon should stay at the taskbar and the main form should switch to the other form. I am using Delphi XE6 and it is a VCL Forms application. I have

Delphi windows 7 control panel component

孤街醉人 提交于 2019-11-27 11:23:19
问题 Im looking for a delphi component that looks and functions like the Windows 7 control panel buttons when you "view by category". Anybody know if something like this already exists? 回答1: I just created a small component that looks sort of what you want. It is double-buffered, and hence completely flicker-free, and works both with visual themes enabled and disabled. unit TaskButton; interface uses SysUtils, Forms, Messages, Windows, Graphics, Classes, Controls, UxTheme, ImgList, PNGImage; type

How to detach a panel and show it in a separate window?

ぐ巨炮叔叔 提交于 2019-11-27 09:31:52
Let's say I have form A that contains a panel (with many other controls in it) and a form B that it is empty. Can I programmatically detach the panel from form A and move it in form B (and maybe back to form A)? I know that I can change the Owner of the panel but does it work between different forms? Update: After some Googling I see that there is a ParentWindow property. You can easily have something appear as if it was a panel, and also as a form, by really using a TForm for what you would have used the panel for. Then dock the form at runtime into the place where you have a blank panel left

How to avoid issues when embedding a TForm in another TForm?

99封情书 提交于 2019-11-27 08:58:09
I often embed a TForm descendant into another TForm descendant like this: var Form1: TForm1; Form2: TForm2; begin Form2.Parent := Form1; Form2.BorderStyle := bsNone; Form2.Align := alClient; Form2.Show; end; Usually this works just fine, but sometimes the controls in Form2 are not aligned properly. Is there a general workaround for this sort of problem? Does anybody know what is causing this "misalignment"? I know that I could use TFrame for this kind of job, but I have a lot of library code that I would have to rewrite and I do not see any reason why the TForm in TForm approach should not

Delphi XE2: Possible to instantiate a FireMonkey Form in VCL application?

a 夏天 提交于 2019-11-27 07:06:51
Prior to Delphi XE2, we have VCL only to create GUI apps. Delphi XE2 states that: Caution: FireMonkey (FMX) and the Visual Component Library (VCL) are not compatible and cannot be used in the same project or application. That is, an application must be exclusively one or the other, either FireMonkey or VCL. The incompatibility is caused by framework differences between FireMonkey (FMX) and VCL. My application is a pure VCL application that is built with runtime packages. All VCL forms are stored in a runtime package. If I am going to create a FireMonkey form and store in a package, do I have

Changing component class at run-time on demand

两盒软妹~` 提交于 2019-11-27 04:22:56
问题 My Question is similar to the idea here: Replacing a component class in delphi. But I need to change a specific component(s) class on demand. Here is some pseudo demo code: unit Unit1; TForm1 = class(TForm) ImageList1: TImageList; ImageList2: TImageList; private ImageList3: TImageList; end; procedure TForm1.FormCreate(Sender: TObject); begin ImageList3 := TImageList.Create(Self); // all instances of TImageList run as usual end; procedure TForm1.Button1Click(Sender: TObject); begin Unit2