Salome HOME
*** empty log message ***
[modules/gui.git] / src / SUIT / SUIT_ToolButton.h
1 #ifndef SUIT_TOOLBUTTON_H
2 #define SUIT_TOOLBUTTON_H
3
4 #include <qtoolbutton.h>
5 #include <qaction.h>
6
7 #include "SUIT.h"
8
9 // Purpose:   to draw down arrow on toolbutton.
10
11 class SUIT_EXPORT SUIT_ToolButton : public QToolButton
12 {
13   Q_OBJECT
14
15 public:
16 //constructors
17   SUIT_ToolButton( QWidget *parent = 0, 
18                    const char *name = 0,
19                    bool changeItemAfterClick = true );
20   SUIT_ToolButton(  const QPixmap & pm, const QString &textLabel,
21                     const QString& grouptext,
22                     QObject * receiver, const char* slot,
23                     QToolBar * parent, const char* name = 0,
24                     bool changeItemAfterClick = true );
25
26   //drawButton is redefined to draw DownArrow
27   void drawButton( QPainter * pQPainter);
28
29   // Add action into popup
30   void AddAction(QAction* theAction);
31
32   // Sets myPopup item with theIndex as current
33   void SetItem(int theIndex);
34
35 public slots:
36   void OnSelectAction(int theItemID);
37
38 protected:
39   void  mouseReleaseEvent (QMouseEvent * theEvent);
40
41 private:
42   void initialize();
43
44   QPopupMenu* myPopup;
45   QSignal* mySignal;
46   bool myChangeItemAfterClick;
47
48 };
49
50 #endif
51