Salome HOME
Merge branch 'python_parametric_api' of https://git.salome-platform.org/git/modules...
[modules/shaper.git] / src / ModuleBase / ModuleBase_ToolBox.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_ToolBox.h
4 // Created:     10 August 2015
5 // Author:      Alexandre SOLOVYOV
6
7 #ifndef ModuleBase_ToolBox_H
8 #define ModuleBase_ToolBox_H
9
10 #include <ModuleBase.h>
11 #include <QFrame>
12
13 class QButtonGroup;
14 class QFrame;
15 class QHBoxLayout;
16 class QStackedWidget;
17
18 /**
19  * \class ModuleBase_ToolBox
20  * \ingroup GUI
21  * \brief An extension of QFrame object
22  */
23 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
24 {
25   Q_OBJECT
26
27 public:
28   /// Constructor
29   /// \param theParent a parent widget
30   ModuleBase_ToolBox( QWidget* theParent );
31   virtual ~ModuleBase_ToolBox();
32
33   ///  Add a new item to the tool box
34   /// \param thePage a widget of the new item
35   /// \param theName a name of the item
36   /// \param theIcon an icon of the item
37   void addItem( QWidget* thePage, const QString& theName, const QPixmap& theIcon );
38
39   /// \return number of items
40   int count() const;
41
42   /// \return index of current widget
43   int currentIndex() const;
44
45   /// Set current item
46   /// \param theIdx an index
47   void setCurrentIndex( const int theIdx);
48
49 signals:
50   /// A signal which is emited on current item changed
51   void currentChanged( int );
52
53 private slots:
54   /// A slot called on button press
55   void onButton( int );
56
57 private:
58   QButtonGroup*   myButtonsGroup;
59   QFrame*         myButtonsFrame;
60   QHBoxLayout*    myButtonsLayout;
61   QStackedWidget* myStack;
62 };
63 #endif