Back to index

salome-gui  6.5.0
QtxListAction.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:      QtxListAction.h
00024 // Author:    Sergey TELKOV
00025 //
00026 #ifndef QTXLISTACTION_H
00027 #define QTXLISTACTION_H
00028 
00029 #include "Qtx.h"
00030 #include "QtxAction.h"
00031 #include <QStringList>
00032 
00033 #ifdef WIN32
00034 #pragma warning( disable:4251 )
00035 #endif
00036 
00037 class QTX_EXPORT QtxListAction : public QtxAction
00038 {
00039   Q_OBJECT
00040 
00041   class ListFrame;
00042   class ListWidget;
00043   class ScrollEvent;
00044 
00045 public:
00047   enum { 
00048     Item,         
00049     SubMenu       
00050   } PopupMode;
00051 
00052 public:
00053   QtxListAction( QObject* = 0 );
00054   QtxListAction( const QString&, int, QObject* );
00055   QtxListAction( const QString&, const QString&, int, QObject* );
00056   QtxListAction( const QIcon&, const QString&, int, QObject* );
00057   QtxListAction( const QString&, const QIcon&, const QString&, int, QObject* );
00058   virtual ~QtxListAction();
00059 
00060   int              popupMode() const;
00061   void             setPopupMode( const int );
00062 
00063   QStringList      names() const;
00064   void             addNames( const QStringList&, bool = true );
00065   void             setComment( const QString&, const QString& = QString() );
00066 
00067   int              linesNumber() const;
00068   int              charsNumber() const;
00069 
00070   void             setLinesNumber( const int );
00071   void             setCharsNumber( const int );
00072 
00073 signals:
00074   void             triggered( int );
00075 
00076 private slots:
00077   void             onChanged();
00078   void             onMultiple( const int );
00079   void             onSingle( bool = false );
00080   void             onTriggered( bool = false );
00081 
00082 protected:
00083   virtual QWidget* createWidget( QWidget* );
00084   virtual void     deleteWidget( QWidget* );
00085 
00086 private:
00087   void             initialize();
00088 
00089 private:
00090   ListFrame*       myFrame;   
00091 
00092   friend class QtxListAction::ListFrame;
00093 };
00094 
00095 #ifdef WIN32
00096 #pragma warning( default:4251 )
00097 #endif
00098 
00099 #endif