Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread General component creation question
Sun, Aug 20 2017 4:33 AMPermanent Link

Uli Becker

Hi,

when I created my first components I just combined BasicPanels, Labels,
Images etc. to mimic a Grid e.g. In some of these components quite a big
number of such controls was used.

Meanwhile I learnt how to create "native" components using
elements/interfaces instead. I'm sure the latter is the cleaner and
better way to create components, but to be honest: I don't see a
remarkable difference as of performance e.g..

Thus my question: Before rewriting all the older components: how
"expensive" is the first approach compared with the second one (loading
time, RAM, performance)?

Thanks Uli
Tue, Aug 22 2017 3:44 AMPermanent Link

Uli Becker

Correction:
I finished my work on a quite complex component and yes: it's a lot
faster than the old component.

Uli
Tue, Aug 22 2017 11:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Thus my question: Before rewriting all the older components: how "expensive" is the first approach compared with the second one (loading time, RAM, performance)? >>

The key point in such a decision is this:

Does the "element" that needs to be embedded within the control simple or is it complex and need to handle user interaction events, etc. ?

If the former, then use a straight element.  If the latter, then embed an existing control.

For example, labels can almost always just be converted to using elements instead of a TLabel control.  But, you'll notice that in controls like the TPagePanel control, I use actual button controls because I need to intercept click events, etc. and any TControl-descendants automatically perform the dispatching of such events for you so that you only need to override the DoClick method, etc.

Hope that helps,

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Aug 22 2017 11:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

That should read:

Is the "element" that needs to be embedded within the control simple or is it complex and need to handle user interaction events, etc. ?

(not does)...

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Aug 22 2017 12:00 PMPermanent Link

Uli Becker

Tim,

> If the former, then use a straight element.  If the latter, then embed an existing control.
> ...
> Hope that helps,

Yes, that helps indeed. Thanks.

Uli
Image