Watch, Follow, &
Connect with Us

Welcome, Guest
Guest Settings
Help

Thread: How to Compact Forms into a Component or library


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 17, 2017 11:04 PM Last Post By: Peter Below Threads: [ Previous | Next ]
Robert Kondner

Posts: 44
Registered: 11/15/01
How to Compact Forms into a Component or library  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 17, 2017 3:46 PM
Hi,

I have a couple of VCL forms (Delphi 10.1, Generating 32 bit apps VCL) that play together forming a little special purpose editor. (For electronic components.)

I would like to wrap these all together into an easy to use component of library, any suggestions on where to view options?

Yes, the code is a little bit of a mess, a couple global variables, there are a few simple global functions. I can clean that up but can the existing mess be "Containerized" into something now?

I have played with building component in the past but I recall you really need to get debugging done prior to that, is that correct?

Thanks,
Bob K.
Peter Below

Posts: 1,080
Registered: 12/16/99
Re: How to Compact Forms into a Component or library  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 17, 2017 11:04 PM   in response to: Robert Kondner in response to: Robert Kondner
Robert Kondner wrote:

Hi,

I have a couple of VCL forms (Delphi 10.1, Generating 32 bit apps
VCL) that play together forming a little special purpose editor. (For
electronic components.)

I would like to wrap these all together into an easy to use component
of library, any suggestions on where to view options?

Yes, the code is a little bit of a mess, a couple global variables,
there are a few simple global functions. I can clean that up but can
the existing mess be "Containerized" into something now?

I have played with building component in the past but I recall you
really need to get debugging done prior to that, is that correct?

It all depends on whether you want to be able to drop this "editor"
onto a container and configure it at design-time or would be happy with
creating it at run-time in code.

To be able to use existing forms at design-time you have basically two
options:

1. You can create a skeleton project and add it to the repository as a
template you can then base new projects on. This is an underdocumented
feature I never used myself, so know little about it. It would work
like the stock projects you see in the Delphi repository dialog, e.g.
for a MDI application. When you create a new project based on such a
template the IDE copies all forms/units that are part of the template
and you can save them under new names into a new folder.

2. Create a wrapper TComponent descendent that you install into a
design-time package and register it with the IDE. The component would
offer properties you need to configure the form set at design-time and
methods to create an instance of this "editor" and interact with it
from code at run-time. If possible avoid creating the actual editor at
design-time, that only complicates matters a lot since that code runs
in the RAD Studio process and can destabilize it if it is buggy.

Yes, you should make sure the component works properly before you
install it, but that can be done easily in a test project where you
create an instance of the component in code at run-time.


--
Peter Below
TeamB

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02