ToolBox.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.net>     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
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         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_DOCKWND_TOOLBOX_H
00025 #define GUI_DOCKWND_TOOLBOX_H
00026 
00027 #include "DockWindow.h"
00028 
00029 class QToolBox;
00030 
00031 namespace Gui
00032 {
00033 
00034 namespace DockWnd 
00035 {
00036 
00057 class GuiExport ToolBox : public QWidget
00058 {
00059   Q_OBJECT
00060 
00061 public:
00062   ToolBox( QWidget *parent=0 );
00063   virtual ~ToolBox();
00064 
00065   int addItem ( QWidget * w, const QString & label );
00066   int addItem ( QWidget * item, const QIcon & iconSet, const QString & label );
00067   int insertItem ( int index, QWidget * item, const QString & label );
00068   int insertItem ( int index, QWidget * item, const QIcon & iconSet, const QString & label );
00069 
00070   void removeItem ( int index );
00071 
00072   void setItemEnabled ( int index, bool enabled );
00073   bool isItemEnabled ( int index ) const;
00074 
00075   void setItemText ( int index, const QString & label );
00076   QString itemText ( int index ) const;
00077   
00078   void setItemIcon ( int index, const QIcon & iconSet );
00079   QIcon itemIcon ( int index ) const;
00080   
00081   void setItemToolTip ( int index, const QString & toolTip );
00082   QString itemToolTip ( int index ) const;
00083   
00084   QWidget * currentWidget () const;
00085 
00086   int currentIndex () const;
00087   QWidget * widget ( int index ) const;
00088   int indexOf ( QWidget * item ) const;
00089   int count () const;
00090 
00091 public Q_SLOTS:
00092   void setCurrentIndex ( int index );
00093   void setCurrentWidget ( QWidget * item );
00094 
00095 protected:
00096   void changeEvent(QEvent *e);
00097 
00098 Q_SIGNALS:
00102   void currentChanged ( int index );
00103 
00104 private:
00105   QToolBox* _pToolBox;
00106 };
00107 
00108 } // namespace DockWnd
00109 } // namespace Gui
00110 
00111 #endif // GUI_DOCKWND_TOOLBOX_H
00112 

Generated on Wed Nov 23 19:00:45 2011 for FreeCAD by  doxygen 1.6.1