X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetSelector.h;h=574ae0e8b5112c96598dd1a39e8ebe0e62415291;hb=cd9217d7e87997ec8bc150a6d8c389e742ca0f84;hp=0d411f3b742b4f747bcb105120827446cf735cb4;hpb=d2cb1dde43baaa219e72a0de8c60ae8f166445af;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.h b/src/ModuleBase/ModuleBase_WidgetSelector.h index 0d411f3b7..574ae0e8b 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetSelector.h @@ -8,13 +8,12 @@ #include "ModuleBase.h" #include "ModuleBase_ModelWidget.h" -#include +#include #include #include - class Config_WidgetAPI; class QWidget; class QLabel; @@ -22,65 +21,76 @@ class QLineEdit; class QToolButton; class ModuleBase_IWorkshop; -class MODULEBASE_EXPORT ModuleBase_WidgetSelector: public ModuleBase_ModelWidget +class MODULEBASE_EXPORT ModuleBase_WidgetSelector : public ModuleBase_ModelWidget { - Q_OBJECT -public: - ModuleBase_WidgetSelector(QWidget* theParent, - ModuleBase_IWorkshop* theWorkshop, - const Config_WidgetAPI* theData); +Q_OBJECT + public: + ModuleBase_WidgetSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, + const Config_WidgetAPI* theData, const std::string& theParentId); virtual ~ModuleBase_WidgetSelector(); /// Saves the internal parameters to the given feature - /// \param theFeature a model feature to be changed - virtual bool storeValue(FeaturePtr theFeature) const; + /// \param theObject a model feature to be changed + virtual bool storeValue() const; - virtual bool restoreValue(FeaturePtr theFeature); + virtual bool restoreValue(); /// Returns the internal parent wiget control, that can be shown anywhere /// \returns the widget - QWidget* getControl() const { return myContainer; } + QWidget* getControl() const + { + return myContainer; + } /// Returns list of widget controls /// \return a control list virtual QList getControls() const; - void setActivationOnStart(bool toActivate) { myActivateOnStart = toActivate; } - bool activateOnStart() const { return myActivateOnStart; } + void setActivationOnStart(bool toActivate) + { + myActivateOnStart = toActivate; + } + bool activateOnStart() const + { + return myActivateOnStart; + } - FeaturePtr selectedFeature() const { return mySelectedFeature; } + ObjectPtr selectedFeature() const + { + return mySelectedObject; + } -public slots: + public slots: /// Activate or deactivate selection void activateSelection(bool toActivate); -protected: + protected: bool eventFilter(QObject* theObj, QEvent* theEvent); -private slots: + private slots: void onSelectionChanged(); -private: + private: void enableOthersControls(bool toEnable) const; void updateSelectionName(); void raisePanel() const; - bool isAccepted(const FeaturePtr theFeature) const; + bool isAccepted(const ObjectPtr theObject) const; static TopAbs_ShapeEnum shapeType(const QString& theType); - QWidget* myContainer; - QLabel* myLabel; - QLineEdit* myTextLine; + QWidget* myContainer; + QLabel* myLabel; + QLineEdit* myTextLine; QToolButton* myActivateBtn; ModuleBase_IWorkshop* myWorkshop; bool myActivateOnStart; - FeaturePtr mySelectedFeature; + ObjectPtr mySelectedObject; QStringList myShapeTypes; }; -#endif \ No newline at end of file +#endif