Sign in Join

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

Mailing lists / lazarus / 2013-01

Components

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Antonio Fortuny

Hi All.

I'm building new components. I've made my first one, installed it and used it. So far so good.
I'm trying not to give to the component default sizes and I can(t figure out how this can be done. To be more precise, I inherit from a TCustomPanel to which I wold like to add some more properties and methods. I'd like also to give default sizes which are far from those of a TCustomPanel.
I've used

   Height := 25;
   Width := 75;

in the overridden creator and

   with GetControlClassDefaultSize do
     SetInitialBounds(0, 0, 75, 25);

without success. My new component works as expected anyway.

Did I miss something ?

Antonio.

Reply by email

Mattias Gaertner
to Antonio Fortuny: Hi All. I'm building new components. I've made my first one, installed it and used it. So…

Antonio Fortuny hat am 14. Januar 2013 um 14:24
geschrieben:

Show quoted text 13 lines
Hi All. I'm building new components. I've made my first one, installed it and used it. So far so good. I'm trying not to give to the component default sizes and I can(t figure out how this can be done. To be more precise, I inherit from a TCustomPanel to which I wold like to add some more properties and methods. I'd like also to give default sizes which are far from those of a TCustomPanel. I've used Height := 25; Width := 75; in the overridden creator and

Should work, except with AutoSize. SetInitialBounds does the same but with less overhead.

with GetControlClassDefaultSize do SetInitialBounds(0, 0, 75, 25);

Note: The "with" has no effect.
SetInitialBounds should work. For AutoSize you need more.

without success. My new component works as expected anyway. Did I miss something ?

For AutoSize you can override

GetControlClassDefaultSize.

Mattias

Reply by email