+ if (alignToTop)
+ thePage->alignToTop();
+}
+
+void ModuleBase_WidgetFactory::createPanel(ModuleBase_PageBase* thePage,
+ const FeaturePtr& theFeature)
+{
+ std::string aPanelName = myWidgetApi->getProperty(PROPERTY_PANEL_ID);
+ if (!aPanelName.empty() && ModuleBase_WidgetCreatorFactory::get()->hasPanelWidget(aPanelName)) {
+ QWidget* aPanel = ModuleBase_WidgetCreatorFactory::get()->createPanelByType(aPanelName,
+ thePage->pageWidget(), theFeature);
+ thePage->addWidget(aPanel);
+ thePage->alignToTop();
+ }
+}
+
+void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage,
+ const std::string& theWidgetId)
+{
+ bool aFound = false;
+ moveToWidgetId(theWidgetId, aFound);
+ if (aFound) {
+ std::string aWdgType = myWidgetApi->widgetType();
+
+ // Create a ModelWidget
+ ModuleBase_ModelWidget* aWidget = createWidgetByType(aWdgType, thePage->pageWidget());
+ if (aWidget) {
+ if (!myWidgetApi->getBooleanAttribute(ATTR_INTERNAL, false)) {
+ thePage->addModelWidget(aWidget);
+ }
+ else {
+ aWidget->setVisible(false);
+ }
+ }
+ }