00001 // Class QToolBar 00002 // Filename QToolBar.h 00003 // FaPra 2003-2004, A5, Alexander Kramer 00004 00005 #ifndef QToolBar_h 00006 #define QToolBar_h 00007 00008 #include "QWidget.h" 00009 00010 //! Pre-declaration of QToolBar 00011 class QToolBar; 00012 00013 00014 00015 00016 //! Tool bar which is movable and layouts its widgets horizontal 00017 class QToolBar : public QWidget 00018 { 00019 protected: 00020 //! Width of the left area, which is used to move the Toolbar 00021 int MoverWidth; 00022 00023 public: 00024 //! brings the given widget to the front. Must be a child widget 00025 virtual void bringToFront( QWidget* widget ); 00026 00027 //! draws itself with OpenGL. Here is the OpenGL drawing code 00028 virtual void draw( QEvent* e ); 00029 00030 //! layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes 00031 virtual void layout(); 00032 00033 //! have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged 00034 virtual bool canDrag( QEvent* e ); 00035 00036 //! processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner 00037 virtual bool processEvent( QEvent* e ); 00038 00039 //! processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner 00040 virtual bool processMouseOwner( QEvent* e ); 00041 00042 //! called if a child is added/removed 00043 virtual void childrenChanged(); 00044 00045 //! defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus 00046 virtual bool canFocus( QEvent* e ); 00047 00048 //! initialization code 00049 virtual void Init(); 00050 00051 //! clean up code 00052 virtual void CleanUp(); 00053 00054 //! getter method for MoverWidth 00055 virtual int getMoverWidth(); 00056 00057 //! setter method for MoverWidth 00058 virtual void setMoverWidth( int newValue ); 00059 00060 //! prints itself to the cout 00061 void print(); 00062 00063 //! Constructor 00064 QToolBar( QWidget* aOwner ); 00065 00066 //! Destructor 00067 virtual ~QToolBar(); 00068 00069 00070 }; 00071 #endif 00072
1.2.18