diff -r b7447adddc9a -r 5522d1da7e37 branchpropwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/branchpropwindow.cpp Tue Jan 23 11:50:53 2007 +0000 @@ -0,0 +1,64 @@ +#include "branchpropwindow.h" + +#include "frameobj.h" + + +BranchPropertyWindow::BranchPropertyWindow (QWidget *parent):QDialog(parent) +{ + ui.setupUi (this); + + branch=NULL; + mapEditor=NULL; + + connect ( ui.frameTypeCombo, SIGNAL (currentIndexChanged( int)), this, SLOT (frameTypeChanged (int))); + connect ( ui.hideLinkIfUnselected, SIGNAL (stateChanged( int)), this, SLOT (linkHideUnselectedChanged (int))); +} + +void BranchPropertyWindow::setBranch (BranchObj *bo) +{ + if (!bo) return; + branch=bo; + + // Frame + switch (branch->getFrameType()) + { + case NoFrame: + ui.frameTypeCombo->setCurrentIndex (0); + break; + case Rectangle: + ui.frameTypeCombo->setCurrentIndex (1); + break; + case Ellipse: + ui.frameTypeCombo->setCurrentIndex (2); + break; + } + + // Link + if (branch->getHideLinkUnselected()) + ui.hideLinkIfUnselected->setCheckState (Qt::Checked); + else + ui.hideLinkIfUnselected->setCheckState (Qt::Unchecked); +} + +void BranchPropertyWindow::setMapEditor (MapEditor *me) +{ + if (me) mapEditor=me; +} + +void BranchPropertyWindow::frameTypeChanged (int i) +{ + if (mapEditor) + switch (i) + { + case 0: mapEditor->setFrame (NoFrame); break; + case 1: mapEditor->setFrame (Rectangle); break; + case 2: mapEditor->setFrame (Ellipse); break; + } +} + +void BranchPropertyWindow::linkHideUnselectedChanged (int i) +{ + if (!branch) return; + branch->setHideLinkUnselected(i); +} +