X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetPoint2D.h;h=bb0f7c84dbfa966a76577a623ae8bdefb43793ca;hb=a8d0fddcc65db1fe234df36354b6735918075a70;hp=a973ef693bf4951c8d4d8ed21b09f6227ac2f77c;hpb=b96d49472ad23f609343fa158d1d7b96c729ed09;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.h b/src/ModuleBase/ModuleBase_WidgetPoint2D.h index a973ef693..bb0f7c84d 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.h +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.h @@ -6,7 +6,7 @@ #define ModuleBase_WidgetPoint2D_H #include -#include "ModuleBase_WidgetCustom.h" +#include "ModuleBase_ModelWidget.h" #include @@ -19,29 +19,38 @@ class QDoubleSpinBox; * \ingroup GUI * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls */ -class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_WidgetCustom +class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget { Q_OBJECT public: /// Constructor /// \theParent the parent object - /// \theTitle the group box title - /// \theFeatureAttributeID the identifier of the feature attribute - ModuleBase_WidgetPoint2D(QWidget* theParent, QString theTitle, - const std::string& theFeatureAttributeID); + /// \theParent the parent object + /// \theData the widget configuation. The attribute of the model widget is obtained from + ModuleBase_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData); /// Destructor virtual ~ModuleBase_WidgetPoint2D(); /// Saves the internal parameters to the given feature /// \param theFeature a model feature to be changed - virtual void store(boost::shared_ptr theFeature); + virtual bool storeValue(FeaturePtr theFeature) const; + + virtual bool restoreValue(FeaturePtr theFeature); /// Returns the internal parent wiget control, that can be shown anywhere /// \returns the widget QWidget* getControl() const; + /// Returns list of widget controls + /// \return a control list + virtual QList getControls() const; + + /// Process key release envent on the widget spin box controls + /// \param theObject the object where the event happens + /// \param theEvent the processed event + virtual bool eventFilter(QObject *theObject, QEvent *theEvent); + private: - std::string myFeatureAttributeID; ///< the identifier of the feature attribute QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets QDoubleSpinBox* myXSpin; ///< the spin box for the X coordinate QDoubleSpinBox* myYSpin; ///< the spin box for the Y coordinate