mapeditor.cpp
changeset 160 72cc3873306a
parent 159 e44baadd4958
child 163 30b22f7bd009
     1.1 --- a/mapeditor.cpp	Thu Sep 01 15:35:18 2005 +0000
     1.2 +++ b/mapeditor.cpp	Mon Sep 05 11:56:31 2005 +0000
     1.3 @@ -115,6 +115,7 @@
     1.4  extern QAction *actionFormatFrameRectangle;
     1.5  
     1.6  extern QActionGroup *actionGroupFormatLinkStyles;
     1.7 +extern QAction *actionFormatHideLinkUnselected;
     1.8  extern QAction *actionFormatLinkStyleLine;
     1.9  extern QAction *actionFormatLinkStyleParabel;
    1.10  extern QAction *actionFormatLinkStylePolyLine;
    1.11 @@ -154,6 +155,7 @@
    1.12  
    1.13      setCanvas (mapCanvas);
    1.14  	
    1.15 +	// Always show scroll bars (automatic would flicker sometimes)
    1.16  	setVScrollBarMode ( QScrollView::AlwaysOn );
    1.17  	setHScrollBarMode ( QScrollView::AlwaysOn );
    1.18  
    1.19 @@ -2602,6 +2604,8 @@
    1.20  				default:
    1.21  					break;
    1.22  			}	
    1.23 +			actionFormatHideLinkUnselected->setOn
    1.24 +				( selection->getHideLinkUnselected());
    1.25  		}
    1.26  		if ( (typeid(*selection) == typeid(FloatImageObj)) )
    1.27  		{
    1.28 @@ -2619,6 +2623,8 @@
    1.29  			actionEditDelete->setEnabled (true);
    1.30  			actionEditToggleFloatExport->setOn
    1.31  				( ((FloatImageObj*)(selection))->getFloatExport() );
    1.32 +			actionFormatHideLinkUnselected->setOn
    1.33 +				( selection->getHideLinkUnselected());
    1.34  		}
    1.35  
    1.36  	} else
    1.37 @@ -2640,6 +2646,16 @@
    1.38  	}	
    1.39  }
    1.40  
    1.41 +void MapEditor::updateNoteFlag()
    1.42 +{
    1.43 +	if (selection)
    1.44 +	{
    1.45 +		if ( (typeid(*selection) == typeid(BranchObj)) || 
    1.46 +			(typeid(*selection) == typeid(MapCenterObj))  )
    1.47 +			((BranchObj*)selection)->updateNoteFlag();
    1.48 +	}
    1.49 +}
    1.50 +
    1.51  void MapEditor::setLinkStyle (LinkStyle ls)
    1.52  {
    1.53  	linkstyle=ls;
    1.54 @@ -2878,6 +2894,15 @@
    1.55  	}
    1.56  }
    1.57  
    1.58 +void MapEditor::setHideLinkUnselected (bool b)
    1.59 +{
    1.60 +	if (selection && 
    1.61 +		(typeid(*selection) == typeid(BranchObj)) || 
    1.62 +		(typeid(*selection) == typeid(MapCenterObj))  ||
    1.63 +		(typeid(*selection) == typeid(FloatImageObj)) )
    1.64 +		selection->setHideLinkUnselected(b);
    1.65 +}
    1.66 +
    1.67  void MapEditor::importDir(BranchObj *dst, QDir d)
    1.68  {
    1.69  	if (selection && 
    1.70 @@ -3211,7 +3236,7 @@
    1.71      // Move the selected MapObj
    1.72      if ( selection && movingObj) 
    1.73      {	
    1.74 -		ensureVisible (p.x(),p.y());
    1.75 +		ensureSelectionVisible ();
    1.76  		
    1.77  		// Now move the selection, but add relative position 
    1.78  		// (movingObj_start) where selection was chosen with