36 #include "KDGanttView.h"
37 #include "KDGanttViewSubwidgets.h"
38 #include "KDGanttMinimizeSplitter.h"
39 #include "KDGanttViewItem.h"
40 #include "KDGanttXMLTools.h"
41 #include "itemAttributeDialog.h"
42 #include <tqprinter.h>
43 #include <tqpainter.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"
86 myTimeHeaderScroll(0),
87 mFixedHorizon( false )
90 EvalDialog::checkEvalLicense(
"KD Gantt" );
96 leftWidget =
new TQVBox( mySplitter );
97 rightWidget =
new TQVBox( mySplitter );
99 myLegend =
new KDLegendWidget( leftWidget,
this );
100 spacerLeft =
new TQHBox( leftWidget );
101 myListView =
new KDListView(leftWidget,
this);
102 myListView->setVScrollBarMode (TQScrollView::AlwaysOff );
103 connect( myListView, TQ_SIGNAL( selectionChanged( TQListViewItem* ) ),
104 this, TQ_SLOT( slotSelectionChanged( TQListViewItem* ) ) );
106 connect( myListView, TQ_SIGNAL( mouseButtonClicked (
int, TQListViewItem * ,
const TQPoint &,
int ) ),
this, TQ_SLOT( slotmouseButtonClicked (
int , TQListViewItem * ,
const TQPoint &,
int ) ) );
107 connect( myListView, TQ_SIGNAL( contextMenuRequested ( TQListViewItem * ,
const TQPoint &,
int ) ),
this, TQ_SLOT( slotcontextMenuRequested ( TQListViewItem * ,
const TQPoint & ,
int ) ) );
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;
195 myTimeTable->setBlockUpdating();
200 KDGanttView::~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 );
431 void KDGanttView::slotSelectionChanged( TQListViewItem* item )
443 void KDGanttView::slotmouseButtonClicked (
int button, TQListViewItem * item,
444 const TQPoint & pos,
int c )
448 if (gItem == 0 && myCurrentItem != 0 ) {
452 if (gItem != 0 && myCurrentItem == 0 ) {
453 myCurrentItem = gItem;
461 case TQt::LeftButton:
479 void KDGanttView::slotcontextMenuRequested ( TQListViewItem * item,
const TQPoint & pos,
int col )
488 void KDGanttView::emptySpaceDoubleClicked( TQMouseEvent * e )
497 void KDGanttView::slotCurrentChanged ( TQListViewItem * item )
500 myCurrentItem = gItem;
508 void KDGanttView::slotItemRenamed ( TQListViewItem * item ,
int col,
509 const TQString & text )
519 void KDGanttView::slotMouseButtonPressed (
int button, TQListViewItem * item,
520 const TQPoint & pos,
int c )
544 TQScrollBar *cvh, *cvv;
545 cvh = myCanvasView->horizontalScrollBar();
546 cvv = myCanvasView->verticalScrollBar();
548 cvh->disconnect(
this );
549 cvv->disconnect(
this );
556 connect( cvv, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
557 connect( cvh, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
558 connect( cvv, TQ_SIGNAL (nextLine () ) ,
this, TQ_SLOT(forceRepaint()));
559 connect( cvh, TQ_SIGNAL (nextLine () ) ,
this, TQ_SLOT(forceRepaint()));
560 connect( cvv, TQ_SIGNAL (prevLine () ) ,
this, TQ_SLOT(forceRepaint()));
561 connect( cvh, TQ_SIGNAL (prevLine () ) ,
this, TQ_SLOT(forceRepaint()));
564 connect( cvv, TQ_SIGNAL (valueChanged (
int ) ) ,
this, TQ_SLOT(forceRepaint(
int )));
565 connect( cvh, TQ_SIGNAL (valueChanged (
int ) ) ,
this, TQ_SLOT(forceRepaint(
int )));
566 connect( cvv, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
567 connect( cvh, TQ_SIGNAL (sliderReleased () ) ,
this, TQ_SLOT(forceRepaint()));
573 void KDGanttView::forceRepaint(
int )
575 if ( myTimeTable->blockUpdating() )
578 myTimeTable->setAllChanged();
579 myTimeTable->update();
583 void KDGanttView::slotHeaderSizeChanged()
585 int legendHeight = 0;
588 int listViewHeaderHeight = 0;
590 listViewHeaderHeight = myListView->header()->height();
591 int timeHeaderHeight = myTimeHeader->height()+myTimeHeaderScroll->frameWidth()*2;;
592 int diffY = timeHeaderHeight-legendHeight-listViewHeaderHeight;
594 spacerLeft->setFixedHeight( 0 );
595 spacerRight->setFixedHeight(-diffY);
597 spacerRight->setFixedHeight( 0 );
598 spacerLeft->setFixedHeight( diffY );
600 myLegend->setFixedHeight( legendHeight );
601 myTimeHeaderContainer->setFixedHeight( timeHeaderHeight );
612 bool isdock = myLegend->asDoctwindow();
613 if (
show != isdock ) {
614 myLegend->setAsDoctwindow(
show);
617 for ( li = myLegendItems->first(); li; li = myLegendItems->next() ) {
618 myLegend->addLegendItem(li->shape, li->color, li->text );
631 return myLegend->asDoctwindow();
649 return myLegend->dockwindow();
663 myLegend->showMe(
show);
677 return myLegend->isShown();
691 if(listViewIsVisible ==
show)
return;
692 listViewIsVisible =
show;
693 if (listViewIsVisible)
694 myListView->parentWidget()->show();
696 myListView->parentWidget()->hide();
708 return listViewIsVisible;
723 editorIsEnabled = enable;
737 return editorIsEnabled;
764 return chartIsEditable;
783 TQDomDocument doc = saveXML();
784 if( device->isOpen() )
786 if( device->open( IO_WriteOnly ) ) {
787 TQTextStream ts( device );
788 ts << doc.toString();
810 if( device->isOpen() )
812 if( device->open( IO_ReadOnly ) ) {
813 TQDomDocument doc(
"GanttView" );
816 if ( !doc.setContent( device, &err, &errline, &errcol ) ) {
817 tqDebug(
"KDGantt::Error parsing XML data at line %d. Message is:", errline );
818 tqDebug(
"%s ", err.latin1());
823 return loadXML( doc );
848 bool printListView,
bool printTimeLine,
851 bool deletePrinter =
false;
853 printer =
new TQPrinter();
854 deletePrinter =
true;
855 if ( !printer->setup()) {
861 TQPainter p( printer );
863 TQPaintDeviceMetrics m = TQPaintDeviceMetrics ( printer );
868 TQSize size =
drawContents( 0, printListView, printTimeLine, printLegend );
871 TQString date =
"Printing Time: " + TQDateTime::currentDateTime().toString();
872 int hei = p.boundingRect(0,0, 5, 5, TQt::AlignLeft, date ).height();
873 p.drawText( 0, 0, date );
876 dx = (float) m.width() / (float)size.width();
877 dy = (float)(m.height() - ( 2 * hei )) / (float)size.height();
887 p.translate( 0, 2*hei );
888 drawContents( &p, printListView, printTimeLine, printLegend );
940 bool drawListView ,
bool drawTimeLine,
bool drawLegend )
943 int lvX, lvY, thX, thY, tlX, tlY, lwX, lwY, allX, allY;
944 lvX = myListView->contentsWidth();
945 lvY = myCanvasView->canvas()->height() + 20;
946 thX = myTimeHeader->width();
947 thY = myTimeHeader->height();
948 tlX = myCanvasView->canvas()->width();
950 lwX = myLegend->legendSize().width();
951 lwY = myLegend->legendSize().height();
954 if ( drawListView ) {
958 if ( drawTimeLine ) {
967 size = TQSize( allX, allY );
970 if ( drawListView ) {
973 p->translate( 0, temp );
977 myListView->drawToPainter( p, drawTimeLine );
978 p->translate( lvX, -temp);
980 if ( drawTimeLine ) {
981 p->translate( myCanvasView->frameWidth(), 0);
982 myTimeHeader->repaintMe( 0, myTimeHeader->width(), p );
983 p->translate( -myCanvasView->frameWidth(), thY);
984 myCanvasView->drawToPainter( p );
986 p->translate( -lvX, tlY);
988 p->translate( 0, tlY);
991 p->translate( -lvX, 0 );
994 myLegend->drawToPainter( p );
995 p->translate( 0, lwY );
1016 myTimeHeader->zoom(factor,absolute);
1029 return myTimeHeader->zoomFactor();
1043 myTimeHeader->zoomToFit();
1061 myTimeHeader->zoomToSelection( start, end);
1074 myListView->ensureItemVisible (item);
1088 myTimeHeader->centerDateTime(
center );
1107 myTimeHeader->centerDateTime(
center );
1108 if ( ! isVisible() ) {
1109 dtCenterTimeLineAfterShow =
center;
1110 fCenterTimeLineAfterShow =
true;
1120 myCanvasView->horizontalScrollBar()->setValue( 0 );
1129 myCanvasView->horizontalScrollBar()->setValue(myCanvasView->horizontalScrollBar()->maxValue());
1145 myTimeHeader->addTickLeft( num );
1160 myTimeHeader->addTickRight( num );
1171 int x = myListView->contentsWidth()/2;
1172 int y = myListView->itemPos (item );
1173 myListView->center(x,y);
1185 myTimeTable->setShowTaskLinks(
show);
1198 return myTimeTable->showTaskLinks();
1211 myListView->setFont(font);
1212 myListView->repaint();
1213 myTimeHeader->setFont(font);
1214 myLegend->setFont( font );
1215 TQWidget::setFont( font );
1252 myTimeHeader->setShowPopupMenu(
show,showZoom,showScale,showTime,
1253 showYear,showGrid,showPrint );
1265 return myTimeHeader->showPopupMenu();
1285 myCanvasView->setShowPopupMenu(
show );
1297 return myCanvasView->showPopupMenu();
1322 bool overwriteExisting )
1324 if ( overwriteExisting ) {
1325 TQListViewItemIterator it(myListView);
1326 for ( ; it.current(); ++it ) {
1331 int index = getIndex( type );
1332 myDefaultShape [index*3] = start;
1333 myDefaultShape [index*3+1] = middle;
1334 myDefaultShape [index*3+2] = end;
1335 undefinedShape[index] =
false;
1356 int index = getIndex( type );
1357 start = myDefaultShape [index*3];
1358 middle = myDefaultShape [index*3+1];
1359 end = myDefaultShape [index*3+2];
1360 return !undefinedShape[index];
1382 const TQColor& start,
const TQColor& middle,
1384 bool overwriteExisting )
1386 if ( overwriteExisting ) {
1387 TQListViewItemIterator it(myListView);
1388 for ( ; it.current(); ++it ) {
1393 int index = getIndex( type );
1394 myColor [index*3] = start;
1395 myColor [index*3+1] = middle;
1396 myColor [index*3+2] = end;
1397 undefinedColor[index] =
false;
1414 TQColor& start, TQColor& middle, TQColor& end )
const
1416 int index = getIndex( type );
1417 start = myColor [index*3];
1418 middle = myColor [index*3+1];
1419 end = myColor [index*3+2];
1420 return !undefinedColor[index];
1444 const TQColor& start,
1445 const TQColor& middle,
1447 bool overwriteExisting )
1449 if ( overwriteExisting ) {
1450 TQListViewItemIterator it(myListView);
1451 for ( ; it.current(); ++it ) {
1456 int index = getIndex( type );
1457 myColorHL [index*3] = start;
1458 myColorHL [index*3+1] = middle;
1459 myColorHL [index*3+2] = end;
1460 undefinedColorHL[index] =
false;
1480 TQColor& start, TQColor& middle,
1481 TQColor& end )
const
1483 int index = getIndex( type );
1484 start = myColorHL [index*3];
1485 middle = myColorHL [index*3+1];
1486 end = myColorHL [index*3+2];
1487 return !undefinedColorHL[index];
1500 TQListViewItemIterator it(myListView);
1501 for ( ; it.current(); ++it ) {
1504 myTextColor = color;
1532 myTimeTable->setNoInformationBrush( brush );
1544 return myTimeTable->noInformationBrush();
1555 myLegend->clearLegend();
1556 myLegendItems->setAutoDelete(
true );
1557 delete myLegendItems;
1558 myLegendItems =
new TQPtrList<legendItem>;
1571 const TQColor& shapeColor,
1572 const TQString& text )
1574 myLegend->addLegendItem( shape,shapeColor,text );
1575 legendItem* item =
new legendItem;
1576 item->shape = shape;
1577 item->color = shapeColor;
1579 myLegendItems->append( item );
1592 myTimeHeader->setHorizonStart(start);
1604 return myTimeHeader->horizonStart();
1617 myTimeHeader->setHorizonEnd(end);
1630 return myTimeHeader->horizonEnd();
1643 myTimeHeader->setScale( unit );
1655 return myTimeHeader->scale();
1667 myTimeHeader->setMaximumScale( unit );
1679 return myTimeHeader->maximumScale();
1691 myTimeHeader->setMinimumScale( unit );
1703 return myTimeHeader->minimumScale();
1718 myTimeHeader->setAutoScaleMinorTickCount( count );
1730 return myTimeHeader->autoScaleMinorTickCount();
1744 myTimeHeader->setMinimumColumnWidth( width );
1756 return myTimeHeader->minimumColumnWidth();
1769 myTimeHeader->setYearFormat(format );
1781 return myTimeHeader->yearFormat();
1795 myTimeHeader->setHourFormat( format );
1808 return myTimeHeader->hourFormat();
1824 myTimeHeader->setShowMajorTicks(
show );
1836 return myTimeHeader->showMajorTicks();
1854 myTimeHeader->setShowMinorTicks(
show );
1866 return myTimeHeader->showMinorTicks();
1888 const TQColor& color ,
1891 myTimeHeader->setColumnBackgroundColor( column, color,mini,maxi );
1921 void KDGanttView::setIntervalBackgroundColor(
const TQDateTime& start,
1922 const TQDateTime& end,
1923 const TQColor& color ,
1924 Scale mini, Scale maxi )
1926 myTimeHeader->setIntervalBackgroundColor( start, end, color,mini,maxi );
1948 bool KDGanttView::changeBackgroundInterval(
const TQDateTime& oldstart,
1949 const TQDateTime& oldend,
1950 const TQDateTime& newstart,
1951 const TQDateTime& newend )
1953 return myTimeHeader->changeBackgroundInterval( oldstart, oldend,
1966 bool KDGanttView::deleteBackgroundInterval(
const TQDateTime& start,
1967 const TQDateTime& end)
1969 return myTimeHeader->deleteBackgroundInterval( start, end );
1980 myTimeHeader->addIntervalBackgroundColor( newItem );
1993 myTimeHeader->clearBackgroundColor();
2007 return myTimeHeader->columnBackgroundColor( column ) ;
2021 myTimeHeader->setWeekendBackgroundColor( color );
2033 return myTimeHeader->weekendBackgroundColor();
2049 myTimeHeader->setWeekdayBackgroundColor( color, weekday );
2062 return myTimeHeader->weekdayBackgroundColor( weekday);
2079 myTimeHeader->setWeekendDays( start, end );
2092 myTimeHeader->weekendDays( start, end );
2198 myTimeHeader->setMajorScaleCount(count );
2210 return myTimeHeader->majorScaleCount();
2222 myTimeHeader->setMinorScaleCount(count );
2234 return myTimeHeader->minorScaleCount();
2252 const TQColor& color,
2253 bool overwriteExisting )
2255 if ( overwriteExisting ) {
2256 TQListViewItemIterator it(myListView);
2257 for ( ; it.current(); ++it ) {
2262 int index = getIndex( type );
2263 myDefaultColor [index] = color;
2280 int index = getIndex( type );
2281 return myDefaultColor [index];
2298 const TQColor& color,
2299 bool overwriteExisting )
2301 if ( overwriteExisting ) {
2302 TQListViewItemIterator it(myListView);
2303 for ( ; it.current(); ++it ) {
2308 int index = getIndex( type );
2309 myDefaultColorHL [index] = color;
2326 int index = getIndex( type );
2327 return myDefaultColorHL [index];
2360 myListView->setCalendarMode( mode );
2373 return myListView->calendarMode();
2389 TQListViewItemIterator it( myListView );
2390 for ( ; it.current(); ++it ) {
2394 _displaySubitemsAsGroup =
show;
2408 return _displaySubitemsAsGroup;
2421 _displayEmptyTasksAsLine =
show;
2433 return _displayEmptyTasksAsLine;
2453 myTimeTable->setHorBackgroundLines( count, brush );
2468 return myTimeTable->horBackgroundLines( brush );
2491 return myTimeTable->taskLinks();
2502 return myTaskLinkGroupList;
2513 bool KDGanttView::loadXML(
const TQDomDocument& doc )
2515 TQDomElement docRoot = doc.documentElement();
2516 TQDomNode node = docRoot.firstChild();
2517 while( !node.isNull() ) {
2518 TQDomElement element = node.toElement();
2519 if( !element.isNull() ) {
2520 TQString tagName = element.tagName();
2521 if( tagName ==
"ShowLegend" ) {
2523 if( KDGanttXML::readBoolNode( element, value ) )
2525 }
else if( tagName ==
"ShowLegendButton" ) {
2527 if( KDGanttXML::readBoolNode( element, value ) )
2529 }
else if( tagName ==
"LegendIsDockWindow" ) {
2531 if( KDGanttXML::readBoolNode( element, value ) )
2533 }
else if( tagName ==
"ShowListView" ) {
2535 if( KDGanttXML::readBoolNode( element, value ) )
2537 }
else if( tagName ==
"ShowHeader" ) {
2539 if( KDGanttXML::readBoolNode( element, value ) )
2541 }
else if( tagName ==
"ShowTaskLinks" ) {
2543 if( KDGanttXML::readBoolNode( element, value ) )
2545 }
else if( tagName ==
"EditorEnabled" ) {
2547 if( KDGanttXML::readBoolNode( element, value ) )
2549 }
else if( tagName ==
"DisplayEmptyTasksAsLine" ) {
2551 if( KDGanttXML::readBoolNode( element, value ) )
2553 }
else if( tagName ==
"GlobalFont" ) {
2555 if( KDGanttXML::readFontNode( element, font ) )
2557 }
else if( tagName ==
"HorizonStart" ) {
2559 if( KDGanttXML::readDateTimeNode( element, value ) )
2561 }
else if( tagName ==
"HorizonEnd" ) {
2563 if( KDGanttXML::readDateTimeNode( element, value ) )
2565 }
else if( tagName ==
"Scale" ) {
2567 if( KDGanttXML::readStringNode( element, value ) )
2568 setScale( stringToScale( value ) );
2569 }
else if( tagName ==
"MinimumScale" ) {
2571 if( KDGanttXML::readStringNode( element, value ) )
2573 }
else if( tagName ==
"MaximumScale" ) {
2575 if( KDGanttXML::readStringNode( element, value ) )
2577 }
else if( tagName ==
"YearFormat" ) {
2579 if( KDGanttXML::readStringNode( element, value ) )
2581 }
else if( tagName ==
"HourFormat" ) {
2583 if( KDGanttXML::readStringNode( element, value ) )
2585 }
else if( tagName ==
"ShowMinorTicks" ) {
2587 if( KDGanttXML::readBoolNode( element, value ) )
2589 }
else if( tagName ==
"ShowMajorTicks" ) {
2591 if( KDGanttXML::readBoolNode( element, value ) )
2593 }
else if( tagName ==
"DragEnabled" ) {
2595 if( KDGanttXML::readBoolNode( element, value ) )
2597 }
else if( tagName ==
"DropEnabled" ) {
2599 if( KDGanttXML::readBoolNode( element, value ) )
2601 }
else if( tagName ==
"CalendarMode" ) {
2603 if( KDGanttXML::readBoolNode( element, value ) )
2605 }
else if( tagName ==
"Editable" ) {
2607 if( KDGanttXML::readBoolNode( element, value ) )
2609 }
else if( tagName ==
"TextColor" ) {
2611 if( KDGanttXML::readColorNode( element, value ) )
2613 }
else if( tagName ==
"MajorScaleCount" ) {
2615 if( KDGanttXML::readIntNode( element, value ) )
2617 }
else if( tagName ==
"MinorScaleCount" ) {
2619 if( KDGanttXML::readIntNode( element, value ) )
2621 }
else if( tagName ==
"AutoScaleMinorTickCount" ) {
2623 if( KDGanttXML::readIntNode( element, value ) )
2625 }
else if( tagName ==
"MinimumColumnWidth" ) {
2627 if( KDGanttXML::readIntNode( element, value ) )
2629 }
else if( tagName ==
"GanttMaximumWidth" ) {
2631 if( KDGanttXML::readIntNode( element, value ) )
2633 }
else if( tagName ==
"NoInformationBrush" ) {
2635 if( KDGanttXML::readBrushNode( element, value ) )
2637 }
else if( tagName ==
"GanttViewBackgroundColor" ) {
2639 if( KDGanttXML::readColorNode( element, value ) )
2641 }
else if( tagName ==
"ListViewBackgroundColor" ) {
2643 if( KDGanttXML::readColorNode( element, value ) )
2645 }
else if( tagName ==
"TimeHeaderBackgroundColor" ) {
2647 if( KDGanttXML::readColorNode( element, value ) )
2649 }
else if( tagName ==
"LegendHeaderBackgroundColor" ) {
2651 if( KDGanttXML::readColorNode( element, value ) )
2653 }
else if( tagName ==
"WeekendBackgroundColor" ) {
2655 if( KDGanttXML::readColorNode( element, value ) )
2657 }
else if( tagName ==
"WeekdayBackgroundColor" ) {
2658 TQDomNode node = element.firstChild();
2661 while( !node.isNull() ) {
2662 TQDomElement element = node.toElement();
2663 if( !element.isNull() ) {
2664 TQString tagName = element.tagName();
2665 if( tagName ==
"Day" ) {
2667 if( KDGanttXML::readIntNode( element, value ) )
2669 }
else if( tagName ==
"Color" ) {
2671 if( KDGanttXML::readColorNode( element, value ) )
2674 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2678 node = node.nextSibling();
2681 if( day && color.isValid() )
2683 }
else if( tagName ==
"WeekendDays" ) {
2684 TQString startString = element.attribute(
"Start" );
2685 TQString endString = element.attribute(
"End" );
2686 bool startOk =
false, endOk =
false;
2687 int start = startString.toInt( &startOk );
2688 int end = startString.toInt( &endOk );
2689 if( startOk && endOk )
2691 }
else if( tagName ==
"ZoomFactor" ) {
2693 if( KDGanttXML::readDoubleNode( element, value ) )
2695 }
else if( tagName ==
"ShowHeaderPopupMenu" ) {
2697 if( KDGanttXML::readBoolNode( element, value ) )
2699 }
else if( tagName ==
"ShowTimeTablePopupMenu" ) {
2701 if( KDGanttXML::readBoolNode( element, value ) )
2703 }
else if( tagName ==
"Shapes" ) {
2704 TQDomNode node = element.firstChild();
2705 bool undefinedShape =
false;
2706 while( !node.isNull() ) {
2707 TQDomElement element = node.toElement();
2708 if( !element.isNull() ) {
2709 TQString tagName = element.tagName();
2710 if( tagName ==
"Event" ) {
2712 startShape = KDGanttViewItem::TriangleDown;
2713 middleShape = KDGanttViewItem::TriangleDown;
2714 endShape = KDGanttViewItem::TriangleDown;
2715 TQDomNode node = element.firstChild();
2716 while( !node.isNull() ) {
2717 TQDomElement element = node.toElement();
2718 if( !element.isNull() ) {
2719 TQString tagName = element.tagName();
2720 if( tagName ==
"Start" ) {
2722 if( KDGanttXML::readStringNode( element, value ) )
2723 startShape = KDGanttViewItem::stringToShape( value );
2724 if ( value ==
"Undefined" )
2725 undefinedShape =
true;
2726 }
else if( tagName ==
"Middle" ) {
2728 if( KDGanttXML::readStringNode( element, value ) )
2729 middleShape = KDGanttViewItem::stringToShape( value );
2730 if ( value ==
"Undefined" )
2731 undefinedShape =
true;
2732 }
else if( tagName ==
"End" ) {
2734 if( KDGanttXML::readStringNode( element, value ) )
2735 endShape = KDGanttViewItem::stringToShape( value );
2736 if ( value ==
"Undefined" )
2737 undefinedShape =
true;
2739 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2743 node = node.nextSibling();
2745 if ( ! undefinedShape )
2746 setShapes( KDGanttViewItem::Event, startShape,
2747 middleShape, endShape,
false );
2748 undefinedShape =
false;
2749 }
else if( tagName ==
"Task" ) {
2751 startShape = KDGanttViewItem::TriangleDown;
2752 middleShape = KDGanttViewItem::TriangleDown;
2753 endShape = KDGanttViewItem::TriangleDown;
2754 TQDomNode node = element.firstChild();
2755 while( !node.isNull()) {
2756 TQDomElement element = node.toElement();
2757 if( !element.isNull() ) {
2758 TQString tagName = element.tagName();
2759 if( tagName ==
"Start" ) {
2761 if( KDGanttXML::readStringNode( element, value ) )
2762 startShape = KDGanttViewItem::stringToShape( value );
2763 if ( value ==
"Undefined" )
2764 undefinedShape =
true;
2765 }
else if( tagName ==
"Middle" ) {
2767 if( KDGanttXML::readStringNode( element, value ) )
2768 middleShape = KDGanttViewItem::stringToShape( value );
2769 if ( value ==
"Undefined" )
2770 undefinedShape =
true;
2771 }
else if( tagName ==
"End" ) {
2773 if( KDGanttXML::readStringNode( element, value ) )
2774 endShape = KDGanttViewItem::stringToShape( value );
2775 if ( value ==
"Undefined" )
2776 undefinedShape =
true;
2778 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2782 node = node.nextSibling();
2784 if ( ! undefinedShape )
2785 setShapes( KDGanttViewItem::Task, startShape, middleShape, endShape,
false );
2786 undefinedShape =
false;
2787 }
else if( tagName ==
"Summary" ) {
2789 startShape = KDGanttViewItem::TriangleDown;
2790 middleShape = KDGanttViewItem::TriangleDown;
2791 endShape = KDGanttViewItem::TriangleDown;
2792 TQDomNode node = element.firstChild();
2793 while( !node.isNull() ) {
2794 TQDomElement element = node.toElement();
2795 if( !element.isNull() ) {
2796 TQString tagName = element.tagName();
2797 if( tagName ==
"Start" ) {
2799 if( KDGanttXML::readStringNode( element, value ) )
2800 startShape = KDGanttViewItem::stringToShape( value );
2801 if ( value ==
"Undefined" )
2802 undefinedShape =
true;
2803 }
else if( tagName ==
"Middle" ) {
2805 if( KDGanttXML::readStringNode( element, value ) )
2806 middleShape = KDGanttViewItem::stringToShape( value );
2807 if ( value ==
"Undefined" )
2808 undefinedShape =
true;
2809 }
else if( tagName ==
"End" ) {
2811 if( KDGanttXML::readStringNode( element, value ) )
2812 endShape = KDGanttViewItem::stringToShape( value );
2813 if ( value ==
"Undefined" )
2814 undefinedShape =
true;
2816 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2820 node = node.nextSibling();
2822 if ( ! undefinedShape )
2823 setShapes( KDGanttViewItem::Summary, startShape,
2824 middleShape, endShape,
false );
2825 undefinedShape =
false;
2827 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2831 node = node.nextSibling();
2833 }
else if( tagName ==
"Colors" ) {
2834 TQDomNode node = element.firstChild();
2835 while( !node.isNull()) {
2836 TQDomElement element = node.toElement();
2837 if( !element.isNull() ) {
2838 TQString tagName = element.tagName();
2839 if( tagName ==
"Event" ) {
2840 TQColor startColor, middleColor, endColor;
2841 TQDomNode node = element.firstChild();
2842 while( !node.isNull() ) {
2843 TQDomElement element = node.toElement();
2844 if( !element.isNull() ) {
2845 TQString tagName = element.tagName();
2846 if( tagName ==
"Start" ) {
2848 if( KDGanttXML::readColorNode( element, value ) )
2850 }
else if( tagName ==
"Middle" ) {
2852 if( KDGanttXML::readColorNode( element, value ) )
2853 middleColor = value;
2854 }
else if( tagName ==
"End" ) {
2856 if( KDGanttXML::readColorNode( element, value ) )
2859 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2863 node = node.nextSibling();
2865 setColors( KDGanttViewItem::Event, startColor,
2866 middleColor, endColor,
false );
2867 }
else if( tagName ==
"Task" ) {
2868 TQColor startColor, middleColor, endColor;
2869 TQDomNode node = element.firstChild();
2870 while( !node.isNull() ) {
2871 TQDomElement element = node.toElement();
2872 if( !element.isNull() ) {
2873 TQString tagName = element.tagName();
2874 if( tagName ==
"Start" ) {
2876 if( KDGanttXML::readColorNode( element, value ) )
2878 }
else if( tagName ==
"Middle" ) {
2880 if( KDGanttXML::readColorNode( element, value ) )
2881 middleColor = value;
2882 }
else if( tagName ==
"End" ) {
2884 if( KDGanttXML::readColorNode( element, value ) )
2887 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2891 node = node.nextSibling();
2893 setColors( KDGanttViewItem::Task, startColor,
2894 middleColor, endColor,
false );
2895 }
else if( tagName ==
"Summary" ) {
2896 TQColor startColor, middleColor, endColor;
2897 TQDomNode node = element.firstChild();
2898 while( !node.isNull() ) {
2899 TQDomElement element = node.toElement();
2900 if( !element.isNull() ) {
2901 TQString tagName = element.tagName();
2902 if( tagName ==
"Start" ) {
2904 if( KDGanttXML::readColorNode( element, value ) )
2906 }
else if( tagName ==
"Middle" ) {
2908 if( KDGanttXML::readColorNode( element, value ) )
2909 middleColor = value;
2910 }
else if( tagName ==
"End" ) {
2912 if( KDGanttXML::readColorNode( element, value ) )
2915 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2919 node = node.nextSibling();
2921 setColors( KDGanttViewItem::Summary, startColor,
2922 middleColor, endColor ,
false);
2924 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2928 node = node.nextSibling();
2930 }
else if( tagName ==
"DefaultColors" ) {
2931 TQDomNode node = element.firstChild();
2932 while( !node.isNull() ) {
2933 TQDomElement element = node.toElement();
2934 if( !element.isNull() ) {
2935 TQString tagName = element.tagName();
2936 if( tagName ==
"Event" ) {
2938 if( KDGanttXML::readColorNode( element, value ) )
2941 }
else if( tagName ==
"Task" ) {
2943 if( KDGanttXML::readColorNode( element, value ) )
2946 }
else if( tagName ==
"Summary" ) {
2948 if( KDGanttXML::readColorNode( element, value ) )
2952 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2957 node = node.nextSibling();
2959 }
else if( tagName ==
"HighlightColors" ) {
2960 TQDomNode node = element.firstChild();
2961 while( !node.isNull() ) {
2962 TQDomElement element = node.toElement();
2963 if( !element.isNull() ) {
2964 TQString tagName = element.tagName();
2965 if( tagName ==
"Event" ) {
2966 TQColor startColor, middleColor, endColor;
2967 TQDomNode node = element.firstChild();
2968 while( !node.isNull() ) {
2969 TQDomElement element = node.toElement();
2970 if( !element.isNull() ) {
2971 TQString tagName = element.tagName();
2972 if( tagName ==
"Start" ) {
2974 if( KDGanttXML::readColorNode( element, value ) )
2976 }
else if( tagName ==
"Middle" ) {
2978 if( KDGanttXML::readColorNode( element, value ) )
2979 middleColor = value;
2980 }
else if( tagName ==
"End" ) {
2982 if( KDGanttXML::readColorNode( element, value ) )
2985 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
2989 node = node.nextSibling();
2993 middleColor, endColor,
false );
2994 }
else if( tagName ==
"Task" ) {
2995 TQColor startColor, middleColor, endColor;
2996 TQDomNode node = element.firstChild();
2997 while( !node.isNull() ) {
2998 TQDomElement element = node.toElement();
2999 if( !element.isNull() ) {
3000 TQString tagName = element.tagName();
3001 if( tagName ==
"Start" ) {
3003 if( KDGanttXML::readColorNode( element, value ) )
3005 }
else if( tagName ==
"Middle" ) {
3007 if( KDGanttXML::readColorNode( element, value ) )
3008 middleColor = value;
3009 }
else if( tagName ==
"End" ) {
3011 if( KDGanttXML::readColorNode( element, value ) )
3014 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3018 node = node.nextSibling();
3022 middleColor, endColor ,
false);
3023 }
else if( tagName ==
"Summary" ) {
3024 TQColor startColor, middleColor, endColor;
3025 TQDomNode node = element.firstChild();
3026 while( !node.isNull() ) {
3027 TQDomElement element = node.toElement();
3028 if( !element.isNull() ) {
3029 TQString tagName = element.tagName();
3030 if( tagName ==
"Start" ) {
3032 if( KDGanttXML::readColorNode( element, value ) )
3034 }
else if( tagName ==
"Middle" ) {
3036 if( KDGanttXML::readColorNode( element, value ) )
3037 middleColor = value;
3038 }
else if( tagName ==
"End" ) {
3040 if( KDGanttXML::readColorNode( element, value ) )
3043 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3047 node = node.nextSibling();
3051 middleColor, endColor,
false );
3053 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3057 node = node.nextSibling();
3059 }
else if( tagName ==
"DefaultHighlightColors" ) {
3060 TQDomNode node = element.firstChild();
3061 while( !node.isNull() ) {
3062 TQDomElement element = node.toElement();
3063 if( !element.isNull() ) {
3064 TQString tagName = element.tagName();
3065 if( tagName ==
"Event" ) {
3067 if( KDGanttXML::readColorNode( element, value ) )
3070 }
else if( tagName ==
"Task" ) {
3072 if( KDGanttXML::readColorNode( element, value ) )
3075 }
else if( tagName ==
"Summary" ) {
3077 if( KDGanttXML::readColorNode( element, value ) )
3081 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3086 node = node.nextSibling();
3088 }
else if( tagName ==
"Items" ) {
3089 TQDomNode node = element.firstChild();
3091 while( !node.isNull() ) {
3092 TQDomElement element = node.toElement();
3093 if( !element.isNull() ) {
3094 TQString tagName = element.tagName();
3095 if( tagName ==
"Item" ) {
3108 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3113 node = node.nextSibling();
3115 }
else if( tagName ==
"TaskLinks" ) {
3116 TQDomNode node = element.firstChild();
3117 while( !node.isNull() ) {
3118 TQDomElement element = node.toElement();
3119 if( !element.isNull() ) {
3120 TQString tagName = element.tagName();
3121 if( tagName ==
"TaskLink" )
3124 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3129 node = node.nextSibling();
3131 }
else if( tagName ==
"TaskLinkGroups" ) {
3132 TQDomNode node = element.firstChild();
3133 while( !node.isNull() ) {
3134 TQDomElement element = node.toElement();
3135 if( !element.isNull() ) {
3136 TQString tagName = element.tagName();
3137 if( tagName ==
"TaskLink" )
3140 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3144 node = node.nextSibling();
3146 }
else if( tagName ==
"ColumnBackgroundColors" ) {
3147 TQDomNode node = element.firstChild();
3148 while( !node.isNull() ) {
3149 TQDomElement element = node.toElement();
3150 if( !element.isNull() ) {
3151 TQString tagName = element.tagName();
3152 if( tagName ==
"ColumnBackgroundColor" ) {
3153 TQDomNode node = element.firstChild();
3154 TQDateTime dateTime;
3156 while( !node.isNull() ) {
3157 TQDomElement element = node.toElement();
3158 if( !element.isNull() ) {
3161 TQString tagName = element.tagName();
3162 if( tagName ==
"DateTime" ) {
3164 if( KDGanttXML::readDateTimeNode( element, value ) )
3166 }
else if( tagName ==
"Color" ) {
3168 if( KDGanttXML::readColorNode( element, value ) )
3171 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3176 node = node.nextSibling();
3180 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3184 node = node.nextSibling();
3186 }
else if( tagName ==
"LegendItems" ) {
3188 TQDomNode node = element.firstChild();
3189 while( !node.isNull() ) {
3190 TQDomElement element = node.toElement();
3191 if( !element.isNull() ) {
3192 TQString tagName = element.tagName();
3193 if( tagName ==
"LegendItem" ) {
3195 tempLegendShape = KDGanttViewItem::TriangleDown;
3196 TQColor tempLegendColor;
3197 TQString tempLegendString;
3199 TQDomNode node = element.firstChild();
3200 while( !node.isNull() ) {
3201 TQDomElement element = node.toElement();
3202 if( !element.isNull() ) {
3203 TQString tagName = element.tagName();
3204 if( tagName ==
"Shape" ) {
3206 if( KDGanttXML::readStringNode( element, value ) )
3207 tempLegendShape = KDGanttViewItem::stringToShape( value );
3210 }
else if( tagName ==
"Color" ) {
3212 if( KDGanttXML::readColorNode( element, value ) )
3213 tempLegendColor = value;
3216 }
else if( tagName ==
"Text" ) {
3218 if( KDGanttXML::readStringNode( element, value ) )
3219 tempLegendString = value;
3223 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3227 node = node.nextSibling();
3233 tqDebug(
"Adding legend item %s", tempLegendString.latin1() );
3236 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3240 node = node.nextSibling();
3243 tqDebug(
"Unrecognized tag name: %s", tagName.latin1() );
3248 node = node.nextSibling();
3262 TQDomDocument KDGanttView::saveXML(
bool withPI )
const
3265 TQString docstart =
"<GanttView/>";
3267 TQDomDocument doc(
"GanttView" );
3268 doc.setContent( docstart );
3270 TQDomProcessingInstruction pin = doc.createProcessingInstruction(
"kdgantt",
"version=\"1.0\" encoding=\"UTF-8\"" ) ;
3271 doc.appendChild ( pin );
3274 TQDomElement docRoot = doc.documentElement();
3275 docRoot.setAttribute(
"xmlns",
"http://www.klaralvdalens-datakonsult.se/kdgantt" );
3276 docRoot.setAttribute(
"xmlns:xsi",
"http://www.w3.org/2000/10/XMLSchema-instance" );
3277 docRoot.setAttribute(
"xsi:schemaLocation",
"http://www.klaralvdalens-datakonsult.se/kdgantt" );
3280 KDGanttXML::createBoolNode( doc, docRoot,
"ShowLegend",
showLegend() );
3283 KDGanttXML::createBoolNode( doc, docRoot,
"ShowLegendButton",
3287 KDGanttXML::createBoolNode( doc, docRoot,
"LegendIsDockWindow",
3291 KDGanttXML::createBoolNode( doc, docRoot,
"ShowListView",
showListView() );
3294 KDGanttXML::createBoolNode( doc, docRoot,
"ShowHeader",
headerVisible() );
3297 KDGanttXML::createBoolNode( doc, docRoot,
"ShowTaskLinks",
showTaskLinks() );
3300 KDGanttXML::createBoolNode( doc, docRoot,
"EditorEnabled",
editorEnabled() );
3303 KDGanttXML::createFontNode( doc, docRoot,
"GlobalFont", font() );
3306 KDGanttXML::createBoolNode( doc, docRoot,
"DisplayEmptyTasksAsLine",
3310 KDGanttXML::createDateTimeNode( doc, docRoot,
"HorizonStart",
horizonStart() );
3313 KDGanttXML::createDateTimeNode( doc, docRoot,
"HorizonEnd",
horizonEnd() );
3316 KDGanttXML::createStringNode( doc, docRoot,
"Scale", scaleToString(
scale() ) );
3317 KDGanttXML::createStringNode( doc, docRoot,
"MinimumScale",
3319 KDGanttXML::createStringNode( doc, docRoot,
"MaximumScale",
3323 KDGanttXML::createStringNode( doc, docRoot,
"YearFormat",
3327 KDGanttXML::createStringNode( doc, docRoot,
"HourFormat",
3331 KDGanttXML::createBoolNode( doc, docRoot,
"ShowMinorTicks",
showMinorTicks() );
3334 KDGanttXML::createBoolNode( doc, docRoot,
"ShowMajorTicks",
showMajorTicks() );
3337 KDGanttXML::createBoolNode( doc, docRoot,
"Editable",
editable() );
3340 KDGanttXML::createColorNode( doc, docRoot,
"TextColor",
textColor() );
3343 KDGanttXML::createIntNode( doc, docRoot,
"MajorScaleCount",
majorScaleCount() );
3346 KDGanttXML::createIntNode( doc, docRoot,
"MinorScaleCount",
minorScaleCount() );
3349 KDGanttXML::createIntNode( doc, docRoot,
"AutoScaleMinorTickCount",
3353 KDGanttXML::createIntNode( doc, docRoot,
"MinimumColumnWidth",
3357 KDGanttXML::createIntNode( doc, docRoot,
"GanttMaximumWidth",
3361 KDGanttXML::createBrushNode( doc, docRoot,
"NoInformationBrush",
3365 KDGanttXML::createColorNode( doc, docRoot,
"GanttViewBackgroundColor",
3369 KDGanttXML::createColorNode( doc, docRoot,
"ListViewBackgroundColor",
3373 KDGanttXML::createColorNode( doc, docRoot,
"TimeHeaderBackgroundColor",
3377 KDGanttXML::createColorNode( doc, docRoot,
"LegendHeaderBackgroundColor",
3381 KDGanttXML::createColorNode( doc, docRoot,
"WeekendBackgroundColor",
3385 for(
int weekday = 1; weekday <= 7; weekday++ ) {
3387 if( color.isValid() ) {
3388 TQDomElement weekendBackgroundColorElement = doc.createElement(
"WeekdayBackgroundColor" );
3389 docRoot.appendChild( weekendBackgroundColorElement );
3390 KDGanttXML::createIntNode( doc, weekendBackgroundColorElement,
3392 KDGanttXML::createColorNode( doc, weekendBackgroundColorElement,
3398 TQDomElement weekendDaysElement = doc.createElement(
"WeekendDays" );
3399 docRoot.appendChild( weekendDaysElement );
3400 int weekendStart, weekendEnd;
3402 weekendDaysElement.setAttribute(
"Start", weekendStart );
3403 weekendDaysElement.setAttribute(
"End", weekendStart );
3406 KDGanttXML::createDoubleNode( doc, docRoot,
"ZoomFactor",
3410 KDGanttXML::createBoolNode( doc, docRoot,
"ShowHeaderPopupMenu",
3414 KDGanttXML::createBoolNode( doc, docRoot,
"ShowTimeTablePopupMenu",
3418 TQDomElement shapesElement = doc.createElement(
"Shapes" );
3419 docRoot.appendChild( shapesElement );
3420 TQDomElement shapesEventElement = doc.createElement(
"Event" );
3421 shapesElement.appendChild( shapesEventElement );
3423 if(
shapes( KDGanttViewItem::Event, start, middle, end ) ) {
3424 KDGanttXML::createStringNode( doc, shapesEventElement,
"Start",
3425 KDGanttViewItem::shapeToString( start ) );
3426 KDGanttXML::createStringNode( doc, shapesEventElement,
"Middle",
3427 KDGanttViewItem::shapeToString( middle ) );
3428 KDGanttXML::createStringNode( doc, shapesEventElement,
"End",
3429 KDGanttViewItem::shapeToString( end ) );
3431 KDGanttXML::createStringNode( doc, shapesEventElement,
"Start",
3433 KDGanttXML::createStringNode( doc, shapesEventElement,
"Middle",
3435 KDGanttXML::createStringNode( doc, shapesEventElement,
"End",
3438 TQDomElement shapesTaskElement = doc.createElement(
"Task" );
3439 shapesElement.appendChild( shapesTaskElement );
3440 if(
shapes( KDGanttViewItem::Task, start, middle, end ) ) {
3441 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Start",
3442 KDGanttViewItem::shapeToString( start ) );
3443 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Middle",
3444 KDGanttViewItem::shapeToString( middle ) );
3445 KDGanttXML::createStringNode( doc, shapesTaskElement,
"End",
3446 KDGanttViewItem::shapeToString( end ) );
3448 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Start",
3450 KDGanttXML::createStringNode( doc, shapesTaskElement,
"Middle",
3452 KDGanttXML::createStringNode( doc, shapesTaskElement,
"End",
3455 TQDomElement shapesSummaryElement = doc.createElement(
"Summary" );
3456 shapesElement.appendChild( shapesSummaryElement );
3457 if(
shapes( KDGanttViewItem::Event, start, middle, end ) ) {
3458 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Start",
3459 KDGanttViewItem::shapeToString( start ) );
3460 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Middle",
3461 KDGanttViewItem::shapeToString( middle ) );
3462 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"End",
3463 KDGanttViewItem::shapeToString( end ) );
3465 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Start",
3467 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"Middle",
3469 KDGanttXML::createStringNode( doc, shapesSummaryElement,
"End",
3474 TQDomElement colorsElement = doc.createElement(
"Colors" );
3475 docRoot.appendChild( colorsElement );
3476 TQDomElement colorsEventElement = doc.createElement(
"Event" );
3477 colorsElement.appendChild( colorsEventElement );
3478 TQColor startColor, middleColor, endColor;
3479 colors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3480 KDGanttXML::createColorNode( doc, colorsEventElement,
"Start", startColor );
3481 KDGanttXML::createColorNode( doc, colorsEventElement,
"Middle", middleColor );
3482 KDGanttXML::createColorNode( doc, colorsEventElement,
"End", endColor );
3483 TQDomElement colorsTaskElement = doc.createElement(
"Task" );
3484 colorsElement.appendChild( colorsTaskElement );
3485 colors( KDGanttViewItem::Task, startColor, middleColor, endColor );
3486 KDGanttXML::createColorNode( doc, colorsTaskElement,
"Start", startColor );
3487 KDGanttXML::createColorNode( doc, colorsTaskElement,
"Middle", middleColor );
3488 KDGanttXML::createColorNode( doc, colorsTaskElement,
"End", endColor );
3489 TQDomElement colorsSummaryElement = doc.createElement(
"Summary" );
3490 colorsElement.appendChild( colorsSummaryElement );
3491 colors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3492 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"Start", startColor );
3493 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"Middle", middleColor );
3494 KDGanttXML::createColorNode( doc, colorsSummaryElement,
"End", endColor );
3497 TQDomElement defaultColorsElement = doc.createElement(
"DefaultColors" );
3498 docRoot.appendChild( defaultColorsElement );
3499 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Event",
3501 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Task",
3503 KDGanttXML::createColorNode( doc, defaultColorsElement,
"Summary",
3508 TQDomElement highlightColorsElement = doc.createElement(
"HighlightColors" );
3509 docRoot.appendChild( highlightColorsElement );
3510 TQDomElement highlightColorsEventElement = doc.createElement(
"Event" );
3511 highlightColorsElement.appendChild( highlightColorsEventElement );
3512 highlightColors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3513 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"Start", startColor );
3514 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"Middle", middleColor );
3515 KDGanttXML::createColorNode( doc, highlightColorsEventElement,
"End", endColor );
3516 TQDomElement highlightColorsTaskElement = doc.createElement(
"Task" );
3517 highlightColorsElement.appendChild( highlightColorsTaskElement );
3518 highlightColors( KDGanttViewItem::Task, startColor, middleColor, endColor );
3519 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"Start", startColor );
3520 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"Middle", middleColor );
3521 KDGanttXML::createColorNode( doc, highlightColorsTaskElement,
"End", endColor );
3522 TQDomElement highlightColorsSummaryElement = doc.createElement(
"Summary" );
3523 highlightColorsElement.appendChild( highlightColorsSummaryElement );
3524 highlightColors( KDGanttViewItem::Event, startColor, middleColor, endColor );
3525 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"Start", startColor );
3526 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"Middle", middleColor );
3527 KDGanttXML::createColorNode( doc, highlightColorsSummaryElement,
"End", endColor );
3542 TQDomElement defaultHighlightColorsElement = doc.createElement(
"DefaultHighlightColors" );
3543 docRoot.appendChild( defaultHighlightColorsElement );
3544 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Event",
3546 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Task",
3548 KDGanttXML::createColorNode( doc, defaultHighlightColorsElement,
"Summary",
3553 TQDomElement itemsElement = doc.createElement(
"Items" );
3554 docRoot.appendChild( itemsElement );
3556 while( currentItem ) {
3557 currentItem->
createNode( doc, itemsElement );
3562 TQDomElement taskLinksElement = doc.createElement(
"TaskLinks" );
3563 docRoot.appendChild( taskLinksElement );
3564 TQPtrList<KDGanttViewTaskLink> taskLinkList =
taskLinks();
3566 for( currentTL = taskLinkList.first(); currentTL;
3567 currentTL = taskLinkList.next() )
3568 currentTL->
createNode( doc, taskLinksElement );
3571 TQDomElement taskLinkGroupsElement = doc.createElement(
"TaskLinkGroups" );
3572 docRoot.appendChild( taskLinkGroupsElement );
3573 TQPtrList<KDGanttViewTaskLinkGroup> taskLinkGroupList =
taskLinkGroups();
3575 for( currentTLG = taskLinkGroupList.first(); currentTLG;
3576 currentTLG = taskLinkGroupList.next() )
3577 currentTLG->
createNode( doc, taskLinkGroupsElement );
3580 TQDomElement columnBackgroundColorsElement =
3581 doc.createElement(
"ColumnBackgroundColors" );
3582 docRoot.appendChild( columnBackgroundColorsElement );
3583 KDTimeHeaderWidget::ColumnColorList ccList =
3584 myTimeHeader->columnBackgroundColorList();
3585 for( KDTimeHeaderWidget::ColumnColorList::iterator it = ccList.begin();
3586 it != ccList.end(); ++it ) {
3587 TQDomElement columnBackgroundColorElement =
3588 doc.createElement(
"ColumnBackgroundColor" );
3589 columnBackgroundColorsElement.appendChild( columnBackgroundColorElement );
3590 KDGanttXML::createDateTimeNode( doc, columnBackgroundColorElement,
3591 "DateTime", (*it).datetime );
3592 KDGanttXML::createColorNode( doc, columnBackgroundColorElement,
3593 "Color", (*it).color );
3597 TQDomElement legendItemsElement =
3598 doc.createElement(
"LegendItems" );
3599 docRoot.appendChild( legendItemsElement );
3600 legendItem* current;
3601 TQPtrListIterator<legendItem> lit( *myLegendItems );
3602 while( ( current = lit.current() ) ) {
3604 TQDomElement legendItemElement = doc.createElement(
"LegendItem" );
3605 legendItemsElement.appendChild( legendItemElement );
3606 KDGanttXML::createStringNode( doc, legendItemElement,
"Shape",
3607 KDGanttViewItem::shapeToString( current->shape ) );
3608 KDGanttXML::createColorNode( doc, legendItemElement,
"Color",
3610 KDGanttXML::createStringNode( doc, legendItemElement,
"Text",
3615 KDGanttXML::createBoolNode( doc, docRoot,
"DragEnabled",
isDragEnabled() );
3618 KDGanttXML::createBoolNode( doc, docRoot,
"DropEnabled",
isDropEnabled() );
3621 KDGanttXML::createBoolNode( doc, docRoot,
"CalendarMode",
calendarMode() );
3628 TQString KDGanttView::scaleToString( Scale scale )
3650 if(
string ==
"Minute" )
3652 else if(
string ==
"Hour" )
3654 else if(
string ==
"Day" )
3656 else if(
string ==
"Week" )
3658 else if(
string ==
"Month" )
3660 else if(
string ==
"Auto" )
3667 TQString KDGanttView::yearFormatToString( YearFormat format )
3674 case TwoDigitApostrophe:
3675 return "TwoDigitApostrophe";
3685 if(
string ==
"FourDigit" )
3687 else if(
string ==
"TwoDigit" )
3689 else if(
string ==
"TwoDigitApostrophe" )
3690 return TwoDigitApostrophe;
3691 else if(
string ==
"NoDate" )
3698 TQString KDGanttView::hourFormatToString( HourFormat format )
3705 case Hour_24_FourDigit:
3706 return "Hour_24_FourDigit";
3714 if(
string ==
"Hour_12" )
3716 else if(
string ==
"Hour_24" )
3726 if (myTaskLinkGroupList.isEmpty()) {
3727 myTaskLinkGroupList.append(group);
3730 if (myTaskLinkGroupList.find(group) == -1)
3731 myTaskLinkGroupList.append(group);
3737 myTaskLinkGroupList.remove(group);
3752 myItemAttributeDialog->reset( item );
3753 myItemAttributeDialog->show();
3770 const TQColor& shapeColor,
3771 const TQColor& backgroundColor,
int itemSize)
3774 int size = itemSize+2;
3775 int hei = ( itemSize/3 ) / 2;
3776 TQPixmap p = TQPixmap( size+4, size+4 );
3777 p.fill( backgroundColor );
3778 TQPainter paint (&p);
3779 TQBrush b = TQBrush ( TQt::SolidPattern );
3780 b.setColor( shapeColor );
3781 paint.setBrush( b );
3782 TQPen pen( TQt::black, 1 ) ;
3783 paint.setPen( pen );
3785 case KDGanttViewItem::TriangleDown:{
3786 TQPointArray arr = TQPointArray(3);
3787 arr.setPoint(0,-size/2,-hei);
3788 arr.setPoint(1,size/2,-hei);
3789 arr.setPoint(2,0,((size/2)-hei));
3790 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3791 paint.drawPolygon( arr );
3794 case KDGanttViewItem::TriangleUp :{
3795 TQPointArray arr = TQPointArray(3);
3796 arr.setPoint(0,-size/2,hei);
3797 arr.setPoint(1,size/2,hei);
3798 arr.setPoint(2,0,(-size/2)+hei);
3799 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3800 paint.drawPolygon( arr );
3803 case KDGanttViewItem::Diamond :{
3804 TQPointArray arr = TQPointArray(4);
3805 arr.setPoint(0,0,-size/2);
3806 arr.setPoint(1,size/2,0);
3807 arr.setPoint(2,0,size/2);
3808 arr.setPoint(3,-size/2,0);
3809 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3810 paint.drawPolygon( arr );
3813 case KDGanttViewItem::Square :{
3814 TQPointArray arr = TQPointArray(4);
3815 arr.setPoint(0,-size/2,-size/2);
3816 arr.setPoint(1,size/2,-size/2);
3817 arr.setPoint(2,size/2,size/2);
3818 arr.setPoint(3,-size/2,size/2);
3819 arr.translate( ( size/2 ) +2 , ( size/2 ) +2);
3820 paint.drawPolygon( arr );
3823 case KDGanttViewItem::Circle :{
3824 paint.drawEllipse( 2, 2, size, size);
3836 case (KDGanttViewItem::Event):
3839 case (KDGanttViewItem::Task):
3842 case (KDGanttViewItem::Summary):
3850 void KDGanttView::initDefaults()
3854 for (i = 0;i<3;++i) {
3855 undefinedShape[i] =
true;
3856 undefinedColor[i] =
true;
3857 undefinedColorHL[i] =
true;
3860 myDefaultColor [ getIndex( KDGanttViewItem::Event ) ] = TQt::blue;
3861 myDefaultColorHL [ getIndex( KDGanttViewItem::Event ) ] = TQt::red;
3862 myDefaultColor [ getIndex( KDGanttViewItem::Task ) ] = TQt::green;
3863 myDefaultColorHL [ getIndex( KDGanttViewItem::Task ) ] = TQt::red;
3864 myDefaultColor [ getIndex( KDGanttViewItem::Summary ) ] = TQt::cyan;
3865 myDefaultColorHL [ getIndex( KDGanttViewItem::Summary ) ] = TQt::red;
3869 for (i = 0;i<3;++i) {
3870 myDefaultShape [3*getIndex( KDGanttViewItem::Event )+ i] = KDGanttViewItem::Diamond;
3871 myDefaultShape [3*getIndex( KDGanttViewItem::Task ) +i] = KDGanttViewItem::Square;
3872 myDefaultShape [3*getIndex( KDGanttViewItem::Summary ) +i] = KDGanttViewItem::TriangleDown;
3884 return myListView->addColumn( label, width );
3895 return myListView->addColumn( iconset, label, width );
3904 myListView->removeColumn( index );
3922 myListView->setSelected( item, selected );
3963 return static_cast<KDGanttViewItem*
>( myListView->itemAt(myListView->mapFromGlobal(pos) ));
3984 TQPoint local = myCanvasView->mapFromGlobal(pos);
3986 TQCanvasItemList il = myTimeTable->collisions( myCanvasView->viewportToContents( local ));
3987 TQCanvasItemList::Iterator it;
3988 for ( it = il.begin(); it != il.end(); ++it ) {
3989 if ( myCanvasView->getType(*it) == Type_is_KDGanttViewItem) {
3990 item = myCanvasView->getItem(*it);
4028 y = myCanvasView->mapFromGlobal(pos).y();
4032 while ( item != 0 ) {
4033 int yc = item->itemPos();
4034 if ( yc <= y && y < yc + item->height()) {
4045 void KDGanttView::addTickRight()
4047 if ( !mFixedHorizon && _enableAdding && myCanvasView->horizontalScrollBar()->value() == myCanvasView->horizontalScrollBar()->maxValue()) {
4049 myTimeHeader->addTickRight();
4051 myCanvasView->updateHorScrollBar();
4057 void KDGanttView::addTickLeft()
4059 if ( !mFixedHorizon && _enableAdding && myCanvasView->horizontalScrollBar()->value() == 0 ) {
4060 myCanvasView->horizontalScrollBar()->blockSignals(
true );
4061 myTimeHeader->addTickLeft();
4062 myCanvasView->horizontalScrollBar()->blockSignals(
false );
4068 void KDGanttView::enableAdding(
int val )
4070 _enableAdding = ( val == 0 || val == myCanvasView->horizontalScrollBar()->maxValue());
4081 return myListView->childCount();
4090 bool block = myTimeTable->blockUpdating();
4091 myTimeTable->setBlockUpdating(
true );
4092 myListView->clear();
4093 myTimeTable->setBlockUpdating(
false );
4094 myTimeTable->updateMyContent();
4095 myTimeTable->setBlockUpdating( block );
4104 emit
dropped( e, droppedItem, itemBelowMouse);
4112 return myListView->dragObject ();
4130 TQWidget::setPaletteBackgroundColor( col );
4131 timeHeaderSpacerWidget->setPaletteBackgroundColor( col );
4143 myTimeTable->setBackgroundColor( c );
4155 myTimeHeader->setPaletteBackgroundColor( c );
4157 timeHeaderSpacerWidget->setPaletteBackgroundColor( c );
4169 myLegend->setPaletteBackgroundColor( c );
4170 leftWidget->setPaletteBackgroundColor( c );
4182 myListView->viewport()->setPaletteBackgroundColor( c );
4194 return myListView->viewport()->paletteBackgroundColor( );
4206 return myTimeTable->backgroundColor( );
4218 return myTimeHeader->paletteBackgroundColor( );
4230 return myLegend->paletteBackgroundColor( );
4251 w->reparent ( spacerLeft, 0, TQPoint(0,0) );
4267 TQListViewItemIterator it( myListView );
4268 for ( ; it.current(); ++it ) {
4288 TQListViewItemIterator it( myListView );
4289 for ( ; it.current(); ++it ) {
4318 return fDragEnabled;
4330 return fDropEnabled;
4383 Q_UNUSED( droppedItem );
4384 Q_UNUSED( itemBelowMouse );
4563 int sw = mySplitter->width();
4564 TQValueList<int> list;
4579 return leftWidget->width();
4594 myListView->setVScrollBarMode ( m );
4609 if ( m == TQScrollView::Auto )
4610 tqDebug(
"KDGanttView::setListViewVScrollBarMode: TQScrollView::Auto not supported. Nothing changed. ");
4613 myCanvasView->setVScrollBarMode ( m );
4614 if ( m == TQScrollView::AlwaysOn )
4615 timeHeaderSpacerWidget->setFixedWidth(myCanvasView->verticalScrollBar()->width() );
4617 timeHeaderSpacerWidget->setFixedWidth( 0 );
4624 if (myItemAttributeDialog->getItem() == item ) {
4625 myItemAttributeDialog->reset( 0 );
4638 myCanvasView->linkItemsEnabled = on;
4639 myCanvasView->autoScrollEnabled =
true;
4649 return myCanvasView->linkItemsEnabled;
The KDGanttMinimizeSplitter class implements a splitter widget with minimize buttons.
KDGanttMinimizeSplitter(TQWidget *parent=0, const char *name=0)
void setSizes(TQValueList< int >)
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)
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 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
TQDateTime getDateTimeForCoordX(int coordX, bool global=true) const
void addIntervalBackgroundColor(KDIntervalColorRectangle *newItem)
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
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)
void setTimeHeaderBackgroundColor(const TQColor &)
void centerTimelineAfterShow(const TQDateTime ¢er)
void editItem(KDGanttViewItem *)
TQColor weekdayBackgroundColor(int weekday) const