36#include "KDGanttView.h"
37#include "KDGanttViewSubwidgets.h"
38#include "KDGanttMinimizeSplitter.h"
39#include "KDGanttViewItem.h"
40#include "KDGanttXMLTools.h"
41#include "itemAttributeDialog.h"
45#include <tqpaintdevicemetrics.h>
48#include <tqscrollview.h>
49#include <tqapplication.h>
51#include <tqiconview.h>
53#include <tqmessagebox.h>
54#include <tqfileinfo.h>
56#ifndef KDGANTT_MASTER_CVS
57#include "KDGanttView.moc"
61#include "../evaldialog/evaldialog.h"
89 EvalDialog::checkEvalLicense(
"KD Gantt" );
94 mySplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Left );
95 leftWidget =
new TQVBox( mySplitter );
96 rightWidget =
new TQVBox( mySplitter );
98 myLegend =
new KDLegendWidget( leftWidget,
this );
99 spacerLeft =
new TQHBox( leftWidget );
100 myListView =
new KDListView(leftWidget,
this);
101 myListView->setVScrollBarMode (TQScrollView::AlwaysOff );
102 connect( myListView, TQ_SIGNAL( selectionChanged( TQListViewItem* ) ),
103 this, TQ_SLOT( slotSelectionChanged( TQListViewItem* ) ) );
105 connect( myListView, TQ_SIGNAL( mouseButtonClicked (
int, TQListViewItem * ,
const TQPoint &,
int ) ),
this, TQ_SLOT( slotmouseButtonClicked (
int , TQListViewItem * ,
const TQPoint &,
int ) ) );
106 connect( myListView, TQ_SIGNAL( contextMenuRequested ( TQListViewItem * ,
const TQPoint &,
int ) ),
this, TQ_SLOT( slotcontextMenuRequested ( TQListViewItem * ,
const TQPoint & ,
int ) ) );
107 connect( myListView, TQ_SIGNAL(doubleClicked ( TQListViewItem * ) ),
this, TQ_SLOT(slotdoubleClicked ( TQListViewItem * ) ) );
109 connect( myListView, TQ_SIGNAL(currentChanged( TQListViewItem * ) ),
this, TQ_SLOT(slotCurrentChanged ( TQListViewItem * ) ) );
110 connect( myListView, TQ_SIGNAL(itemRenamed ( TQListViewItem * ,
int ,
const TQString & ) ),
this, TQ_SLOT(slotItemRenamed ( TQListViewItem *,
int ,
const TQString & ) ) );
111 connect( myListView, TQ_SIGNAL(mouseButtonPressed(
int, TQListViewItem * ,
const TQPoint &,
int ) ),
this, TQ_SLOT(slotMouseButtonPressed (
int , TQListViewItem * ,
const TQPoint & ,
int ) ) );
114 myTimeTable =
new KDTimeTableWidget (rightWidget,
this);
116 spacerRight =
new TQWidget( rightWidget );
118 myTimeHeaderContainer =
new TQHBox( rightWidget );
119 myTimeHeaderContainer->setFrameStyle( TQFrame::NoFrame );
120 myTimeHeaderContainer->setMargin( 0 );
121 myTimeHeaderScroll =
new TQScrollView ( myTimeHeaderContainer );
122 myTimeHeaderScroll->setHScrollBarMode( TQScrollView::AlwaysOff );
123 myTimeHeaderScroll->setVScrollBarMode( TQScrollView::AlwaysOff );
124 timeHeaderSpacerWidget =
new TQWidget( myTimeHeaderContainer );
133 myTimeHeader =
new KDTimeHeaderWidget (myTimeHeaderScroll->viewport(),
this);
134 myTimeHeaderScroll->addChild( myTimeHeader );
135 myTimeHeaderScroll->viewport()->setBackgroundColor( myTimeHeader->backgroundColor() );
136 timeHeaderSpacerWidget->setBackgroundColor( myTimeHeader->backgroundColor() );
137 myCanvasView =
new KDGanttCanvasView (
this,myTimeTable,rightWidget);
138 myTimeHeaderScroll->setFrameStyle( TQFrame::NoFrame );
140 myCanvasView->setFrameStyle( TQFrame::NoFrame );
141 myCanvasView->setMargin( 0 );
143 myTimeHeaderScroll->setMargin( 0 );
144 setFrameStyle(myListView->frameStyle());
146 myListView->setFrameStyle( TQFrame::NoFrame );
147 myListView->setMargin( 0 );
148 TQObject::connect(myListView, TQ_SIGNAL ( expanded ( TQListViewItem * ) ) , myTimeTable , TQ_SLOT( expandItem(TQListViewItem * ))) ;
149 TQObject::connect(myListView, TQ_SIGNAL (collapsed ( TQListViewItem * ) ) , myTimeTable , TQ_SLOT(collapseItem(TQListViewItem * ))) ;
151 timeHeaderSpacerWidget->setFixedWidth(myCanvasView->verticalScrollBar()->width() );
152 listViewIsVisible =
true;
153 chartIsEditable =
true;
154 editorIsEnabled =
true;
155 _displaySubitemsAsGroup =
false;
159 myTextColor = TQt::black;
160 myLegendItems =
new TQPtrList<legendItem>;
162 myItemAttributeDialog =
new itemAttributeDialog();
169 connect(myCanvasView->horizontalScrollBar(), TQ_SIGNAL ( valueChanged (
int )) ,myTimeHeaderScroll->horizontalScrollBar(), TQ_SLOT( setValue (
int))) ;
170 connect(myCanvasView, TQ_SIGNAL ( heightResized(
int )) ,myTimeTable, TQ_SLOT( checkHeight (
int))) ;
171 connect(myCanvasView, TQ_SIGNAL ( widthResized(
int )) ,myTimeHeader, TQ_SLOT( checkWidth (
int))) ;
173 TQObject::connect(myCanvasView->verticalScrollBar(), TQ_SIGNAL ( valueChanged (
int ) ) ,myListView->verticalScrollBar(), TQ_SLOT( setValue (
int ))) ;
174 connect(myTimeHeader, TQ_SIGNAL ( sizeChanged(
int ) ) ,
this, TQ_SLOT(slotHeaderSizeChanged() )) ;
175 connect(myTimeHeader, TQ_SIGNAL ( sizeChanged(
int ) ) ,myTimeTable, TQ_SLOT(resetWidth(
int ) )) ;
176 connect(myListView, TQ_SIGNAL ( contentsMoving (
int,
int ) ) ,myCanvasView, TQ_SLOT( moveMyContent(
int,
int ))) ;
177 connect(myTimeTable, TQ_SIGNAL ( heightComputed (
int ) ) ,myCanvasView, TQ_SLOT( setMyContentsHeight(
int ))) ;
179 connect( myCanvasView->horizontalScrollBar(), TQ_SIGNAL (prevLine () ) ,
this, TQ_SLOT(addTickLeft()));
180 connect( myCanvasView->horizontalScrollBar(), TQ_SIGNAL (nextLine () ) ,
this, TQ_SLOT(addTickRight()));
181 connect( myCanvasView->horizontalScrollBar(), TQ_SIGNAL (valueChanged (
int ) ) ,
this, TQ_SLOT( enableAdding(
int )));
184 fCenterTimeLineAfterShow =
false;
185 fDragEnabled =
false;
186 fDropEnabled =
false;
187 closingBlocked =
false;
188 myTimeHeader->computeTicks();
191 TQValueList<int> list;
194 mySplitter->setSizes( list );
195 myTimeTable->setBlockUpdating();
200KDGanttView::~KDGanttView()
204 myCanvasView->resetCutPaste( 0 );
205 myTimeTable->clearTaskLinks();
232 myTimeTable->setBlockUpdating( !enable );
234 myTimeTable->updateMyContent();
235 myCanvasView->setMyContentsHeight( 0 );
248 return !myTimeTable->blockUpdating();
262 myTimeHeader->setMaximumWidth ( w );
273 return myTimeHeader->maximumWidth();
284 myTimeTable->setBlockUpdating(
false );
285 if (myCanvasView->horizontalScrollBar()->value() > 0 )
286 myCanvasView->horizontalScrollBar()->setValue(myCanvasView->horizontalScrollBar()->value()-1 );
288 myCanvasView->horizontalScrollBar()->setValue(1 );
289 myTimeTable->updateMyContent();
291 myCanvasView->setMyContentsHeight( 0 );
292 if ( fCenterTimeLineAfterShow ) {
293 fCenterTimeLineAfterShow =
false;
307 if ( closingBlocked )
309 return TQWidget::close ( alsoDelete );
323 bool block = myTimeTable->blockUpdating();
324 myTimeTable->setBlockUpdating(
false );
325 myTimeTable->updateMyContent();
332 int hintHeight = myTimeHeader->height();
333 int legendHeight = 0;
335 legendHeight = myLegend->height();
336 int listViewHeaderHeight = 0;
338 listViewHeaderHeight = myListView->header()->height();
339 if ( hintHeight < legendHeight+listViewHeaderHeight )
340 hintHeight = legendHeight + listViewHeaderHeight;
341 hintHeight += myListView->horizontalScrollBar()->height();
342 if ( myLegend->isShown() )
343 hintHeight += myLegend->legendSizeHint().height() +10;
344 hintHeight += myTimeTable->minimumHeight+myListView->frameWidth()*2+2;
345 int hintWid = myListView->sizeHint().width();
347 hintWid += myCanvasView->sizeHint().width();
350 myTimeTable->setBlockUpdating( block );
351 return TQSize( hintWid+10, hintHeight );
364 _showLegendButton =
show;
369 slotHeaderSizeChanged();
381 return _showLegendButton;
394 myListView->header()->show();
396 myListView->header()->hide();
397 _showHeader = visible;
398 slotHeaderSizeChanged();
424 return myTimeHeader->getDateTimeForIndex(coordX, !global );
431void KDGanttView::slotSelectionChanged( TQListViewItem* item )
443void KDGanttView::slotmouseButtonClicked (
int button, TQListViewItem * item,
444 const TQPoint & pos,
int c )
446 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
448 if (gItem == 0 && myCurrentItem != 0 ) {
452 if (gItem != 0 && myCurrentItem == 0 ) {
453 myCurrentItem = gItem;
461 case TQt::LeftButton:
479void KDGanttView::slotcontextMenuRequested ( TQListViewItem * item,
const TQPoint & pos,
int col )
481 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
491void KDGanttView::slotdoubleClicked ( TQListViewItem * item )
494 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
504void KDGanttView::slotCurrentChanged ( TQListViewItem * item )
506 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
507 myCurrentItem = gItem;
515void KDGanttView::slotItemRenamed ( TQListViewItem * item ,
int col,
516 const TQString & text )
518 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
526void KDGanttView::slotMouseButtonPressed (
int button, TQListViewItem * item,
527 const TQPoint & pos,
int c )
529 KDGanttViewItem* gItem =
static_cast<KDGanttViewItem*
>( item );
551 TQScrollBar *cvh, *cvv;
552 cvh = myCanvasView->horizontalScrollBar();
553 cvv = myCanvasView->verticalScrollBar();
555 cvh->disconnect(
this );
556 cvv->disconnect(
this );
563 connect( cvv, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
564 connect( cvh, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
565 connect( cvv, TQ_SIGNAL (nextLine () ) ,
this, TQ_SLOT(forceRepaint()));
566 connect( cvh, TQ_SIGNAL (nextLine () ) ,
this, TQ_SLOT(forceRepaint()));
567 connect( cvv, TQ_SIGNAL (prevLine () ) ,
this, TQ_SLOT(forceRepaint()));
568 connect( cvh, TQ_SIGNAL (prevLine () ) ,
this, TQ_SLOT(forceRepaint()));
571 connect( cvv, TQ_SIGNAL (valueChanged (
int ) ) ,
this, TQ_SLOT(forceRepaint(
int )));
572 connect( cvh, TQ_SIGNAL (valueChanged (
int ) ) ,
this, TQ_SLOT(forceRepaint(
int )));
573 connect( cvv, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
574 connect( cvh, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
580void KDGanttView::forceRepaint(
int )
582 if ( myTimeTable->blockUpdating() )
585 myTimeTable->setAllChanged();
586 myTimeTable->update();
590void KDGanttView::slotHeaderSizeChanged()
592 int legendHeight = 0;
595 int listViewHeaderHeight = 0;
597 listViewHeaderHeight = myListView->header()->height();
598 int timeHeaderHeight = myTimeHeader->height()+myTimeHeaderScroll->frameWidth()*2;;
599 int diffY = timeHeaderHeight-legendHeight-listViewHeaderHeight;
601 spacerLeft->setFixedHeight( 0 );
602 spacerRight->setFixedHeight(-diffY);
604 spacerRight->setFixedHeight( 0 );
605 spacerLeft->setFixedHeight( diffY );
607 myLegend->setFixedHeight( legendHeight );
608 myTimeHeaderContainer->setFixedHeight( timeHeaderHeight );
619 bool isdock = myLegend->asDoctwindow();
620 if (
show != isdock ) {
621 myLegend->setAsDoctwindow(
show);
624 for ( li = myLegendItems->first(); li; li = myLegendItems->next() ) {
625 myLegend->addLegendItem(li->shape, li->color, li->text );
638 return myLegend->asDoctwindow();
656 return myLegend->dockwindow();
670 myLegend->showMe(
show);
684 return myLegend->isShown();
698 if(listViewIsVisible ==
show)
return;
699 listViewIsVisible =
show;
700 if (listViewIsVisible)
701 myListView->parentWidget()->show();
703 myListView->parentWidget()->hide();
715 return listViewIsVisible;
730 editorIsEnabled = enable;
744 return editorIsEnabled;
771 return chartIsEditable;
790 TQDomDocument doc = saveXML();
791 if( device->isOpen() )
793 if( device->open( IO_WriteOnly ) ) {
794 TQTextStream ts( device );
795 ts << doc.toString();
817 if( device->isOpen() )
819 if( device->open( IO_ReadOnly ) ) {
820 TQDomDocument doc(
"GanttView" );
823 if ( !doc.setContent( device, &err, &errline, &errcol ) ) {
824 tqDebug(
"KDGantt::Error parsing XML data at line %d. Message is:", errline );
825 tqDebug(
"%s ", err.latin1());
830 return loadXML( doc );
855 bool printListView,
bool printTimeLine,
858 bool deletePrinter =
false;
860 printer =
new TQPrinter();
861 deletePrinter =
true;
862 if ( !printer->setup()) {
868 TQPainter p( printer );
870 TQPaintDeviceMetrics m = TQPaintDeviceMetrics ( printer );
875 TQSize size =
drawContents( 0, printListView, printTimeLine, printLegend );
878 TQString date =
"Printing Time: " + TQDateTime::currentDateTime().toString();
879 int hei = p.boundingRect(0,0, 5, 5, TQt::AlignLeft, date ).height();
880 p.drawText( 0, 0, date );
883 dx = (float) m.width() / (float)size.width();
884 dy = (float)(m.height() - ( 2 * hei )) / (float)size.height();
894 p.translate( 0, 2*hei );
895 drawContents( &p, printListView, printTimeLine, printLegend );
947 bool drawListView ,
bool drawTimeLine,
bool drawLegend )
950 int lvX, lvY, thX, thY, tlX, tlY, lwX, lwY, allX, allY;
951 lvX = myListView->contentsWidth();
952 lvY = myCanvasView->canvas()->height() + 20;
953 thX = myTimeHeader->width();
954 thY = myTimeHeader->height();
955 tlX = myCanvasView->canvas()->width();
957 lwX = myLegend->legendSize().width();
958 lwY = myLegend->legendSize().height();
961 if ( drawListView ) {
965 if ( drawTimeLine ) {
974 size = TQSize( allX, allY );
977 if ( drawListView ) {
980 p->translate( 0, temp );
983 myListView->drawToPainter( p, drawTimeLine );
984 p->translate( lvX, -temp);
986 if ( drawTimeLine ) {
987 p->translate( myCanvasView->frameWidth(), 0);
988 myTimeHeader->repaintMe( 0, myTimeHeader->width(), p );
989 p->translate( -myCanvasView->frameWidth(), thY);
990 myCanvasView->drawToPainter( p );
992 p->translate( -lvX, tlY);
994 p->translate( 0, tlY);
997 p->translate( -lvX, 0 );
1000 myLegend->drawToPainter( p );
1001 p->translate( 0, lwY );
1022 myTimeHeader->zoom(factor,absolute);
1035 return myTimeHeader->zoomFactor();
1049 myTimeHeader->zoomToFit();
1067 myTimeHeader->zoomToSelection( start, end);
1080 myListView->ensureItemVisible (item);
1094 myTimeHeader->centerDateTime(
center );
1113 myTimeHeader->centerDateTime(
center );
1114 if ( ! isVisible() ) {
1115 dtCenterTimeLineAfterShow =
center;
1116 fCenterTimeLineAfterShow =
true;
1126 myCanvasView->horizontalScrollBar()->setValue( 0 );
1135 myCanvasView->horizontalScrollBar()->setValue(myCanvasView->horizontalScrollBar()->maxValue());
1151 myTimeHeader->addTickLeft( num );
1166 myTimeHeader->addTickRight( num );
1177 int x = myListView->contentsWidth()/2;
1178 int y = myListView->itemPos (item );
1179 myListView->center(x,y);
1191 myTimeTable->setShowTaskLinks(
show);
1204 return myTimeTable->showTaskLinks();
1217 myListView->setFont(font);
1218 myListView->repaint();
1219 myTimeHeader->setFont(font);
1220 myLegend->setFont( font );
1221 TQWidget::setFont( font );
1258 myTimeHeader->setShowPopupMenu(
show,showZoom,showScale,showTime,
1259 showYear,showGrid,showPrint );
1271 return myTimeHeader->showPopupMenu();
1291 myCanvasView->setShowPopupMenu(
show );
1303 return myCanvasView->showPopupMenu();
1328 bool overwriteExisting )
1330 if ( overwriteExisting ) {
1331 TQListViewItemIterator it(myListView);
1332 for ( ; it.current(); ++it ) {
1333 if ( ((KDGanttViewItem*)it.current())->type() == type)
1334 ((KDGanttViewItem*)it.current())->setShapes(start,middle, end );
1337 int index = getIndex( type );
1338 myDefaultShape [index*3] = start;
1339 myDefaultShape [index*3+1] = middle;
1340 myDefaultShape [index*3+2] = end;
1341 undefinedShape[index] =
false;
1362 int index = getIndex( type );
1363 start = myDefaultShape [index*3];
1364 middle = myDefaultShape [index*3+1];
1365 end = myDefaultShape [index*3+2];
1366 return !undefinedShape[index];
1388 const TQColor& start,
const TQColor& middle,
1390 bool overwriteExisting )
1392 if ( overwriteExisting ) {
1393 TQListViewItemIterator it(myListView);
1394 for ( ; it.current(); ++it ) {
1395 if ( ((KDGanttViewItem*)it.current())->type() == type)
1396 ((KDGanttViewItem*)it.current())->setColors(start,middle, end );
1399 int index = getIndex( type );
1400 myColor [index*3] = start;
1401 myColor [index*3+1] = middle;
1402 myColor [index*3+2] = end;
1403 undefinedColor[index] =
false;
1420 TQColor& start, TQColor& middle, TQColor& end )
const
1422 int index = getIndex( type );
1423 start = myColor [index*3];
1424 middle = myColor [index*3+1];
1425 end = myColor [index*3+2];
1426 return !undefinedColor[index];
1450 const TQColor& start,
1451 const TQColor& middle,
1453 bool overwriteExisting )
1455 if ( overwriteExisting ) {
1456 TQListViewItemIterator it(myListView);
1457 for ( ; it.current(); ++it ) {
1458 if ( ((KDGanttViewItem*)it.current())->type() == type)
1459 ((KDGanttViewItem*)it.current())->setHighlightColors(start,middle, end );
1462 int index = getIndex( type );
1463 myColorHL [index*3] = start;
1464 myColorHL [index*3+1] = middle;
1465 myColorHL [index*3+2] = end;
1466 undefinedColorHL[index] =
false;
1486 TQColor& start, TQColor& middle,
1487 TQColor& end )
const
1489 int index = getIndex( type );
1490 start = myColorHL [index*3];
1491 middle = myColorHL [index*3+1];
1492 end = myColorHL [index*3+2];
1493 return !undefinedColorHL[index];
1506 TQListViewItemIterator it(myListView);
1507 for ( ; it.current(); ++it ) {
1508 ((KDGanttViewItem*)it.current())->setTextColor(color);
1510 myTextColor = color;
1538 myTimeTable->setNoInformationBrush( brush );
1550 return myTimeTable->noInformationBrush();
1561 myLegend->clearLegend();
1562 myLegendItems->setAutoDelete(
true );
1563 delete myLegendItems;
1564 myLegendItems =
new TQPtrList<legendItem>;
1577 const TQColor& shapeColor,
1578 const TQString& text )
1580 myLegend->addLegendItem( shape,shapeColor,text );
1581 legendItem* item =
new legendItem;
1582 item->shape = shape;
1583 item->color = shapeColor;
1585 myLegendItems->append( item );
1598 myTimeHeader->setHorizonStart(start);
1610 return myTimeHeader->horizonStart();
1623 myTimeHeader->setHorizonEnd(end);
1636 return myTimeHeader->horizonEnd();
1649 myTimeHeader->setScale( unit );
1661 return myTimeHeader->scale();
1673 myTimeHeader->setMaximumScale( unit );
1685 return myTimeHeader->maximumScale();
1697 myTimeHeader->setMinimumScale( unit );
1709 return myTimeHeader->minimumScale();
1724 myTimeHeader->setAutoScaleMinorTickCount( count );
1736 return myTimeHeader->autoScaleMinorTickCount();
1750 myTimeHeader->setMinimumColumnWidth( width );
1762 return myTimeHeader->minimumColumnWidth();
1775 myTimeHeader->setYearFormat(format );
1787 return myTimeHeader->yearFormat();
1801 myTimeHeader->setHourFormat( format );
1814 return myTimeHeader->hourFormat();
1830 myTimeHeader->setShowMajorTicks(
show );
1842 return myTimeHeader->showMajorTicks();
1860 myTimeHeader->setShowMinorTicks(
show );
1872 return myTimeHeader->showMinorTicks();
1894 const TQColor& color ,
1897 myTimeHeader->setColumnBackgroundColor( column, color,mini,maxi );
1928 const TQDateTime& end,
1929 const TQColor& color ,
1932 myTimeHeader->setIntervalBackgroundColor( start, end, color,mini,maxi );
1955 const TQDateTime& oldend,
1956 const TQDateTime& newstart,
1957 const TQDateTime& newend )
1959 return myTimeHeader->changeBackgroundInterval( oldstart, oldend,
1973 const TQDateTime& end)
1975 return myTimeHeader->deleteBackgroundInterval( start, end );
1989 myTimeHeader->clearBackgroundColor();
2003 return myTimeHeader->columnBackgroundColor( column ) ;
2017 myTimeHeader->setWeekendBackgroundColor( color );
2029 return myTimeHeader->weekendBackgroundColor();
2045 myTimeHeader->setWeekdayBackgroundColor( color, weekday );
2058 return myTimeHeader->weekdayBackgroundColor( weekday);
2075 myTimeHeader->setWeekendDays( start, end );
2088 myTimeHeader->weekendDays( start, end );
2194 myTimeHeader->setMajorScaleCount(count );
2206 return myTimeHeader->majorScaleCount();
2218 myTimeHeader->setMinorScaleCount(count );
2230 return myTimeHeader->minorScaleCount();
2248 const TQColor& color,
2249 bool overwriteExisting )
2251 if ( overwriteExisting ) {
2252 TQListViewItemIterator it(myListView);
2253 for ( ; it.current(); ++it ) {
2254 if ( ((KDGanttViewItem*)it.current())->type() == type)
2255 ((KDGanttViewItem*)it.current())->setDefaultColor(color );
2258 int index = getIndex( type );
2259 myDefaultColor [index] = color;
2276 int index = getIndex( type );
2277 return myDefaultColor [index];
2294 const TQColor& color,
2295 bool overwriteExisting )
2297 if ( overwriteExisting ) {
2298 TQListViewItemIterator it(myListView);
2299 for ( ; it.current(); ++it ) {
2300 if ( ((KDGanttViewItem*)it.current())->type() == type)
2301 ((KDGanttViewItem*)it.current())->setDefaultHighlightColor(color );
2304 int index = getIndex( type );
2305 myDefaultColorHL [index] = color;
2322 int index = getIndex( type );
2323 return myDefaultColorHL [index];
2334 return (KDGanttViewItem*)myListView->
firstChild();
2356 myListView->setCalendarMode( mode );
2369 return myListView->calendarMode();
2385 TQListViewItemIterator it( myListView );
2386 for ( ; it.current(); ++it ) {
2387 KDGanttViewItem* currentItem = ( KDGanttViewItem* )it.current();
2390 _displaySubitemsAsGroup =
show;
2404 return _displaySubitemsAsGroup;
2417 _displayEmptyTasksAsLine =
show;
2429 return _displayEmptyTasksAsLine;
2449 myTimeTable->setHorBackgroundLines( count, brush );
2464 return myTimeTable->horBackgroundLines( brush );
2475 return (KDGanttViewItem*)myListView->lastItem ();
2487 return myTimeTable->taskLinks();
2498 return myTaskLinkGroupList;
2509bool KDGanttView::loadXML(
const TQDomDocument& doc )
2511 TQDomElement docRoot = doc.documentElement();
2512 TQDomNode node = docRoot.firstChild();
2513 while( !node.isNull() ) {
2514 TQDomElement element = node.toElement();
2515 if( !element.isNull() ) {
2516 TQString tagName = element.tagName();
2517 if( tagName ==
"ShowLegend" ) {
2519 if( KDGanttXML::readBoolNode( element, value ) )
2521 }
else if( tagName ==
"ShowLegendButton" ) {
2523 if( KDGanttXML::readBoolNode( element, value ) )
2525 }
else if( tagName ==
"LegendIsDockWindow" ) {
2527 if( KDGanttXML::readBoolNode( element, value ) )
2529 }
else if( tagName ==
"ShowListView" ) {
2531 if( KDGanttXML::readBoolNode( element, value ) )
2533 }
else if( tagName ==
"ShowHeader" ) {
2535 if( KDGanttXML::readBoolNode( element, value ) )
2537 }
else if( tagName ==
"ShowTaskLinks" ) {
2539 if( KDGanttXML::readBoolNode( element, value ) )
2541 }
else if( tagName ==
"EditorEnabled" ) {
2543 if( KDGanttXML::readBoolNode( element, value ) )
2545 }
else if( tagName ==
"DisplayEmptyTasksAsLine" ) {
2547 if( KDGanttXML::readBoolNode( element, value ) )
2549 }
else if( tagName ==
"GlobalFont" ) {
2551 if( KDGanttXML::readFontNode( element, font ) )
2553 }
else if( tagName ==
"HorizonStart" ) {
2555 if( KDGanttXML::readDateTimeNode( element, value ) )
2557 }
else if( tagName ==
"HorizonEnd" ) {
2559 if( KDGanttXML::readDateTimeNode( element, value ) )
2561 }
else if( tagName ==
"Scale" ) {
2563 if( KDGanttXML::readStringNode( element, value ) )
2564 setScale( stringToScale( value ) );
2565 }
else if( tagName ==
"MinimumScale" ) {
2567 if( KDGanttXML::readStringNode( element, value ) )
2569 }
else if( tagName ==
"MaximumScale" ) {
2571 if( KDGanttXML::readStringNode( element, value ) )
2573 }
else if( tagName ==
"YearFormat" ) {
2575 if( KDGanttXML::readStringNode( element, value ) )
2577 }
else if( tagName ==
"HourFormat" ) {
2579 if( KDGanttXML::readStringNode( element, value ) )
2581 }
else if( tagName ==
"ShowMinorTicks" ) {
2583 if( KDGanttXML::readBoolNode( element, value ) )
2585 }
else if( tagName ==
"ShowMajorTicks" ) {
2587 if( KDGanttXML::readBoolNode( element, value ) )
2589 }
else if( tagName ==
"DragEnabled" ) {
2591 if( KDGanttXML::readBoolNode( element, value ) )
2593 }
else if( tagName ==
"DropEnabled" ) {
2595 if( KDGanttXML::readBoolNode( element, value ) )
2597 }
else if( tagName ==
"CalendarMode" ) {
2599 if( KDGanttXML::readBoolNode( element, value ) )
2601 }
else if( tagName ==
"Editable" ) {
2603 if( KDGanttXML::readBoolNode( element, value ) )
2605 }
else if( tagName ==
"TextColor" ) {
2607 if( KDGanttXML::readColorNode( element, value ) )
2609 }
else if( tagName ==
"MajorScaleCount" ) {
2611 if( KDGanttXML::readIntNode( element, value ) )
2613 }
else if( tagName ==
"MinorScaleCount" ) {
2615 if( KDGanttXML::readIntNode( element, value ) )
2617 }
else if( tagName ==
"AutoScaleMinorTickCount" ) {
2619 if( KDGanttXML::readIntNode( element, value ) )
2621 }
else if( tagName ==
"MinimumColumnWidth" ) {
2623 if( KDGanttXML::readIntNode( element, value ) )
2625 }
else if( tagName ==
"GanttMaximumWidth" ) {
2627 if( KDGanttXML::readIntNode( element, value ) )
2629 }
else if( tagName ==
"NoInformationBrush" ) {
2631 if( KDGanttXML::readBrushNode( element, value ) )
2633 }
else if( tagName ==
"GanttViewBackgroundColor" ) {
2635 if( KDGanttXML::readColorNode( element, value ) )
2637 }
else if( tagName ==
"ListViewBackgroundColor" ) {
2639 if( KDGanttXML::readColorNode( element, value ) )
2641 }
else if( tagName ==
"TimeHeaderBackgroundColor" ) {
2643 if( KDGanttXML::readColorNode( element, value ) )
2645 }
else if( tagName ==
"LegendHeaderBackgroundColor" ) {
2647 if( KDGanttXML::readColorNode( element, value ) )
2649 }
else if( tagName ==
"WeekendBackgroundColor" ) {
2651 if( KDGanttXML::readColorNode( element, value ) )
2653 }
else if( tagName ==
"WeekdayBackgroundColor" ) {
2654 TQDomNode node = element.firstChild();
2657 while( !node.isNull() ) {
2658 TQDomElement element = node.toElement();
2659 if( !element.isNull() ) {
2660 TQString tagName = element.tagName();
2661 if( tagName ==
"Day" ) {
2663 if( KDGanttXML::readIntNode( element, value ) )
2665 }
else if( tagName ==
"Color" ) {
2667 if( KDGanttXML::readColorNode( element, value ) )
2670 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2674 node = node.nextSibling();
2677 if( day && color.isValid() )
2679 }
else if( tagName ==
"WeekendDays" ) {
2680 TQString startString = element.attribute(
"Start" );
2681 TQString endString = element.attribute(
"End" );
2682 bool startOk =
false, endOk =
false;
2683 int start = startString.toInt( &startOk );
2684 int end = startString.toInt( &endOk );
2685 if( startOk && endOk )
2687 }
else if( tagName ==
"ZoomFactor" ) {
2689 if( KDGanttXML::readDoubleNode( element, value ) )
2691 }
else if( tagName ==
"ShowHeaderPopupMenu" ) {
2693 if( KDGanttXML::readBoolNode( element, value ) )
2695 }
else if( tagName ==
"ShowTimeTablePopupMenu" ) {
2697 if( KDGanttXML::readBoolNode( element, value ) )
2699 }
else if( tagName ==
"Shapes" ) {
2700 TQDomNode node = element.firstChild();
2701 bool undefinedShape =
false;
2702 while( !node.isNull() ) {
2703 TQDomElement element = node.toElement();
2704 if( !element.isNull() ) {
2705 TQString tagName = element.tagName();
2706 if( tagName ==
"Event" ) {
2708 startShape = KDGanttViewItem::TriangleDown;
2709 middleShape = KDGanttViewItem::TriangleDown;
2710 endShape = KDGanttViewItem::TriangleDown;
2711 TQDomNode node = element.firstChild();
2712 while( !node.isNull() ) {
2713 TQDomElement element = node.toElement();
2714 if( !element.isNull() ) {
2715 TQString tagName = element.tagName();
2716 if( tagName ==
"Start" ) {
2718 if( KDGanttXML::readStringNode( element, value ) )
2719 startShape = KDGanttViewItem::stringToShape( value );
2720 if ( value ==
"Undefined" )
2721 undefinedShape =
true;
2722 }
else if( tagName ==
"Middle" ) {
2724 if( KDGanttXML::readStringNode( element, value ) )
2725 middleShape = KDGanttViewItem::stringToShape( value );
2726 if ( value ==
"Undefined" )
2727 undefinedShape =
true;
2728 }
else if( tagName ==
"End" ) {
2730 if( KDGanttXML::readStringNode( element, value ) )
2731 endShape = KDGanttViewItem::stringToShape( value );
2732 if ( value ==
"Undefined" )
2733 undefinedShape =
true;
2735 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2739 node = node.nextSibling();
2741 if ( ! undefinedShape )
2742 setShapes( KDGanttViewItem::Event, startShape,
2743 middleShape, endShape,
false );
2744 undefinedShape =
false;
2745 }
else if( tagName ==
"Task" ) {
2747 startShape = KDGanttViewItem::TriangleDown;
2748 middleShape = KDGanttViewItem::TriangleDown;
2749 endShape = KDGanttViewItem::TriangleDown;
2750 TQDomNode node = element.firstChild();
2751 while( !node.isNull()) {
2752 TQDomElement element = node.toElement();
2753 if( !element.isNull() ) {
2754 TQString tagName = element.tagName();
2755 if( tagName ==
"Start" ) {
2757 if( KDGanttXML::readStringNode( element, value ) )
2758 startShape = KDGanttViewItem::stringToShape( value );
2759 if ( value ==
"Undefined" )
2760 undefinedShape =
true;
2761 }
else if( tagName ==
"Middle" ) {
2763 if( KDGanttXML::readStringNode( element, value ) )
2764 middleShape = KDGanttViewItem::stringToShape( value );
2765 if ( value ==
"Undefined" )
2766 undefinedShape =
true;
2767 }
else if( tagName ==
"End" ) {
2769 if( KDGanttXML::readStringNode( element, value ) )
2770 endShape = KDGanttViewItem::stringToShape( value );
2771 if ( value ==
"Undefined" )
2772 undefinedShape =
true;
2774 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2778 node = node.nextSibling();
2780 if ( ! undefinedShape )
2781 setShapes( KDGanttViewItem::Task, startShape, middleShape, endShape,
false );
2782 undefinedShape =
false;
2783 }
else if( tagName ==
"Summary" ) {
2785 startShape = KDGanttViewItem::TriangleDown;
2786 middleShape = KDGanttViewItem::TriangleDown;
2787 endShape = KDGanttViewItem::TriangleDown;
2788 TQDomNode node = element.firstChild();
2789 while( !node.isNull() ) {
2790 TQDomElement element = node.toElement();
2791 if( !element.isNull() ) {
2792 TQString tagName = element.tagName();
2793 if( tagName ==
"Start" ) {
2795 if( KDGanttXML::readStringNode( element, value ) )
2796 startShape = KDGanttViewItem::stringToShape( value );
2797 if ( value ==
"Undefined" )
2798 undefinedShape =
true;
2799 }
else if( tagName ==
"Middle" ) {
2801 if( KDGanttXML::readStringNode( element, value ) )
2802 middleShape = KDGanttViewItem::stringToShape( value );
2803 if ( value ==
"Undefined" )
2804 undefinedShape =
true;
2805 }
else if( tagName ==
"End" ) {
2807 if( KDGanttXML::readStringNode( element, value ) )
2808 endShape = KDGanttViewItem::stringToShape( value );
2809 if ( value ==
"Undefined" )
2810 undefinedShape =
true;
2812 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2816 node = node.nextSibling();
2818 if ( ! undefinedShape )
2819 setShapes( KDGanttViewItem::Summary, startShape,
2820 middleShape, endShape,
false );
2821 undefinedShape =
false;
2823 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2827 node = node.nextSibling();
2829 }
else if( tagName ==
"Colors" ) {
2830 TQDomNode node = element.firstChild();
2831 while( !node.isNull()) {
2832 TQDomElement element = node.toElement();
2833 if( !element.isNull() ) {
2834 TQString tagName = element.tagName();
2835 if( tagName ==
"Event" ) {
2836 TQColor startColor, middleColor, endColor;
2837 TQDomNode node = element.firstChild();
2838 while( !node.isNull() ) {
2839 TQDomElement element = node.toElement();
2840 if( !element.isNull() ) {
2841 TQString tagName = element.tagName();
2842 if( tagName ==
"Start" ) {
2844 if( KDGanttXML::readColorNode( element, value ) )
2846 }
else if( tagName ==
"Middle" ) {
2848 if( KDGanttXML::readColorNode( element, value ) )
2849 middleColor = value;
2850 }
else if( tagName ==
"End" ) {
2852 if( KDGanttXML::readColorNode( element, value ) )
2855 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2859 node = node.nextSibling();
2861 setColors( KDGanttViewItem::Event, startColor,
2862 middleColor, endColor,
false );
2863 }
else if( tagName ==
"Task" ) {
2864 TQColor startColor, middleColor, endColor;
2865 TQDomNode node = element.firstChild();
2866 while( !node.isNull() ) {
2867 TQDomElement element = node.toElement();
2868 if( !element.isNull() ) {
2869 TQString tagName = element.tagName();
2870 if( tagName ==
"Start" ) {
2872 if( KDGanttXML::readColorNode( element, value ) )
2874 }
else if( tagName ==
"Middle" ) {
2876 if( KDGanttXML::readColorNode( element, value ) )
2877 middleColor = value;
2878 }
else if( tagName ==
"End" ) {
2880 if( KDGanttXML::readColorNode( element, value ) )
2883 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2887 node = node.nextSibling();
2889 setColors( KDGanttViewItem::Task, startColor,
2890 middleColor, endColor,
false );
2891 }
else if( tagName ==
"Summary" ) {
2892 TQColor startColor, middleColor, endColor;
2893 TQDomNode node = element.firstChild();
2894 while( !node.isNull() ) {
2895 TQDomElement element = node.toElement();
2896 if( !element.isNull() ) {
2897 TQString tagName = element.tagName();
2898 if( tagName ==
"Start" ) {
2900 if( KDGanttXML::readColorNode( element, value ) )
2902 }
else if( tagName ==
"Middle" ) {
2904 if( KDGanttXML::readColorNode( element, value ) )
2905 middleColor = value;
2906 }
else if( tagName ==
"End" ) {
2908 if( KDGanttXML::readColorNode( element, value ) )
2911 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2915 node = node.nextSibling();
2917 setColors( KDGanttViewItem::Summary, startColor,
2918 middleColor, endColor ,
false);
2920 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2924 node = node.nextSibling();
2926 }
else if( tagName ==
"DefaultColors" ) {
2927 TQDomNode node = element.firstChild();
2928 while( !node.isNull() ) {
2929 TQDomElement element = node.toElement();
2930 if( !element.isNull() ) {
2931 TQString tagName = element.tagName();
2932 if( tagName ==
"Event" ) {
2934 if( KDGanttXML::readColorNode( element, value ) )
2937 }
else if( tagName ==
"Task" ) {
2939 if( KDGanttXML::readColorNode( element, value ) )
2942 }
else if( tagName ==
"Summary" ) {
2944 if( KDGanttXML::readColorNode( element, value ) )
2948 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2953 node = node.nextSibling();
2955 }
else if( tagName ==
"HighlightColors" ) {
2956 TQDomNode node = element.firstChild();
2957 while( !node.isNull() ) {
2958 TQDomElement element = node.toElement();
2959 if( !element.isNull() ) {
2960 TQString tagName = element.tagName();
2961 if( tagName ==
"Event" ) {
2962 TQColor startColor, middleColor, endColor;
2963 TQDomNode node = element.firstChild();
2964 while( !node.isNull() ) {
2965 TQDomElement element = node.toElement();
2966 if( !element.isNull() ) {
2967 TQString tagName = element.tagName();
2968 if( tagName ==
"Start" ) {
2970 if( KDGanttXML::readColorNode( element, value ) )
2972 }
else if( tagName ==
"Middle" ) {
2974 if( KDGanttXML::readColorNode( element, value ) )
2975 middleColor = value;
2976 }
else if( tagName ==
"End" ) {
2978 if( KDGanttXML::readColorNode( element, value ) )
2981 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2985 node = node.nextSibling();
2989 middleColor, endColor,
false );
2990 }
else if( tagName ==
"Task" ) {
2991 TQColor startColor, middleColor, endColor;
2992 TQDomNode node = element.firstChild();
2993 while( !node.isNull() ) {
2994 TQDomElement element = node.toElement();
2995 if( !element.isNull() ) {
2996 TQString tagName = element.tagName();
2997 if( tagName ==
"Start" ) {
2999 if( KDGanttXML::readColorNode( element, value ) )
3001 }
else if( tagName ==
"Middle" ) {
3003 if( KDGanttXML::readColorNode( element, value ) )
3004 middleColor = value;
3005 }
else if( tagName ==
"End" ) {
3007 if( KDGanttXML::readColorNode( element, value ) )
3010 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3014 node = node.nextSibling();
3018 middleColor, endColor ,
false);
3019 }
else if( tagName ==
"Summary" ) {
3020 TQColor startColor, middleColor, endColor;
3021 TQDomNode node = element.firstChild();
3022 while( !node.isNull() ) {
3023 TQDomElement element = node.toElement();
3024 if( !element.isNull() ) {
3025 TQString tagName = element.tagName();
3026 if( tagName ==
"Start" ) {
3028 if( KDGanttXML::readColorNode( element, value ) )
3030 }
else if( tagName ==
"Middle" ) {
3032 if( KDGanttXML::readColorNode( element, value ) )
3033 middleColor = value;
3034 }
else if( tagName ==
"End" ) {
3036 if( KDGanttXML::readColorNode( element, value ) )
3039 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3043 node = node.nextSibling();
3047 middleColor, endColor,
false );
3049 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3053 node = node.nextSibling();
3055 }
else if( tagName ==
"DefaultHighlightColors" ) {
3056 TQDomNode node = element.firstChild();
3057 while( !node.isNull() ) {
3058 TQDomElement element = node.toElement();
3059 if( !element.isNull() ) {
3060 TQString tagName = element.tagName();
3061 if( tagName ==
"Event" ) {
3063 if( KDGanttXML::readColorNode( element, value ) )
3066 }
else if( tagName ==
"Task" ) {
3068 if( KDGanttXML::readColorNode( element, value ) )
3071 }
else if( tagName ==
"Summary" ) {
3073 if( KDGanttXML::readColorNode( element, value ) )
3077 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3082 node = node.nextSibling();
3084 }
else if( tagName ==
"Items" ) {
3085 TQDomNode node = element.firstChild();
3086 KDGanttViewItem* previous = 0;
3087 while( !node.isNull() ) {
3088 TQDomElement element = node.toElement();
3089 if( !element.isNull() ) {
3090 TQString tagName = element.tagName();
3091 if( tagName ==
"Item" ) {
3092 KDGanttViewItem* newItem;
3104 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3109 node = node.nextSibling();
3111 }
else if( tagName ==
"TaskLinks" ) {
3112 TQDomNode node = element.firstChild();
3113 while( !node.isNull() ) {
3114 TQDomElement element = node.toElement();
3115 if( !element.isNull() ) {
3116 TQString tagName = element.tagName();
3117 if( tagName ==
"TaskLink" )
3120 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3125 node = node.nextSibling();
3127 }
else if( tagName ==
"TaskLinkGroups" ) {
3128 TQDomNode node = element.firstChild();
3129 while( !node.isNull() ) {
3130 TQDomElement element = node.toElement();
3131 if( !element.isNull() ) {
3132 TQString tagName = element.tagName();
3133 if( tagName ==
"TaskLink" )
3136 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3140 node = node.nextSibling();
3142 }
else if( tagName ==
"ColumnBackgroundColors" ) {
3143 TQDomNode node = element.firstChild();
3144 while( !node.isNull() ) {
3145 TQDomElement element = node.toElement();
3146 if( !element.isNull() ) {
3147 TQString tagName = element.tagName();
3148 if( tagName ==
"ColumnBackgroundColor" ) {
3149 TQDomNode node = element.firstChild();
3150 TQDateTime dateTime;
3152 while( !node.isNull() ) {
3153 TQDomElement element = node.toElement();
3154 if( !element.isNull() ) {
3157 TQString tagName = element.tagName();
3158 if( tagName ==
"DateTime" ) {
3160 if( KDGanttXML::readDateTimeNode( element, value ) )
3162 }
else if( tagName ==
"Color" ) {
3164 if( KDGanttXML::readColorNode( element, value ) )
3167 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3172 node = node.nextSibling();
3176 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3180 node = node.nextSibling();
3182 }
else if( tagName ==
"LegendItems" ) {
3184 TQDomNode node = element.firstChild();
3185 while( !node.isNull() ) {
3186 TQDomElement element = node.toElement();
3187 if( !element.isNull() ) {
3188 TQString tagName = element.tagName();
3189 if( tagName ==
"LegendItem" ) {
3191 tempLegendShape = KDGanttViewItem::TriangleDown;
3192 TQColor tempLegendColor;
3193 TQString tempLegendString;
3195 TQDomNode node = element.firstChild();
3196 while( !node.isNull() ) {
3197 TQDomElement element = node.toElement();
3198 if( !element.isNull() ) {
3199 TQString tagName = element.tagName();
3200 if( tagName ==
"Shape" ) {
3202 if( KDGanttXML::readStringNode( element, value ) )
3203 tempLegendShape = KDGanttViewItem::stringToShape( value );
3206 }
else if( tagName ==
"Color" ) {
3208 if( KDGanttXML::readColorNode( element, value ) )
3209 tempLegendColor = value;
3212 }
else if( tagName ==
"Text" ) {
3214 if( KDGanttXML::readStringNode( element, value ) )
3215 tempLegendString = value;
3219 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3223 node = node.nextSibling();
3229 tqDebug(
"Adding legend item %s", tempLegendString.latin1() );
3232 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3236 node = node.nextSibling();
3239 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3244 node = node.nextSibling();
3258TQDomDocument KDGanttView::saveXML(
bool withPI )
const
3261 TQString docstart =
"<GanttView/>";
3263 TQDomDocument doc(
"GanttView" );
3264 doc.setContent( docstart );
3266 TQDomProcessingInstruction pin = doc.createProcessingInstruction(
"kdgantt",
"version=\"1.0\" encoding=\"UTF-8\"" ) ;
3267 doc.appendChild ( pin );
3270 TQDomElement docRoot = doc.documentElement();
3271 docRoot.setAttribute(
"xmlns",
"http://www.klaralvdalens-datakonsult.se/kdgantt" );
3272 docRoot.setAttribute(
"xmlns:xsi",
"http://www.w3.org/2000/10/XMLSchema-instance" );
3273 docRoot.setAttribute(
"xsi:schemaLocation",
"http://www.klaralvdalens-datakonsult.se/kdgantt" );
3276 KDGanttXML::createBoolNode( doc, docRoot,
"ShowLegend",
showLegend() );
3279 KDGanttXML::createBoolNode( doc, docRoot,
"ShowLegendButton",
3283 KDGanttXML::createBoolNode( doc, docRoot,
"LegendIsDockWindow",
3287 KDGanttXML::createBoolNode( doc, docRoot,
"ShowListView",
showListView() );
3290 KDGanttXML::createBoolNode( doc, docRoot,
"ShowHeader",
headerVisible() );
3293 KDGanttXML::createBoolNode( doc, docRoot,
"ShowTaskLinks",
showTaskLinks() );
3296 KDGanttXML::createBoolNode( doc, docRoot,
"EditorEnabled",
editorEnabled() );
3299 KDGanttXML::createFontNode( doc, docRoot,
"GlobalFont", font() );
3302 KDGanttXML::createBoolNode( doc, docRoot,
"DisplayEmptyTasksAsLine",
3306 KDGanttXML::createDateTimeNode( doc, docRoot,
"HorizonStart",
horizonStart() );
3309 KDGanttXML::createDateTimeNode( doc, docRoot,
"HorizonEnd",
horizonEnd() );
3312 KDGanttXML::createStringNode( doc, docRoot,
"Scale", scaleToString(
scale() ) );
3313 KDGanttXML::createStringNode( doc, docRoot,
"MinimumScale",
3315 KDGanttXML::createStringNode( doc, docRoot,
"MaximumScale",
3319 KDGanttXML::createStringNode( doc, docRoot,
"YearFormat",
3323 KDGanttXML::createStringNode( doc, docRoot,
"HourFormat",
3327 KDGanttXML::createBoolNode( doc, docRoot,
"ShowMinorTicks",
showMinorTicks() );
3330 KDGanttXML::createBoolNode( doc, docRoot,
"ShowMajorTicks",
showMajorTicks() );
3333 KDGanttXML::createBoolNode( doc, docRoot,
"Editable",
editable() );
3336 KDGanttXML::createColorNode( doc, docRoot,
"TextColor",
textColor() );
3339 KDGanttXML::createIntNode( doc, docRoot,
"MajorScaleCount",
majorScaleCount() );
3342 KDGanttXML::createIntNode( doc, docRoot,
"MinorScaleCount",
minorScaleCount() );
3345 KDGanttXML::createIntNode( doc, docRoot,
"AutoScaleMinorTickCount",
3349 KDGanttXML::createIntNode( doc, docRoot,
"MinimumColumnWidth",
3353 KDGanttXML::createIntNode( doc, docRoot,
"GanttMaximumWidth",
3357 KDGanttXML::createBrushNode( doc, docRoot,
"NoInformationBrush",
3361 KDGanttXML::createColorNode( doc, docRoot,
"GanttViewBackgroundColor",
3365 KDGanttXML::createColorNode( doc, docRoot,
"ListViewBackgroundColor",
3369 KDGanttXML::createColorNode( doc, docRoot,
"TimeHeaderBackgroundColor",
3373 KDGanttXML::createColorNode( doc, docRoot,
"LegendHeaderBackgroundColor",
3377 KDGanttXML::createColorNode( doc, docRoot,
"WeekendBackgroundColor",
3381 for(
int weekday = 1; weekday <= 7; weekday++ ) {
3383 if( color.isValid() ) {
3384 TQDomElement weekendBackgroundColorElement = doc.createElement(
"WeekdayBackgroundColor" );
3385 docRoot.appendChild( weekendBackgroundColorElement );
3386 KDGanttXML::createIntNode( doc, weekendBackgroundColorElement,
3388 KDGanttXML::createColorNode( doc, weekendBackgroundColorElement,
3394 TQDomElement weekendDaysElement = doc.createElement(
"WeekendDays" );
3395 docRoot.appendChild( weekendDaysElement );
3396 int weekendStart, weekendEnd;
3398 weekendDaysElement.setAttribute(
"Start", weekendStart );
3399 weekendDaysElement.setAttribute(
"End", weekendStart );
3402 KDGanttXML::createDoubleNode( doc, docRoot,
"ZoomFactor",
3406 KDGanttXML::createBoolNode( doc, docRoot,
"ShowHeaderPopupMenu",
3410 KDGanttXML::createBoolNode( doc, docRoot,
"ShowTimeTablePopupMenu",
3414 TQDomElement shapesElement = doc.createElement(
"Shapes" );
3415 docRoot.appendChild( shapesElement );
3416 TQDomElement shapesEventElement = doc.createElement(
"Event" );
3417 shapesElement.appendChild( shapesEventElement );
3419 if(
shapes( KDGanttViewItem::Event, start, middle, end ) ) {
3420 KDGanttXML::createStringNode( doc, shapesEventElement,
"Start",
3421 KDGanttViewItem::shapeToString( start ) );
3422 KDGanttXML::createStringNode( doc, shapesEventElement,
"Middle",
3423 KDGanttViewItem::shapeToString( middle ) );
3424 KDGanttXML::createStringNode( doc, shapesEventElement,
"End",
3425 KDGanttViewItem::shapeToString( end ) );
3427 KDGanttXML::createStringNode( doc, shapesEventElement,
"Start",
3429 KDGanttXML::createStringNode( doc, shapesEventElement,
"Middle",
3431 KDGanttXML::createStringNode( doc, shapesEventElement,
"End",
3434 TQDomElement shapesTaskElement = doc.createElement(
"Task" );
3435 shapesElement.appendChild( shapesTaskElement );
3436 if(
shapes( KDGanttViewItem::Task, start, middle, end ) ) {
3437 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Start",
3438 KDGanttViewItem::shapeToString( start ) );
3439 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Middle",
3440 KDGanttViewItem::shapeToString( middle ) );
3441 KDGanttXML::createStringNode( doc, shapesTaskElement,
"End",
3442 KDGanttViewItem::shapeToString( end ) );
3444 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Start",
3446 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Middle",
3448 KDGanttXML::createStringNode( doc, shapesTaskElement,
"End",
3451 TQDomElement shapesSummaryElement = doc.createElement(
"Summary" );
3452 shapesElement.appendChild( shapesSummaryElement );
3453 if(
shapes( KDGanttViewItem::Event, start, middle, end ) ) {
3454 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Start",
3455 KDGanttViewItem::shapeToString( start ) );
3456 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Middle",
3457 KDGanttViewItem::shapeToString( middle ) );
3458 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"End",
3459 KDGanttViewItem::shapeToString( end ) );
3461 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Start",
3463 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Middle",
3465 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"End",
3470 TQDomElement colorsElement = doc.createElement(
"Colors" );
3471 docRoot.appendChild( colorsElement );
3472 TQDomElement colorsEventElement = doc.createElement(
"Event" );
3473 colorsElement.appendChild( colorsEventElement );
3474 TQColor startColor, middleColor, endColor;
3475 colors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3476 KDGanttXML::createColorNode( doc, colorsEventElement,
"Start", startColor );
3477 KDGanttXML::createColorNode( doc, colorsEventElement,
"Middle", middleColor );
3478 KDGanttXML::createColorNode( doc, colorsEventElement,
"End", endColor );
3479 TQDomElement colorsTaskElement = doc.createElement(
"Task" );
3480 colorsElement.appendChild( colorsTaskElement );
3481 colors( KDGanttViewItem::Task, startColor, middleColor, endColor );
3482 KDGanttXML::createColorNode( doc, colorsTaskElement,
"Start", startColor );
3483 KDGanttXML::createColorNode( doc, colorsTaskElement,
"Middle", middleColor );
3484 KDGanttXML::createColorNode( doc, colorsTaskElement,
"End", endColor );
3485 TQDomElement colorsSummaryElement = doc.createElement(
"Summary" );
3486 colorsElement.appendChild( colorsSummaryElement );
3487 colors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3488 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"Start", startColor );
3489 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"Middle", middleColor );
3490 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"End", endColor );
3493 TQDomElement defaultColorsElement = doc.createElement(
"DefaultColors" );
3494 docRoot.appendChild( defaultColorsElement );
3495 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Event",
3497 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Task",
3499 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Summary",
3504 TQDomElement highlightColorsElement = doc.createElement(
"HighlightColors" );
3505 docRoot.appendChild( highlightColorsElement );
3506 TQDomElement highlightColorsEventElement = doc.createElement(
"Event" );
3507 highlightColorsElement.appendChild( highlightColorsEventElement );
3508 highlightColors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3509 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"Start", startColor );
3510 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"Middle", middleColor );
3511 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"End", endColor );
3512 TQDomElement highlightColorsTaskElement = doc.createElement(
"Task" );
3513 highlightColorsElement.appendChild( highlightColorsTaskElement );
3514 highlightColors( KDGanttViewItem::Task, startColor, middleColor, endColor );
3515 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"Start", startColor );
3516 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"Middle", middleColor );
3517 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"End", endColor );
3518 TQDomElement highlightColorsSummaryElement = doc.createElement(
"Summary" );
3519 highlightColorsElement.appendChild( highlightColorsSummaryElement );
3520 highlightColors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3521 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"Start", startColor );
3522 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"Middle", middleColor );
3523 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"End", endColor );
3538 TQDomElement defaultHighlightColorsElement = doc.createElement(
"DefaultHighlightColors" );
3539 docRoot.appendChild( defaultHighlightColorsElement );
3540 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Event",
3542 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Task",
3544 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Summary",
3549 TQDomElement itemsElement = doc.createElement(
"Items" );
3550 docRoot.appendChild( itemsElement );
3552 while( currentItem ) {
3553 currentItem->
createNode( doc, itemsElement );
3558 TQDomElement taskLinksElement = doc.createElement(
"TaskLinks" );
3559 docRoot.appendChild( taskLinksElement );
3560 TQPtrList<KDGanttViewTaskLink> taskLinkList =
taskLinks();
3561 KDGanttViewTaskLink* currentTL = 0;
3562 for( currentTL = taskLinkList.first(); currentTL;
3563 currentTL = taskLinkList.next() )
3564 currentTL->
createNode( doc, taskLinksElement );
3567 TQDomElement taskLinkGroupsElement = doc.createElement(
"TaskLinkGroups" );
3568 docRoot.appendChild( taskLinkGroupsElement );
3569 TQPtrList<KDGanttViewTaskLinkGroup> taskLinkGroupList =
taskLinkGroups();
3570 KDGanttViewTaskLinkGroup* currentTLG = 0;
3571 for( currentTLG = taskLinkGroupList.first(); currentTLG;
3572 currentTLG = taskLinkGroupList.next() )
3573 currentTLG->
createNode( doc, taskLinkGroupsElement );
3576 TQDomElement columnBackgroundColorsElement =
3577 doc.createElement(
"ColumnBackgroundColors" );
3578 docRoot.appendChild( columnBackgroundColorsElement );
3579 KDTimeHeaderWidget::ColumnColorList ccList =
3580 myTimeHeader->columnBackgroundColorList();
3581 for( KDTimeHeaderWidget::ColumnColorList::iterator it = ccList.begin();
3582 it != ccList.end(); ++it ) {
3583 TQDomElement columnBackgroundColorElement =
3584 doc.createElement(
"ColumnBackgroundColor" );
3585 columnBackgroundColorsElement.appendChild( columnBackgroundColorElement );
3586 KDGanttXML::createDateTimeNode( doc, columnBackgroundColorElement,
3587 "DateTime", (*it).datetime );
3588 KDGanttXML::createColorNode( doc, columnBackgroundColorElement,
3589 "Color", (*it).color );
3593 TQDomElement legendItemsElement =
3594 doc.createElement(
"LegendItems" );
3595 docRoot.appendChild( legendItemsElement );
3596 legendItem* current;
3597 TQPtrListIterator<legendItem> lit( *myLegendItems );
3598 while( ( current = lit.current() ) ) {
3600 TQDomElement legendItemElement = doc.createElement(
"LegendItem" );
3601 legendItemsElement.appendChild( legendItemElement );
3602 KDGanttXML::createStringNode( doc, legendItemElement,
"Shape",
3603 KDGanttViewItem::shapeToString( current->shape ) );
3604 KDGanttXML::createColorNode( doc, legendItemElement,
"Color",
3606 KDGanttXML::createStringNode( doc, legendItemElement,
"Text",
3611 KDGanttXML::createBoolNode( doc, docRoot,
"DragEnabled",
isDragEnabled() );
3614 KDGanttXML::createBoolNode( doc, docRoot,
"DropEnabled",
isDropEnabled() );
3617 KDGanttXML::createBoolNode( doc, docRoot,
"CalendarMode",
calendarMode() );
3624TQString KDGanttView::scaleToString( Scale scale )
3646 if(
string ==
"Minute" )
3648 else if(
string ==
"Hour" )
3650 else if(
string ==
"Day" )
3652 else if(
string ==
"Week" )
3654 else if(
string ==
"Month" )
3656 else if(
string ==
"Auto" )
3663TQString KDGanttView::yearFormatToString( YearFormat format )
3670 case TwoDigitApostrophe:
3671 return "TwoDigitApostrophe";
3681 if(
string ==
"FourDigit" )
3683 else if(
string ==
"TwoDigit" )
3685 else if(
string ==
"TwoDigitApostrophe" )
3686 return TwoDigitApostrophe;
3687 else if(
string ==
"NoDate" )
3694TQString KDGanttView::hourFormatToString( HourFormat format )
3701 case Hour_24_FourDigit:
3702 return "Hour_24_FourDigit";
3710 if(
string ==
"Hour_12" )
3712 else if(
string ==
"Hour_24" )
3722 if (myTaskLinkGroupList.isEmpty()) {
3723 myTaskLinkGroupList.append(group);
3726 if (myTaskLinkGroupList.find(group) == -1)
3727 myTaskLinkGroupList.append(group);
3733 myTaskLinkGroupList.remove(group);
3748 myItemAttributeDialog->reset( item );
3749 myItemAttributeDialog->show();
3766 const TQColor& shapeColor,
3767 const TQColor& backgroundColor,
int itemSize)
3770 int size = itemSize+2;
3771 int hei = ( itemSize/3 ) / 2;
3772 TQPixmap p = TQPixmap( size+4, size+4 );
3773 p.fill( backgroundColor );
3774 TQPainter paint (&p);
3775 TQBrush b = TQBrush ( TQt::SolidPattern );
3776 b.setColor( shapeColor );
3777 paint.setBrush( b );
3778 TQPen pen( TQt::black, 1 ) ;
3779 paint.setPen( pen );
3781 case KDGanttViewItem::TriangleDown:{
3782 TQPointArray arr = TQPointArray(3);
3783 arr.setPoint(0,-size/2,-hei);
3784 arr.setPoint(1,size/2,-hei);
3785 arr.setPoint(2,0,((size/2)-hei));
3786 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3787 paint.drawPolygon( arr );
3790 case KDGanttViewItem::TriangleUp :{
3791 TQPointArray arr = TQPointArray(3);
3792 arr.setPoint(0,-size/2,hei);
3793 arr.setPoint(1,size/2,hei);
3794 arr.setPoint(2,0,(-size/2)+hei);
3795 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3796 paint.drawPolygon( arr );
3799 case KDGanttViewItem::Diamond :{
3800 TQPointArray arr = TQPointArray(4);
3801 arr.setPoint(0,0,-size/2);
3802 arr.setPoint(1,size/2,0);
3803 arr.setPoint(2,0,size/2);
3804 arr.setPoint(3,-size/2,0);
3805 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3806 paint.drawPolygon( arr );
3809 case KDGanttViewItem::Square :{
3810 TQPointArray arr = TQPointArray(4);
3811 arr.setPoint(0,-size/2,-size/2);
3812 arr.setPoint(1,size/2,-size/2);
3813 arr.setPoint(2,size/2,size/2);
3814 arr.setPoint(3,-size/2,size/2);
3815 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3816 paint.drawPolygon( arr );
3819 case KDGanttViewItem::Circle :{
3820 paint.drawEllipse( 2, 2, size, size);
3832 case (KDGanttViewItem::Event):
3835 case (KDGanttViewItem::Task):
3838 case (KDGanttViewItem::Summary):
3846void KDGanttView::initDefaults()
3850 for (i = 0;i<3;++i) {
3851 undefinedShape[i] =
true;
3852 undefinedColor[i] =
true;
3853 undefinedColorHL[i] =
true;
3856 myDefaultColor [ getIndex( KDGanttViewItem::Event ) ] = TQt::blue;
3857 myDefaultColorHL [ getIndex( KDGanttViewItem::Event ) ] = TQt::red;
3858 myDefaultColor [ getIndex( KDGanttViewItem::Task ) ] = TQt::green;
3859 myDefaultColorHL [ getIndex( KDGanttViewItem::Task ) ] = TQt::red;
3860 myDefaultColor [ getIndex( KDGanttViewItem::Summary ) ] = TQt::cyan;
3861 myDefaultColorHL [ getIndex( KDGanttViewItem::Summary ) ] = TQt::red;
3865 for (i = 0;i<3;++i) {
3866 myDefaultShape [3*getIndex( KDGanttViewItem::Event )+ i] = KDGanttViewItem::Diamond;
3867 myDefaultShape [3*getIndex( KDGanttViewItem::Task ) +i] = KDGanttViewItem::Square;
3868 myDefaultShape [3*getIndex( KDGanttViewItem::Summary ) +i] = KDGanttViewItem::TriangleDown;
3880 return myListView->addColumn( label, width );
3891 return myListView->addColumn( iconset, label, width );
3900 myListView->removeColumn( index );
3909 return static_cast<KDGanttViewItem*
>( myListView->selectedItem() );
3918 myListView->setSelected( item, selected );
3959 return static_cast<KDGanttViewItem*
>( myListView->itemAt(myListView->mapFromGlobal(pos) ));
3979 KDGanttViewItem* item;
3980 TQPoint local = myCanvasView->mapFromGlobal(pos);
3982 TQCanvasItemList il = myTimeTable->collisions( myCanvasView->viewportToContents( local ));
3983 TQCanvasItemList::Iterator it;
3984 for ( it = il.begin(); it != il.end(); ++it ) {
3985 if ( myCanvasView->getType(*it) == Type_is_KDGanttViewItem) {
3986 item = myCanvasView->getItem(*it);
4020 KDGanttViewItem* item;
4021 KDGanttViewItem* retItem = 0;
4024 y = myCanvasView->mapFromGlobal(pos).y();
4028 while ( item != 0 ) {
4029 int yc = item->itemPos();
4030 if ( yc <= y && y < yc + item->height()) {
4041void KDGanttView::addTickRight()
4043 if ( _enableAdding && myCanvasView->horizontalScrollBar()->value() == myCanvasView->horizontalScrollBar()->maxValue()) {
4045 myTimeHeader->addTickRight();
4047 myCanvasView->updateHorScrollBar();
4053void KDGanttView::addTickLeft()
4055 if ( _enableAdding && myCanvasView->horizontalScrollBar()->value() == 0 ) {
4056 myCanvasView->horizontalScrollBar()->blockSignals(
true );
4057 myTimeHeader->addTickLeft();
4058 myCanvasView->horizontalScrollBar()->blockSignals(
false );
4064void KDGanttView::enableAdding(
int val )
4066 _enableAdding = ( val == 0 || val == myCanvasView->horizontalScrollBar()->maxValue());
4077 return myListView->childCount();
4086 bool block = myTimeTable->blockUpdating();
4087 myTimeTable->setBlockUpdating(
true );
4088 myListView->clear();
4089 myTimeTable->setBlockUpdating(
false );
4090 myTimeTable->updateMyContent();
4091 myTimeTable->setBlockUpdating( block );
4100 emit
dropped( e, droppedItem, itemBelowMouse);
4108 return myListView->dragObject ();
4126 TQWidget::setPaletteBackgroundColor( col );
4127 timeHeaderSpacerWidget->setPaletteBackgroundColor( col );
4139 myTimeTable->setBackgroundColor( c );
4151 myTimeHeader->setPaletteBackgroundColor( c );
4153 timeHeaderSpacerWidget->setPaletteBackgroundColor( c );
4165 myLegend->setPaletteBackgroundColor( c );
4166 leftWidget->setPaletteBackgroundColor( c );
4178 myListView->viewport()->setPaletteBackgroundColor( c );
4190 return myListView->viewport()->paletteBackgroundColor( );
4202 return myTimeTable->backgroundColor( );
4214 return myTimeHeader->paletteBackgroundColor( );
4226 return myLegend->paletteBackgroundColor( );
4247 w->reparent ( spacerLeft, 0, TQPoint(0,0) );
4263 TQListViewItemIterator it( myListView );
4264 for ( ; it.current(); ++it ) {
4265 (( KDGanttViewItem* )it.current())->setDragEnabled(b);
4284 TQListViewItemIterator it( myListView );
4285 for ( ; it.current(); ++it ) {
4286 (( KDGanttViewItem* )it.current())->setDropEnabled(b);
4314 return fDragEnabled;
4326 return fDropEnabled;
4375 KDGanttViewItem* droppedItem,
4376 KDGanttViewItem* itemBelowMouse )
4379 Q_UNUSED( droppedItem );
4380 Q_UNUSED( itemBelowMouse );
4559 int sw = mySplitter->width();
4560 TQValueList<int> list;
4563 mySplitter->setSizes( list );
4575 return leftWidget->width();
4590 myListView->setVScrollBarMode ( m );
4605 if ( m == TQScrollView::Auto )
4606 tqDebug(
"KDGanttView::setListViewVScrollBarMode: TQScrollView::Auto not supported. Nothing changed. ");
4609 myCanvasView->setVScrollBarMode ( m );
4610 if ( m == TQScrollView::AlwaysOn )
4611 timeHeaderSpacerWidget->setFixedWidth(myCanvasView->verticalScrollBar()->width() );
4613 timeHeaderSpacerWidget->setFixedWidth( 0 );
4620 if (myItemAttributeDialog->getItem() == item ) {
4621 myItemAttributeDialog->reset( 0 );
4634 myCanvasView->linkItemsEnabled = on;
4635 myCanvasView->autoScrollEnabled =
true;
4645 return myCanvasView->linkItemsEnabled;
KDGanttMinimizeSplitter(TQWidget *parent=0, const char *name=0)
void setMinimizeDirection(Direction)
Drag and drop of KD Gantt items.
static bool canDecode(const TQMimeSource *e)
KDGanttViewItem * getChildByName(const TQString &name)
KDGanttViewItem * itemBelow(bool includeDisabled=true)
void createNode(TQDomDocument &doc, TQDomElement &parentElement)
KDGanttViewItem * nextSibling() const
static KDGanttViewItem * createFromDomElement(KDGanttView *view, TQDomElement &element)
void setDisplaySubitemsAsGroup(bool show)
KDGanttViewItem * firstChild() const
static KDGanttViewTaskLinkGroup * createFromDomElement(TQDomElement &)
void createNode(TQDomDocument &doc, TQDomElement &parentElement)
void createNode(TQDomDocument &doc, TQDomElement &parentElement)
static KDGanttViewTaskLink * createFromDomElement(TQDomElement &)
bool showMinorTicks() const
bool showListView() const
void setZoomFactor(double factor, bool absolute)
void setYearFormat(YearFormat format)
void itemRightClicked(KDGanttViewItem *)
bool isLinkItemsEnabled() const
void setDisplaySubitemsAsGroup(bool show)
void setMinimumColumnWidth(int width)
TQBrush noInformationBrush() const
TQSize drawContents(TQPainter *p=0, bool drawListView=true, bool drawTimeLine=true, bool drawLegend=false)
void setWeekendDays(int start, int end)
void lvItemRenamed(KDGanttViewItem *, int col, const TQString &text)
bool editorEnabled() const
void lvMouseButtonPressed(int button, KDGanttViewItem *item, const TQPoint &pos, int c)
void addUserdefinedLegendHeaderWidget(TQWidget *w)
void clearBackgroundColor()
TQColor timeHeaderBackgroundColor() const
void print(TQPrinter *printer=0, bool printListView=true, bool printTimeLine=true, bool printLegend=false)
static TQPixmap getPixmap(KDGanttViewItem::Shape shape, const TQColor &shapeColor, const TQColor &backgroundColor, int itemSize)
void lvCurrentChanged(KDGanttViewItem *)
KDGanttViewItem * getItemAt(const TQPoint &pos, bool global=true) const
void setShowMajorTicks(bool)
void itemMidClicked(KDGanttViewItem *)
virtual int addColumn(const TQString &label, int width=-1)
virtual void lvStartDrag(KDGanttViewItem *)
void setShowTaskLinks(bool show)
int ganttMaximumWidth() const
void setDefaultColor(KDGanttViewItem::Type type, const TQColor &, bool overwriteExisting=true)
KDGanttViewItem * firstChild() const
KDGanttViewItem * getItemByGanttViewPos(const TQPoint &pos) const
void setEditable(bool editable)
bool colors(KDGanttViewItem::Type type, TQColor &start, TQColor &middle, TQColor &end) const
void setSelected(KDGanttViewItem *, bool)
TQColor columnBackgroundColor(const TQDateTime &column) const
void setLegendHeaderBackgroundColor(const TQColor &)
bool isDropEnabled() const
TQPtrList< KDGanttViewTaskLinkGroup > taskLinkGroups() const
void center(KDGanttViewItem *)
void lvContextMenuRequested(KDGanttViewItem *item, const TQPoint &pos, int col)
KDGanttView(TQWidget *parent=0, const char *name=0)
void lvItemDoubleClicked(KDGanttViewItem *)
void setPaletteBackgroundColor(const TQColor &col)
double zoomFactor() const
virtual void removeColumn(int index)
void setShowListView(bool show)
void setGanttMaximumWidth(int w)
void setDragDropEnabled(bool b)
void setShapes(KDGanttViewItem::Type type, KDGanttViewItem::Shape start, KDGanttViewItem::Shape middle, KDGanttViewItem::Shape end, bool overwriteExisting=true)
void setCalendarMode(bool mode)
void setDropEnabled(bool b)
void setWeekendBackgroundColor(const TQColor &color)
void setHighlightColors(KDGanttViewItem::Type type, const TQColor &start, const TQColor &middle, const TQColor &end, bool overwriteExisting=true)
bool saveProject(TQIODevice *)
void setLinkItemsEnabled(bool on)
void addLegendItem(KDGanttViewItem::Shape shape, const TQColor &shapeColor, const TQString &text)
void setListViewWidth(int)
Scale minimumScale() const
bool getUpdateEnabled() const
void setShowHeaderPopupMenu(bool show=true, bool showZoom=true, bool showScale=true, bool showTime=true, bool showYear=true, bool showGrid=true, bool showPrint=false)
void setDisplayEmptyTasksAsLine(bool show)
void centerTimeline(const TQDateTime ¢er)
bool calendarMode() const
bool highlightColors(KDGanttViewItem::Type type, TQColor &start, TQColor &middle, TQColor &end) const
void setGvVScrollBarMode(TQScrollView::ScrollBarMode)
void setHorBackgroundLines(int count=2, TQBrush brush=TQBrush(TQColor(200, 200, 200), TQt::Dense6Pattern))
virtual bool lvDragMoveEvent(TQDragMoveEvent *e, KDGanttViewItem *, KDGanttViewItem *)
void setMinorScaleCount(int count)
void addTicksLeft(int num=1)
void setDragEnabled(bool b)
bool isDragEnabled() const
void setShowLegend(bool show)
TQColor defaultHighlightColor(KDGanttViewItem::Type type) const
int minimumColumnWidth() const
void lvSelectionChanged(KDGanttViewItem *)
void setShowLegendButton(bool show)
TQColor lvBackgroundColor() const
TQColor legendHeaderBackgroundColor() const
virtual TQSize sizeHint() const
TQColor defaultColor(KDGanttViewItem::Type type) const
void setIntervalBackgroundColor(const TQDateTime &start, const TQDateTime &end, const TQColor &color, Scale mini=KDGanttView::Minute, Scale maxi=KDGanttView::Month)
TQDateTime getDateTimeForCoordX(int coordX, bool global=true) const
void setEditorEnabled(bool enable)
bool showTaskLinks() const
bool showMajorTicks() const
int majorScaleCount() const
void itemLeftClicked(KDGanttViewItem *)
TQDateTime horizonStart() const
void setHorizonEnd(const TQDateTime &start)
virtual TQDragObject * dragObject()
void setDefaultHighlightColor(KDGanttViewItem::Type type, const TQColor &, bool overwriteExisting=true)
KDGanttViewItem * getItemByListViewPos(const TQPoint &pos) const
Scale maximumScale() const
void itemDoubleClicked(KDGanttViewItem *)
bool loadProject(TQIODevice *)
TQPtrList< KDGanttViewTaskLink > taskLinks() const
void setMaximumScale(Scale)
TQColor gvBackgroundColor() const
virtual void lvDragEnterEvent(TQDragEnterEvent *e)
void setMajorScaleCount(int count)
void lvItemMidClicked(KDGanttViewItem *)
bool showTimeTablePopupMenu() const
void lvItemLeftClicked(KDGanttViewItem *)
void setTextColor(const TQColor &color)
void setShowTimeTablePopupMenu(bool)
void setHorizonStart(const TQDateTime &start)
bool legendIsDoctwindow() const
void setFont(const TQFont &f)
void setLvVScrollBarMode(TQScrollView::ScrollBarMode)
bool shapes(KDGanttViewItem::Type type, KDGanttViewItem::Shape &start, KDGanttViewItem::Shape &middle, KDGanttViewItem::Shape &end) const
void setAutoScaleMinorTickCount(int count)
void setLegendIsDoctwindow(bool dock)
TQColor weekendBackgroundColor() const
void weekendDays(int &start, int &end) const
bool showLegendButton() const
TQColor textColor() const
HourFormat hourFormat() const
bool displaySubitemsAsGroup() const
void setWeekdayBackgroundColor(const TQColor &color, int weekday)
void ensureVisible(KDGanttViewItem *)
void zoomToSelection(const TQDateTime &start, const TQDateTime &end)
void setUpdateEnabled(bool enable)
bool showHeaderPopupMenu() const
void setHourFormat(HourFormat format)
int autoScaleMinorTickCount() const
KDGanttViewItem * selectedItem() const
bool headerVisible() const
int minorScaleCount() const
void dropped(TQDropEvent *e, KDGanttViewItem *droppedItem, KDGanttViewItem *itemBelowMouse)
void setHeaderVisible(bool)
virtual bool close(bool alsoDelete)
void setColors(KDGanttViewItem::Type type, const TQColor &start, const TQColor &middle, const TQColor &end, bool overwriteExisting=true)
YearFormat yearFormat() const
virtual bool lvDropEvent(TQDropEvent *e, KDGanttViewItem *, KDGanttViewItem *)
TQDateTime horizonEnd() const
void setNoInformationBrush(const TQBrush &brush)
void setLvBackgroundColor(const TQColor &)
KDGanttViewItem * getItemByName(const TQString &name) const
void setShowMinorTicks(bool)
bool displayEmptyTasksAsLine() const
int horBackgroundLines(TQBrush &brush)
void setGvBackgroundColor(const TQColor &)
TQDockWindow * legendDoctwindow() const
void setMinimumScale(Scale)
void setColumnBackgroundColor(const TQDateTime &column, const TQColor &color, Scale mini=KDGanttView::Minute, Scale maxi=KDGanttView::Month)
void setTimelineToStart()
void lvItemRightClicked(KDGanttViewItem *)
void lvMouseButtonClicked(int button, KDGanttViewItem *item, const TQPoint &pos, int c)
KDGanttViewItem * lastItem() const
void addTicksRight(int num=1)
void setRepaintMode(RepaintMode mode)
bool changeBackgroundInterval(const TQDateTime &oldstart, const TQDateTime &oldend, const TQDateTime &newstart, const TQDateTime &newend)
void setTimeHeaderBackgroundColor(const TQColor &)
void centerTimelineAfterShow(const TQDateTime ¢er)
void editItem(KDGanttViewItem *)
TQColor weekdayBackgroundColor(int weekday) const
bool deleteBackgroundInterval(const TQDateTime &start, const TQDateTime &end)