Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

Form always 400 x 300 initially

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Phil Hess

In my TCustomForm-based design control, I would like it to have an initial size of my choosing rather than the default 400 wide, 300 high. It appears as though these values are hardwired in the FormEditor1.CreateComponent call in TMainIDE.CreateNewForm, ignoring anything that I set Width or Height to. All other properties that I set in my constructor are honored, just not these.

Any workaround for this?

Thanks.

-Phil

Reply by email

Matt Shaffer
to Phil Hess

I'm guessing then that setting the width and height OnCreate won't work because that's where they're overridden; a very messy solution would be to set a TTimer to 5ms or so and then change the width.

Phil Hess wrote 19 lines
In my TCustomForm-based design control, I would like it to have an initial size of my choosing rather than the default 400 wide, 300 high. It appears as though these values are hardwired in the FormEditor1.CreateComponent call in TMainIDE.CreateNewForm, ignoring anything that I set Width or Height to. All other properties that I set in my constructor are honored, just not these. Any workaround for this? Thanks. -Phil -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091217/814d2ac8/attachment-0001.html>

Reply by email

Phil Hess

Correct, does not work when TMyForm is registered with IDE via FormEditingHook.RegisterDesignerBaseClass.

Thanks.

-Phil

----- "Bart" wrote 21 lines
You mean that this does not work? TMyForm = class(TCustomForm) public constructor Create(AOwner: TComponent); override; end; consructor TMyForm.Create(AOwner: TComponent); begin inherited Create(AOwner); Width := 640; Height := 480; end; Bart -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Phil Hess: In my TCustomForm-based design control, I would like it to have an initial size of my…
In my TCustomForm-based design control, I would like it to have an initial size of my choosing rather than the default 400 wide, 300 high. It appears as though these values are hardwired in the FormEditor1.CreateComponent call in TMainIDE.CreateNewForm, ignoring anything that I set Width or Height to. All other properties that I set in my constructor are honored, just not these. Any workaround for this?

The IDE now uses the default width/height.

Mattias

Reply by email

Phil Hess
to Mattias Gaertner

Many thanks. Now works fine.

-Phil

----- "Mattias Gaertner" wrote 21 lines
On 17 Dec 2009 18:40:13 -0000 Phil Hess wrote: > In my TCustomForm-based design control, I would like it to have an initial size of my choosing rather than the default 400 wide, 300 high. It appears as though these values are hardwired in the FormEditor1.CreateComponent call in TMainIDE.CreateNewForm, ignoring anything that I set Width or Height to. All other properties that I set in my constructor are honored, just not these. > > Any workaround for this? The IDE now uses the default width/height. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email