Virtual controls
Virtual controls are controls, that automatically pop up in the work area (right side of the application) when selecting an entry in the application tree. The control to be shown on the work area depends on the complex data type of the instance selected in the tree. Thus, defining a virtual control in the work area (here virtual_edit ) will automatically look for virtual_edit controls in the class of the selected instance and in its base classes.
By initializing the class with the _TPL_VirtualTab template, the preconditions for implementing virtual tab controls are given. The project tree requires a virtual control with the name virtual_edit . The template also initializes an Edit window, which will be displayed when selecting edit from the context menu in a list or tree. The virtual edit control refers to a tools_edit control, which provides a toolbar for the tab control referenced below. Even though the control is rather complex, the only thing to do is to design three controls.
Each tab_edit controls contains a static area (e.g. Person ::edit_static ), which will be displayed on each tab level. The first tab page shows the object's properties ( Person ::edit_properties ) and the second tab shows references ( Person ::edit_references ). In order to make data visible, those three controls should be designed or removed. The tools_edit control also defines a window toolbar, which might be updated or removed. Some additional ...frame controls have been added, which are necessary for technical reasons.
In order to disable elements (e.g. the edit_static control in the tab_edit control, you only need to switch off the Auto-open option after switching to the Properties view) (see also Standard application elements ).
Unfortunately, this feature is not yet fully implemented, i.e. there is still a small interface necessary. Thus, a context class has to be defined for the tree (in this case cStdProjectTree , which implements a doAfterSelect() handler. This handler still requires three lines of code in order to inform the work area about the change in the tree selection. In the initialized database, there you will find the cStdProjectTree context class, which provides an corresponding doAfterSelect() handler.