OWLNext 7.0
Borland's Object Windows Library for the modern age
|
If you do not construct child-window objects in their parent window object's constructor, they will not be automatically created and displayed when the parent is.
You can then create them yourself using TWindow::Create() or, in the case of modal dialog boxes, Execute. In this context, creating means instantiating an interface element.
For example, suppose you have two buttons displayed when the main window is created, one labeled Show and the other labeled Hide. When the user presses the Show button, you want to display a third button labeled Transfer. When the user presses the Hide button, you want to remove the Transfer button:
The call to DisableAutoCreate in the constructor prevents the Transfer button from being displayed when TTestWindow is created. The conditional tests in the EvButton1 and EvButton2 functions work by testing the validity of the HWindow data member of the button3 interface object; if the Transfer button is already being displayed, EvButton1 does not try to display it again, and EvButton2 does not try to destroy the Transfer button if it is not being displayed.