VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
The Palette and Editing Panel

the makVrf::DtAutoHidePanel class the the manager that contains the tabs that show up on the right hand side of the gui and the dialogs they represent.

The makVrf::DtAutoHidePanel manages makVrf::DtAutoHidePanelItem classes that wrap a makVrf::DtAutoHideDock that contains a particular property dialog to display. When creating the initial auto hide panel, the default_guiConfiguration.gui file is used to see this panel

<pagecollection pagecollectionname="DtAutoHidePanel" title="Creation Panel" location="9" visible="True" index="-1" show="EntityCreationPalette" closable="True" floatable="True" movable="True">
<pageitem pageitemname="EntityCreationPalette"/>
<pageitem pageitemname="ORBATCreationPalette"/>
<pageitem pageitemname="TacticalGraphicCreationPalette"/>
<pageitem pageitemname="PropCreationPalette"/>
</pagecollection>

When editing or modifying an object in the simulation, the Object Modifier Dialog Manager is used in conjunction with this class to create a new dock tab and dock widget

DtVrfObjectModifierDialogCreator* thisEntitysDialogCreator = thisEntitysDialogCreationParameters->objectModifierDialogCreator();
if (thisEntitysDialogCreator)
{
// Get the name of the object to be created to set to the Title string
QString title(QObject::tr("Create %1").arg(QString::fromUtf8(findEntityTypeName(thisEntityType).c_str())));
//create the dialog from the creator object
myObjectPropertiesDlg = thisEntitysDialogCreator->create(myDe, qtMainWindow, thisEntityType, title, signalCreate,
DtCreateAndEditObjectDialogInterface::DtCreationMode, Context);
//force dialog to appear when creating specified objects in plans (generally control objects)
bool forceDialogToAppear = ((signalCreate == DtSignalCreationAndStop ) && thisEntitysDialogCreationParameters->forceDialogToAppearInPlans());
// Add the dialog into the autohide panel
//WHD: This can probably be reduced to:
//DtAutoHidePanel::instance(de)->addItem(myObjectPropertiesDlg, forceDialogToAppear);
//myObjectPropertiesDlg->hideDialog();
// since all possible myObjectPropertiesDlg are children of DtAutoHideDock
// and it's hard to conceive of a scenario in which the DE can't return an instance
DtAutoHidePanel* thisAutoHidePanel = DtAutoHidePanel::instance(myDe);
if (thisAutoHidePanel)
{
thisAutoHidePanel->addItem(dynamic_cast<DtAutoHideDock*>(myObjectPropertiesDlg), forceDialogToAppear);
if (!forceDialogToAppear)
{
myObjectPropertiesDlg->hideDialog();
}
}
myObjectPropertiesDlg->setForce(force);
signal_dialogCreated(myObjectPropertiesDlg);
}

All dock widgets assigned to display are of the subclass makVrf::DtAutoHideDock. If you wish to add a new tab to the auto hide panel for functionality you wish to allow the user to select, you can add a an item to the makVrf::DtAutoHidePanel via the addItem call. This will add a new tab to the dock based on your design. Note that title and icon methods of the auto hide dock will be used to fill in the tab

As with other page manipulation, if you wish to remove the palettes from the display, you can either remove them from the gui file or use a plugin to remove them from code (Dock Widget and Toolbar Configuration).


Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)