branchpropwindow.cpp
changeset 421 5522d1da7e37
child 440 c6a8651e6bbc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/branchpropwindow.cpp	Tue Jan 23 11:50:53 2007 +0000
     1.3 @@ -0,0 +1,64 @@
     1.4 +#include "branchpropwindow.h"
     1.5 +
     1.6 +#include "frameobj.h"
     1.7 +
     1.8 +
     1.9 +BranchPropertyWindow::BranchPropertyWindow (QWidget *parent):QDialog(parent)
    1.10 +{
    1.11 +	ui.setupUi (this);
    1.12 +
    1.13 +	branch=NULL;
    1.14 +	mapEditor=NULL;
    1.15 +
    1.16 +	connect ( ui.frameTypeCombo, SIGNAL (currentIndexChanged( int)), this, SLOT (frameTypeChanged (int)));
    1.17 +	connect ( ui.hideLinkIfUnselected, SIGNAL (stateChanged( int)), this, SLOT (linkHideUnselectedChanged (int)));
    1.18 +}
    1.19 +
    1.20 +void BranchPropertyWindow::setBranch (BranchObj *bo)
    1.21 +{
    1.22 +	if (!bo) return;
    1.23 +	branch=bo;
    1.24 +
    1.25 +	// Frame
    1.26 +	switch (branch->getFrameType())
    1.27 +	{
    1.28 +		case NoFrame: 
    1.29 +			ui.frameTypeCombo->setCurrentIndex (0);
    1.30 +			break;
    1.31 +		case Rectangle: 
    1.32 +			ui.frameTypeCombo->setCurrentIndex (1);
    1.33 +			break;
    1.34 +		case Ellipse: 
    1.35 +			ui.frameTypeCombo->setCurrentIndex (2);
    1.36 +			break;
    1.37 +	}
    1.38 +	
    1.39 +	// Link
    1.40 +	if (branch->getHideLinkUnselected())
    1.41 +		ui.hideLinkIfUnselected->setCheckState (Qt::Checked);
    1.42 +	else	
    1.43 +		ui.hideLinkIfUnselected->setCheckState (Qt::Unchecked);
    1.44 +}
    1.45 +
    1.46 +void BranchPropertyWindow::setMapEditor (MapEditor *me)
    1.47 +{
    1.48 +	if (me) mapEditor=me;
    1.49 +}
    1.50 +
    1.51 +void BranchPropertyWindow::frameTypeChanged (int i)
    1.52 +{
    1.53 +	if (mapEditor)
    1.54 +		switch (i)
    1.55 +		{
    1.56 +			case 0: mapEditor->setFrame (NoFrame); break;
    1.57 +			case 1: mapEditor->setFrame (Rectangle); break;
    1.58 +			case 2: mapEditor->setFrame (Ellipse); break;
    1.59 +		}
    1.60 +}
    1.61 +
    1.62 +void BranchPropertyWindow::linkHideUnselectedChanged (int i)
    1.63 +{
    1.64 +	if (!branch) return;
    1.65 +	branch->setHideLinkUnselected(i);
    1.66 +}
    1.67 +