|
|
|
|
/*
|
|
|
|
|
$Id: KDGanttViewSubwidgets.cpp 669475 2007-05-29 13:44:48Z mueller $
|
|
|
|
|
KDGantt - a multi-platform charting engine
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
** Copyright (C) 2002-2004 Klar<EFBFBD>lvdalens Datakonsult AB. All rights reserved.
|
|
|
|
|
**
|
|
|
|
|
** This file is part of the KDGantt library.
|
|
|
|
|
**
|
|
|
|
|
** This file may be distributed and/or modified under the terms of the
|
|
|
|
|
** GNU General Public License version 2 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
|
|
|
** packaging of this file.
|
|
|
|
|
**
|
|
|
|
|
** Licensees holding valid commercial KDGantt licenses may use this file in
|
|
|
|
|
** accordance with the KDGantt Commercial License Agreement provided with
|
|
|
|
|
** the Software.
|
|
|
|
|
**
|
|
|
|
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
|
|
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
**
|
|
|
|
|
** See http://www.klaralvdalens-datakonsult.se/Public/products/ for
|
|
|
|
|
** information about KDGantt Commercial License Agreements.
|
|
|
|
|
**
|
|
|
|
|
** Contact info@klaralvdalens-datakonsult.se if any conditions of this
|
|
|
|
|
** licensing are not clear to you.
|
|
|
|
|
**
|
|
|
|
|
** As a special exception, permission is given to link this program
|
|
|
|
|
** with any edition of TQt, and distribute the resulting executable,
|
|
|
|
|
** without including the source code for TQt in the source distribution.
|
|
|
|
|
**
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "KDGanttViewSubwidgets.h"
|
|
|
|
|
#include "KDGanttViewEventItem.h"
|
|
|
|
|
#include "KDGanttViewSummaryItem.h"
|
|
|
|
|
#include "KDGanttViewTaskItem.h"
|
|
|
|
|
#ifndef KDGANTT_MASTER_CVS
|
|
|
|
|
#include "KDGanttViewSubwidgets.moc"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <tqlabel.h>
|
|
|
|
|
#include <tqheader.h>
|
|
|
|
|
#include <tqpainter.h>
|
|
|
|
|
#include <tqrect.h>
|
|
|
|
|
#include <tqtooltip.h>
|
|
|
|
|
#include <tqapplication.h>
|
|
|
|
|
#include <tqdrawutil.h>
|
|
|
|
|
#include <tqpalette.h>
|
|
|
|
|
#include <tqdragobject.h>
|
|
|
|
|
#include <tqptrlist.h>
|
|
|
|
|
#include <tqpen.h>
|
|
|
|
|
|
|
|
|
|
#include <tdeglobal.h>
|
|
|
|
|
#include <tdelocale.h>
|
|
|
|
|
#include <kcalendarsystem.h>
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
|
|
KDTimeTableWidget:: KDTimeTableWidget( TQWidget* parent,KDGanttView* myGantt)
|
|
|
|
|
: TQCanvas (TQT_TQOBJECT(parent))
|
|
|
|
|
{
|
|
|
|
|
myGanttView = myGantt;
|
|
|
|
|
taskLinksVisible = true;
|
|
|
|
|
flag_blockUpdating = false;
|
|
|
|
|
int_blockUpdating = 0;
|
|
|
|
|
gridPen.setStyle(TQt::DotLine);
|
|
|
|
|
gridPen.setColor(TQColor(100,100,100));
|
|
|
|
|
maximumComputedGridHeight = 0;
|
|
|
|
|
denseLineCount = 0;
|
|
|
|
|
denseLineBrush = TQBrush( TQColor ( 240,240,240 ));
|
|
|
|
|
noInfoLineBrush = TQBrush( TQColor ( 100,100,100 ), TQt::FDiagPattern );
|
|
|
|
|
pendingHeight = 0;
|
|
|
|
|
pendingWidth = 0;
|
|
|
|
|
retune(256);
|
|
|
|
|
resize(1,1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQPtrList<KDGanttViewTaskLink> KDTimeTableWidget::taskLinks()
|
|
|
|
|
{
|
|
|
|
|
return myTaskLinkList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::clearTaskLinks()
|
|
|
|
|
{
|
|
|
|
|
// cannot use clear() here, as tasklinks will remove themselves from my list when deleted!
|
|
|
|
|
TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList);
|
|
|
|
|
while (it.current()) {
|
|
|
|
|
delete it.current();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::resetWidth( int wid )
|
|
|
|
|
{
|
|
|
|
|
if ( wid == width() ) {
|
|
|
|
|
if (pendingHeight)
|
|
|
|
|
pendingWidth = wid;
|
|
|
|
|
else
|
|
|
|
|
pendingWidth = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ( ! pendingHeight )
|
|
|
|
|
pendingHeight = height();
|
|
|
|
|
pendingWidth = wid;
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::checkHeight( int hei )
|
|
|
|
|
{
|
|
|
|
|
if( hei < height() )
|
|
|
|
|
return;
|
|
|
|
|
if ( pendingHeight < hei+100)
|
|
|
|
|
pendingHeight = hei+100;
|
|
|
|
|
if ( ! pendingWidth )
|
|
|
|
|
pendingWidth = width();
|
|
|
|
|
maximumComputedGridHeight = 0; //force recomputing all
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::setNoInformationBrush( const TQBrush& brush )
|
|
|
|
|
{
|
|
|
|
|
noInfoLineBrush = brush;
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
TQBrush KDTimeTableWidget::noInformationBrush() const
|
|
|
|
|
{
|
|
|
|
|
return noInfoLineBrush;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::removeItemFromTasklinks( KDGanttViewItem* item)
|
|
|
|
|
{
|
|
|
|
|
TQPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList));
|
|
|
|
|
for ( ; it.current(); ++it ) {
|
|
|
|
|
it.current()->removeItemFromList( item );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::expandItem( TQListViewItem * item)
|
|
|
|
|
{
|
|
|
|
|
item->invalidateHeight () ;
|
|
|
|
|
//tqApp->processEvents();
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
void KDTimeTableWidget::collapseItem( TQListViewItem * item)
|
|
|
|
|
{
|
|
|
|
|
item->invalidateHeight () ;
|
|
|
|
|
//tqApp->processEvents();
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::highlightItem( TQListViewItem * item )
|
|
|
|
|
{
|
|
|
|
|
static bool itemwashighlighted;
|
|
|
|
|
static KDGanttViewItem* highlightedItem = 0;
|
|
|
|
|
if (highlightedItem)
|
|
|
|
|
highlightedItem->setHighlight(itemwashighlighted);
|
|
|
|
|
highlightedItem = ( KDGanttViewItem*)item;
|
|
|
|
|
itemwashighlighted = highlightedItem->highlight();
|
|
|
|
|
highlightedItem->setHighlight(true);
|
|
|
|
|
item->invalidateHeight () ;
|
|
|
|
|
myGanttView->myListView->contentsY();
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
int KDTimeTableWidget::computeHeight()
|
|
|
|
|
{
|
|
|
|
|
// compute height of ListView
|
|
|
|
|
// show only items shown in ListView
|
|
|
|
|
int hei = 0;
|
|
|
|
|
KDGanttViewItem* temp;
|
|
|
|
|
temp = myGanttView->firstChild();
|
|
|
|
|
while (temp) {
|
|
|
|
|
hei += temp->computeHeight();
|
|
|
|
|
temp = temp->nextSibling();
|
|
|
|
|
}
|
|
|
|
|
// set hei to 1 to avoid canavs to be a null pixmap
|
|
|
|
|
if (hei == 0) {
|
|
|
|
|
hei = 1;
|
|
|
|
|
}
|
|
|
|
|
//tqDebug("COMPUTED HEI %d ", hei);
|
|
|
|
|
emit heightComputed( hei );
|
|
|
|
|
return hei;
|
|
|
|
|
}
|
|
|
|
|
void KDTimeTableWidget::computeVerticalGrid()
|
|
|
|
|
{
|
|
|
|
|
// recompute the vertical grid
|
|
|
|
|
// compute the vertical grid
|
|
|
|
|
// if we have too much lines, hide them
|
|
|
|
|
//tqDebug("computeVerticalGrid() ");
|
|
|
|
|
int cw = myGanttView->myTimeHeader->myGridMinorWidth;
|
|
|
|
|
int i = 0;
|
|
|
|
|
int h ;
|
|
|
|
|
if (pendingHeight > height() )
|
|
|
|
|
h = pendingHeight;
|
|
|
|
|
else
|
|
|
|
|
h = height();
|
|
|
|
|
int wid;
|
|
|
|
|
if ( pendingWidth )
|
|
|
|
|
wid = pendingWidth;
|
|
|
|
|
else
|
|
|
|
|
wid = width();
|
|
|
|
|
KDCanvasLine* templine;
|
|
|
|
|
KDCanvasRectangle* temprect;
|
|
|
|
|
TQColor colcol;
|
|
|
|
|
TQPen colPen;
|
|
|
|
|
bool colorIterator = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (myGanttView->showMinorTicks()){//minor
|
|
|
|
|
colPen.setWidth(cw);
|
|
|
|
|
TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList);
|
|
|
|
|
TQPtrListIterator<KDCanvasLine> itgrid(verGridList);
|
|
|
|
|
for ( ; itgrid.current(); ++itgrid ) {
|
|
|
|
|
if (i < wid) {
|
|
|
|
|
itgrid.current()->setPoints(i,0,i,h);
|
|
|
|
|
itgrid.current()->show();
|
|
|
|
|
|
|
|
|
|
if (myGanttView->myTimeHeader->getColumnColor(colcol,i,i+cw))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
colPen.setColor(colcol);
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
colorIterator = itcol.current();
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
{/*
|
|
|
|
|
itcol.current()->setPen(colPen);
|
|
|
|
|
itcol.current()->setPoints(i+(cw/2),0,i+(cw/2),h);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
itcol.current()->setPen( TQt::NoPen );
|
|
|
|
|
itcol.current()->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
itcol.current()->setSize(cw ,h );
|
|
|
|
|
itcol.current()->move( i, 0 );
|
|
|
|
|
itcol.current()->show();
|
|
|
|
|
++itcol;
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(colPen);
|
|
|
|
|
templine->setPoints(i+(cw/2),0,i+(cw/2),h);
|
|
|
|
|
*/
|
|
|
|
|
temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
temprect->setPen( TQt::NoPen );
|
|
|
|
|
temprect->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
temprect->setSize(cw ,h );
|
|
|
|
|
temprect->move( i, 0 );
|
|
|
|
|
temprect->setZ(-20);
|
|
|
|
|
temprect->show();
|
|
|
|
|
columnColorList.append(temprect);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i += cw;
|
|
|
|
|
} else {
|
|
|
|
|
itgrid.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// create additional Lines for vertical grid
|
|
|
|
|
for ( ;i < wid;i += cw) {
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(gridPen);
|
|
|
|
|
templine->setPoints(i,0,i,h);
|
|
|
|
|
templine->setZ(0);
|
|
|
|
|
templine->show();
|
|
|
|
|
verGridList.append(templine);
|
|
|
|
|
if (myGanttView->myTimeHeader->getColumnColor(colcol,i,i+cw))
|
|
|
|
|
{
|
|
|
|
|
colPen.setColor(colcol);
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
colorIterator = itcol.current();
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
{/*
|
|
|
|
|
itcol.current()->setPen(colPen);
|
|
|
|
|
itcol.current()->setPoints(i+(cw/2),0,i+(cw/2),h);
|
|
|
|
|
*/
|
|
|
|
|
itcol.current()->setPen( TQt::NoPen );
|
|
|
|
|
itcol.current()->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
itcol.current()->setSize(cw ,h );
|
|
|
|
|
itcol.current()->move( i, 0 );
|
|
|
|
|
itcol.current()->show();
|
|
|
|
|
++itcol;
|
|
|
|
|
} else {
|
|
|
|
|
temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
temprect->setPen( TQt::NoPen );
|
|
|
|
|
temprect->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
temprect->setSize(cw ,h );
|
|
|
|
|
temprect->move( i, 0 );
|
|
|
|
|
temprect->setZ(-20);
|
|
|
|
|
temprect->show();
|
|
|
|
|
columnColorList.append(temprect);
|
|
|
|
|
/*
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(colPen);
|
|
|
|
|
templine->setPoints(i+(cw/2),0,i+(cw/2),h);
|
|
|
|
|
templine->setZ(-20);
|
|
|
|
|
templine->show();
|
|
|
|
|
columnColorList.append(templine);
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
for ( ; itcol.current(); ++itcol )
|
|
|
|
|
itcol.current()->hide();
|
|
|
|
|
} else {//major
|
|
|
|
|
if (myGanttView->showMajorTicks()) {
|
|
|
|
|
TQValueList<int>::iterator intIt = myGanttView->myTimeHeader->majorTicks.begin();
|
|
|
|
|
TQValueList<int>::iterator intItEnd = myGanttView->myTimeHeader->majorTicks.end();
|
|
|
|
|
TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList);
|
|
|
|
|
TQPtrListIterator<KDCanvasLine> itgrid(verGridList);
|
|
|
|
|
int left = 0;
|
|
|
|
|
for ( ; itgrid.current(); ++itgrid ) {
|
|
|
|
|
if (intIt != intItEnd) {
|
|
|
|
|
left = (*intIt);
|
|
|
|
|
++intIt;
|
|
|
|
|
itgrid.current()->setPoints(left,0,left,h);
|
|
|
|
|
itgrid.current()->show();
|
|
|
|
|
//int right = (*intIt);
|
|
|
|
|
if ((*intIt))
|
|
|
|
|
if (myGanttView->myTimeHeader->getColumnColor(colcol,left,(*intIt) ))
|
|
|
|
|
{
|
|
|
|
|
int mid = (-left+(*intIt));
|
|
|
|
|
colPen.setColor(colcol);
|
|
|
|
|
colPen.setWidth((*intIt)-left);
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
colorIterator = itcol.current();
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
{/*
|
|
|
|
|
itcol.current()->setPen(colPen);
|
|
|
|
|
itcol.current()->setPoints(i+mid,0,mid,h);
|
|
|
|
|
*/
|
|
|
|
|
itcol.current()->setPen( TQt::NoPen );
|
|
|
|
|
itcol.current()->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
itcol.current()->setSize(mid ,h );
|
|
|
|
|
itcol.current()->move( left, 0 );
|
|
|
|
|
itcol.current()->show();
|
|
|
|
|
++itcol;
|
|
|
|
|
} else {
|
|
|
|
|
temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
temprect->setPen( TQt::NoPen );
|
|
|
|
|
temprect->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
temprect->setSize(mid,h );
|
|
|
|
|
temprect->move( left, 0 );
|
|
|
|
|
temprect->setZ(-20);
|
|
|
|
|
temprect->show();
|
|
|
|
|
columnColorList.append(temprect);
|
|
|
|
|
/*
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(colPen);
|
|
|
|
|
templine->setPoints(mid,0,i+mid,h);
|
|
|
|
|
templine->setZ(-20);
|
|
|
|
|
templine->show();
|
|
|
|
|
columnColorList.append(templine);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
itgrid.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
KDCanvasLine* templine;
|
|
|
|
|
// create additional Lines for vertical grid
|
|
|
|
|
for ( ;intIt != intItEnd ;++intIt) {
|
|
|
|
|
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(gridPen);
|
|
|
|
|
templine->setPoints((*intIt),0,(*intIt),h);
|
|
|
|
|
templine->setZ(0);
|
|
|
|
|
templine->show();
|
|
|
|
|
verGridList.append(templine);
|
|
|
|
|
if ((*intIt))
|
|
|
|
|
if (myGanttView->myTimeHeader->getColumnColor(colcol,left,(*intIt)))
|
|
|
|
|
{
|
|
|
|
|
int mid = (-left+(*intIt));
|
|
|
|
|
colPen.setColor(colcol);
|
|
|
|
|
colPen.setWidth((*intIt)-left);
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
colorIterator = itcol.current();
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
{/*
|
|
|
|
|
itcol.current()->setPen(colPen);
|
|
|
|
|
itcol.current()->setPoints(i+mid,0,mid,h);
|
|
|
|
|
*/
|
|
|
|
|
itcol.current()->setPen( TQt::NoPen );
|
|
|
|
|
itcol.current()->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
itcol.current()->setSize(mid ,h );
|
|
|
|
|
itcol.current()->move( left, 0 );
|
|
|
|
|
itcol.current()->show();
|
|
|
|
|
++itcol;
|
|
|
|
|
} else {
|
|
|
|
|
temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
temprect->setPen( TQt::NoPen );
|
|
|
|
|
temprect->setBrush( TQBrush( colcol, SolidPattern) );
|
|
|
|
|
temprect->setSize(mid ,h );
|
|
|
|
|
temprect->move( left, 0 );
|
|
|
|
|
temprect->setZ(-20);
|
|
|
|
|
temprect->show();
|
|
|
|
|
columnColorList.append(temprect);
|
|
|
|
|
/*
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(colPen);
|
|
|
|
|
templine->setPoints(mid,0,i+mid,h);
|
|
|
|
|
templine->setZ(-20);
|
|
|
|
|
templine->show();
|
|
|
|
|
columnColorList.append(templine);
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
left = (*intIt);
|
|
|
|
|
}
|
|
|
|
|
if (colorIterator)
|
|
|
|
|
for ( ; itcol.current(); ++itcol ) {
|
|
|
|
|
itcol.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//hideall
|
|
|
|
|
TQPtrListIterator<KDCanvasLine> itgrid(verGridList);
|
|
|
|
|
for ( ; itgrid.current(); ++itgrid ) {
|
|
|
|
|
itgrid.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList);
|
|
|
|
|
for ( ; itcol.current(); ++itcol ) {
|
|
|
|
|
itcol.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void KDTimeTableWidget::computeHorizontalGrid()
|
|
|
|
|
{
|
|
|
|
|
// compute horizontal grid
|
|
|
|
|
//tqDebug("computeHorizontalGrid() ");
|
|
|
|
|
KDGanttViewItem* temp = myGanttView->firstChild();
|
|
|
|
|
int wid;
|
|
|
|
|
if ( pendingWidth )
|
|
|
|
|
wid = pendingWidth;
|
|
|
|
|
else
|
|
|
|
|
wid = width();
|
|
|
|
|
KDCanvasLine* templine;
|
|
|
|
|
TQPtrListIterator<KDCanvasLine> ithor(horGridList);
|
|
|
|
|
if ( ithor.current() ) {
|
|
|
|
|
templine = ithor.current();
|
|
|
|
|
++ithor;
|
|
|
|
|
} else {
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(gridPen);
|
|
|
|
|
templine->setZ(0);
|
|
|
|
|
horGridList.append(templine);
|
|
|
|
|
}
|
|
|
|
|
templine->setPoints(0,0,wid,0);
|
|
|
|
|
templine->show();
|
|
|
|
|
int posY;
|
|
|
|
|
while ( temp ) {
|
|
|
|
|
posY = temp->itemPos() + temp->height();
|
|
|
|
|
if ( ithor.current() ) {
|
|
|
|
|
templine = ithor.current();
|
|
|
|
|
++ithor;
|
|
|
|
|
} else {
|
|
|
|
|
//new vertical grid line
|
|
|
|
|
templine = new KDCanvasLine(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
templine->setPen(gridPen);
|
|
|
|
|
templine->setZ(0);
|
|
|
|
|
horGridList.append(templine);
|
|
|
|
|
}
|
|
|
|
|
if ( templine->endPoint() != TQPoint(wid,posY ))
|
|
|
|
|
templine->setPoints(0,posY,wid,posY );
|
|
|
|
|
if ( !templine->isVisible() )
|
|
|
|
|
templine->show();
|
|
|
|
|
//TQString ts = "asGroup";
|
|
|
|
|
//if (!temp->displaySubitemsAsGroup() )
|
|
|
|
|
// ts = " NOT asGroup";
|
|
|
|
|
//tqDebug("temp name %s %s", temp->listViewText(0).latin1(), ts.latin1());
|
|
|
|
|
|
|
|
|
|
temp = temp->itemBelow ();
|
|
|
|
|
}
|
|
|
|
|
while ( ithor.current() ) {
|
|
|
|
|
if ( ithor.current()->isVisible() )
|
|
|
|
|
ithor.current()->hide();
|
|
|
|
|
++ithor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::computeDenseLines()
|
|
|
|
|
{
|
|
|
|
|
KDGanttViewItem* temp = myGanttView->firstChild();
|
|
|
|
|
int wid;
|
|
|
|
|
if ( pendingWidth )
|
|
|
|
|
wid = pendingWidth;
|
|
|
|
|
else
|
|
|
|
|
wid = width();
|
|
|
|
|
TQPtrListIterator<KDCanvasRectangle> ithordense(horDenseList);
|
|
|
|
|
KDCanvasRectangle* denseLine;
|
|
|
|
|
int tempDenseLineCount = 0;
|
|
|
|
|
while ( temp ) {
|
|
|
|
|
if ( temp->isVisible() ) {
|
|
|
|
|
++tempDenseLineCount;
|
|
|
|
|
if ( tempDenseLineCount == denseLineCount ) {
|
|
|
|
|
tempDenseLineCount = 0;
|
|
|
|
|
if ( ithordense.current() ) {
|
|
|
|
|
denseLine = ithordense.current();
|
|
|
|
|
++ithordense;
|
|
|
|
|
} else {
|
|
|
|
|
denseLine =new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
denseLine->setZ(-2);
|
|
|
|
|
horDenseList.append( denseLine );
|
|
|
|
|
}
|
|
|
|
|
if ( denseLine->rect() != TQRect(0, temp->itemPos(),wid, temp->height()) ) {
|
|
|
|
|
denseLine->move( 0, temp->itemPos() );
|
|
|
|
|
denseLine->setSize( wid, temp->height());
|
|
|
|
|
}
|
|
|
|
|
if (denseLine->brush() != denseLineBrush ) {
|
|
|
|
|
denseLine->setPen( TQPen( TQt::NoPen ) );
|
|
|
|
|
denseLine->setBrush( denseLineBrush);
|
|
|
|
|
}
|
|
|
|
|
if (!denseLine->isVisible() )
|
|
|
|
|
denseLine->show();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
temp = temp->itemBelow ();
|
|
|
|
|
}
|
|
|
|
|
while ( ithordense.current() ) {
|
|
|
|
|
if ( ithordense.current()->isVisible() ) {
|
|
|
|
|
ithordense.current()->hide();
|
|
|
|
|
}
|
|
|
|
|
++ithordense;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void KDTimeTableWidget::computeShowNoInformation()
|
|
|
|
|
{
|
|
|
|
|
KDGanttViewItem* temp = myGanttView->firstChild();
|
|
|
|
|
int wid;
|
|
|
|
|
if ( pendingWidth )
|
|
|
|
|
wid = pendingWidth;
|
|
|
|
|
else
|
|
|
|
|
wid = width();
|
|
|
|
|
TQPtrListIterator<KDCanvasRectangle> itnoinfo(showNoInfoList);
|
|
|
|
|
KDCanvasRectangle* noInfoLine;
|
|
|
|
|
while ( temp ) {
|
|
|
|
|
if ( temp->showNoInformation() ) {
|
|
|
|
|
if ( itnoinfo.current() ) {
|
|
|
|
|
noInfoLine = itnoinfo.current();
|
|
|
|
|
++itnoinfo;
|
|
|
|
|
} else {
|
|
|
|
|
noInfoLine =new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem);
|
|
|
|
|
showNoInfoList.append( noInfoLine );
|
|
|
|
|
noInfoLine->setZ(-1);
|
|
|
|
|
}
|
|
|
|
|
noInfoLine->move( 0, temp->itemPos() );
|
|
|
|
|
noInfoLine->setSize( wid, temp->height());
|
|
|
|
|
noInfoLine->setPen( TQPen( TQt::NoPen ) );
|
|
|
|
|
noInfoLine->setBrush( noInfoLineBrush);
|
|
|
|
|
noInfoLine->show();
|
|
|
|
|
}
|
|
|
|
|
temp = temp->itemBelow ();
|
|
|
|
|
}
|
|
|
|
|
while ( itnoinfo.current() ) {
|
|
|
|
|
itnoinfo.current()->hide();
|
|
|
|
|
++itnoinfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::computeTaskLinks()
|
|
|
|
|
{
|
|
|
|
|
//compute and show tasklinks
|
|
|
|
|
TQPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList));
|
|
|
|
|
for ( ; it.current(); ++it ) {
|
|
|
|
|
if (it.current()->isVisible())
|
|
|
|
|
it.current()->showMe(true);
|
|
|
|
|
else
|
|
|
|
|
it.current()->showMe(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// updateMyContent() can be blocked by blockUpdating( true ) or inc_blockUpdating()
|
|
|
|
|
// updateMyContent() is blocked, if the GanttView is hidden after startup
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::updateMyContent()
|
|
|
|
|
{
|
|
|
|
|
if ( flag_blockUpdating || int_blockUpdating ) {
|
|
|
|
|
// tqDebug("KDTimeTableWidget::updateMyContent() blocked! ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//tqDebug("KDTimeTableWidget::updateMyContent() ********************************* ");
|
|
|
|
|
/*
|
|
|
|
|
// debug output
|
|
|
|
|
KDGanttViewItem* temp = myGanttView->firstChild();
|
|
|
|
|
while (temp != 0) {
|
|
|
|
|
temp->printinfo(" " );
|
|
|
|
|
temp = temp->nextSibling();
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
int hei = computeHeight();
|
|
|
|
|
minimumHeight = hei;
|
|
|
|
|
int viewport_hei = myGanttView->myCanvasView->viewport()->height();
|
|
|
|
|
if ( viewport_hei > hei )
|
|
|
|
|
hei = viewport_hei + 100;
|
|
|
|
|
if ( myGanttView->myTimeHeader->registerStartTime() )
|
|
|
|
|
return; // try again via timeheader computeTicks();
|
|
|
|
|
if ( myGanttView->myTimeHeader->registerEndTime() )
|
|
|
|
|
return; // try again via timeheader computeTicks();
|
|
|
|
|
if ( hei > height() ) {
|
|
|
|
|
if ( ! pendingWidth )
|
|
|
|
|
pendingWidth = width();
|
|
|
|
|
if ( pendingHeight < hei )
|
|
|
|
|
pendingHeight = hei;
|
|
|
|
|
}
|
|
|
|
|
if (pendingHeight > hei )
|
|
|
|
|
hei = pendingHeight;
|
|
|
|
|
if (hei > maximumComputedGridHeight)
|
|
|
|
|
{
|
|
|
|
|
maximumComputedGridHeight = hei;
|
|
|
|
|
// compute the background interval lines
|
|
|
|
|
myGanttView->myTimeHeader->computeIntervals( hei );
|
|
|
|
|
//compute VerticalGrid and column color
|
|
|
|
|
computeVerticalGrid();
|
|
|
|
|
}
|
|
|
|
|
computeTaskLinks();
|
|
|
|
|
computeHorizontalGrid();
|
|
|
|
|
computeDenseLines();
|
|
|
|
|
computeShowNoInformation();
|
|
|
|
|
//setAllChanged();
|
|
|
|
|
update();
|
|
|
|
|
if (pendingWidth && pendingHeight ) {
|
|
|
|
|
resize( pendingWidth, pendingHeight );
|
|
|
|
|
pendingWidth = 0;
|
|
|
|
|
pendingHeight = 0;
|
|
|
|
|
emit heightComputed( 0 );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
pendingWidth = 0;
|
|
|
|
|
pendingHeight = 0;
|
|
|
|
|
//tqDebug("KDTimeTableWidget::updateMyContent() -------------------------");
|
|
|
|
|
}
|
|
|
|
|
// used for blocking recursive methods
|
|
|
|
|
// e.g. KDGanttViewItem::setHighlight() and displaySubitemsAsGroup() == true
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::inc_blockUpdating( )
|
|
|
|
|
{
|
|
|
|
|
++ int_blockUpdating;
|
|
|
|
|
}
|
|
|
|
|
// used for blocking recursive methods
|
|
|
|
|
void KDTimeTableWidget::dec_blockUpdating( )
|
|
|
|
|
{
|
|
|
|
|
-- int_blockUpdating;
|
|
|
|
|
}
|
|
|
|
|
// if false(i.e. unblock), sets int_blockUpdating to 0
|
|
|
|
|
void KDTimeTableWidget::setBlockUpdating( bool block )
|
|
|
|
|
{
|
|
|
|
|
if ( !block )
|
|
|
|
|
int_blockUpdating = 0;
|
|
|
|
|
flag_blockUpdating = block;
|
|
|
|
|
}
|
|
|
|
|
bool KDTimeTableWidget::blockUpdating()
|
|
|
|
|
{
|
|
|
|
|
return flag_blockUpdating;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeTableWidget::setShowTaskLinks( bool show )
|
|
|
|
|
{
|
|
|
|
|
taskLinksVisible = show;
|
|
|
|
|
updateMyContent();
|
|
|
|
|
}
|
|
|
|
|
bool KDTimeTableWidget::showTaskLinks()
|
|
|
|
|
{
|
|
|
|
|
return taskLinksVisible;
|
|
|
|
|
}
|
|
|
|
|
void KDTimeTableWidget::setHorBackgroundLines( int count, TQBrush brush )
|
|
|
|
|
{
|
|
|
|
|
denseLineBrush = brush;
|
|
|
|
|
denseLineCount = 0;
|
|
|
|
|
if ( count > 1 )
|
|
|
|
|
denseLineCount = count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int KDTimeTableWidget::horBackgroundLines( TQBrush& brush )
|
|
|
|
|
{
|
|
|
|
|
brush = denseLineBrush;
|
|
|
|
|
return denseLineCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int KDTimeTableWidget::getCoordX( TQDateTime dt ) {
|
|
|
|
|
return myGanttView->myTimeHeader->getCoordX(dt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ***************************************************************
|
|
|
|
|
KDTimeHeaderWidget:: KDTimeHeaderWidget
|
|
|
|
|
***************************************************************** */
|
|
|
|
|
KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* parent,KDGanttView* gant )
|
|
|
|
|
: TQWidget (parent)
|
|
|
|
|
{
|
|
|
|
|
myToolTip = new KDTimeHeaderToolTip(this,this);
|
|
|
|
|
mySizeHint = 0;
|
|
|
|
|
myGanttView = gant;
|
|
|
|
|
flagDoNotRecomputeAfterChange = true;
|
|
|
|
|
TQDateTime start = (TQDateTime::currentDateTime ()).addSecs(-3600);
|
|
|
|
|
setHorizonStart(start);
|
|
|
|
|
setHorizonEnd( start.addSecs(3600*2));
|
|
|
|
|
flagStartTimeSet = false;
|
|
|
|
|
flagEndTimeSet = false;
|
|
|
|
|
myCenterDateTime = TQDateTime::currentDateTime ();
|
|
|
|
|
setScale(KDGanttView::Auto);
|
|
|
|
|
//setScale(KDGanttView::Hour);
|
|
|
|
|
myMaxScale = KDGanttView::Month;
|
|
|
|
|
myMinScale = KDGanttView::Minute;
|
|
|
|
|
myAutoScaleMinorTickcount = 100;
|
|
|
|
|
setMajorScaleCount( 1 );
|
|
|
|
|
setMinorScaleCount( 1);
|
|
|
|
|
setMinimumColumnWidth( 5 );
|
|
|
|
|
setYearFormat(KDGanttView::FourDigit );
|
|
|
|
|
setHourFormat( KDGanttView::Hour_12 );
|
|
|
|
|
myZoomFactor = 1.0;
|
|
|
|
|
setWeekendBackgroundColor(TQColor(220,220,220) );
|
|
|
|
|
setWeekendDays( 6, 7 );
|
|
|
|
|
myGridMinorWidth = 0;
|
|
|
|
|
myPopupMenu = new TQPopupMenu(this);
|
|
|
|
|
TQPopupMenu * zoomPopupMenu = new TQPopupMenu(this);
|
|
|
|
|
myPopupMenu->insertItem (i18n("Zoom"),zoomPopupMenu, 1);
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom to 100%"),this, TQT_SLOT(setSettings(int)),0 ,21,21 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom to Fit"),this, TQT_SLOT(setSettings(int)),0 ,20,20 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom In (x 2)"),this, TQT_SLOT(setSettings(int)),0 ,22,22 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom In (x 6)"),this, TQT_SLOT(setSettings(int)),0 ,24,24 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom In (x 12)"),this, TQT_SLOT(setSettings(int)),0 ,26,26 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/2)"),this, TQT_SLOT(setSettings(int)),0 ,23,23 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/6)"),this, TQT_SLOT(setSettings(int)),0 ,25,25 );
|
|
|
|
|
zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/12)"),this, TQT_SLOT(setSettings(int)),0 ,27,27 );
|
|
|
|
|
scalePopupMenu = new TQPopupMenu(this);
|
|
|
|
|
myPopupMenu->insertItem (i18n("Scale"),scalePopupMenu, 2);
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Minute"),this, TQT_SLOT(setSettings(int)),0 ,1,1 );
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Hour"),this, TQT_SLOT(setSettings(int)),0 ,2,2 );
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Day"),this, TQT_SLOT(setSettings(int)),0 ,3,3 );
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Week"),this, TQT_SLOT(setSettings(int)),0 ,4,4 );
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Month"),this, TQT_SLOT(setSettings(int)),0 ,5,5 );
|
|
|
|
|
scalePopupMenu->insertItem( i18n("Auto"),this, TQT_SLOT(setSettings(int)),0 ,6,6 );
|
|
|
|
|
scalePopupMenu->setCheckable ( true );
|
|
|
|
|
timePopupMenu = new TQPopupMenu(this);
|
|
|
|
|
myPopupMenu->insertItem (i18n("Time Format"),timePopupMenu, 3);
|
|
|
|
|
timePopupMenu->insertItem( i18n("24 Hour"),this, TQT_SLOT(setSettings(int)),0 ,40,40 );
|
|
|
|
|
timePopupMenu->insertItem( i18n("12 PM Hour"),this, TQT_SLOT(setSettings(int)),0 ,41,41 );
|
|
|
|
|
timePopupMenu->insertItem( i18n("24:00 Hour"),this, TQT_SLOT(setSettings(int)),0 ,42,42 );
|
|
|
|
|
yearPopupMenu = new TQPopupMenu(this);
|
|
|
|
|
myPopupMenu->insertItem (i18n("Year Format"),yearPopupMenu, 4);
|
|
|
|
|
yearPopupMenu->insertItem( i18n("Four Digit"),this, TQT_SLOT(setSettings(int)),0 ,50,50 );
|
|
|
|
|
yearPopupMenu->insertItem( i18n("Two Digit"),this, TQT_SLOT(setSettings(int)),0 ,51,51 );
|
|
|
|
|
yearPopupMenu->insertItem( i18n("Two Digit Apostrophe"),this, TQT_SLOT(setSettings(int)),0 ,52,52 );
|
|
|
|
|
yearPopupMenu->insertItem( i18n("No Date on Minute/Hour Scale"),this, TQT_SLOT(setSettings(int)),0 ,53,53 );
|
|
|
|
|
|
|
|
|
|
gridPopupMenu = new TQPopupMenu(this);
|
|
|
|
|
myPopupMenu->insertItem (i18n("Grid"),gridPopupMenu,5);
|
|
|
|
|
gridPopupMenu->insertItem( i18n("Show Minor Grid"),this, TQT_SLOT(setSettings(int)),0 ,10,10 );
|
|
|
|
|
gridPopupMenu->insertItem( i18n("Show Major Grid"),this, TQT_SLOT(setSettings(int)),0 ,11,11 );
|
|
|
|
|
gridPopupMenu->insertItem( i18n("Show No Grid"),this, TQT_SLOT(setSettings(int)),0 ,12,12 );
|
|
|
|
|
myPopupMenu->insertItem( i18n("Print"),this, TQT_SLOT(setSettings(int)),0 ,30,30 );
|
|
|
|
|
connect(myPopupMenu, TQT_SIGNAL ( aboutToShow () ) , this, TQT_SLOT( preparePopupMenu() )) ;
|
|
|
|
|
flagZoomToFit = false;
|
|
|
|
|
setShowMinorTicks( true );
|
|
|
|
|
myRealEnd = myHorizonEnd;
|
|
|
|
|
myRealStart = myHorizonStart;
|
|
|
|
|
autoComputeTimeLine = true;
|
|
|
|
|
flagDoNotRecomputeAfterChange = false;
|
|
|
|
|
flagDoNotRepaintAfterChange = false;
|
|
|
|
|
setShowPopupMenu(false,false,false,false,false,false,false);
|
|
|
|
|
for (int j =1;j<8;++j)
|
|
|
|
|
weekdayColor[j] = TQt::white;
|
|
|
|
|
myMinimumWidth = 0;
|
|
|
|
|
mouseDown = false;
|
|
|
|
|
beginMouseDown = 0;
|
|
|
|
|
endMouseDown = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KDTimeHeaderWidget::~KDTimeHeaderWidget()
|
|
|
|
|
{
|
|
|
|
|
delete myToolTip;
|
|
|
|
|
}
|
|
|
|
|
void KDTimeHeaderWidget::preparePopupMenu()
|
|
|
|
|
{
|
|
|
|
|
myPopupMenu->setItemVisible ( 1, flagShowZoom );
|
|
|
|
|
myPopupMenu->setItemVisible ( 2, flagShowScale );
|
|
|
|
|
myPopupMenu->setItemVisible ( 3, flagShowTime );
|
|
|
|
|
myPopupMenu->setItemVisible ( 4, flagShowYear );
|
|
|
|
|
myPopupMenu->setItemVisible ( 5, flagShowGrid);
|
|
|
|
|
myPopupMenu->setItemVisible ( 30, flagShowPrint );
|
|
|
|
|
if (flagZoomToFit)
|
|
|
|
|
myPopupMenu->changeItem( 1, i18n("Zoom (Fit)"));
|
|
|
|
|
else
|
|
|
|
|
myPopupMenu->changeItem( 1, i18n("Zoom (%1)").arg( TQString::number( zoomFactor(), 'f',3) ) );
|
|
|
|
|
int i = 0;
|
|
|
|
|
int id;
|
|
|
|
|
while ( ( id = scalePopupMenu->idAt( i++ )) >= 0 ) {
|
|
|
|
|
scalePopupMenu->setItemChecked ( id, false );
|
|
|
|
|
}
|
|
|
|
|
scalePopupMenu->setItemChecked ( scalePopupMenu->idAt ( (int)( scale()) ), true );
|
|
|
|
|
i = 0;
|
|
|
|
|
while ( ( id = timePopupMenu->idAt( i++ )) >= 0 ) {
|
|
|
|
|
timePopupMenu->setItemChecked ( id, false );
|
|
|
|
|
}
|
|
|
|
|
timePopupMenu->setItemChecked ( timePopupMenu->idAt ( (int)( hourFormat()) ), true );
|
|
|
|
|
i = 0;
|
|
|
|
|
while ( ( id = yearPopupMenu->idAt( i++ )) >= 0 ) {
|
|
|
|
|
yearPopupMenu->setItemChecked ( id, false );
|
|
|
|
|
}
|
|
|
|
|
yearPopupMenu->setItemChecked ( yearPopupMenu->idAt ( (int)( yearFormat()) ), true );
|
|
|
|
|
i = 0;
|
|
|
|
|
while ( ( id = gridPopupMenu->idAt( i++ )) >= 0 ) {
|
|
|
|
|
gridPopupMenu->setItemChecked ( id, false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gridPopupMenu->setItemChecked ( gridPopupMenu->idAt ( 0 ), showMinorTicks() );
|
|
|
|
|
gridPopupMenu->setItemChecked ( gridPopupMenu->idAt ( 1 ), showMajorTicks() );
|
|
|
|
|
gridPopupMenu->setItemChecked ( gridPopupMenu->idAt ( 2 ),
|
|
|
|
|
!(showMajorTicks() || showMinorTicks()) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString KDTimeHeaderWidget::getToolTipText(TQPoint p)
|
|
|
|
|
{
|
|
|
|
|
return TDEGlobal::locale()->formatDateTime(getDateTimeForIndex(p.x()));
|
|
|
|
|
}
|
|
|
|
|
void KDTimeHeaderWidget::addTickRight( int num )
|
|
|
|
|
{
|
|
|
|
|
int secs = ((num*getTickTime())-30);
|
|
|
|
|
setHorizonEnd(getDateTimeForIndex(width()).addSecs(secs));
|
|
|
|
|
//tqApp->processEvents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KDTimeHeaderWidget::addTickLeft( int num )
|
|
|
|
|
{
|
|
|
|
|
int secs = ((num*getTickTime())-30);
|
|
|
|
|
setHorizonStart(getDateTimeForIndex(0).addSecs(-secs));
|
|
|
|
|
//tqApp->processEvents();
|
|
|
|
|