@ -179,7 +179,7 @@ int KDTimeTableWidget::computeHeight()
if ( hei = = 0 ) {
if ( hei = = 0 ) {
hei = 1 ;
hei = 1 ;
}
}
// qDebug("COMPUTED HEI %d ", hei);
// t qDebug("COMPUTED HEI %d ", hei);
emit heightComputed ( hei ) ;
emit heightComputed ( hei ) ;
return hei ;
return hei ;
}
}
@ -188,7 +188,7 @@ void KDTimeTableWidget::computeVerticalGrid()
// recompute the vertical grid
// recompute the vertical grid
// compute the vertical grid
// compute the vertical grid
// if we have too much lines, hide them
// if we have too much lines, hide them
// qDebug("computeVerticalGrid() ");
// t qDebug("computeVerticalGrid() ");
int cw = myGanttView - > myTimeHeader - > myGridMinorWidth ;
int cw = myGanttView - > myTimeHeader - > myGridMinorWidth ;
int i = 0 ;
int i = 0 ;
int h ;
int h ;
@ -434,7 +434,7 @@ void KDTimeTableWidget::computeVerticalGrid()
void KDTimeTableWidget : : computeHorizontalGrid ( )
void KDTimeTableWidget : : computeHorizontalGrid ( )
{
{
// compute horizontal grid
// compute horizontal grid
// qDebug("computeHorizontalGrid() ");
// t qDebug("computeHorizontalGrid() ");
KDGanttViewItem * temp = myGanttView - > firstChild ( ) ;
KDGanttViewItem * temp = myGanttView - > firstChild ( ) ;
int wid ;
int wid ;
if ( pendingWidth )
if ( pendingWidth )
@ -474,7 +474,7 @@ void KDTimeTableWidget::computeHorizontalGrid()
//TQString ts = "asGroup";
//TQString ts = "asGroup";
//if (!temp->displaySubitemsAsGroup() )
//if (!temp->displaySubitemsAsGroup() )
// ts = " NOT asGroup";
// ts = " NOT asGroup";
// qDebug("temp name %s %s", temp->listViewText(0).latin1(), ts.latin1());
// t qDebug("temp name %s %s", temp->listViewText(0).latin1(), ts.latin1());
temp = temp - > itemBelow ( ) ;
temp = temp - > itemBelow ( ) ;
}
}
@ -586,10 +586,10 @@ void KDTimeTableWidget::computeTaskLinks()
void KDTimeTableWidget : : updateMyContent ( )
void KDTimeTableWidget : : updateMyContent ( )
{
{
if ( flag_blockUpdating | | int_blockUpdating ) {
if ( flag_blockUpdating | | int_blockUpdating ) {
// qDebug("KDTimeTableWidget::updateMyContent() blocked! ");
// t qDebug("KDTimeTableWidget::updateMyContent() blocked! ");
return ;
return ;
}
}
// qDebug("KDTimeTableWidget::updateMyContent() ********************************* ");
// t qDebug("KDTimeTableWidget::updateMyContent() ********************************* ");
/*
/*
// debug output
// debug output
KDGanttViewItem * temp = myGanttView - > firstChild ( ) ;
KDGanttViewItem * temp = myGanttView - > firstChild ( ) ;
@ -638,7 +638,7 @@ void KDTimeTableWidget::updateMyContent()
}
}
pendingWidth = 0 ;
pendingWidth = 0 ;
pendingHeight = 0 ;
pendingHeight = 0 ;
// qDebug("KDTimeTableWidget::updateMyContent() -------------------------");
// t qDebug("KDTimeTableWidget::updateMyContent() -------------------------");
}
}
// used for blocking recursive methods
// used for blocking recursive methods
// e.g. KDGanttViewItem::setHighlight() and displaySubitemsAsGroup() == true
// e.g. KDGanttViewItem::setHighlight() and displaySubitemsAsGroup() == true
@ -1111,12 +1111,12 @@ void KDTimeHeaderWidget::zoomToSelection( TQDateTime start, TQDateTime end)
if ( start < myHorizonStart ) {
if ( start < myHorizonStart ) {
myHorizonStart = start ;
myHorizonStart = start ;
flagStartTimeSet = true ;
flagStartTimeSet = true ;
// qDebug("myHorizonStart reset");
// t qDebug("myHorizonStart reset");
}
}
if ( end > myHorizonEnd ) {
if ( end > myHorizonEnd ) {
myHorizonEnd = end ;
myHorizonEnd = end ;
flagEndTimeSet = true ;
flagEndTimeSet = true ;
// qDebug("myHorizonEnd reset ");
// t qDebug("myHorizonEnd reset ");
}
}
flagDoNotRepaintAfterChange = true ; //avoid flicker
flagDoNotRepaintAfterChange = true ; //avoid flicker
zoom ( 1.0 ) ; // set to 100%
zoom ( 1.0 ) ; // set to 100%
@ -1134,7 +1134,7 @@ void KDTimeHeaderWidget::zoomToSelection( TQDateTime start, TQDateTime end)
zoom ( fac ) ;
zoom ( fac ) ;
timeWid = getCoordX ( end ) - getCoordX ( start ) ;
timeWid = getCoordX ( end ) - getCoordX ( start ) ;
if ( count + + > 10 ) {
if ( count + + > 10 ) {
// qDebug("Exiting while loop in zoomToSelection ");
// t qDebug("Exiting while loop in zoomToSelection ");
break ;
break ;
}
}
}
}
@ -1156,7 +1156,7 @@ void KDTimeHeaderWidget::zoom(double factor, bool absolute)
{
{
flagZoomToFit = false ;
flagZoomToFit = false ;
if ( factor < 0.000001 ) {
if ( factor < 0.000001 ) {
qDebug( " KDGanttView::zoom() : Zoom factor to low. Nothing zoomed. " ) ;
t qDebug( " KDGanttView::zoom() : Zoom factor to low. Nothing zoomed. " ) ;
return ;
return ;
}
}
double newZoom ;
double newZoom ;
@ -1167,12 +1167,12 @@ void KDTimeHeaderWidget::zoom(double factor, bool absolute)
double relativeZoom ;
double relativeZoom ;
relativeZoom = newZoom / myZoomFactor ;
relativeZoom = newZoom / myZoomFactor ;
// qDebug("zooming relative %f ", relativeZoom);
// t qDebug("zooming relative %f ", relativeZoom);
// qDebug("zooming absolute %f ", newZoom);
// t qDebug("zooming absolute %f ", newZoom);
int viewWid = myGanttView - > myCanvasView - > viewport ( ) - > width ( ) ;
int viewWid = myGanttView - > myCanvasView - > viewport ( ) - > width ( ) ;
if ( width ( ) * relativeZoom < viewWid & & ( newZoom > 1.01 | | newZoom < 0.99 ) ) {
if ( width ( ) * relativeZoom < viewWid & & ( newZoom > 1.01 | | newZoom < 0.99 ) ) {
qDebug( " KDGanttView::zoom() : Zoom factor to low for current horizon. " ) ;
t qDebug( " KDGanttView::zoom() : Zoom factor to low for current horizon. " ) ;
// qDebug("zooming relative %f, zooming absolute %f, viewWidth %d width %d ", relativeZoom, newZoom, viewWid, width() );
// t qDebug("zooming relative %f, zooming absolute %f, viewWidth %d width %d ", relativeZoom, newZoom, viewWid, width() );
return ;
return ;
}
}
myZoomFactor = newZoom ;
myZoomFactor = newZoom ;
@ -1819,14 +1819,14 @@ int KDTimeHeaderWidget::minorScaleCount() const
void KDTimeHeaderWidget : : resizeEvent ( TQResizeEvent * )
void KDTimeHeaderWidget : : resizeEvent ( TQResizeEvent * )
{
{
// qDebug("KDTimeHeaderWidget:: resizeEvent ");
// t qDebug("KDTimeHeaderWidget:: resizeEvent ");
paintPix . resize ( 800 , height ( ) ) ;
paintPix . resize ( 800 , height ( ) ) ;
}
}
void KDTimeHeaderWidget : : updateTimeTable ( )
void KDTimeHeaderWidget : : updateTimeTable ( )
{
{
// qDebug("KDTimeHeaderWidget::updateTimeTable() ");
// t qDebug("KDTimeHeaderWidget::updateTimeTable() ");
if ( flagDoNotRecomputeAfterChange ) return ;
if ( flagDoNotRecomputeAfterChange ) return ;
// setting the scrolling steps
// setting the scrolling steps
int scrollLineStep = myGridMinorWidth ;
int scrollLineStep = myGridMinorWidth ;
@ -1969,7 +1969,7 @@ TQDateTime KDTimeHeaderWidget::getEvenTimeDate(TQDateTime tempdatetime ,Scale sc
min = tempdatetime . time ( ) . minute ( ) ;
min = tempdatetime . time ( ) . minute ( ) ;
while ( 60 % tempMinorScaleCount > 0 & & 60 % tempMinorScaleCount < 60 )
while ( 60 % tempMinorScaleCount > 0 & & 60 % tempMinorScaleCount < 60 )
+ + tempMinorScaleCount ;
+ + tempMinorScaleCount ;
// qDebug("myMinorScaleCount %d %d %d",myMinorScaleCount, myRealMinorScaleCount, tempMinorScaleCount);
// t qDebug("myMinorScaleCount %d %d %d",myMinorScaleCount, myRealMinorScaleCount, tempMinorScaleCount);
min = ( min / tempMinorScaleCount ) * tempMinorScaleCount ;
min = ( min / tempMinorScaleCount ) * tempMinorScaleCount ;
tempdatetime = TQDateTime ( tempdatetime . date ( ) , TQTime ( tempdatetime . time ( ) . hour ( ) , min ) ) ;
tempdatetime = TQDateTime ( tempdatetime . date ( ) , TQTime ( tempdatetime . time ( ) . hour ( ) , min ) ) ;
@ -1985,7 +1985,7 @@ void KDTimeHeaderWidget::computeRealScale(TQDateTime start)
{
{
if ( myScale = = KDGanttView : : Auto ) {
if ( myScale = = KDGanttView : : Auto ) {
// qDebug("Autoscale ");
// t qDebug("Autoscale ");
//double secsPerMinor = (((double)start.daysTo(myHorizonEnd))* 86400.00)/((double)myAutoScaleMinorTickcount);
//double secsPerMinor = (((double)start.daysTo(myHorizonEnd))* 86400.00)/((double)myAutoScaleMinorTickcount);
double secsPerMinor = ( ( ( double ) start . secsTo ( myHorizonEnd ) ) ) / ( ( double ) myAutoScaleMinorTickcount ) ;
double secsPerMinor = ( ( ( double ) start . secsTo ( myHorizonEnd ) ) ) / ( ( double ) myAutoScaleMinorTickcount ) ;
secsPerMinor / = myZoomFactor ;
secsPerMinor / = myZoomFactor ;
@ -2017,7 +2017,7 @@ void KDTimeHeaderWidget::computeRealScale(TQDateTime start)
myRealMajorScaleCount = 1 ;
myRealMajorScaleCount = 1 ;
}
}
else {
else {
// qDebug("Fixed scale ");
// t qDebug("Fixed scale ");
myRealScale = myScale ;
myRealScale = myScale ;
if ( myRealScale > myMaxScale )
if ( myRealScale > myMaxScale )
myRealScale = myMaxScale ;
myRealScale = myMaxScale ;
@ -2067,7 +2067,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
if ( flagDoNotRecomputeAfterChange ) return ;
if ( flagDoNotRecomputeAfterChange ) return ;
bool block = myGanttView - > myTimeTable - > blockUpdating ( ) ;
bool block = myGanttView - > myTimeTable - > blockUpdating ( ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( true ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( true ) ;
// qDebug("computeticks ");
// t qDebug("computeticks ");
majorTicks . clear ( ) ;
majorTicks . clear ( ) ;
minorText . clear ( ) ;
minorText . clear ( ) ;
majorText . clear ( ) ;
majorText . clear ( ) ;
@ -2082,7 +2082,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
tempMajorScaleCount = myRealMajorScaleCount ;
tempMajorScaleCount = myRealMajorScaleCount ;
int minorItems , minorPerMajor = 1 ;
int minorItems , minorPerMajor = 1 ;
minorItems = ( int ) ( secsFromTo ( myRealStart , myHorizonEnd ) / 60.0 ) ;
minorItems = ( int ) ( secsFromTo ( myRealStart , myHorizonEnd ) / 60.0 ) ;
// qDebug("tempMinorScaleCount %d ", tempMinorScaleCount);
// t qDebug("tempMinorScaleCount %d ", tempMinorScaleCount);
TQPainter p ( this ) ;
TQPainter p ( this ) ;
int Width , Height ;
int Width , Height ;
TQString testTextMinor , testTextMajor , tempStr ;
TQString testTextMinor , testTextMajor , tempStr ;
@ -2131,14 +2131,14 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
minorPerMajor = 1200 ;
minorPerMajor = 1200 ;
break ;
break ;
case KDGanttView : : Auto :
case KDGanttView : : Auto :
qDebug( " KDGanttView::Internal Error in KDTimeHeaderWidget::computeTicks() " ) ;
t qDebug( " KDGanttView::Internal Error in KDTimeHeaderWidget::computeTicks() " ) ;
qDebug( " RealScale == Auto : This may not be! " ) ;
t qDebug( " RealScale == Auto : This may not be! " ) ;
break ;
break ;
}
}
itemRectMinor = p . boundingRect ( 10 , 10 , 2 , 2 , TQt : : AlignLeft , testTextMinor ) ;
itemRectMinor = p . boundingRect ( 10 , 10 , 2 , 2 , TQt : : AlignLeft , testTextMinor ) ;
itemRectMajor = p . boundingRect ( 10 , 10 , 2 , 2 , TQt : : AlignLeft , testTextMajor ) ;
itemRectMajor = p . boundingRect ( 10 , 10 , 2 , 2 , TQt : : AlignLeft , testTextMajor ) ;
p . end ( ) ;
p . end ( ) ;
// qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
// t qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
Height = itemRectMinor . height ( ) + itemRectMajor . height ( ) + 11 ;
Height = itemRectMinor . height ( ) + itemRectMajor . height ( ) + 11 ;
Width = ( itemRectMinor . width ( ) + 5 ) ;
Width = ( itemRectMinor . width ( ) + 5 ) ;
if ( Width < minimumColumnWidth ( ) ) Width = minimumColumnWidth ( ) ;
if ( Width < minimumColumnWidth ( ) ) Width = minimumColumnWidth ( ) ;
@ -2149,7 +2149,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
maxWid = maximumWidth ( ) ;
maxWid = maximumWidth ( ) ;
while ( ( minorItems / tempMinorScaleCount + 1 ) * Width > maxWid )
while ( ( minorItems / tempMinorScaleCount + 1 ) * Width > maxWid )
+ + tempMinorScaleCount ;
+ + tempMinorScaleCount ;
// qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
// t qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
mySizeHint = ( minorItems / tempMinorScaleCount + 1 ) * Width ;
mySizeHint = ( minorItems / tempMinorScaleCount + 1 ) * Width ;
switch ( myRealScale )
switch ( myRealScale )
{
{
@ -2162,7 +2162,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
myRealMinorScaleCount = tempMinorScaleCount / 60 ;
myRealMinorScaleCount = tempMinorScaleCount / 60 ;
// myRealMinorScaleCount = 1;
// myRealMinorScaleCount = 1;
myRealMajorScaleCount = 1 ;
myRealMajorScaleCount = 1 ;
qDebug( " KDGantt::Overzoom:Rescaling from Minute to Hour " ) ;
t qDebug( " KDGantt::Overzoom:Rescaling from Minute to Hour " ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
emit myGanttView - > rescaling ( KDGanttView : : Hour ) ;
emit myGanttView - > rescaling ( KDGanttView : : Hour ) ;
computeTicks ( true ) ;
computeTicks ( true ) ;
@ -2177,7 +2177,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
myRealMinorScaleCount = tempMinorScaleCount / 24 ;
myRealMinorScaleCount = tempMinorScaleCount / 24 ;
//myRealMinorScaleCount = 1;
//myRealMinorScaleCount = 1;
myRealMajorScaleCount = 1 ;
myRealMajorScaleCount = 1 ;
qDebug( " KDGantt::Overzoom:Rescaling from Hour to Day " ) ;
t qDebug( " KDGantt::Overzoom:Rescaling from Hour to Day " ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
emit myGanttView - > rescaling ( KDGanttView : : Day ) ;
emit myGanttView - > rescaling ( KDGanttView : : Day ) ;
computeTicks ( true ) ;
computeTicks ( true ) ;
@ -2339,7 +2339,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
return ;
return ;
}
}
// qDebug("KDTimeHeaderWidget width %d, viewport width %d ",width (), myGanttView->myCanvasView->viewport()->width());
// t qDebug("KDTimeHeaderWidget width %d, viewport width %d ",width (), myGanttView->myCanvasView->viewport()->width());
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
myGanttView - > myTimeTable - > setBlockUpdating ( block ) ;
updateTimeTable ( ) ;
updateTimeTable ( ) ;
centerDateTime ( myCenterDateTime ) ;
centerDateTime ( myCenterDateTime ) ;
@ -2364,7 +2364,7 @@ void KDTimeHeaderWidget::saveCenterDateTime()
void KDTimeHeaderWidget : : centerDateTime ( const TQDateTime & center )
void KDTimeHeaderWidget : : centerDateTime ( const TQDateTime & center )
{
{
moveTimeLineTo ( getCoordX ( center ) - ( myGanttView - > myCanvasView - > viewport ( ) - > width ( ) / 2 ) ) ;
moveTimeLineTo ( getCoordX ( center ) - ( myGanttView - > myCanvasView - > viewport ( ) - > width ( ) / 2 ) ) ;
// qDebug("centerDateTime %s %d %d", center.toString().latin1(),getCoordX( center ),(myGanttView->myCanvasView->viewport()->width() /2) );
// t qDebug("centerDateTime %s %d %d", center.toString().latin1(),getCoordX( center ),(myGanttView->myCanvasView->viewport()->width() /2) );
}
}
@ -2482,8 +2482,8 @@ void KDTimeHeaderWidget::mouseReleaseEvent ( TQMouseEvent * )
start = 0 ;
start = 0 ;
if ( end > width ( ) )
if ( end > width ( ) )
end = width ( ) ;
end = width ( ) ;
// qDebug("start %s ",getDateTimeForIndex(start).toString().latin1() );
// t qDebug("start %s ",getDateTimeForIndex(start).toString().latin1() );
// qDebug("end %s ",getDateTimeForIndex(end).toString().latin1() );
// t qDebug("end %s ",getDateTimeForIndex(end).toString().latin1() );
emit myGanttView - > timeIntervalSelected ( getDateTimeForIndex ( start ) , getDateTimeForIndex ( end ) ) ;
emit myGanttView - > timeIntervalSelected ( getDateTimeForIndex ( start ) , getDateTimeForIndex ( end ) ) ;
emit myGanttView - > timeIntervallSelected ( getDateTimeForIndex ( start ) , getDateTimeForIndex ( end ) ) ;
emit myGanttView - > timeIntervallSelected ( getDateTimeForIndex ( start ) , getDateTimeForIndex ( end ) ) ;
//zoomToSelection( getDateTimeForIndex(start),getDateTimeForIndex(end) );
//zoomToSelection( getDateTimeForIndex(start),getDateTimeForIndex(end) );
@ -2529,7 +2529,7 @@ void KDTimeHeaderWidget::mouseMoveEvent ( TQMouseEvent * e )
}
}
myGanttView - > myCanvasView - > horizontalScrollBar ( ) - > setValue ( val ) ;
myGanttView - > myCanvasView - > horizontalScrollBar ( ) - > setValue ( val ) ;
}
}
// qDebug("mousemove %d %d %d %d",endMouseDown, -x(),parentWidget()->width() , e->pos().y());
// t qDebug("mousemove %d %d %d %d",endMouseDown, -x(),parentWidget()->width() , e->pos().y());
}
}
}
}
@ -2708,7 +2708,7 @@ KDListView::KDListView(TQWidget* parent, KDGanttView* gantView):TQListView (pare
void KDListView : : dragItem ( TQListViewItem * )
void KDListView : : dragItem ( TQListViewItem * )
{
{
// qDebug("drag ");
// t qDebug("drag ");
// startDrag();
// startDrag();
}
}
TQString KDListView : : getWhatsThisText ( TQPoint p )
TQString KDListView : : getWhatsThisText ( TQPoint p )
@ -2746,7 +2746,7 @@ void KDListView::setOpen(TQListViewItem * item, bool open )
}
}
else {
else {
temp - > setVisible ( false ) ;
temp - > setVisible ( false ) ;
// qDebug(" temp->setVisible( false );");
// t qDebug(" temp->setVisible( false );");
}
}
temp = temp - > nextSibling ( ) ;
temp = temp - > nextSibling ( ) ;
}
}
@ -3009,7 +3009,7 @@ void KDListView::dragMoveEvent ( TQDragMoveEvent * e)
void KDListView : : dragLeaveEvent ( TQDragLeaveEvent * )
void KDListView : : dragLeaveEvent ( TQDragLeaveEvent * )
{
{
// qDebug("contentsDragLeaveEvent ");
// t qDebug("contentsDragLeaveEvent ");
}
}
void KDListView : : dropEvent ( TQDropEvent * e )
void KDListView : : dropEvent ( TQDropEvent * e )
{
{
@ -3028,7 +3028,7 @@ void KDListView::dropEvent ( TQDropEvent *e )
KDGanttViewItem * newItem = 0 ;
KDGanttViewItem * newItem = 0 ;
if ( gItem = = myGanttView - > myCanvasView - > lastClickedItem & & gItem ! = 0 ) {
if ( gItem = = myGanttView - > myCanvasView - > lastClickedItem & & gItem ! = 0 ) {
qDebug( " KDGanttView::Possible bug in drag&drop code " ) ;
t qDebug( " KDGanttView::Possible bug in drag&drop code " ) ;
return ;
return ;
}
}
@ -3056,16 +3056,16 @@ void KDListView::dropEvent ( TQDropEvent *e )
newItem = KDGanttViewItem : : createFromDomElement ( myGanttView ,
newItem = KDGanttViewItem : : createFromDomElement ( myGanttView ,
element ) ;
element ) ;
} else {
} else {
qDebug( " Unrecognized tag name: %s " , tagName . latin1 ( ) ) ;
t qDebug( " Unrecognized tag name: %s " , tagName . latin1 ( ) ) ;
Q_ASSERT ( false ) ;
Q_ASSERT ( false ) ;
}
}
}
}
// qDebug("next node1 ");
// t qDebug("next node1 ");
node = node . nextSibling ( ) ;
node = node . nextSibling ( ) ;
}
}
}
}
}
}
// qDebug("next node2 ");
// t qDebug("next node2 ");
node = node . nextSibling ( ) ;
node = node . nextSibling ( ) ;
}
}
newItem - > setDisplaySubitemsAsGroup ( myGanttView - > displaySubitemsAsGroup ( ) ) ;
newItem - > setDisplaySubitemsAsGroup ( myGanttView - > displaySubitemsAsGroup ( ) ) ;
@ -3273,7 +3273,7 @@ void KDGanttCanvasView::myUpdateScrollBars()
}
}
void KDGanttCanvasView : : setMyContentsHeight ( int hei )
void KDGanttCanvasView : : setMyContentsHeight ( int hei )
{
{
// qDebug("setMyContentsHeight %d %d ", hei, myMyContentsHeight);
// t qDebug("setMyContentsHeight %d %d ", hei, myMyContentsHeight);
if ( hei > 0 )
if ( hei > 0 )
myMyContentsHeight = hei ;
myMyContentsHeight = hei ;
verticalScrollBar ( ) - > setUpdatesEnabled ( true ) ; // set false in resizeEvent()
verticalScrollBar ( ) - > setUpdatesEnabled ( true ) ; // set false in resizeEvent()
@ -3294,7 +3294,7 @@ void KDGanttCanvasView::setMyContentsHeight( int hei )
// Call after *internal* resizing (like addTickRight())
// Call after *internal* resizing (like addTickRight())
// Then the new scrollbar maxValue is in myTimeHeader.
// Then the new scrollbar maxValue is in myTimeHeader.
void KDGanttCanvasView : : updateHorScrollBar ( ) {
void KDGanttCanvasView : : updateHorScrollBar ( ) {
// qDebug("horizontalScrollBar max=%d, myTimeHeaderScroll=%d", horizontalScrollBar()->maxValue(), mySignalSender->myTimeHeaderScroll->horizontalScrollBar()->value());
// t qDebug("horizontalScrollBar max=%d, myTimeHeaderScroll=%d", horizontalScrollBar()->maxValue(), mySignalSender->myTimeHeaderScroll->horizontalScrollBar()->value());
horizontalScrollBar ( ) - > setRange ( mySignalSender - > myTimeHeaderScroll - > horizontalScrollBar ( ) - > minValue ( ) , mySignalSender - > myTimeHeaderScroll - > horizontalScrollBar ( ) - > maxValue ( ) ) ;
horizontalScrollBar ( ) - > setRange ( mySignalSender - > myTimeHeaderScroll - > horizontalScrollBar ( ) - > minValue ( ) , mySignalSender - > myTimeHeaderScroll - > horizontalScrollBar ( ) - > maxValue ( ) ) ;
@ -3332,7 +3332,7 @@ void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* parent , KDGanttViewI
void KDGanttCanvasView : : cutItem ( )
void KDGanttCanvasView : : cutItem ( )
{
{
lastClickedItem - > hideSubtree ( ) ;
lastClickedItem - > hideSubtree ( ) ;
// qDebug("last clicked %d parent %d ", lastClickedItem , lastClickedItem->parent());
// t qDebug("last clicked %d parent %d ", lastClickedItem , lastClickedItem->parent());
if ( lastClickedItem - > parent ( ) )
if ( lastClickedItem - > parent ( ) )
lastClickedItem - > parent ( ) - > takeItem ( lastClickedItem ) ;
lastClickedItem - > parent ( ) - > takeItem ( lastClickedItem ) ;
else
else
@ -3509,8 +3509,8 @@ KDGanttCanvasView::MovingOperation KDGanttCanvasView::gvItemHitTest( KDGanttView
void KDGanttCanvasView : : contentsMousePressEvent ( TQMouseEvent * e )
void KDGanttCanvasView : : contentsMousePressEvent ( TQMouseEvent * e )
{
{
// qDebug("mousepress! %d ", this);
// t qDebug("mousepress! %d ", this);
// qDebug("focus %d ",tqApp->focusWidget());
// t qDebug("focus %d ",tqApp->focusWidget());
setFocus ( ) ;
setFocus ( ) ;
currentLink = 0 ;
currentLink = 0 ;
currentItem = 0 ;
currentItem = 0 ;
@ -3637,9 +3637,9 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( TQMouseEvent * e )
mouseDown = false ;
mouseDown = false ;
static KDGanttViewItem * lastClicked = 0 ;
static KDGanttViewItem * lastClicked = 0 ;
mySignalSender - > gvMouseButtonClicked ( e - > button ( ) , currentItem , e - > globalPos ( ) ) ;
mySignalSender - > gvMouseButtonClicked ( e - > button ( ) , currentItem , e - > globalPos ( ) ) ;
// qDebug("datetime %s ",mySignalSender->getDateTimeForCoordX(e->globalPos().x(), true ).toString().latin1() );
// t qDebug("datetime %s ",mySignalSender->getDateTimeForCoordX(e->globalPos().x(), true ).toString().latin1() );
// qDebug("mousepos %d %d ",e->pos().x(),e->pos().y() );
// t qDebug("mousepos %d %d ",e->pos().x(),e->pos().y() );
// qDebug("mouseup ");
// t qDebug("mouseup ");
// if ( currentLink || currentItem )
// if ( currentLink || currentItem )
{
{
switch ( e - > button ( ) ) {
switch ( e - > button ( ) ) {
@ -3873,7 +3873,7 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( TQMouseEvent *e )
if ( autoScrollEnabled )
if ( autoScrollEnabled )
mousePos = e - > pos ( ) - TQPoint ( contentsX ( ) , contentsY ( ) ) ; // make mousePos relative 0
mousePos = e - > pos ( ) - TQPoint ( contentsX ( ) , contentsY ( ) ) ; // make mousePos relative 0
if ( fromItem ) {
if ( fromItem ) {
// qDebug("mousemove: linking %s: %d,%d ",fromItem->listViewText().latin1(), e->pos().x(), e->pos().y());
// t qDebug("mousemove: linking %s: %d,%d ",fromItem->listViewText().latin1(), e->pos().x(), e->pos().y());
linkLine - > setPoints ( linkLine - > startPoint ( ) . x ( ) , linkLine - > startPoint ( ) . y ( ) , e - > pos ( ) . x ( ) , e - > pos ( ) . y ( ) ) ;
linkLine - > setPoints ( linkLine - > startPoint ( ) . x ( ) , linkLine - > startPoint ( ) . y ( ) , e - > pos ( ) . x ( ) , e - > pos ( ) . y ( ) ) ;
canvas ( ) - > update ( ) ;
canvas ( ) - > update ( ) ;
}
}
@ -3946,7 +3946,7 @@ int KDGanttCanvasView::getItemArea(KDGanttViewItem *item, int x) {
// TODO: middle (move, dnd), front, back (resize)
// TODO: middle (move, dnd), front, back (resize)
KDTimeTableWidget * tt = dynamic_cast < KDTimeTableWidget * > ( canvas ( ) ) ;
KDTimeTableWidget * tt = dynamic_cast < KDTimeTableWidget * > ( canvas ( ) ) ;
if ( ! tt ) {
if ( ! tt ) {
qWarning( " Cannot cast canvas to KDTimeTableWidget " ) ;
t qWarning( " Cannot cast canvas to KDTimeTableWidget " ) ;
return 0 ;
return 0 ;
}
}
int area = 0 ;
int area = 0 ;