Back to index

salome-gui  6.5.0
QtxMenu.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      QtxMenu.h
00021 // Author:    Sergey TELKOV
00022 //
00023 #ifndef QTXMENU_H
00024 #define QTXMENU_H
00025 
00026 #include "Qtx.h"
00027 
00028 #include <QMenu>
00029 
00030 class QWidgetAction;
00031 
00032 class QTX_EXPORT QtxMenu : public QMenu
00033 {
00034   Q_OBJECT
00035 
00036   class Title;
00037 
00038 public:
00040   typedef enum { 
00041     TitleAuto,        
00042     TitleOn,          
00043     TitleOff          
00044   } TitleMode;
00045 
00046 public:
00047   QtxMenu( QWidget* = 0 );
00048   virtual ~QtxMenu();
00049 
00050   QIcon                  titleIcon() const;
00051   QString                titleText() const;
00052 
00053   TitleMode              titleMode() const;
00054   Qt::Alignment          titleAlignment() const;
00055 
00056   virtual void           setTitleIcon( const QIcon& );
00057   virtual void           setTitleText( const QString& );
00058 
00059   virtual void           setTitleMode( const TitleMode );
00060   virtual void           setTitleAlignment( const Qt::Alignment );
00061 
00062 public slots:
00063   virtual void           setVisible( bool );
00064 
00065 private:
00066   void                   updateTitle();
00067   void                   insertTitle();
00068   void                   removeTitle();
00069 
00070 private:
00071   TitleMode              myMode;
00072   Title*                 myTitle;
00073   QWidgetAction*         myAction;
00074 };
00075 
00076 #endif // QTXMENU_H