ModuleBase_ModelWidget does not use theParentId parameter.
It is removed to avoid having this parameter in createWidgetByType method
of WidgetCreator
/// \param theMenu a popup menu to be shown in the viewer\r
/// \param theStdActions a map of standard actions\r
/// \return true if items are added and there is no necessity to provide standard menu\r
- virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const { return false; }\r
+ virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const\r
+ { return false; }\r
\r
/// Add menu items for object browser into the given menu\r
/// \param theMenu a popup menu to be shown in the object browser\r
/// \param theType a type of widget\r
/// \param theParent the parent object\r
/// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from\r
- /// \param theParentId is Id of a parent of the current attribute\r
virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,\r
- Config_WidgetAPI* theWidgetApi, std::string theParentId)\r
+ Config_WidgetAPI* theWidgetApi)\r
{\r
return 0;\r
}\r
/// Create page by its type
/// \param theType a type
/// \param theParent a parent widget
+ /// \param theData a low-level API for reading xml definitions of widgets
virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
QWidget* theParent,
- Config_WidgetAPI* theWidgetApi,
- std::string theParentId) = 0;
+ Config_WidgetAPI* theWidgetApi) = 0;
/// Create widget by its type
- /// \param theType a type
- /// \param theParent a parent widget
+ /// \param theType a type
+ /// \param theParent a parent widget
+ /// \param theData a low-level API for reading xml definitions of widgets
virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
QWidget* theParent,
Config_WidgetAPI* theWidgetApi,
- std::string theParentId,
ModuleBase_IWorkshop* theWorkshop) = 0;
};
//#define DEBUG_VALUE_STATE
ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
+ const Config_WidgetAPI* theData)
: QWidget(theParent),
- myParentId(theParentId),
myIsEditing(false),
myState(Stored),
myIsValueStateBlocked(false)
ModifiedInViewer, /// modification performed by viewer events
Reset }; /// the value is reset
- /// Constructor
+ /// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ /// \param theData a low-level API for reading xml definitions of widgets
+ ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData);
/// Destructor
virtual ~ModuleBase_ModelWidget()
{
return myAttributeID;
}
- /// Returns the parent of the attribute
- /// \returns the string value
- std::string parentID() const
- {
- return myParentId;
- }
-
/// \return Current feature
FeaturePtr feature() const
{
/// The attribute name of the model feature
std::string myAttributeID;
- /// Name of parent
- std::string myParentId;
-
/// A feature which is processing by active operation
FeaturePtr myFeature;
#include <QVBoxLayout>
-ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_ModelWidget(theParent, theData, theParentId),
+ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData),
myIsFocusOnCurrentPage(false)
{
// it is not obligatory to be ignored when property panel tries to activate next active widget
/// A constructor
/// \param theParent a parent widget
/// \param theData a data of the widget
- /// \param theParentId an Id of the parent object
- ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_PagedContainer();
/// Add a new page
#include <QCheckBox>
ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData)
{
QString aText = QString::fromStdString(theData->widgetLabel());
QString aToolTip = QString::fromStdString(theData->widgetTooltip());
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetBoolValue();
#include <QList>
ModuleBase_WidgetCheckGroupBox::ModuleBase_WidgetCheckGroupBox(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_ModelWidget(theParent, theData, theParentId),
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData),
ModuleBase_PageBase()
{
QString aToolTip = QString::fromStdString(theData->widgetTooltip());
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetCheckGroupBox();
void setTitle(const QString& theTitle);
ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId), myCombo(0), myButtons(0)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData), myCombo(0), myButtons(0)
{
QHBoxLayout* aLayout = new QHBoxLayout(this);
ModuleBase_Tools::adjustMargins(aLayout);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetChoice();
}
ModuleBase_PageBase* ModuleBase_WidgetCreatorFactory::createPageByType(
- const std::string& theType, QWidget* theParent,
- Config_WidgetAPI* theWidgetApi, std::string theParentId)
+ const std::string& theType, QWidget* theParent,
+ Config_WidgetAPI* theWidgetApi)
{
ModuleBase_PageBase* aPage = 0;
if (myPageToCreator.contains(theType)) {
WidgetCreatorPtr aCreator = myPageToCreator[theType];
- aPage = aCreator->createPageByType(theType, theParent, theWidgetApi, theParentId);
+ aPage = aCreator->createPageByType(theType, theParent, theWidgetApi);
}
return aPage;
ModuleBase_ModelWidget* ModuleBase_WidgetCreatorFactory::createWidgetByType(
- const std::string& theType, QWidget* theParent,
- Config_WidgetAPI* theWidgetApi, std::string theParentId,
- ModuleBase_IWorkshop* theWorkshop)
+ const std::string& theType, QWidget* theParent,
+ Config_WidgetAPI* theWidgetApi,
+ ModuleBase_IWorkshop* theWorkshop)
{
ModuleBase_ModelWidget* aWidget = 0;
if (myCreators.contains(theType)) {
WidgetCreatorPtr aCreator = myCreators[theType];
- aWidget = aCreator->createWidgetByType(theType, theParent, theWidgetApi, theParentId,
- theWorkshop);
+ aWidget = aCreator->createWidgetByType(theType, theParent, theWidgetApi, theWorkshop);
}
return aWidget;
/// \param theParent a parent widget
ModuleBase_PageBase* createPageByType(const std::string& theType,
QWidget* theParent,
- Config_WidgetAPI* theWidgetApi,
- std::string theParentId);
+ Config_WidgetAPI* theWidgetApi);
/// Create widget by its type
/// \param theType a type
ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
QWidget* theParent,
Config_WidgetAPI* theWidgetApi,
- std::string theParentId,
ModuleBase_IWorkshop* theWorkshop);
private:
#endif
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+ : ModuleBase_ModelWidget(theParent, theData)
{
QFormLayout* aControlLay = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aControlLay);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent structure (widget, operation, group)
- ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetDoubleValue();
#include <QLayout>
ModuleBase_WidgetEditor::ModuleBase_WidgetEditor(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId),
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetDoubleValue(theParent, theData),
myXPosition(-1), myYPosition(-1)
{
}
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData);
/// Constructor
/// \param theParent the parent object
/// \param theAttribute The attribute of the model widget
#include <QEvent>
ModuleBase_WidgetErrorLabel::ModuleBase_WidgetErrorLabel(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetLabel(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetLabel(theParent, theData)
{
myDefaultStyle = myLabel->styleSheet();
myLabel->setContentsMargins(0,0,0,4);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetErrorLabel(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string & theParentId);
+ ModuleBase_WidgetErrorLabel(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetErrorLabel();
ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder )
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+: ModuleBase_ModelWidget(theParent, theData)
{
QVBoxLayout* aMainLay = new QVBoxLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
/// \param thePlaceHolder a placeholder string
ModuleBase_WidgetExprEditor( QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder );
virtual ~ModuleBase_WidgetExprEditor();
void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage)
{
- myParentId = myWidgetApi->widgetId();
if (!myWidgetApi->toChildWidget())
return;
if (!theAttributeId.empty())
return;
- myParentId = myWidgetApi->widgetId();
if (!myWidgetApi->toChildWidget())
return;
if (theFound)
return;
- myParentId = myWidgetApi->widgetId();
if (!myWidgetApi->toChildWidget())
return;
else if (theType == WDG_CHECK_GROUP) {
QString aGroupName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME));
ModuleBase_WidgetCheckGroupBox* aPage = new ModuleBase_WidgetCheckGroupBox(theParent,
- myWidgetApi, myParentId);
+ myWidgetApi);
aPage->setTitle(aGroupName);
aResult = aPage;
}
if (!aResult)
aResult = ModuleBase_WidgetCreatorFactory::get()->createPageByType(theType, theParent,
- myWidgetApi, myParentId);
+ myWidgetApi);
ModuleBase_ModelWidget* aWidget = dynamic_cast<ModuleBase_ModelWidget*>(aResult);
if (aWidget)
ModuleBase_ModelWidget* result = NULL;
if (theType == WDG_INFO) {
- result = new ModuleBase_WidgetLabel(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetLabel(theParent, myWidgetApi);
} else if (theType == WDG_ERRORINFO) {
- result = new ModuleBase_WidgetErrorLabel(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetErrorLabel(theParent, myWidgetApi);
} else if (theType == WDG_DOUBLEVALUE) {
- result = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetDoubleValue(theParent, myWidgetApi);
} else if (theType == WDG_INTEGERVALUE) {
- result = new ModuleBase_WidgetIntValue(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetIntValue(theParent, myWidgetApi);
} else if (theType == WDG_SHAPE_SELECTOR) {
- result = new ModuleBase_WidgetShapeSelector(theParent, myWorkshop, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetShapeSelector(theParent, myWorkshop, myWidgetApi);
} else if (theType == WDG_BOOLVALUE) {
- result = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetBoolValue(theParent, myWidgetApi);
//} else if (theType == WDG_DOUBLEVALUE_EDITOR) {
- // result = new ModuleBase_WidgetEditor(theParent, myWidgetApi, myParentId);
+ // result = new ModuleBase_WidgetEditor(theParent, myWidgetApi);
} else if (theType == WDG_FILE_SELECTOR) {
- result = new ModuleBase_WidgetFileSelector(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetFileSelector(theParent, myWidgetApi);
} else if (theType == WDG_CHOICE) {
- result = new ModuleBase_WidgetChoice(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetChoice(theParent, myWidgetApi);
} else if (theType == WDG_STRINGVALUE) {
std::string aPlaceHolder = myWidgetApi->getProperty( WDG_PLACE_HOLDER );
- result = new ModuleBase_WidgetLineEdit( theParent, myWidgetApi, myParentId, aPlaceHolder );
+ result = new ModuleBase_WidgetLineEdit( theParent, myWidgetApi, aPlaceHolder );
} else if (theType == WDG_EXPR_EDITOR) {
std::string aPlaceHolder = myWidgetApi->getProperty( WDG_PLACE_HOLDER );
- result = new ModuleBase_WidgetExprEditor( theParent, myWidgetApi, myParentId, aPlaceHolder );
+ result = new ModuleBase_WidgetExprEditor( theParent, myWidgetApi, aPlaceHolder );
} else if (theType == WDG_MULTISELECTOR) {
- result = new ModuleBase_WidgetMultiSelector(theParent, myWorkshop, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetMultiSelector(theParent, myWorkshop, myWidgetApi);
} else if (theType == WDG_TOOLBOX) {
- result = new ModuleBase_WidgetToolbox(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetToolbox(theParent, myWidgetApi);
} else if (theType == WDG_SWITCH) {
- result = new ModuleBase_WidgetSwitch(theParent, myWidgetApi, myParentId);
+ result = new ModuleBase_WidgetSwitch(theParent, myWidgetApi);
} else if (theType == WDG_TOOLBOX_BOX || theType == WDG_SWITCH_CASE ||
theType == NODE_VALIDATOR) {
// Do nothing for "box" and "case"
result = NULL;
} else {
- result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi, myParentId);
+ result = myWorkshop->module()->createWidgetByType(theType, theParent, myWidgetApi);
if (!result)
result = ModuleBase_WidgetCreatorFactory::get()->createWidgetByType(theType, theParent,
- myWidgetApi, myParentId, myWorkshop);
+ myWidgetApi, myWorkshop);
#ifdef _DEBUG
if (!result) {
qDebug("ModuleBase_WidgetFactory::fillWidget: find bad widget type %s", theType.c_str());
/// List of created model widgets
QList<ModuleBase_ModelWidget*> myModelWidgets;
-
- /// Id of current parent
- std::string myParentId;
};
#endif /* ModuleBase_WidgetFactory_H_ */
#include <string>
ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData)
{
myTitle = QString::fromStdString(theData->getProperty("title"));
myType = (theData->getProperty("type") == "save") ? WFS_SAVE : WFS_OPEN;
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetFileSelector(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetFileSelector();
virtual QList<QWidget*> getControls() const;
#endif
ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData)
{
QFormLayout* aControlLay = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aControlLay);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent structure (widget, operation, group)
- ModuleBase_WidgetIntValue(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetIntValue(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetIntValue();
ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData)
{
QString aText = QString::fromStdString(theData->getProperty("title"));
myLabel = new QLabel(aText, theParent);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetLabel();
ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder )
- : ModuleBase_ModelWidget(theParent, theData, theParentId)
+: ModuleBase_ModelWidget(theParent, theData)
{
QFormLayout* aMainLay = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration.
- /// \param theParentId is Id of a parent of the current attribute
/// \param thePlaceHolder a string of placeholder
ModuleBase_WidgetLineEdit( QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder );
virtual ~ModuleBase_WidgetLineEdit();
ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId),
- mySelectionCount(0)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetSelector(theParent, theWorkshop, theData),
+ mySelectionCount(0)
{
QGridLayout* aMainLay = new QGridLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetMultiSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetMultiSelector();
/// Returns list of widget controls
ModuleBase_WidgetSelector::ModuleBase_WidgetSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetValidated(theParent, theWorkshop, theData)
{
}
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetSelector();
ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetSelector(theParent, theWorkshop, theData)
{
QFormLayout* aLayout = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aLayout);
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetShapeSelector();
#include <QStackedLayout>
#include <QVBoxLayout>
-ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_PagedContainer(theParent, theData, theParentId)
+ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData)
+: ModuleBase_PagedContainer(theParent, theData)
{
QVBoxLayout* aMainLay = new QVBoxLayout(this);
//aMainLay->setContentsMargins(2, 4, 2, 2);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetSwitch(QWidget* theParent,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetSwitch();
/// Defines if it is supported to set the value in this widget
#include <QVBoxLayout>
#include <QIcon>
-ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_PagedContainer(theParent, theData, theParentId)
+ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData)
+: ModuleBase_PagedContainer(theParent, theData)
{
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
ModuleBase_Tools::zeroMargins(aMainLayout);
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetToolbox();
/// Defines if it is supported to set the value in this widget
ModuleBase_WidgetValidated::ModuleBase_WidgetValidated(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_ModelWidget(theParent, theData, theParentId),
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData),
myWorkshop(theWorkshop), myIsInValidate(false)
{
}
/// \param theParent the parent object
/// \param theWorkshop a reference to workshop
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
ModuleBase_WidgetValidated(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~ModuleBase_WidgetValidated();
/// Checks whether all active viewer filters validate the presentation
mySketchMgr->operationActivatedByPreselection();
}
-ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
- Config_WidgetAPI* theWidgetApi, std::string theParentId)
+ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType,
+ QWidget* theParent,
+ Config_WidgetAPI* theWidgetApi)
{
ModuleBase_IWorkshop* aWorkshop = workshop();
XGUI_Workshop* aXUIWorkshop = getWorkshop();
ModuleBase_ModelWidget* aWgt = NULL;
if (theType == "sketch-start-label") {
PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, aWorkshop,
- theWidgetApi, theParentId, myHasConstraintShown);
+ theWidgetApi, myHasConstraintShown);
connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
connect(aLabelWgt, SIGNAL(showConstraintToggled(int, bool)),
aWgt = aLabelWgt;
} else if (theType == "sketch-2dpoint_selector") {
PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, aWorkshop,
- theWidgetApi, theParentId);
+ theWidgetApi);
aPointWgt->setSketch(mySketchMgr->activeSketch());
connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected()));
aWgt = aPointWgt;
}else if (theType == "sketch-2dpoint_flyout_selector") {
PartSet_WidgetPoint2DFlyout* aPointWgt = new PartSet_WidgetPoint2DFlyout(theParent, aWorkshop,
- theWidgetApi, theParentId);
+ theWidgetApi);
aPointWgt->setSketch(mySketchMgr->activeSketch());
connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected()));
aWgt = aPointWgt;
} else if (theType == "point2ddistance") {
PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent,
- aWorkshop, theWidgetApi, theParentId);
+ aWorkshop, theWidgetApi);
aDistanceWgt->setSketch(mySketchMgr->activeSketch());
aWgt = aDistanceWgt;
} else if (theType == "sketch_shape_selector") {
PartSet_WidgetShapeSelector* aShapeSelectorWgt =
- new PartSet_WidgetShapeSelector(theParent, aWorkshop, theWidgetApi, theParentId);
+ new PartSet_WidgetShapeSelector(theParent, aWorkshop, theWidgetApi);
aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
aWgt = aShapeSelectorWgt;
} else if (theType == "sketch_multi_selector") {
PartSet_WidgetMultiSelector* aShapeSelectorWgt =
- new PartSet_WidgetMultiSelector(theParent, aWorkshop, theWidgetApi, theParentId);
+ new PartSet_WidgetMultiSelector(theParent, aWorkshop, theWidgetApi);
aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
aWgt = aShapeSelectorWgt;
} else if (theType == WDG_DOUBLEVALUE_EDITOR) {
- aWgt = new PartSet_WidgetEditor(theParent, aWorkshop, theWidgetApi, theParentId);
+ aWgt = new PartSet_WidgetEditor(theParent, aWorkshop, theWidgetApi);
} else if (theType == "export_file_selector") {
- aWgt = new PartSet_WidgetFileSelector(theParent, aWorkshop, theWidgetApi, theParentId);
+ aWgt = new PartSet_WidgetFileSelector(theParent, aWorkshop, theWidgetApi);
} else if (theType == "sketch_launcher") {
- aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi, theParentId);
+ aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi);
} else if (theType == "module_choice") {
- aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi, theParentId);
+ aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi);
connect(aWgt, SIGNAL(itemSelected(int)), SLOT(onBooleanOperationChange(int)));
}
return aWgt;
/// Creates custom widgets for property panel
virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,
- Config_WidgetAPI* theWidgetApi, std::string theParentId);
+ Config_WidgetAPI* theWidgetApi);
/// Returns the active widget, by default it is the property panel active widget
/// If the internal edit operation is started, this is the first widget of the operation
/// Constructor
/// \param theParent the parent object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetChoice(theParent, theData, theParentId) {}
+ PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData)
+ : ModuleBase_WidgetChoice(theParent, theData) {}
};
#endif
\ No newline at end of file
#include <QWidget>
PartSet_WidgetEditor::PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : ModuleBase_WidgetEditor(theParent, theData, theParentId), myWorkshop(theWorkshop)
+ const Config_WidgetAPI* theData)
+ : ModuleBase_WidgetEditor(theParent, theData), myWorkshop(theWorkshop)
{
}
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetEditor() {}
PartSet_WidgetFileSelector::PartSet_WidgetFileSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_WidgetFileSelector(theParent, theData, theParentId)
-, myWorkshop(theWorkshop)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetFileSelector(theParent, theData),
+ myWorkshop(theWorkshop)
{
}
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuration. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetFileSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetFileSelector() {}
PartSet_WidgetMultiSelector::PartSet_WidgetMultiSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_WidgetMultiSelector(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetMultiSelector(theParent, theWorkshop, theData)
{
myExternalObjectMgr = new PartSet_ExternalObjectsMgr(theData->getProperty("use_external"), false);
}
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetMultiSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetMultiSelector();
PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
- : PartSet_WidgetPoint2D(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+ : PartSet_WidgetPoint2D(theParent, theWorkshop, theData)
{
}
/// \param theParent the parent object
/// \param theWorkshop a current workshop
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
/// Destructor
virtual ~PartSet_WidgetPoint2DFlyout() {};
PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_ModelWidget(theParent, theData, theParentId), myWorkshop(theWorkshop),
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData), myWorkshop(theWorkshop),
myValueIsCashed(false), myIsFeatureVisibleInCash(true),
myXValueInCash(0), myYValueInCash(0)
{
/// \param theParent the parent object
/// \param theWorkshop a current workshop
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetPoint2D(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ const Config_WidgetAPI* theData);
/// Destructor
virtual ~PartSet_WidgetPoint2D();
PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), myWorkshop(theWorkshop),
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetDoubleValue(theParent, theData), myWorkshop(theWorkshop),
myValueIsCashed(false), myIsFeatureVisibleInCash(true), myValueInCash(0)
{
myFirstPntName = theData->getProperty("first_point");
/// \param theParent the parent object
/// \param theWorkshop a current workshop
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId);
+ PartSet_WidgetPoint2dDistance(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetPoint2dDistance();
PartSet_WidgetShapeSelector::PartSet_WidgetShapeSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId)
+ const Config_WidgetAPI* theData)
+: ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData)
{
myUseSketchPlane = theData->getBooleanAttribute("use_sketch_plane", true);
myExternalObjectMgr = new PartSet_ExternalObjectsMgr(theData->getProperty("use_external"), true);
/// \param theParent the parent object
/// \param theWorkshop instance of workshop interface
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
PartSet_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetShapeSelector();
PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent,
PartSet_Module* theModule,
- const Config_WidgetAPI* theData,
- const std::string& theParentId)
-: ModuleBase_ModelWidget(theParent, theData, theParentId), myModule(theModule), myUseBody(true)
+ const Config_WidgetAPI* theData)
+: ModuleBase_ModelWidget(theParent, theData), myModule(theModule), myUseBody(true)
{
QFormLayout* aLayout = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aLayout);
/// \param theParent the parent object
/// \param theModule a reference to a module object
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
- PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule,
- const Config_WidgetAPI* theData, const std::string& theParentId);
+ PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule,
+ const Config_WidgetAPI* theData);
virtual ~PartSet_WidgetSketchCreator();
PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints)
-: ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId),
+: ModuleBase_WidgetValidated(theParent, theWorkshop, theData),
myPreviewDisplayed(false)
{
QVBoxLayout* aLayout = new QVBoxLayout(this);
/// \param theParent the parent object
/// \param theWorkshop a reference to workshop
/// \param theData the widget configuation. The attribute of the model widget is obtained from
- /// \param theParentId is Id of a parent of the current attribute
/// \param toShowConstraints a current show constraints state
PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints);
virtual ~PartSet_WidgetSketchLabel();