Re: Hide non-visual components
- From: "Shane Stump" <ShaneStumpNOSPAM@xxxxxxxxxxxxx>
- Date: Fri, 7 Apr 2006 00:07:31 -0500
That is pretty close to how I do it. I have several base classes that handle
quite a bit of the defaults and my base "parent dialog" class or View class
(a form that is non-modal), interact with all child forms via properties /
virtual methods. Now only is it easier to maintain, it allows new features
to be added to a product very quickly.
Best Regards,
Shane
www.StumpWare.com
"Roger Lascelles" <rogerlasAToptusnet.com.au> wrote in message
news:4435effa@xxxxxxxxxxxxxxxxxxxxxxxxx
"Shane Stump" <ShaneStumpNOSPAM@xxxxxxxxxxxxx> wrote in message
news:443586f9@xxxxxxxxxxxxxxxxxxxxxxxxx
The forms are child forms that get inserted into my "dialog" form in the
dialog's constructor; that is,
void __fastcall TDialog::TDialog(TComponent * pOwner)
{
new TChildForm(pTabSheet,this);
}
Once you have separate forms, you can give each form properties and
methods
which access it in a clean way, and the code gets more maintainable &
better
quality. You never touch the individual controls on each form, just use
properties and methods you added to the form. The form which holds the
tab
control can do any synchronism work, like telling a form it now is showing
or not showing. After adding each form to the tabsheet, you can
initialise
any outside data references it may need - e.g. shared database objects,
global data and classes.
You can have initialisation functions, which give each form the data it
needs, and lets the individual form handle setting up controls, etc. Nice
and modular. This lets you add a new form (tab) any time, without
breaking
the old code. Often an application is open ended, and you keep adding
forms
each time the customer wants some more. Common in engineering software
where you start interfacing to a device on a basic level, then keep adding
tabs as the device itself is developed. You end up with a set of tabs
which
let you communicate with and test the device at low and high level.
The alternative to separate forms is to at least have a naming convention
where the name of each control starts with its parent's name.
I think it would be very hard to maintain 15 big tabbed pages full of
controls any other way.
Roger Lascelles
.
- References:
- Hide non-visual components
- From: Don Strenczewilk
- Re: Hide non-visual components
- From: OBones
- Re: Hide non-visual components
- From: Don Strenczewilk
- Re: Hide non-visual components
- From: John Herbster
- Re: Hide non-visual components
- From: Don Strenczewilk
- Re: Hide non-visual components
- From: Shane Stump
- Re: Hide non-visual components
- From: Don Strenczewilk
- Re: Hide non-visual components
- From: Shane Stump
- Re: Hide non-visual components
- From: John E. Wilfong
- Re: Hide non-visual components
- From: Shane Stump
- Re: Hide non-visual components
- From: Roger Lascelles
- Hide non-visual components
- Prev by Date: Re: Hide non-visual components
- Next by Date: Re: Hide non-visual components
- Previous by thread: Re: Hide non-visual components
- Next by thread: Re: Hide non-visual components
- Index(es):
Relevant Pages
|