tframe

Delphi 7 - Handling MouseWheel events for Embedded Frames in Forms?

别等时光非礼了梦想. 提交于 2019-12-04 22:19:59
问题 Hi I have a form with several frames inside. For some of the frames, i wish to scroll the contents (or at least handle the mousewheel event). I have tried the following: Simply assigning a OnMouseWheel event handler for each frame Overriding the MouseWheel event for the parent form: procedure TFmReview.MouseWheelHandler(var Message: TMessage); var Control: TControl; begin Control := ControlAtPos(ScreenToClient(SmallPointToPoint(TWMMouseWheel(Message).Pos)), False, True); if Assigned(Control)

Should I use delphi tframes for multi-pages forms?

 ̄綄美尐妖づ 提交于 2019-12-03 09:43:21
问题 I have some forms in my application which have different "states" depending on what the user is doing; for exemple when listing through his files the form displays some data about that file in a grid, but if he clicks on some button the grid is replaced by a graph relating to it. Simply said, the controls in the form depends on the what the user wants to do. Of course the obvious way of doing that was showing/hidding controls as needed, works like a charm for small numbers but once you reach

Should I use delphi tframes for multi-pages forms?

岁酱吖の 提交于 2019-12-03 01:13:41
I have some forms in my application which have different "states" depending on what the user is doing; for exemple when listing through his files the form displays some data about that file in a grid, but if he clicks on some button the grid is replaced by a graph relating to it. Simply said, the controls in the form depends on the what the user wants to do. Of course the obvious way of doing that was showing/hidding controls as needed, works like a charm for small numbers but once you reach 10/15+ controls per state (or more than 3 states really) it's unusable. I'm experimenting with TFrames

How to simulate an OnDestroy event on a TFrame in Delphi?

孤者浪人 提交于 2019-12-03 00:33:42
How can i simulate an OnDestroy event for a TFrame in Delphi? i nievely added a constructor and destructor to my frame, thinking that is what TForm does: TframeEditCustomer = class(TFrame) ... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; ... end; constructor TframeEditCustomer.Create(AOwner: TComponent) begin inherited Create(AOwner); //allocate stuff end; destructor TframeEditCustomer.Destroy; begin //cleanup stuff inherited Destroy; end; The problem with this is that by the time my destructor runs, controls on the frame have been destroyed and are no

Frame inheritance and duplicate files in packages

邮差的信 提交于 2019-12-02 02:13:23
I have been developing a number of components using TFrames and ModelMaker -- I've found the combination of visual design/development + inheritance + ModelMaker to be very compelling. I then register these TFrame descendants w/a registration unit, and they become full-fledges palette-based components from there. I'm using Delphi 2007. Early in my learning about the little "snags" of this process, I found that a number of the problems I would run into with TFrame descendants streaming incorrectly (often appearing as forms in the IDE, rather than frames) could be completely eliminated by

Registering a custom Frame

眉间皱痕 提交于 2019-11-30 14:18:00
问题 In Delphi 2009, In one of my projects, I have a custom frame with some controls on it which I want to use as the base class for some other controls. I want to register this frame as an IDE wizard to be available in New Items list. When I add my newly added item (my custom frame) to a project, I expect it to: Show all the properties and events I added to the custom frame in object inspector. Derive the newly created frame from my custom frame rather than TFrame. Ok, to make it show my

Showing TFrame descendant's additional properties on the object inspector

浪尽此生 提交于 2019-11-29 02:01:43
Delphi object inspector doesn't show TFrame descendants's additional properties by design. People tend to suggest using a known trick which is commonly used for showing TForm descendant's properties on the Object inspector. The trick is: registering custom module for TForm descendants to Delphi IDE via design time package like: RegisterCustomModule(TMyFrame, TCustomModule); The object inspector can show additional properties of the TFrame Descendant's instance with this way but it loses its frame behaviours while it is embedded in a form. Not redesignable, not possible to implement events for

How to improve the use of Delphi Frames

瘦欲@ 提交于 2019-11-28 03:24:11
I've used frames in Delphi for years, and they are one of the most powerful features of the VCL, but standard use of them seems to have some risk such as: It's easy to accidentally move or edit the frame sub-components on a frame's host form without realising that you are 'tweaking' with the frame - I know this does not affect the original frame code, but it's generally not what you would want. When working with the frame you are still exposed to its sub-components for visual editing, even when that frame is years old and should not be touched. So I got to thinking.... Is there a way of

Showing TFrame descendant's additional properties on the object inspector

淺唱寂寞╮ 提交于 2019-11-27 16:17:41
问题 Delphi object inspector doesn't show TFrame descendants's additional properties by design. People tend to suggest using a known trick which is commonly used for showing TForm descendant's properties on the Object inspector. The trick is: registering custom module for TForm descendants to Delphi IDE via design time package like: RegisterCustomModule(TMyFrame, TCustomModule); The object inspector can show additional properties of the TFrame Descendant's instance with this way but it loses its

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