36 #include "KDGanttViewEventItem.h"
37 #include "KDGanttViewSubwidgets.h"
38 #include "itemAttributeDialog.h"
56 const TQString& lvtext,
57 const TQString& name ) :
73 const TQString& lvtext,
74 const TQString& name ) :
93 const TQString& lvtext,
94 const TQString& name ) :
113 const TQString& lvtext,
114 const TQString& name ) :
141 if (! start.isValid() ) {
142 tqDebug(
"KDGanttViewEventItem::setStartTime():Invalid parameter-no time set");
169 if (!myLeadTime) myLeadTime =
new TQDateTime;
170 *myLeadTime = leadTimeStart;
197 void KDGanttViewEventItem::hideMe()
204 floatStartShape->hide();
205 floatEndShape->hide();
209 void KDGanttViewEventItem::showItem(
bool show,
int coordY)
212 invalidateHeight () ;
217 float prio = ((float) (
priority() - 100 )) / 100.0;
221 floatStartShape->setZ(prio + 0.004);
222 floatStartShape->hide();
223 floatEndShape->setZ(prio + 0.004);
224 floatEndShape->hide();
232 int startX, endX, allY;
239 endX =
myGanttView->myTimeHeader->getCoordX(*myLeadTime);
240 startLine->setPoints(startX,allY,endX,allY);
253 if (myFloatStartTime.isValid()) {
254 KDCanvasRectangle* floatStartTemp = (KDCanvasRectangle*) floatStartShape;
255 int floatStartX =
myGanttView->myTimeHeader->getCoordX(myFloatStartTime);
256 int hei =
startShape->boundingRect().height();
258 TQBrush b(
startShape->brush().color(), Dense4Pattern);
259 floatStartTemp->setBrush(b);
260 floatStartTemp->setPen(TQPen(gray));
261 if (floatStartX < startX) {
262 floatStartTemp->setSize(startX - floatStartX, hei/2);
263 floatStartTemp->move(floatStartX, allY-hei/4);
265 floatStartTemp->setSize(floatStartX - startX, hei/2);
266 floatStartTemp->move(startX, allY-hei/4);
268 floatStartShape->show();
270 if (myFloatEndTime.isValid()) {
271 KDCanvasRectangle* floatEndTemp = (KDCanvasRectangle*) floatEndShape;
272 int floatEndX =
myGanttView->myTimeHeader->getCoordX(myFloatEndTime);
273 int hei =
startShape->boundingRect().height();
275 TQBrush b(
startShape->brush().color(), Dense4Pattern);
276 floatEndTemp->setBrush(b);
277 floatEndTemp->setPen(TQPen(gray));
278 if (floatEndX > startX) {
279 floatEndTemp->setSize(floatEndX - startX, hei/2);
280 floatEndTemp->move(startX, allY-hei/4);
282 floatEndTemp->setSize(startX - floatEndX, hei/2);
283 floatEndTemp->move(floatEndX, allY-hei/4);
285 floatEndShape->show();
295 void KDGanttViewEventItem::initItem()
TQDateTime leadTime() const
KDGanttViewEventItem(KDGanttView *view, const TQString &lvtext=TQString(), const TQString &name=TQString())
virtual ~KDGanttViewEventItem()
void setLeadTime(const TQDateTime &leadTimeStart)
void setStartTime(const TQDateTime &start)
KDCanvasText * textCanvas
KDCanvasPolygonItem * startShape
void moveTextCanvas(int x, int y)
KDCanvasPolygonItem * startShapeBack
TQDateTime myChildStartTime()
KDGanttView * myGanttView
KDCanvasLine * startLineBack
bool displaySubitemsAsGroup() const
KDGanttViewItem * firstChild() const
bool isVisibleInGanttView
TQDateTime myChildEndTime()
TQDateTime startTime() const