Re: Hide non-visual components



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




.



Relevant Pages

  • Re: Forms, subforms, and tab control
    ... about adding a tab control to an existing form.... ... If you draw the tab control on top of existing form controls, ... Drag the subform from the database window to the tab page. ... and downloaded the Contacts Management template from the MS Access ...
    (microsoft.public.access.forms)
  • Re: SysTabControl32 class
    ... I am now thinking that since SETCURSEL doesnt work and clicking the tab ... other controls off the tabcontrol, ... at deal with the tab control and the child controls separately. ... I would call it the "frame approach". ...
    (microsoft.public.vb.winapi)
  • Re: SSTab -- How to disable/enable an option button from a different tab.
    ... I was resetting control properties in the ssTab ... The code disables controls that are not on the current tab. ... Command2 toggles the display of the Frame ON/OFF ...
    (microsoft.public.vb.controls)
  • Re: Tab Control Background and Windows Theme
    ... article in the Access/VB advisor magazine on how to create your own tab ... Advisor magazine still holds the copyright, so I an unable to produce it ... His sample database seems to have "Use Windows themed controls" ...
    (microsoft.public.access.forms)
  • Re: delete unneccesary tabs
    ... AllInfo record source table in some way, then a subform is ... subform to be on a tab page, ... The unbound controls are probably being used to filter the ... connect the event to the event procedure, ...
    (microsoft.public.access.formscoding)