Salome HOME
New item (FontItem), allowing to show information about font setting and to select...
[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 /*! To draw down arrow on toolbutton.*/
10 class SUIT_EXPORT SUIT_ToolButton : public QToolButton
11 {
12   Q_OBJECT
13
14 public:
15   /*! @name constructors*/
16   //@{
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
27   /*!drawButton is redefined to draw DownArrow*/
28   void drawButton( QPainter * pQPainter);
29
30   /*! Add action into popup*/
31   void AddAction(QAction* theAction);
32
33   /*! Sets myPopup item with theIndex as current*/
34   void SetItem(int theIndex);
35
36 public slots:
37   void OnSelectAction(int theItemID);
38
39 protected:
40   void  mouseReleaseEvent (QMouseEvent * theEvent);
41
42 private:
43   void initialize();
44
45   QPopupMenu* myPopup;
46   QSignal* mySignal;
47   bool myChangeItemAfterClick;
48
49 };
50
51 #endif
52