20#ifndef KPTPERTCANVAS_H
21#define KPTPERTCANVAS_H
24#include "kptproject.h"
27#include <tqmemarray.h>
40class PertCanvas : public TQCanvasView
46 PertCanvas( TQWidget *parent );
47 virtual ~PertCanvas();
49 void draw(Project& project);
53 PertNodeItem *selectedItem();
55 int verticalGap() { return m_verticalGap; }
56 int horizontalGap() { return m_horizontalGap; }
57 TQSize itemSize() { return m_itemSize; }
59 void setColumn( int row, int col) { m_rows.at(row)[col] = true; }
61 void mapNode(PertNodeItem *item);
62 void mapChildNode(PertNodeItem *parentItem, PertNodeItem *childItem, Relation::Type type);
69 void createChildItems(PertNodeItem *node);
70 PertNodeItem *createNodeItem(Node *node);
72 void contentsMousePressEvent ( TQMouseEvent * e );
73 void contentsMouseReleaseEvent ( TQMouseEvent * e );
76 void rightButtonPressed(Node *node, const TQPoint & point);
77 void updateView( bool calculate);
78 void addRelation(Node *par, Node *child);
79 void modifyRelation(Relation *rel);
85 TQTimer *m_scrollTimer;
93 TQPtrDict<PertNodeItem> m_nodes;
94 TQPtrList<Relation> m_relations;
96 TQPtrList<TQMemArray<bool> > m_rows;
99 void printDebug( int );
|