]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_WidgetDoubleValue.h
Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_WidgetDoubleValue.h
4 // Created:     04 June 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_WidgetDoubleValue_H
8 #define ModuleBase_WidgetDoubleValue_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
12
13 class ModuleBase_DoubleSpinBox;
14 class Config_WidgetAPI;
15 class QWidget;
16 class QLabel;
17 class QTimer;
18
19 /**
20 * A class of property panel widget for double value input
21 * It can be defined with "doublevalue" keyword. For example:
22 * "<doublevalue id="x" label="X:" icon=":pictures/x_point.png" tooltip="X coordinate"/>"
23 */
24 class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue : public ModuleBase_ModelWidget
25 {
26 Q_OBJECT
27  public:
28   /// Constructor
29   /// \param theParent the parent object
30   /// \param theData the widget configuation. The attribute of the model widget is obtained from
31   /// \param theParentId is Id of a parent structure (widget, operation, group)
32   ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData,
33                                const std::string& theParentId);
34
35   virtual ~ModuleBase_WidgetDoubleValue();
36
37   //! Saves the internal parameters to the given feature
38   // \return True in success
39   virtual bool storeValue() const;
40
41   //! Read value of corresponded attribute from data model to the input control
42   // \return True in success
43   virtual bool restoreValue();
44
45   /// Returns list of widget controls
46   /// \return a control list
47   virtual QList<QWidget*> getControls() const;
48
49   /// Returns the internal parent wiget control, that can be shown anywhere
50   /// \returns the widget
51   QWidget* getControl() const
52   {
53     return myContainer;
54   }
55
56  public slots:
57  // Delayed value chnged: when user starts typing something,
58  // it gives him a 0,5 second to finish typing, when sends valueChnaged() signal
59 //  void onValueChanged();
60
61  protected:
62    /// Container for thw widget controls
63   QWidget* myContainer;
64
65   /// Label of the widget
66   QLabel* myLabel;
67
68   /// Input value control
69   ModuleBase_DoubleSpinBox* mySpinBox;
70 };
71
72 #endif