1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 // File: QtxMenuButton.h
20 // Author: Sergey TELKOV
22 #ifndef QTXMENUBUTTON_H
23 #define QTXMENUBUTTON_H
27 #include <qpushbutton.h>
32 class QTX_EXPORT QtxMenuButton : public QPushButton
39 enum { Left, Right, Top, Bottom };
42 QtxMenuButton( int, QWidget* = 0, const char* = 0 );
43 QtxMenuButton( const QString&, QWidget* = 0, const char* = 0 );
44 QtxMenuButton( int, const QString&, QWidget* = 0, const char* = 0 );
45 QtxMenuButton( QWidget* = 0, const char* = 0 );
46 virtual ~QtxMenuButton();
49 void setPosition( const int );
51 bool isAlignWidth() const;
52 void setAlignWidth( const bool );
54 bool isArrowEnabled() const;
55 void setArrowEnabled( const bool );
58 void removeItem( int );
59 int insertSeparator( int = -1 );
60 int insertItem( const QString&, int = -1, int = -1 );
61 int insertItem( const QIconSet&, const QString&, int = -1, int = -1 );
63 virtual QSize sizeHint() const;
64 virtual QSize minimumSizeHint() const;
67 void activated( int );
73 QPopupMenu* popup() const;
74 virtual bool event( QEvent* );
75 virtual void resizeEvent( QResizeEvent* );
76 virtual void drawButtonLabel( QPainter* );