*/
#include <ModuleBase_WidgetFactory.h>
+#include <ModuleBase_IconFactory.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_OperationDescription.h>
#include <ModuleBase_WidgetEditor.h>
#include <ModuleBase_WidgetSwitch.h>
#include <ModuleBase_WidgetShapeSelector.h>
+#include <ModuleBase_WidgetFeatureSelector.h>
#include <ModuleBase_WidgetDoubleValue.h>
#include <ModuleBase_WidgetIntValue.h>
#include <ModuleBase_WidgetBoolValue.h>
#include <ModuleBase_Tools.h>
#include <ModuleBase_WidgetLineEdit.h>
#include <ModuleBase_WidgetMultiSelector.h>
+#include <ModuleBase_WidgetConcealedObjects.h>
#include <ModuleBase_WidgetLabel.h>
-#include <ModuleBase_WidgetErrorLabel.h>
#include <ModuleBase_WidgetToolbox.h>
#include <ModuleBase_PageBase.h>
#include <ModuleBase_PageGroupBox.h>
-#include <ModuleBase_WidgetCheckGroupBox.h>
+#include <ModuleBase_WidgetOptionalBox.h>
#include <ModuleBase_PageWidget.h>
#include <ModuleBase_WidgetExprEditor.h>
#include <ModuleBase_WidgetCreatorFactory.h>
+#include <ModuleBase_WidgetAction.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_Session.h>
delete myWidgetApi;
}
-void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage)
+void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage, bool alignToTop)
{
std::string aWType = myWidgetApi->widgetType();
if (aWType == NODE_FEATURE) {
ModuleBase_PageBase* aPage = new ModuleBase_PageWidget(aWidget);
createWidget(aPage);
if (aWdgType == WDG_SWITCH || aWdgType == WDG_TOOLBOX) {
- ModuleBase_PagedContainer* aContainer = qobject_cast<ModuleBase_PagedContainer*>(aWidget);
+ ModuleBase_PagedContainer* aContainer =
+ qobject_cast<ModuleBase_PagedContainer*>(aWidget);
QString anIconPath = qs( myWidgetApi->getProperty( CONTAINER_PAGE_ICON ) );
- QPixmap anIcon( anIconPath );
+ QPixmap anIcon = ModuleBase_IconFactory::loadPixmap( anIconPath );
aContainer->addPage( aPage, aPageName, aCaseId, anIcon );
}
} while (myWidgetApi->toNextWidget());
}
} while (myWidgetApi->toNextWidget());
- thePage->alignToTop();
+ if (alignToTop)
+ thePage->alignToTop();
}
void ModuleBase_WidgetFactory::createPanel(ModuleBase_PageBase* thePage,
if (aFound) {
theTitle = QString::fromStdString(myWidgetApi->widgetLabel()).toStdString().c_str();
if (theTitle.empty())
- theTitle = QString::fromStdString(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)).toStdString().c_str();
+ theTitle =
+ QString::fromStdString(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)).toStdString().c_str();
}
}
aPage->setTitle(aGroupName);
aResult = aPage;
}
- else if (theType == WDG_CHECK_GROUP) {
- QString aGroupName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME));
- ModuleBase_WidgetCheckGroupBox* aPage = new ModuleBase_WidgetCheckGroupBox(theParent,
+ else if (theType == WDG_OPTIONALBOX) {
+ ModuleBase_WidgetOptionalBox* aPage = new ModuleBase_WidgetOptionalBox(theParent,
myWidgetApi);
- aPage->setTitle(aGroupName);
aResult = aPage;
}
if (!aResult)
if (theType == WDG_INFO) {
result = new ModuleBase_WidgetLabel(theParent, myWidgetApi);
- } else if (theType == WDG_ERRORINFO) {
- result = new ModuleBase_WidgetErrorLabel(theParent, myWidgetApi);
} else if (theType == WDG_DOUBLEVALUE) {
result = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi);
} else if (theType == WDG_INTEGERVALUE) {
result = new ModuleBase_WidgetIntValue(theParent, myWidgetApi);
} else if (theType == WDG_SHAPE_SELECTOR) {
result = new ModuleBase_WidgetShapeSelector(theParent, myWorkshop, myWidgetApi);
+ } else if (theType == WDG_FEATURE_SELECTOR) {
+ result = new ModuleBase_WidgetFeatureSelector(theParent, myWorkshop, myWidgetApi);
} else if (theType == WDG_BOOLVALUE) {
result = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi);
//} else if (theType == WDG_DOUBLEVALUE_EDITOR) {
result = new ModuleBase_WidgetExprEditor( theParent, myWidgetApi, aPlaceHolder );
} else if (theType == WDG_MULTISELECTOR) {
result = new ModuleBase_WidgetMultiSelector(theParent, myWorkshop, myWidgetApi);
+ } else if (theType == WDG_CONCEALED_OBJECTS_VIEW) {
+ result = new ModuleBase_WidgetConcealedObjects(theParent, myWidgetApi);
} else if (theType == WDG_TOOLBOX) {
result = new ModuleBase_WidgetToolbox(theParent, myWidgetApi);
} else if (theType == WDG_SWITCH) {
theType == NODE_VALIDATOR) {
// Do nothing for "box" and "case"
result = NULL;
+ } else if (theType == WDG_ACTION) {
+ result = new ModuleBase_WidgetAction(theParent, myWidgetApi);
} else {
result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi);
if (!result)