kgantt

xQGanttListViewPort.h

00001 #ifndef _XQGANTTLISTVIEWPORT_H_
00002 #define _XQGANTTLISTVIEWPORT_H_
00003 
00004 /*
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 GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 
00021     author  : jh, jochen@ifb.bv.tu-berlin.de
00022 
00023     file    : xQGanttListViewPort.h
00024     date    : 26 oct 2000
00025 
00026 
00027     changelog :
00028 
00029 */
00030 
00031 
00032 
00033 #include "xQGanttBarViewPort.h"
00034 #include "KGanttItem.h"
00035 
00036 
00037 #include <qcursor.h>
00038 
00039 
00040 
00042 
00046 
00047 class xQGanttListViewPort : public QFrame
00049 {
00050 
00051   Q_OBJECT
00052 
00053   friend class xQGanttListView;
00054  
00055 
00056 public:
00057 
00058 
00060 
00063   xQGanttListViewPort(KGanttItem* toplevelitem, QWidget* parent = 0,
00064              const char * name=0, WFlags f=0 );
00065 
00066 
00067 
00069 
00072   ~xQGanttListViewPort();
00073  
00074 
00075 
00076 public slots:
00077 
00078   void barViewResized();
00079 
00080 
00081 protected:
00082 
00084 
00087   void update(int x1, int y1, int x2, int y2);
00088 
00089 
00091 
00094   void setBarViewPort(xQGanttBarViewPort* v);
00095 
00096 
00097   void drawContents(QPainter*, int x1, int y1, int x2, int y2);
00098   void drawItem(KGanttItem*, QPainter* p, const QRect&, int);
00099 
00100   xQGanttBarViewPort* _barviewport;
00101 
00102   int _width;
00103 
00104   KGanttItem* _toplevelitem;
00105 
00106   void paintEvent(QPaintEvent * e) {    
00107     // printf("xQGanttListViewPort::paintEvent()\n");
00108     update(e->rect().left(), e->rect().top(),
00109        e->rect().right(), e->rect().bottom() );
00110   }
00111 
00112   QPopupMenu* _menu;
00113 
00114   void mousePressEvent(QMouseEvent* e) {
00115 
00116     if(e->button() == RightButton && e->state() == ControlButton ) {
00117       _menu->popup(e->globalPos());
00118       return;
00119     }
00120     
00121   }
00122 
00123 
00124   QBrush brush1, brush2;
00125 
00126   static int _ListViewCounter;
00127 
00128 };
00129 
00130 
00131 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys