#include <ModuleBase_WidgetSelector.h>
#include <ModuleBase_WidgetDoubleValue.h>
#include <ModuleBase_WidgetBoolValue.h>
+#include <ModuleBase_WidgetPoint2dDistance.h>
#include <Config_Keywords.h>
#include <Config_WidgetAPI.h>
//Create a widget (doublevalue, groupbox, toolbox, etc.
QWidget* aWidget = createWidgetByType(aWdgType, theParent);
if (aWidget) {
- aWidgetLay->addWidget(aWidget);
+ if (!isInternalWidget(aWdgType)) {
+ aWidgetLay->addWidget(aWidget);
+ }
+ else
+ aWidget->setVisible(false);
}
if (myWidgetApi->isContainerWidget()) {
//if current widget is groupbox (container) process it's children recursively
QWidget* result = new QWidget(theParent);
QVBoxLayout* aLabelLay = new QVBoxLayout(result);
QLabel* aLabel = new QLabel(result);
+ aLabel->setWordWrap(true);
aLabel->setText(qs(myWidgetApi->getProperty(INFO_WDG_TEXT)));
aLabel->setToolTip(qs(myWidgetApi->getProperty(INFO_WDG_TOOLTIP)));
aLabelLay->addWidget(aLabel);
} else if (theType == WDG_DOUBLEVALUE_EDITOR) {
result = doubleValueEditor(theParent);
+
+ } else if (theType == WDG_POINT2D_DISTANCE) {
+ result = point2dDistanceControl(theParent);
}
else if (myWidgetApi->isContainerWidget() || myWidgetApi->isPagedWidget()) {
return QString::fromStdString(theStdString);
}
+bool ModuleBase_WidgetFactory::isInternalWidget(const std::string& theType)
+{
+ std::string prop = myWidgetApi->getProperty(FEATURE_INTERNAL);
+
+ std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower);
+ if(prop.empty() || prop == "false" || prop == "0") {
+ return false;
+ }
+ return true;
+}
QWidget* ModuleBase_WidgetFactory::selectorControl(QWidget* theParent)
{
myModelWidgets.append(aBoolWgt);
return aBoolWgt->getControl();
+}
+
+
+QWidget* ModuleBase_WidgetFactory::point2dDistanceControl(QWidget* theParent)
+{
+ ModuleBase_WidgetPoint2dDistance* aDistWgt = new ModuleBase_WidgetPoint2dDistance(theParent, myWidgetApi);
+ myModelWidgets.append(aDistWgt);
+
+ return aDistWgt->getControl();
}
\ No newline at end of file