Salome HOME
f7a442e41ad12b9cf8528b3dd80909b14f204a3f
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetSwitch.h
1 /*
2  * ModuleBase_WidgetSwitch.h
3  *
4  *  Created on: Apr 16, 2014
5  *      Author: sbh
6  */
7
8 #ifndef ModuleBase_WidgetSwitch_H_
9 #define ModuleBase_WidgetSwitch_H_
10
11 #include <ModuleBase.h>
12 #include <QFrame>
13
14 class QComboBox;
15 class QVBoxLayout;
16
17 class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public QFrame
18 {
19 Q_OBJECT
20  public:
21   ModuleBase_WidgetSwitch(QWidget* parent = NULL);
22   virtual ~ModuleBase_WidgetSwitch();
23
24   int addPage(QWidget * theWidget, const QString & theName);
25   int count() const;
26   int currentIndex() const;
27   QWidget * currentWidget() const;
28   int indexOf(QWidget * theWidget) const;
29   int insertPage(int index, QWidget * theWidget, const QString & theName);
30   bool isPageEnabled(int index) const;
31   QString pageText(int index) const;
32   QString pageToolTip(int index) const;
33   void removePage(int index);
34   void setPageEnabled(int index, bool enabled);
35   void setPageName(int index, const QString & text);
36   void setPageToolTip(int index, const QString & toolTip);
37
38  public slots:
39   void setCurrentIndex(int index);
40
41 signals:
42   void currentPageChanged(int);
43
44  protected:
45   void refresh();
46
47  private:
48   QVBoxLayout* myMainLay;
49   QComboBox* myCombo;
50   QWidgetList myCases;
51 };
52
53 #endif /* ModuleBase_WidgetSwitch_H_ */