tooltip="Select a face of another object"
shape_types="face"
use_subshapes="true"
+ concealment="true"
/>
+ <!-- In order to avoid automatic closing of operation -->
+ <label id="" label="" internal="1"/>
</source>
ModuleBase_WidgetDoubleValue.h
ModuleBase_WidgetEditor.h
ModuleBase_WidgetFactory.h
-# ModuleBase_WidgetFeature.h
-# ModuleBase_WidgetFeatureOrAttribute.h
ModuleBase_WidgetSwitch.h
ModuleBase_WidgetShapeSelector.h
ModuleBase_IWorkshop.h
ModuleBase_ViewerFilters.h
ModuleBase_ResultPrs.h
ModuleBase_IViewWindow.h
+ ModuleBase_WidgetLabel.h
)
SET(PROJECT_SOURCES
ModuleBase_WidgetDoubleValue.cpp
ModuleBase_WidgetEditor.cpp
ModuleBase_WidgetFactory.cpp
-# ModuleBase_WidgetFeature.cpp
-# ModuleBase_WidgetFeatureOrAttribute.cpp
ModuleBase_WidgetSwitch.cpp
ModuleBase_WidgetShapeSelector.cpp
ModuleBase_WidgetValue.cpp
ModuleBase_WidgetMultiSelector.cpp
ModuleBase_ViewerFilters.cpp
ModuleBase_ResultPrs.cpp
+ ModuleBase_WidgetLabel.cpp
)
SET(PROJECT_LIBRARIES
#include <ModuleBase_Tools.h>
#include <ModuleBase_WidgetLineEdit.h>
#include <ModuleBase_WidgetMultiSelector.h>
+#include <ModuleBase_WidgetLabel.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_Session.h>
theParent->setLayout(aWidgetLay);
}
+
QWidget* ModuleBase_WidgetFactory::labelControl(QWidget* theParent)
{
- 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);
- aLabelLay->addStretch(1);
- result->setLayout(aLabelLay);
- return result;
+ ModuleBase_WidgetLabel* aWgt =
+ new ModuleBase_WidgetLabel(theParent, myWidgetApi, myParentId);
+ myModelWidgets.append(aWgt);
+ return aWgt->getControl();
}
+
QWidget* ModuleBase_WidgetFactory::createWidgetByType(const std::string& theType,
QWidget* theParent)
{
return aDblWgt->getControl();
}
-//QWidget* ModuleBase_WidgetFactory::featureSelectorControl(QWidget* theParent)
-//{
-// ModuleBase_WidgetFeature* aWidget =
-// new ModuleBase_WidgetFeature(theParent, myWidgetApi,myParentId);
-// myModelWidgets.append(aWidget);
-// return aWidget->getControl();
-//}
-
-//QWidget* ModuleBase_WidgetFactory::featureOrAttributeSelectorControl(QWidget* theParent)
-//{
-// ModuleBase_WidgetFeatureOrAttribute* aWidget =
-// new ModuleBase_WidgetFeatureOrAttribute(theParent, myWidgetApi, myParentId);
-// myModelWidgets.append(aWidget);
-// return aWidget->getControl();
-//}
-
QWidget* ModuleBase_WidgetFactory::doubleValueEditor(QWidget* theParent)
{
ModuleBase_WidgetEditor* aWidget =
{
return QString::fromStdString(theStdString);
}
+
QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
QWidget* labelControl(QWidget* theParent);
QWidget* doubleSpinBoxControl(QWidget* theParent);
- //QWidget* featureSelectorControl(QWidget* theParent);
- //QWidget* featureOrAttributeSelectorControl(QWidget* theParent);
QWidget* doubleValueEditor(QWidget* theParent);
QWidget* shapeSelectorControl(QWidget* theParent);
QWidget* booleanControl(QWidget* theParent);
--- /dev/null
+// File: ModuleBase_WidgetLabel.cpp
+// Created: 03 Dec 2014
+// Author: Vitaly SMETANNIKOV
+
+#include "ModuleBase_WidgetLabel.h"
+
+#include <Config_WidgetAPI.h>
+
+#include <QLabel>
+
+
+ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent,
+ const Config_WidgetAPI* theData,
+ const std::string& theParentId)
+ : ModuleBase_ModelWidget(theParent, theData, theParentId)
+{
+ QString aText = QString::fromStdString(theData->getProperty("title"));
+ myLabel = new QLabel(aText, theParent);
+ myLabel->setWordWrap(true);
+ myLabel->setIndent(5);
+}
+
+ModuleBase_WidgetLabel::~ModuleBase_WidgetLabel()
+{
+}
+
+QList<QWidget*> ModuleBase_WidgetLabel::getControls() const
+{
+ return QList<QWidget*>();
+}
+
+QWidget* ModuleBase_WidgetLabel::getControl() const
+{
+ return myLabel;
+}
--- /dev/null
+// File: ModuleBase_WidgetLabel.h
+// Created: 03 Dec 2014
+// Author: Vitaly SMETANNIKOV
+
+#ifndef ModuleBase_WidgetLabel_H
+#define ModuleBase_WidgetLabel_H
+
+#include "ModuleBase.h"
+#include "ModuleBase_ModelWidget.h"
+
+class QLabel;
+
+class MODULEBASE_EXPORT ModuleBase_WidgetLabel : public ModuleBase_ModelWidget
+{
+Q_OBJECT
+ public:
+ ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData,
+ const std::string& theParentId);
+
+ virtual ~ModuleBase_WidgetLabel();
+
+ virtual bool storeValue() const
+ {
+ return true;
+ }
+
+ virtual bool restoreValue()
+ {
+ return true;
+ }
+
+ virtual QList<QWidget*> getControls() const;
+
+ QWidget* getControl() const;
+
+private:
+ QLabel* myLabel;
+};
+
+#endif
\ No newline at end of file