kgantt

xQGanttListView.cpp
1 //
2 // file : xQGanttListView.C
3 // date : 23 nov 2000
4 // changed :
5 // author : jh
6 //
7 
8 #include "xQGanttListView.h"
9 
10 #include <tqcolor.h>
11 #include <tdelocale.h>
12 
13 xQGanttListView::xQGanttListView(KGanttItem* toplevelitem, TQWidget* parent,
14  const char * name, WFlags f)
15  : TQScrollView(parent,name,f)
17 {
18  _toplevelitem = toplevelitem;
19 
20  setFrameStyle(TQFrame::Sunken);
21  setLineWidth(1);
22 
23  _headerBackBrush = TQBrush(TQColor(230,230,230));
24 
25  setMargins( 1, TOPMARGIN , 1, 1 );
26 
27  setVScrollBarMode( AlwaysOff );
28 
29  _viewport = new xQGanttListViewPort(toplevelitem,viewport());
30  addChild(_viewport);
31 
32  viewport()->setBackgroundColor(TQColor(white));
33 
34 }
35 
36 
37 
40 {
41 }
42 
43 
44 void
45 xQGanttListView::drawHeader()
47 {
48  // printf("xQGanttListView::drawHeader()\n");
49 
50  TQPainter p(this);
51  p.setPen( TQPen(TQColor(black)) );
52  p.fillRect(0,0,width(),TOPMARGIN, _headerBackBrush );
53 
54  p.drawText(5, (int)(0.8 * TOPMARGIN), i18n("Items"));
55 
56 }
57 
58 
59 
60 void
61 xQGanttListView::contentsMoved(int x, int y)
63 {
64  printf("xQGanttListView::contentsMoved(%d,%d)\n", x, y);
65  setContentsPos( 0, y );
66 }
67 
68 
69 
70 void
71 xQGanttListView::paintEvent(TQPaintEvent * /*e*/)
72 {
73  drawHeader();
74 }
75 #include "xQGanttListView.moc"
KGanttItem.
Definition: KGanttItem.h:56
GanttListViewPort Widget.
xQGanttListView(KGanttItem *toplevelitem, TQWidget *parent=0, const char *name=0, WFlags f=0)
Constructor.
~xQGanttListView()
Destructor.