Salome HOME
Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetChoice.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_WidgetChoice.h
4 // Created:     03 Sept 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_WidgetChoice_H
8 #define ModuleBase_WidgetChoice_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
12
13 class QWidget;
14 class QLabel;
15 class QComboBox;
16
17 class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget
18 {
19 Q_OBJECT
20  public:
21   ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, 
22                           const std::string& theParentId);
23
24   virtual ~ModuleBase_WidgetChoice();
25   
26   /// Saves the internal parameters to the given feature
27   /// \param theObject a model feature to be changed
28   virtual bool storeValue() const;
29
30   virtual bool restoreValue();
31
32   virtual bool focusTo();
33
34   /// Returns the internal parent wiget control, that can be shown anywhere
35   /// \returns the widget
36   QWidget* getControl() const
37   {
38     return myContainer;
39   }
40
41   /// Returns list of widget controls
42   /// \return a control list
43   virtual QList<QWidget*> getControls() const;
44
45 private slots:
46   void onCurrentIndexChanged(int theIndex);
47
48 private:
49   QWidget* myContainer;
50   QLabel* myLabel;
51   QComboBox* myCombo;
52 };
53
54 #endif