kgantt Library API Documentation

xQGanttListView.cpp

00001 // 00002 // file : xQGanttListView.C 00003 // date : 23 nov 2000 00004 // changed : 00005 // author : jh 00006 // 00007 00008 #include "xQGanttListView.h" 00009 00010 #include <qcolor.h> 00011 #include <klocale.h> 00012 00013 xQGanttListView::xQGanttListView(KGanttItem* toplevelitem, QWidget* parent, 00014 const char * name, WFlags f) 00015 : QScrollView(parent,name,f) 00017 { 00018 _toplevelitem = toplevelitem; 00019 00020 setFrameStyle(QFrame::Sunken); 00021 setLineWidth(1); 00022 00023 _headerBackBrush = QBrush(QColor(230,230,230)); 00024 00025 setMargins( 1, TOPMARGIN , 1, 1 ); 00026 00027 setVScrollBarMode( AlwaysOff ); 00028 00029 _viewport = new xQGanttListViewPort(toplevelitem,viewport()); 00030 addChild(_viewport); 00031 00032 viewport()->setBackgroundColor(QColor(white)); 00033 00034 } 00035 00036 00037 00038 xQGanttListView::~xQGanttListView() 00040 { 00041 } 00042 00043 00044 void 00045 xQGanttListView::drawHeader() 00047 { 00048 // printf("xQGanttListView::drawHeader()\n"); 00049 00050 QPainter p(this); 00051 p.setPen( QPen(QColor(black)) ); 00052 p.fillRect(0,0,width(),TOPMARGIN, _headerBackBrush ); 00053 00054 p.drawText(5, (0.8 * TOPMARGIN), i18n("Items")); 00055 00056 } 00057 00058 00059 00060 void 00061 xQGanttListView::contentsMoved(int x, int y) 00063 { 00064 printf("xQGanttListView::contentsMoved(%d,%d)\n", x, y); 00065 setContentsPos( 0, y ); 00066 } 00067 00068 00069 00070 void 00071 xQGanttListView::paintEvent(QPaintEvent * e) 00072 { 00073 drawHeader(); 00074 } 00075 #include "xQGanttListView.moc"
KDE Logo
This file is part of the documentation for kgantt Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:48:23 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003