20#include "kptpertview.h"
23#include "kptpertcanvas.h"
25#include "kptproject.h"
26#include "kptrelation.h"
27#include "kptcontext.h"
31#include <tqsplitter.h>
34#include <tqlistview.h>
36#include <tqpopupmenu.h>
43PertView::PertView( View *view, TQWidget *parent, TQLayout *layout )
44 : TQWidget( parent,
"Pert view" ),
55void PertView::init(TQLayout *)
58 TQGridLayout *gl =
new TQGridLayout(
this, 1, 1, -1, -1,
"Pert TQGridLayout");
59 m_canvasview =
new PertCanvas(
this);
60 gl->addWidget(m_canvasview, 0, 0);
62 connect(m_canvasview, TQ_SIGNAL(rightButtonPressed(Node *,
const TQPoint &)),
this, TQ_SLOT(slotRMBPressed(Node *,
const TQPoint &)));
63 connect(m_canvasview, TQ_SIGNAL(updateView(
bool)), m_mainview, TQ_SLOT(slotUpdate(
bool)));
65 connect(m_canvasview, TQ_SIGNAL(addRelation(Node*, Node*)), TQ_SLOT(slotAddRelation(Node*, Node*)));
66 connect(m_canvasview, TQ_SIGNAL(modifyRelation(Relation*)), TQ_SLOT(slotModifyRelation(Relation*)));
72 m_canvasview->draw(m_mainview->getPart()->getProject());
76void PertView::slotRMBPressed(Node *node,
const TQPoint & point)
80 if (node && (node->type() == Node::Type_Task || node->type() == Node::Type_Milestone)) {
81 TQPopupMenu *menu = m_mainview->popupMenu(
"task_popup");
89 if (node && node->type() == Node::Type_Summarytask) {
90 TQPopupMenu *menu = m_mainview->popupMenu(
"node_popup");
101void PertView::slotAddRelation(Node* par, Node* child)
103 kdDebug()<<k_funcinfo<<endl;
104 emit addRelation(par, child);
107void PertView::slotModifyRelation(Relation *rel)
109 kdDebug()<<k_funcinfo<<endl;
110 emit modifyRelation(rel);
113void PertView::print(KPrinter &printer)
116 kdDebug()<<k_funcinfo<<endl;
120Node *PertView::currentNode()
122 return m_canvasview->selectedNode();
125bool PertView::setContext(Context::Pertview &context)
132void PertView::getContext(Context::Pertview &context)
const
140#include "kptpertview.moc"