//Widgets
const static char* WDG_DOUBLEVALUE = "doublevalue";
//Widget containers
+const static char* WDG_INFO = "label";
const static char* WDG_GROUP = "groupbox";
const static char* WDG_CHECK_GROUP = "check_groupbox";
const static char* WDG_TOOLBOX = "toolbox";
// doublevalue properties:
+const static char* INFO_WDG_TEXT = FEATURE_TEXT;
+const static char* INFO_WDG_TOOLTIP = FEATURE_TOOLTIP;
const static char* DOUBLE_WDG_MIN = "min";
const static char* DOUBLE_WDG_MAX = "max";
const static char* DOUBLE_WDG_STEP = "step";
<plugin>
<workbench id="Sketch">
<group id="Basic">
- <feature id="Sketch" text="New sketch" tooltip="Create a new sketch or edit an existing sketch" icon=":icons/sketch.png"/>
+ <feature id="Sketch" text="New sketch" tooltip="Create a new sketch or edit an existing sketch" icon=":icons/sketch.png">
+ <label text="Natasha, please provide a text for the label" tooltip="Natasha, please provide a text for the tooltip"/>
+ <!--icon=":pictures/x_point.png"-->
+ </feature>
</group>
</workbench>
</plugin>
theParent->setLayout(aWidgetLay);
}
+QWidget* XGUI_WidgetFactory::labelControl(QWidget* theParent)
+{
+ QWidget* result = new QWidget(theParent);
+ QVBoxLayout* aLabelLay = new QVBoxLayout(result);
+ QLabel* aLabel = new QLabel(result);
+ 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;
+}
+
QWidget* XGUI_WidgetFactory::createWidgetByType(const std::string& theType, QWidget* theParent)
{
QWidget* result = NULL;
if (theType == WDG_DOUBLEVALUE) {
result = doubleSpinBoxControl();
+ } else if (theType == WDG_INFO) {
+ result = labelControl(theParent);
} else if (myWidgetApi->isContainerWidget() || myWidgetApi->isPagedWidget()) {
result = createContainer(theType, theParent);
}
protected:
//Widgets
- QWidget* doubleSpinBoxControl();
QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
+ QWidget* labelControl(QWidget* theParent);
+ QWidget* doubleSpinBoxControl();
QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
- bool connectWidget(QWidget*, const QString&);
+ bool connectWidget(QWidget*, const QString&);
QString qs(const std::string& theStdString) const;
private: