diff -r 000000000000 -r fb74fa7bfb4c branchpropwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/branchpropwindow.cpp Mon Feb 12 09:28:47 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); +} +