1.8.70 Fixes in property window
authorinsilmaril
Sat, 31 Mar 2007 09:28:27 +0000
changeset 442dfbc371b7280
parent 441 658ad3bc0c8a
child 443 0a4b622d5dc3
1.8.70 Fixes in property window
floatobj.cpp
frameobj.cpp
frameobj.h
historywindow.cpp
historywindow.h
linkablemapobj.cpp
linkablemapobj.h
mainwindow.cpp
mainwindow.h
mapeditor.cpp
mapeditor.h
ornamentedobj.cpp
ornamentedobj.h
texteditor.cpp
texteditor.h
version.h
     1.1 --- a/floatobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     1.2 +++ b/floatobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     1.3 @@ -73,14 +73,11 @@
     1.4  void FloatObj::move (double x, double y)
     1.5  {
     1.6  	MapObj::move(x,y);
     1.7 -	//selbox->setPos(x,y);
     1.8 -	selbox->rect().moveTo (QPointF (x,y));
     1.9  }
    1.10  
    1.11  void FloatObj::move (QPointF p)
    1.12  {
    1.13  	MapObj::move (p);
    1.14 -	selbox->rect().moveTo (p);
    1.15  }
    1.16  
    1.17  void FloatObj::setDockPos()
     2.1 --- a/frameobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     2.2 +++ b/frameobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     2.3 @@ -26,6 +26,8 @@
     2.4  {
     2.5      type=NoFrame;
     2.6      border=0;
     2.7 +	penColor=QColor (Qt::black);
     2.8 +	brushColor=QColor (Qt::white);
     2.9  }
    2.10  
    2.11  void FrameObj::clear()
    2.12 @@ -129,17 +131,19 @@
    2.13  				break;
    2.14  			case Rectangle:
    2.15  				border=10;
    2.16 -				rectFrame = scene->addRect(QRectF(0,0,0,0), QPen(QColor("black") ), QColor("white"));
    2.17 +				rectFrame = scene->addRect(QRectF(0,0,0,0), QPen(penColor), brushColor);
    2.18  				rectFrame->setZValue(Z_FRAME);
    2.19 +				rectFrame->show();
    2.20  				break;
    2.21  			case Ellipse:
    2.22  				border=10;
    2.23 -				ellipseFrame = scene->addEllipse(QRectF(0,0,0,0), QPen(QColor("black") ), QColor("white"));
    2.24 +				ellipseFrame = scene->addEllipse(QRectF(0,0,0,0), QPen(penColor), brushColor);
    2.25  				ellipseFrame->setZValue(Z_FRAME);
    2.26 +				ellipseFrame->show();
    2.27  				break;
    2.28  		}
    2.29 -		setVisibility (visible);
    2.30  	}
    2.31 +	setVisibility (visible);
    2.32  }
    2.33  
    2.34  void FrameObj::setFrameType(const QString &t)
    2.35 @@ -152,6 +156,46 @@
    2.36  		FrameObj::setFrameType (NoFrame);
    2.37  }
    2.38  
    2.39 +void FrameObj::setPenColor (QColor col)
    2.40 +{
    2.41 +	penColor=col;
    2.42 +	repaint();
    2.43 +}
    2.44 +
    2.45 +QColor FrameObj::getPenColor ()
    2.46 +{
    2.47 +	return penColor;
    2.48 +}
    2.49 +
    2.50 +void FrameObj::setBrushColor (QColor col)
    2.51 +{
    2.52 +	brushColor=col;
    2.53 +	repaint();
    2.54 +}
    2.55 +
    2.56 +QColor FrameObj::getBrushColor ()
    2.57 +{
    2.58 +	return brushColor;
    2.59 +}
    2.60 +
    2.61 +void FrameObj::repaint()
    2.62 +{
    2.63 +	switch (type)
    2.64 +	{
    2.65 +		case Rectangle:
    2.66 +			rectFrame->setPen   (penColor);
    2.67 +			rectFrame->setBrush (brushColor);
    2.68 +			break;
    2.69 +		case Ellipse:
    2.70 +			ellipseFrame->setPen   (penColor);
    2.71 +			ellipseFrame->setBrush (brushColor);
    2.72 +			break;
    2.73 +		default:
    2.74 +			break;
    2.75 +	}
    2.76 +}
    2.77 +
    2.78 +
    2.79  void FrameObj::setVisibility (bool v)
    2.80  {
    2.81      MapObj::setVisibility(v);
    2.82 @@ -177,6 +221,8 @@
    2.83  QString FrameObj::saveToDir ()
    2.84  {
    2.85  	QString	frameTypeAttr=attribut ("frameType",getFrameTypeName());
    2.86 -	return singleElement ("frame",frameTypeAttr);
    2.87 +	QString	penColAttr=attribut ("penColor",penColor.name() );
    2.88 +	QString	brushColAttr=attribut ("brushColor",brushColor.name() );
    2.89 +	return singleElement ("frame",frameTypeAttr + penColAttr + brushColAttr);
    2.90  }
    2.91  
     3.1 --- a/frameobj.h	Sat Mar 31 09:28:27 2007 +0000
     3.2 +++ b/frameobj.h	Sat Mar 31 09:28:27 2007 +0000
     3.3 @@ -22,14 +22,21 @@
     3.4      QString getFrameTypeName ();
     3.5      void setFrameType (const FrameType &);
     3.6      void setFrameType (const QString &);
     3.7 +	void setPenColor (QColor);
     3.8 +	QColor getPenColor ();
     3.9 +	void setBrushColor (QColor);
    3.10 +	QColor getBrushColor ();
    3.11 +	void repaint();
    3.12      void setVisibility(bool);
    3.13  	QString saveToDir ();
    3.14  
    3.15 -protected:
    3.16 +private:
    3.17      FrameType type;
    3.18      QGraphicsRectItem * rectFrame;
    3.19      QGraphicsEllipseItem * ellipseFrame;
    3.20      int border;									// distance text - frame
    3.21 +	QColor penColor;
    3.22 +	QColor brushColor;
    3.23  };
    3.24  #endif
    3.25  
     4.1 --- a/historywindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     4.2 +++ b/historywindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     4.3 @@ -158,6 +158,15 @@
     4.4  	showwithmain=v;
     4.5  }
     4.6  
     4.7 +void HistoryWindow::closeEvent( QCloseEvent* ce )
     4.8 +{
     4.9 +    ce->accept();	// TextEditor can be reopened with show()
    4.10 +    showwithmain=false;
    4.11 +	emit (windowClosed() );
    4.12 +    return;
    4.13 +}
    4.14 +
    4.15 +
    4.16  bool HistoryWindow::showWithMain()
    4.17  {
    4.18  	return showwithmain;
     5.1 --- a/historywindow.h	Sat Mar 31 09:28:27 2007 +0000
     5.2 +++ b/historywindow.h	Sat Mar 31 09:28:27 2007 +0000
     5.3 @@ -18,11 +18,17 @@
     5.4  	void setShowWithMain (bool);
     5.5  	bool showWithMain ();
     5.6  
     5.7 +protected:
     5.8 +    void closeEvent( QCloseEvent* );
     5.9 +
    5.10  private slots:	
    5.11  	void undo();
    5.12  	void redo();
    5.13  	void select();
    5.14  
    5.15 +signals:
    5.16 +	void windowClosed();
    5.17 +
    5.18  private:
    5.19  	void clearRow (int);
    5.20  	void updateRow (int, int, SimpleSettings &);
     6.1 --- a/linkablemapobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     6.2 +++ b/linkablemapobj.cpp	Sat Mar 31 09:28:27 2007 +0000
     6.3 @@ -28,8 +28,6 @@
     6.4  LinkableMapObj::~LinkableMapObj()
     6.5  {
     6.6      delete (bottomline);
     6.7 -    delete (selbox);
     6.8 -	delete (frame);
     6.9  	delLink();
    6.10  }
    6.11  
    6.12 @@ -81,18 +79,12 @@
    6.13      bottomline->show();
    6.14  
    6.15      // Prepare showing the selection of a MapObj
    6.16 -    selbox = scene->addRect(QRectF(0,0,0,0), QPen(QColor(255,255,0) ), QColor(255,255,0));
    6.17 -    selbox->setZValue(Z_SELBOX);
    6.18 -    selbox->hide();
    6.19      selected=false;
    6.20  
    6.21  	hideLinkUnselected=false;
    6.22  
    6.23  	topPad=botPad=leftPad=rightPad=0;
    6.24  
    6.25 -	// initialize frame
    6.26 -	frame = new FrameObj (scene);
    6.27 -	
    6.28  	repositionRequest=false;
    6.29  
    6.30  	// Rel Positions
    6.31 @@ -347,27 +339,6 @@
    6.32  	return linkcolor;
    6.33  }
    6.34  
    6.35 -FrameType LinkableMapObj::getFrameType()
    6.36 -{
    6.37 -	return frame->getFrameType();
    6.38 -}
    6.39 -
    6.40 -void LinkableMapObj::setFrameType(const FrameType &t)
    6.41 -{
    6.42 -	frame->setFrameType(t);
    6.43 -	calcBBoxSize();
    6.44 -	positionBBox();
    6.45 -	requestReposition();
    6.46 -}
    6.47 -
    6.48 -void LinkableMapObj::setFrameType(const QString &t)
    6.49 -{
    6.50 -	frame->setFrameType(t);
    6.51 -	calcBBoxSize();
    6.52 -	positionBBox();
    6.53 -	requestReposition();
    6.54 -}
    6.55 -
    6.56  void LinkableMapObj::setVisibility (bool v)
    6.57  {
    6.58  	MapObj::setVisibility (v);
    6.59 @@ -465,16 +436,12 @@
    6.60  	// have parents yet...
    6.61  	if (style==StyleUndef) return;	
    6.62  
    6.63 -	if (frame->getFrameType() == NoFrame)
    6.64 -		linkpos=LinkBottom;
    6.65 -	else	
    6.66 -		linkpos=LinkMiddle;
    6.67  	switch (linkpos)
    6.68  	{
    6.69  		case LinkMiddle:
    6.70 -			bottomlineY=bbox.top()+bbox.height() /2;	// draw link to middle (of frame)
    6.71 +			bottomlineY=bbox.top() + bbox.height()/2;	// draw link to middle (of frame)
    6.72  			break;
    6.73 -		default :
    6.74 +		case LinkBottom:
    6.75  			bottomlineY=bbox.bottom()-1;	// draw link to bottom of box
    6.76  			break;
    6.77  	}
    6.78 @@ -687,17 +654,9 @@
    6.79  }
    6.80  
    6.81  
    6.82 -void LinkableMapObj::setSelBox()
    6.83 -{
    6.84 -	//selbox->prepareGeometryChange();
    6.85 -	selbox->setRect (clickBox);
    6.86 -}
    6.87 -
    6.88  void LinkableMapObj::select()
    6.89  {
    6.90 -	setSelBox();
    6.91      selected=true;
    6.92 -    selbox->show();
    6.93  	setVisibility (visible);
    6.94  }
    6.95  
    6.96 @@ -705,7 +664,6 @@
    6.97  void LinkableMapObj::unselect()
    6.98  {
    6.99      selected=false;
   6.100 -    selbox->hide();
   6.101  	// Maybe we have to hide the link:
   6.102  	setVisibility (visible);
   6.103  }
     7.1 --- a/linkablemapobj.h	Sat Mar 31 09:28:27 2007 +0000
     7.2 +++ b/linkablemapobj.h	Sat Mar 31 09:28:27 2007 +0000
     7.3 @@ -1,7 +1,6 @@
     7.4  #ifndef LINKABLEMAPOBJ_H
     7.5  #define LINKABLEMAPOBJ_H
     7.6  
     7.7 -#include "frameobj.h"
     7.8  #include "noteobj.h"
     7.9  #include "headingobj.h"
    7.10  #include "flagrowobj.h"
    7.11 @@ -57,9 +56,6 @@
    7.12  	virtual void setLinkColor();					// sets color according to colorhint, overloaded
    7.13  	virtual void setLinkColor(QColor);
    7.14  	QColor getLinkColor();
    7.15 -	virtual FrameType getFrameType ();
    7.16 -	virtual void setFrameType (const FrameType &);
    7.17 -	virtual void setFrameType (const QString &);
    7.18  	virtual void setVisibility (bool);
    7.19  	virtual void setOrientation();
    7.20      virtual void updateLink();				// update parPos and childPos
    7.21 @@ -88,7 +84,6 @@
    7.22  	//virtual QRectF getBBoxSizeWithChilds();// return size of BBox including childs  
    7.23  	virtual void calcBBoxSizeWithChilds()=0;// calc size of  BBox including childs recursivly
    7.24  
    7.25 -	virtual void setSelBox();
    7.26      virtual void select();
    7.27      virtual void unselect();
    7.28  	virtual	QString getSelectString()=0;
    7.29 @@ -101,7 +96,9 @@
    7.30      QPointF childPos;
    7.31      QPointF parPos;
    7.32  	bool link2ParPos;				// While moving around, sometimes link to parent
    7.33 -	MapEditor* mapEditor;			// for updateNoteFlag() and toggleScroll()
    7.34 +	MapEditor* mapEditor;			// for and toggleScroll(), get default styles
    7.35 +									// and mapEditor->updateActions()
    7.36 +									// and mapEditor->updateSelection()
    7.37      LinkOrient orientation;     
    7.38      qreal linkwidth;				// width of a link
    7.39      int depth;						// depth: undef=-1 mapCenter=0 branch=1..n
    7.40 @@ -129,8 +126,6 @@
    7.41  
    7.42  	bool selected;					// Used for marking the selection
    7.43  	bool hideLinkUnselected;		// to hide links if unselected
    7.44 -	QGraphicsRectItem* selbox;
    7.45 -	FrameObj *frame;				// frame around object
    7.46  	qreal topPad, botPad,
    7.47  		leftPad, rightPad;          // padding within bbox
    7.48  
     8.1 --- a/mainwindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     8.2 +++ b/mainwindow.cpp	Sat Mar 31 09:28:27 2007 +0000
     8.3 @@ -19,6 +19,7 @@
     8.4  #include "process.h"
     8.5  #include "settings.h"
     8.6  #include "texteditor.h"
     8.7 +#include "warningdialog.h"
     8.8  
     8.9  extern TextEditor *textEditor;
    8.10  extern Main *mainWindow;
    8.11 @@ -160,6 +161,8 @@
    8.12  
    8.13  	restoreState (settings.value("/mainwindow/state",0).toByteArray());
    8.14  
    8.15 +	// Satellite windows //////////////////////////////////////////
    8.16 +
    8.17  	// Initialize Find window
    8.18  	findWindow=new FindWindow(NULL);
    8.19  	findWindow->move (x(),y()+70);
    8.20 @@ -170,7 +173,10 @@
    8.21  
    8.22  	// Connect TextEditor, so that we can update flags if text changes
    8.23  	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
    8.24 -	connect (textEditor, SIGNAL (textEditorClosed() ), this, SLOT (updateActions()));
    8.25 +	connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
    8.26 +
    8.27 +	// Connect HistoryWindow, so that we can update flags
    8.28 +	connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions()));
    8.29  
    8.30  	updateGeometry();
    8.31  }
    8.32 @@ -198,7 +204,7 @@
    8.33  	//FIXME save scriptEditor settings
    8.34  
    8.35  	// call the destructors
    8.36 -	delete (textEditor);
    8.37 +	delete textEditor;
    8.38  	delete historyWindow;
    8.39  
    8.40  	// Remove temporary directory
    8.41 @@ -244,25 +250,24 @@
    8.42      QAction *a;
    8.43      a = new QAction(QPixmap( iconPath+"filenew.png"), tr( "&New...","File menu" ),this);
    8.44  	a->setStatusTip ( tr( "New map","Status tip File menu" ) );
    8.45 -	a->setShortcut ( Qt::CTRL + Qt::Key_N );
    8.46 +	a->setShortcut ( Qt::CTRL + Qt::Key_N );		//New map
    8.47      a->addTo( tb );
    8.48  	fileMenu->addAction (a);
    8.49      connect( a, SIGNAL( triggered() ), this, SLOT( fileNew() ) );
    8.50  	
    8.51      a = new QAction( QPixmap( iconPath+"fileopen.png"), tr( "&Open..." ,"File menu"),this);
    8.52  	a->setStatusTip (tr( "Open","Status tip File menu" ) );
    8.53 -	a->setShortcut ( Qt::CTRL + Qt::Key_O );
    8.54 +	a->setShortcut ( Qt::CTRL + Qt::Key_O );		//Open map
    8.55      a->addTo( tb );
    8.56  	fileMenu->addAction (a);
    8.57      connect( a, SIGNAL( triggered() ), this, SLOT( fileLoad() ) );
    8.58  	
    8.59  	fileLastMapsMenu = fileMenu->addMenu (tr("Open Recent","File menu"));
    8.60 -	fileLastMapsMenu->menuAction()->setShortcut ( Qt::CTRL + +Qt::SHIFT + Qt::Key_O );
    8.61  	fileMenu->addSeparator();
    8.62  	
    8.63      a = new QAction( QPixmap( iconPath+"filesave.png"), tr( "&Save...","File menu" ), this);
    8.64  	a->setStatusTip ( tr( "Save","Status tip file menu" ));
    8.65 -	a->setShortcut (Qt::CTRL + Qt::Key_S );
    8.66 +	a->setShortcut (Qt::CTRL + Qt::Key_S );			//Save map
    8.67      a->addTo( tb );
    8.68  	fileMenu->addAction (a);
    8.69      connect( a, SIGNAL( triggered() ), this, SLOT( fileSave() ) );
    8.70 @@ -313,7 +318,7 @@
    8.71  	fileExportMenu->addAction (a);
    8.72  
    8.73  	a = new QAction(  "Webpage (XHTML)...",this );
    8.74 -	a->setShortcut (Qt::ALT + Qt::Key_X);
    8.75 +	a->setShortcut (Qt::ALT + Qt::Key_X);			//Export XHTML
    8.76  	a->setStatusTip ( tr( "Export as %1","status tip file menu").arg(tr(" webpage (XHTML)","status tip file menu")));
    8.77      connect( a, SIGNAL( triggered() ), this, SLOT( fileExportXHTML() ) );
    8.78  	fileExportMenu->addAction (a);
    8.79 @@ -347,7 +352,7 @@
    8.80  
    8.81      a = new QAction(QPixmap( iconPath+"fileprint.png"), tr( "&Print")+QString("..."), this);
    8.82  	a->setStatusTip ( tr( "Print" ,"File menu") );
    8.83 -	a->setShortcut (Qt::CTRL + Qt::Key_P );
    8.84 +	a->setShortcut (Qt::CTRL + Qt::Key_P );			//Print map
    8.85      a->addTo( tb );
    8.86  	fileMenu->addAction (a);
    8.87      connect( a, SIGNAL( triggered() ), this, SLOT( filePrint() ) );
    8.88 @@ -355,13 +360,13 @@
    8.89  
    8.90      a = new QAction( QPixmap(iconPath+"fileclose.png"), tr( "&Close Map","File menu" ), this);
    8.91  	a->setStatusTip (tr( "Close Map" ) );
    8.92 -	a->setShortcut (Qt::ALT + Qt::Key_C );
    8.93 +	a->setShortcut (Qt::ALT + Qt::Key_C );			//Close map
    8.94  	fileMenu->addAction (a);
    8.95      connect( a, SIGNAL( triggered() ), this, SLOT( fileCloseMap() ) );
    8.96  
    8.97      a = new QAction(QPixmap(iconPath+"exit.png"), tr( "E&xit","File menu")+" "+vymName, this);
    8.98  	a->setStatusTip ( tr( "Exit")+" "+vymName );
    8.99 -	a->setShortcut (Qt::CTRL + Qt::Key_Q );
   8.100 +	a->setShortcut (Qt::CTRL + Qt::Key_Q );			//Quit vym
   8.101  	fileMenu->addAction (a);
   8.102      connect( a, SIGNAL( triggered() ), this, SLOT( fileExitVYM() ) );
   8.103  }
   8.104 @@ -380,7 +385,7 @@
   8.105      a = new QAction( QPixmap( iconPath+"undo.png"), tr( "&Undo","Edit menu" ),this);
   8.106      connect( a, SIGNAL( triggered() ), this, SLOT( editUndo() ) );
   8.107  	a->setStatusTip (tr( "Undo" ) );
   8.108 -	a->setShortcut ( Qt::CTRL + Qt::Key_Z );
   8.109 +	a->setShortcut ( Qt::CTRL + Qt::Key_Z );		//Undo last action
   8.110  	a->setEnabled (false);
   8.111      tb->addAction (a);
   8.112  	editMenu->addAction (a);
   8.113 @@ -388,7 +393,7 @@
   8.114      
   8.115  	a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); 
   8.116  	a->setStatusTip (tr( "Redo" ));
   8.117 -	a->setShortcut (Qt::CTRL + Qt::Key_Y );
   8.118 +	a->setShortcut (Qt::CTRL + Qt::Key_Y );			//Redo last action
   8.119      tb->addAction (a);
   8.120  	editMenu->addAction (a);
   8.121  	connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) );
   8.122 @@ -397,7 +402,7 @@
   8.123  	editMenu->addSeparator();
   8.124      a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this);
   8.125  	a->setStatusTip ( tr( "Copy" ) );
   8.126 -	a->setShortcut (Qt::CTRL + Qt::Key_C );
   8.127 +	a->setShortcut (Qt::CTRL + Qt::Key_C );			//Copy
   8.128  	a->setEnabled (false);
   8.129      tb->addAction (a);
   8.130  	editMenu->addAction (a);
   8.131 @@ -406,7 +411,7 @@
   8.132  	
   8.133      a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this);
   8.134  	a->setStatusTip ( tr( "Cut" ) );
   8.135 -	a->setShortcut (Qt::CTRL + Qt::Key_X );
   8.136 +	a->setShortcut (Qt::CTRL + Qt::Key_X );			//Cut
   8.137  	a->setEnabled (false);
   8.138      tb->addAction (a);
   8.139  	editMenu->addAction (a);
   8.140 @@ -416,7 +421,7 @@
   8.141      a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this);
   8.142      connect( a, SIGNAL( triggered() ), this, SLOT( editPaste() ) );
   8.143  	a->setStatusTip ( tr( "Paste" ) );
   8.144 -	a->setShortcut ( Qt::CTRL + Qt::Key_V );
   8.145 +	a->setShortcut ( Qt::CTRL + Qt::Key_V );		//Paste
   8.146  	a->setEnabled (false);
   8.147      tb->addAction (a);
   8.148  	editMenu->addAction (a);
   8.149 @@ -425,14 +430,14 @@
   8.150      // Shortcuts to modify heading:
   8.151      a = new QAction(tr( "Edit heading","Edit menu" ),this);
   8.152  	a->setStatusTip ( tr( "edit Heading" ));
   8.153 -	a->setShortcut ( Qt::Key_Enter);
   8.154 +	a->setShortcut ( Qt::Key_Enter);				//Edit heading
   8.155  //	a->setShortcutContext (Qt::WindowShortcut);
   8.156  	addAction (a);
   8.157      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   8.158  	actionListBranches.append(a);
   8.159      a = new QAction( tr( "Edit heading","Edit menu" ), this);
   8.160  	a->setStatusTip (tr( "edit Heading" ));
   8.161 -	a->setShortcut (Qt::Key_Return );
   8.162 +	a->setShortcut (Qt::Key_Return );				//Edit heading
   8.163  	//a->setShortcutContext (Qt::WindowShortcut);
   8.164  	addAction (a);
   8.165      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   8.166 @@ -441,7 +446,7 @@
   8.167  	actionEditHeading=a;
   8.168      a = new QAction( tr( "Edit heading","Edit menu" ), this);
   8.169  	a->setStatusTip (tr( "edit Heading" ));
   8.170 -	a->setShortcut ( Qt::Key_F2 );
   8.171 +	a->setShortcut ( Qt::Key_F2 );					//Edit heading
   8.172  	a->setShortcutContext (Qt::WindowShortcut);
   8.173  	addAction (a);
   8.174      connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) );
   8.175 @@ -450,7 +455,7 @@
   8.176      // Shortcut to delete selection
   8.177      a = new QAction( tr( "Delete Selection","Edit menu" ),this);
   8.178  	a->setStatusTip (tr( "Delete Selection" ));
   8.179 -	a->setShortcut ( Qt::Key_Delete);
   8.180 +	a->setShortcut ( Qt::Key_Delete);				//Delete selection
   8.181  	a->setShortcutContext (Qt::WindowShortcut);
   8.182  	addAction (a);
   8.183      connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) );
   8.184 @@ -459,13 +464,13 @@
   8.185      // Shortcut to add branch
   8.186  	alt = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
   8.187  	alt->setStatusTip ( tr( "Add a branch as child of selection" ));
   8.188 -	alt->setShortcut (Qt::Key_A);
   8.189 +	alt->setShortcut (Qt::Key_A);					//Add branch
   8.190  	alt->setShortcutContext (Qt::WindowShortcut);
   8.191  	addAction (alt);
   8.192  	connect( alt, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   8.193  	a = new QAction(QPixmap(iconPath+"newbranch.png"), tr( "Add branch as child","Edit menu" ), this);
   8.194  	a->setStatusTip ( tr( "Add a branch as child of selection" ));
   8.195 -	a->setShortcut (Qt::Key_Insert);	
   8.196 +	a->setShortcut (Qt::Key_Insert);				//Add branch
   8.197  	connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranch() ) );
   8.198  	actionListBranches.append(a);
   8.199  	#if defined (Q_OS_MACX)
   8.200 @@ -481,7 +486,7 @@
   8.201      // Add branch by inserting it at selection
   8.202  	a = new QAction(tr( "Add branch (insert)","Edit menu" ), this);
   8.203  	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   8.204 -	a->setShortcut (Qt::ALT + Qt::Key_Insert );
   8.205 +	a->setShortcut (Qt::ALT + Qt::Key_Insert );		//Insert branch
   8.206  	a->setShortcutContext (Qt::WindowShortcut);
   8.207  	addAction (a);
   8.208      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
   8.209 @@ -490,7 +495,7 @@
   8.210  	actionEditAddBranchBefore=a;
   8.211  	a = new QAction(tr( "Add branch (insert)","Edit menu" ),this);
   8.212  	a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" ));
   8.213 -	a->setShortcut ( Qt::ALT + Qt::Key_A );
   8.214 +	a->setShortcut ( Qt::ALT + Qt::Key_A );			//Insert branch
   8.215  	a->setShortcutContext (Qt::WindowShortcut);
   8.216  	addAction (a);
   8.217      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) );
   8.218 @@ -499,7 +504,7 @@
   8.219  	// Add branch above
   8.220      a = new QAction(tr( "Add branch above","Edit menu" ), this);
   8.221  	a->setStatusTip ( tr( "Add a branch above selection" ));
   8.222 -	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );
   8.223 +	a->setShortcut (Qt::SHIFT+Qt::Key_Insert );		//Add branch above
   8.224  	a->setShortcutContext (Qt::WindowShortcut);
   8.225  	addAction (a);
   8.226      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   8.227 @@ -508,7 +513,7 @@
   8.228  	actionEditAddBranchAbove=a;
   8.229      a = new QAction(tr( "Add branch above","Edit menu" ), this);
   8.230  	a->setStatusTip ( tr( "Add a branch above selection" ));
   8.231 -	a->setShortcut (Qt::SHIFT+Qt::Key_A );
   8.232 +	a->setShortcut (Qt::SHIFT+Qt::Key_A );			//Add branch above
   8.233  	a->setShortcutContext (Qt::WindowShortcut);
   8.234  	addAction (a);
   8.235      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) );
   8.236 @@ -517,7 +522,7 @@
   8.237  	// Add branch below 
   8.238      a = new QAction(tr( "Add branch below","Edit menu" ), this);
   8.239  	a->setStatusTip ( tr( "Add a branch below selection" ));
   8.240 -	a->setShortcut (Qt::CTRL +Qt::Key_Insert );
   8.241 +	a->setShortcut (Qt::CTRL +Qt::Key_Insert );		//Add branch below
   8.242  	a->setShortcutContext (Qt::WindowShortcut);
   8.243  	addAction (a);
   8.244      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   8.245 @@ -526,7 +531,7 @@
   8.246  	actionEditAddBranchBelow=a;
   8.247      a = new QAction(tr( "Add branch below","Edit menu" ), this);
   8.248  	a->setStatusTip ( tr( "Add a branch below selection" ));
   8.249 -	a->setShortcut (Qt::CTRL +Qt::Key_A );
   8.250 +	a->setShortcut (Qt::CTRL +Qt::Key_A );			// Add branch below
   8.251  	a->setShortcutContext (Qt::WindowShortcut);
   8.252  	addAction (a);
   8.253      connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) );
   8.254 @@ -534,7 +539,7 @@
   8.255  
   8.256      a = new QAction(QPixmap(iconPath+"up.png" ), tr( "Move up","Edit menu" ), this);
   8.257  	a->setStatusTip ( tr( "Move branch up" ) );
   8.258 -	a->setShortcut (Qt::Key_PageUp );
   8.259 +	a->setShortcut (Qt::Key_PageUp );				// Move branch up
   8.260  	a->setEnabled (false);
   8.261      tb->addAction (a);
   8.262  	editMenu->addAction (a);
   8.263 @@ -544,7 +549,7 @@
   8.264      a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this);
   8.265      connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) );
   8.266  	a->setStatusTip (tr( "Move branch down" ) );
   8.267 -	a->setShortcut ( Qt::Key_PageDown );
   8.268 +	a->setShortcut ( Qt::Key_PageDown );			// Move branch down
   8.269  	a->setEnabled (false);
   8.270      tb->addAction (a);
   8.271  	editMenu->addAction (a);
   8.272 @@ -557,7 +562,7 @@
   8.273      connect( a, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   8.274  
   8.275  	alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this);
   8.276 -	alt->setShortcut ( Qt::Key_S );
   8.277 +	alt->setShortcut ( Qt::Key_S );					// Scroll branch
   8.278  	alt->setStatusTip (tr( "Scroll branch" )); 
   8.279      connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) );
   8.280  	#if defined(Q_OS_MACX)
   8.281 @@ -583,7 +588,7 @@
   8.282  
   8.283  	a = new QAction( QPixmap(iconPath+"find.png"), tr( "Find...","Edit menu"), this);
   8.284  	a->setStatusTip (tr( "Find" ) );
   8.285 -	a->setShortcut (Qt::CTRL + Qt::Key_F );
   8.286 +	a->setShortcut (Qt::CTRL + Qt::Key_F );				//Find
   8.287  	editMenu->addAction (a);
   8.288      connect( a, SIGNAL( triggered() ), this, SLOT( editOpenFindWindow() ) );
   8.289      
   8.290 @@ -779,10 +784,13 @@
   8.291      connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) );
   8.292  	actionEditLoadImage=a;
   8.293  
   8.294 -    a = new QAction( tr( "Properties","Context menu for images and branches" )+QString ("..."), this);
   8.295 -	a->setStatusTip (tr( "Set properties for object" ));
   8.296 +    a = new QAction( tr( "Property Dialog","Dialog to edit properties of selection" )+QString ("..."), this);
   8.297 +	a->setStatusTip (tr( "Set properties for selection" ));
   8.298 +	a->setShortcut ( Qt::CTRL + Qt::Key_I );		//Property window
   8.299 +	a->setShortcutContext (Qt::WindowShortcut);
   8.300 +	addAction (a);
   8.301      connect( a, SIGNAL( triggered() ), this, SLOT( showPropertyDialog() ) );
   8.302 -	actionOpenPropertyDialog=a;
   8.303 +	actionTogglePropertyDialog=a;
   8.304  }
   8.305  
   8.306  // Format Actions
   8.307 @@ -813,7 +821,7 @@
   8.308  
   8.309      a= new QAction(QPixmap(iconPath+"formatcolorbranch.png"), tr( "Color &branch","Edit menu" ), this);
   8.310  	a->setStatusTip ( tr( "Color branch" ) );
   8.311 -	a->setShortcut (Qt::CTRL + Qt::Key_I);
   8.312 +	a->setShortcut (Qt::CTRL + Qt::Key_B);
   8.313      connect( a, SIGNAL( triggered() ), this, SLOT( formatColorBranch() ) );
   8.314  	a->setEnabled (false);
   8.315      a->addTo( tb );
   8.316 @@ -893,6 +901,12 @@
   8.317      connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectLinkColor() ) );
   8.318      actionFormatLinkColor=a;
   8.319  
   8.320 +    a= new QAction( pix, tr( "Set &Selection Color"+QString("...") ), this  );
   8.321 +	a->setStatusTip (tr( "Set Selection Color" ));
   8.322 +	formatMenu->addAction (a);
   8.323 +    connect( a, SIGNAL( triggered() ), this, SLOT( formatSelectSelectionColor() ) );
   8.324 +    actionFormatSelectionColor=a;
   8.325 +
   8.326      a= new QAction( pix, tr( "Set &Background Color" )+QString("..."), this );
   8.327  	a->setStatusTip (tr( "Set Background Color" ));
   8.328  	formatMenu->addAction (a);
   8.329 @@ -950,8 +964,8 @@
   8.330      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) );
   8.331  	actionViewToggleNoteEditor=a;
   8.332  
   8.333 -    a = new QAction(QPixmap(iconPath+"history.png"),  tr( "Show history window","View action" ),this );
   8.334 -	a->setStatusTip ( tr( "Show history window" ));
   8.335 +    a = new QAction(QPixmap(iconPath+"history.png"),  tr( "History Window","View action" ),this );
   8.336 +	a->setStatusTip ( tr( "Show History Window" ));
   8.337  	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
   8.338  	a->setToggleAction(true);
   8.339      a->addTo( tb );
   8.340 @@ -959,6 +973,8 @@
   8.341      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
   8.342  	actionViewToggleHistoryWindow=a;
   8.343  
   8.344 +	viewMenu->addAction (actionTogglePropertyDialog );
   8.345 +
   8.346      a = new QAction(tr( "Antialiasing","View action" ),this );
   8.347  	a->setStatusTip ( tr( "Antialiasing" ));
   8.348  	a->setToggleAction(true);
   8.349 @@ -1450,8 +1466,7 @@
   8.350  
   8.351  	// Context Menu for branch or mapcenter
   8.352  	branchContextMenu =new QMenu (this);
   8.353 -
   8.354 -	actionOpenPropertyDialog->addTo (branchContextMenu);
   8.355 +	branchContextMenu->addAction (actionTogglePropertyDialog);
   8.356  	branchContextMenu->addSeparator();	
   8.357  
   8.358  		// Submenu "Add"
   8.359 @@ -1533,6 +1548,7 @@
   8.360  	canvasContextMenu->insertSeparator();	
   8.361  	actionFormatLinkColorHint->addTo( canvasContextMenu );
   8.362  	actionFormatLinkColor->addTo( canvasContextMenu );
   8.363 +	actionFormatSelectionColor->addTo( canvasContextMenu );
   8.364  	actionFormatBackColor->addTo( canvasContextMenu );
   8.365  	actionFormatBackImage->addTo( canvasContextMenu );
   8.366  
   8.367 @@ -2215,13 +2231,14 @@
   8.368  			QString dir=dia.getDir();
   8.369  			// Check, if warnings should be used before overwriting
   8.370  			// the output directory
   8.371 -			bool ok;
   8.372 -			if (dia.warnings()) 
   8.373 -				ok=reallyWriteDirectory(dir);
   8.374 -			else
   8.375 -				ok=true;
   8.376 -
   8.377 -			if (ok)
   8.378 +			WarningDialog warn;
   8.379 +			warn.showCancelButton (true);
   8.380 +			warn.setText(QString(
   8.381 +				"The directory %1 is not empty.\n"
   8.382 +				"Do you risk to overwrite some of its contents?").arg(dir));
   8.383 +			warn.setCaption("Warning: Directory not empty");
   8.384 +			warn.setShowAgainName("mainwindow/overwrite-dir-xhtml");
   8.385 +			if (warn.exec()==QDialog::Accepted)
   8.386  			{
   8.387  				me->exportXML (dia.getDir() );
   8.388  				dia.doExport(me->getMapName() );
   8.389 @@ -3067,6 +3084,12 @@
   8.390  		currentMapEditor()->selectMapLinkColor();
   8.391  }
   8.392  
   8.393 +void Main::formatSelectSelectionColor()
   8.394 +{
   8.395 +	if (currentMapEditor())
   8.396 +		currentMapEditor()->selectMapSelectionColor();
   8.397 +}
   8.398 +
   8.399  void Main::formatToggleLinkColorHint()
   8.400  {
   8.401  	currentMapEditor()->toggleMapLinkColorHint();
   8.402 @@ -3211,6 +3234,11 @@
   8.403  		currentMapEditor()->updateNoteFlag();
   8.404  }
   8.405  
   8.406 +void Main::updateSatellites(MapEditor *me)
   8.407 +{
   8.408 +	branchPropertyWindow->setMapEditor (me);
   8.409 +}
   8.410 +
   8.411  void Main::updateActions()
   8.412  {
   8.413  	MapEditor *me=currentMapEditor();
   8.414 @@ -3220,6 +3248,7 @@
   8.415  
   8.416  	// updateActions is also called when NoteEditor is closed
   8.417  	actionViewToggleNoteEditor->setOn (textEditor->showWithMain());
   8.418 +	actionViewToggleHistoryWindow->setOn (historyWindow->showWithMain());
   8.419  
   8.420  	if (me->getMapLinkColorHint()==HeadingColor) 
   8.421  		actionFormatLinkColorHint->setOn(true);
   8.422 @@ -3244,12 +3273,16 @@
   8.423  			break;
   8.424  	}	
   8.425  
   8.426 +	// Update colors
   8.427  	QPixmap pix( 16, 16 );
   8.428      pix.fill( me->getMapBackgroundColor() );
   8.429      actionFormatBackColor->setIconSet( pix );
   8.430 +    pix.fill( me->getSelectionColor() );
   8.431 +    actionFormatSelectionColor->setIconSet( pix );
   8.432      pix.fill( me->getMapDefLinkColor() );
   8.433      actionFormatLinkColor->setIconSet( pix );
   8.434  
   8.435 +
   8.436  	actionFileSave->setEnabled( me->isUnsaved() );
   8.437  	if (me->isUndoAvailable())
   8.438  		actionEditUndo->setEnabled( true);
     9.1 --- a/mainwindow.h	Sat Mar 31 09:28:27 2007 +0000
     9.2 +++ b/mainwindow.h	Sat Mar 31 09:28:27 2007 +0000
     9.3 @@ -147,6 +147,7 @@
     9.4      void formatSelectBackColor();
     9.5      void formatSelectBackImage();
     9.6      void formatSelectLinkColor();
     9.7 +    void formatSelectSelectionColor();
     9.8      void formatToggleLinkColorHint();
     9.9  	void formatIncludeImagesVer();
    9.10  	void formatIncludeImagesHor();
    9.11 @@ -167,6 +168,7 @@
    9.12  	void windowToggleAntiAlias();
    9.13  	void windowToggleSmoothPixmap();
    9.14  	void updateNoteFlag();
    9.15 +	void updateSatellites(MapEditor *);
    9.16  	void updateActions();
    9.17  	ModMode getModMode();
    9.18  	bool autoEdit();
    9.19 @@ -260,6 +262,7 @@
    9.20  	QAction* actionFormatBackColor;
    9.21  	QAction* actionFormatBackImage;
    9.22  	QAction* actionFormatLinkColor;
    9.23 +	QAction* actionFormatSelectionColor;
    9.24  	QAction *actionFormatIncludeImagesVer;
    9.25  	QAction *actionFormatIncludeImagesHor;
    9.26  
    9.27 @@ -270,7 +273,7 @@
    9.28  
    9.29  	QActionGroup *actionGroupFormatFrameTypes;
    9.30  
    9.31 -	QAction *actionOpenPropertyDialog;
    9.32 +	QAction *actionTogglePropertyDialog;
    9.33  
    9.34  	QActionGroup *actionGroupFormatLinkStyles;
    9.35  	QAction *actionFormatLinkStyleLine;
    10.1 --- a/mapeditor.cpp	Sat Mar 31 09:28:27 2007 +0000
    10.2 +++ b/mapeditor.cpp	Sat Mar 31 09:28:27 2007 +0000
    10.3 @@ -97,7 +97,7 @@
    10.4      editingBO=NULL;
    10.5      movingObj=NULL;
    10.6  
    10.7 -	xelection.setMapCenter (mapCenter);
    10.8 +	xelection.setMapEditor (this);
    10.9  	xelection.unselect();
   10.10  
   10.11  	defXLinkWidth=1;
   10.12 @@ -222,6 +222,7 @@
   10.13  				  attribut("comment",mapCenter->getComment()) +
   10.14  			      attribut("date",mapCenter->getDate()) +
   10.15  		          attribut("backgroundColor", mapScene->backgroundBrush().color().name() ) +
   10.16 +		          attribut("selectionColor", xelection.getColor().name() ) +
   10.17  		          attribut("linkStyle", ls ) +
   10.18  		          attribut("linkColor", defLinkColor.name() ) +
   10.19  		          attribut("defXLinkColor", defXLinkColor.name() ) +
   10.20 @@ -890,6 +891,13 @@
   10.21  			b=parser.parBool(ok,0);
   10.22  			if (ok) setIncludeImagesVer(b);
   10.23  		}
   10.24 +	} else if (com=="setSelectionColor")
   10.25 +	{
   10.26 +		if (parser.checkParamCount(1))
   10.27 +		{
   10.28 +			QColor c=parser.parColor (ok,0);
   10.29 +			if (ok) setSelectionColorInt (c);
   10.30 +		}	
   10.31  	} else if (com=="setURL")
   10.32  	{
   10.33  		if (xelection.isEmpty() )
   10.34 @@ -1147,6 +1155,7 @@
   10.35  		if ( ok ) 
   10.36  		{
   10.37  			mapCenter->reposition();
   10.38 +			xelection.update();
   10.39  			if (lmode==NewMap)
   10.40  			{
   10.41  				mapDefault=false;
   10.42 @@ -1221,8 +1230,6 @@
   10.43  		printer->setOutputFileName(settings.value("/mainwindow/printerFileName",printer->outputFileName()).toString());
   10.44  	}
   10.45  
   10.46 -	// FIXME testing cout << "ME::print  printProgram="<<printer->printProgram().ascii()<<endl;
   10.47 -
   10.48  	QRectF totalBBox=mapCenter->getTotalBBox();
   10.49  
   10.50  	// Try to set orientation automagically
   10.51 @@ -1319,7 +1326,6 @@
   10.52  {
   10.53  	QRectF mapRect=mapCenter->getTotalBBox();
   10.54  	QPixmap pix((int)mapRect.width(),(int)mapRect.height());
   10.55 -	cout << "w.h="<<(int)mapRect.width()<<","<<(int)mapRect.height()<<endl;
   10.56  	QPainter pp (&pix);
   10.57  	
   10.58  	pp.setRenderHints(renderHints());
   10.59 @@ -1611,6 +1617,7 @@
   10.60  
   10.61  	mainWindow->updateHistory (undoSet);
   10.62  	updateActions();
   10.63 +	xelection.update();
   10.64  	ensureSelectionVisible();
   10.65  }
   10.66  
   10.67 @@ -1777,6 +1784,7 @@
   10.68  			QString("Move %1 to  %2").arg(getName(sel)).arg(ps));
   10.69  		sel->move(x,y);	// FIXME	xelection not moved automagically...
   10.70  		mapCenter->reposition();
   10.71 +		xelection.update();
   10.72  	}
   10.73  
   10.74  }
   10.75 @@ -1795,6 +1803,7 @@
   10.76  		((OrnamentedObj*)sel)->move2RelPos (x,y);
   10.77  		mapCenter->reposition();
   10.78  		sel->updateLink();
   10.79 +		xelection.update();
   10.80  	}
   10.81  }
   10.82  
   10.83 @@ -1813,6 +1822,7 @@
   10.84  		saveState (bo,"moveBranchDown ()",bo,"moveBranchUp ()",QString("Move up %1").arg(getName(bo)));
   10.85  		mapCenter->reposition();
   10.86  		scene()->update();
   10.87 +		xelection.update();
   10.88  		ensureSelectionVisible();
   10.89  	}
   10.90  }
   10.91 @@ -1832,6 +1842,7 @@
   10.92  		saveState(bo,"moveBranchUp ()",bo,"moveBranchDown ()",QString("Move down %1").arg(getName(bo)));
   10.93  		mapCenter->reposition();
   10.94  		scene()->update();
   10.95 +		xelection.update();
   10.96  		ensureSelectionVisible();
   10.97  	}	
   10.98  }
   10.99 @@ -1892,6 +1903,7 @@
  10.100  			QString("Set heading of %1 to \"%2\"").arg(getName(sel)).arg(s) );
  10.101  		sel->setHeading(s );
  10.102  		mapCenter->reposition();
  10.103 +		xelection.update();
  10.104  		ensureSelectionVisible();
  10.105  	}
  10.106  }
  10.107 @@ -1904,6 +1916,7 @@
  10.108  	{
  10.109  		bo->setURL(s);
  10.110  		mapCenter->reposition();
  10.111 +		xelection.update();
  10.112  		ensureSelectionVisible();
  10.113  	}
  10.114  }
  10.115 @@ -1915,6 +1928,7 @@
  10.116  	{
  10.117  		bo->setHeading(s);
  10.118  		mapCenter->reposition();
  10.119 +		xelection.update();
  10.120  		ensureSelectionVisible();
  10.121  	}
  10.122  }
  10.123 @@ -1927,6 +1941,7 @@
  10.124  	{
  10.125  		bo->setVymLink(s);
  10.126  		mapCenter->reposition();
  10.127 +		xelection.update();
  10.128  		ensureSelectionVisible();
  10.129  	}
  10.130  }
  10.131 @@ -1988,6 +2003,7 @@
  10.132  				QString ("Add new branch to %1").arg(getName(bo)));	
  10.133  
  10.134  			mapCenter->reposition();
  10.135 +			xelection.update();
  10.136  		}
  10.137  	}	
  10.138  	return newbo;
  10.139 @@ -2019,6 +2035,7 @@
  10.140  				QString ("Add branch before %1").arg(getName(bo)));
  10.141  
  10.142  			mapCenter->reposition();
  10.143 +			xelection.update();
  10.144  		}
  10.145  	}	
  10.146  	return newbo;
  10.147 @@ -2036,7 +2053,8 @@
  10.148  		xelection.select (par);
  10.149  		ensureSelectionVisible();
  10.150  		mapCenter->reposition();
  10.151 -		mapScene->update();
  10.152 +		xelection.update();
  10.153 +		xelection.update();
  10.154  		return;
  10.155  	}
  10.156  	FloatImageObj *fio=xelection.getFloatImage();
  10.157 @@ -2052,9 +2070,9 @@
  10.158  		xelection.unselect();
  10.159  		par->removeFloatImage(fio);
  10.160  		xelection.select (par);
  10.161 +		mapCenter->reposition();
  10.162 +		xelection.update();
  10.163  		ensureSelectionVisible();
  10.164 -		mapCenter->reposition();
  10.165 -		mapScene->update();
  10.166  		return;
  10.167  	}
  10.168  }
  10.169 @@ -2064,6 +2082,16 @@
  10.170  	return xelection.single();
  10.171  }
  10.172  
  10.173 +BranchObj* MapEditor::getSelectedBranch()
  10.174 +{
  10.175 +	return xelection.getBranch();
  10.176 +}
  10.177 +
  10.178 +FloatImageObj* MapEditor::getSelectedFloatImage()
  10.179 +{
  10.180 +	return xelection.getFloatImage();
  10.181 +}
  10.182 +
  10.183  void MapEditor::unselect()
  10.184  {
  10.185  	xelection.unselect();
  10.186 @@ -2083,6 +2111,7 @@
  10.187  	{
  10.188  		xelection.unselect();
  10.189  		xelection.select(lmo);
  10.190 +		xelection.update();
  10.191  		ensureSelectionVisible();
  10.192  		return true;
  10.193  	} 
  10.194 @@ -2097,7 +2126,10 @@
  10.195  void MapEditor::selectInt (LinkableMapObj *lmo)
  10.196  {
  10.197  	if (lmo && xelection.single()!= lmo)
  10.198 +	{
  10.199  		xelection.select(lmo);
  10.200 +		xelection.update();
  10.201 +	}	
  10.202  }
  10.203  
  10.204  void MapEditor::selectNextBranchInt()
  10.205 @@ -2311,6 +2343,7 @@
  10.206  				{
  10.207  					bo=par->getLastBranch();
  10.208  					xelection.select(bo);
  10.209 +					xelection.update();
  10.210  					ensureSelectionVisible();
  10.211  				}
  10.212  			}	
  10.213 @@ -2323,6 +2356,7 @@
  10.214  					xelection.type() == FloatImage)
  10.215  				{
  10.216  					xelection.select(par);
  10.217 +					xelection.update();
  10.218  					ensureSelectionVisible();
  10.219  				}
  10.220  			} else
  10.221 @@ -2333,6 +2367,7 @@
  10.222  					if (bo) 
  10.223  					{
  10.224  						xelection.select(bo);
  10.225 +						xelection.update();
  10.226  						ensureSelectionVisible();
  10.227  					}
  10.228  				}
  10.229 @@ -2360,6 +2395,7 @@
  10.230  				if (bo)
  10.231  				{
  10.232  					xelection.select(bo);
  10.233 +					xelection.update();
  10.234  					ensureSelectionVisible();
  10.235  				}
  10.236  			}
  10.237 @@ -2372,6 +2408,7 @@
  10.238  					xelection.type() == FloatImage)
  10.239  				{
  10.240  					xelection.select(par);
  10.241 +					xelection.update();
  10.242  					ensureSelectionVisible();
  10.243  				}
  10.244  			} else
  10.245 @@ -2382,6 +2419,7 @@
  10.246  					if (bo) 
  10.247  					{
  10.248  						xelection.select(bo);
  10.249 +						xelection.update();
  10.250  						ensureSelectionVisible();
  10.251  					}
  10.252  				}
  10.253 @@ -2401,6 +2439,7 @@
  10.254  		bo2=par->getFirstBranch();
  10.255  		if (bo2) {
  10.256  			xelection.select(bo2);
  10.257 +			xelection.update();
  10.258  			ensureSelectionVisible();
  10.259  		}
  10.260  	}		
  10.261 @@ -2418,6 +2457,7 @@
  10.262  		if (bo2) 
  10.263  		{
  10.264  			xelection.select(bo2);
  10.265 +			xelection.update();
  10.266  			ensureSelectionVisible();
  10.267  		}
  10.268  	}		
  10.269 @@ -2444,7 +2484,7 @@
  10.270  	}
  10.271  }	
  10.272  
  10.273 -void MapEditor::setMapBackgroundImage (const QString &fn)
  10.274 +void MapEditor::setMapBackgroundImage (const QString &fn)	//FIXME missing savestate
  10.275  {
  10.276  	QColor oldcol=mapScene->backgroundBrush().color();
  10.277  	/*
  10.278 @@ -2455,7 +2495,6 @@
  10.279  		QString ("setMapBackgroundImage (%1)").arg(col.name()),
  10.280  		QString("Set background color of map to %1").arg(col.name()));
  10.281  	*/	
  10.282 -	cout << "Trying to load "<<fn.ascii()<<endl;//FIXME
  10.283  	QBrush brush;
  10.284  	brush.setTextureImage (QPixmap (fn));
  10.285  	mapScene->setBackgroundBrush(brush);
  10.286 @@ -2550,6 +2589,7 @@
  10.287  			QString("%1 (\"%2\")").arg(r).arg(f),
  10.288  			QString("Toggling standard flag \"%1\" of %2").arg(f).arg(getName(bo)));
  10.289  		bo->toggleStandardFlag (f,mainWindow->useFlagGroups());
  10.290 +		xelection.update();
  10.291  	}
  10.292  }
  10.293  
  10.294 @@ -2715,6 +2755,7 @@
  10.295  		QFileDialog *fd=new QFileDialog( this,vymName+" - " +tr("Link to another map"));
  10.296  		fd->setFilters (filters);
  10.297  		fd->setCaption(vymName+" - " +tr("Link to another map"));
  10.298 +		fd->setDirectory (lastFileDir);
  10.299  		if (! bo->getVymLink().isEmpty() )
  10.300  			fd->selectFile( bo->getVymLink() );
  10.301  		fd->show();
  10.302 @@ -2722,6 +2763,7 @@
  10.303  		QString fn;
  10.304  		if ( fd->exec() == QDialog::Accepted )
  10.305  		{
  10.306 +			lastFileDir=QDir (fd->directory().path());
  10.307  			saveState(
  10.308  				bo,
  10.309  				"setVymLink (\""+bo->getVymLink()+"\")",
  10.310 @@ -2892,8 +2934,22 @@
  10.311  	}
  10.312  }
  10.313  
  10.314 +void MapEditor::ensureSelectionVisible()
  10.315 +{
  10.316 +	LinkableMapObj *lmo=xelection.single();
  10.317 +	if (lmo) ensureVisible (lmo->getBBox() );
  10.318 +	
  10.319 +}
  10.320 +
  10.321 +void MapEditor::updateSelection()
  10.322 +{
  10.323 +	// Tell selection to update geometries
  10.324 +	xelection.update();
  10.325 +}
  10.326 +
  10.327  void MapEditor::updateActions()
  10.328  {
  10.329 +	// Tell mainwindow to update states of actions
  10.330  	mainWindow->updateActions();
  10.331  	// TODO maybe don't update if blockReposition is set
  10.332  }
  10.333 @@ -3048,7 +3104,36 @@
  10.334  		QString("Set link color to %1").arg(col.name())
  10.335  	);
  10.336  	setMapDefLinkColor( col );
  10.337 -
  10.338 +}
  10.339 +
  10.340 +void MapEditor::selectMapSelectionColor()
  10.341 +{
  10.342 +	QColor col = QColorDialog::getColor( defLinkColor, this );
  10.343 +	setSelectionColor (col);
  10.344 +}
  10.345 +
  10.346 +void MapEditor::setSelectionColorInt (QColor col)
  10.347 +{
  10.348 +	if ( !col.isValid() ) return;
  10.349 +	xelection.setColor (col);
  10.350 +}
  10.351 +
  10.352 +void MapEditor::setSelectionColor(QColor col)
  10.353 +{
  10.354 +	if ( !col.isValid() ) return;
  10.355 +	saveState (
  10.356 +		mapCenter,
  10.357 +		QString("setSelectionColor (%1)").arg(xelection.getColor().name()),
  10.358 +		mapCenter,
  10.359 +		QString("setSelectionColor (%1)").arg(col.name()),
  10.360 +		QString("Set color of selection box to %1").arg(col.name())
  10.361 +	);
  10.362 +	setSelectionColorInt (col);
  10.363 +}
  10.364 +
  10.365 +QColor MapEditor::getSelectionColor()
  10.366 +{
  10.367 +	return xelection.getColor();
  10.368  }
  10.369  
  10.370  bool MapEditor::scrollBranch()
  10.371 @@ -3240,7 +3325,7 @@
  10.372  	}
  10.373  }
  10.374  
  10.375 -void MapEditor::setFrame(const FrameType &t)	// FIXME missing saveState
  10.376 +void MapEditor::setFrameType(const FrameType &t)	// FIXME missing saveState
  10.377  {
  10.378  	BranchObj *bo=xelection.getBranch();
  10.379  	if (bo)
  10.380 @@ -3251,6 +3336,20 @@
  10.381  	}
  10.382  }
  10.383  
  10.384 +void MapEditor::setFramePenColor(const QColor &c)	// FIXME missing saveState
  10.385 +{
  10.386 +	BranchObj *bo=xelection.getBranch();
  10.387 +	if (bo)
  10.388 +		bo->setFramePenColor (c);
  10.389 +}
  10.390 +
  10.391 +void MapEditor::setFrameBrushColor(const QColor &c)	// FIXME missing saveState
  10.392 +{
  10.393 +	BranchObj *bo=xelection.getBranch();
  10.394 +	if (bo)
  10.395 +		bo->setFrameBrushColor (c);
  10.396 +}
  10.397 +
  10.398  void MapEditor::setIncludeImagesVer(bool b)	
  10.399  {
  10.400  	BranchObj *bo=xelection.getBranch();
  10.401 @@ -3455,12 +3554,6 @@
  10.402  	*/
  10.403  }
  10.404  
  10.405 -void MapEditor::ensureSelectionVisible()
  10.406 -{
  10.407 -	LinkableMapObj *lmo=xelection.single();
  10.408 -	if (lmo) ensureVisible (lmo->getBBox() );
  10.409 -}
  10.410 -
  10.411  void MapEditor::contextMenuEvent ( QContextMenuEvent * e )
  10.412  {
  10.413  	// Lineedits are already closed by preceding
  10.414 @@ -3542,7 +3635,7 @@
  10.415  	
  10.416  	e->accept();
  10.417  
  10.418 -	//Take care of clickdesystem flags _or_ modifier modes
  10.419 +	//Take care of  system flags _or_ modifier modes
  10.420  	//
  10.421  	if (lmo && (typeid(*lmo)==typeid(BranchObj) ||
  10.422  		typeid(*lmo)==typeid(MapCenterObj) ))
  10.423 @@ -3568,12 +3661,12 @@
  10.424  				mainWindow->windowToggleNoteEditor();
  10.425  			else if (foname=="hideInExport")		
  10.426  				toggleHideExport();
  10.427 +			xelection.update();	
  10.428  			return;	
  10.429  		} 
  10.430  	} 
  10.431 -	// No system flag clicked, take care of modmodes
  10.432 -
  10.433 -	// Special case: CTRL is pressed
  10.434 +
  10.435 +	// No system flag clicked, take care of modmodes (CTRL-Click)
  10.436  	if (e->state() & Qt::ControlModifier)
  10.437  	{
  10.438  		if (mainWindow->getModMode()==ModModeColor)
  10.439 @@ -3604,10 +3697,13 @@
  10.440  				return;
  10.441  			} 
  10.442  		}
  10.443 -	}
  10.444 +	}	// End of modmodes
  10.445 +
  10.446      if (lmo) 
  10.447  	{	
  10.448 +		// Select the clicked object
  10.449  		selectInt (lmo);
  10.450 +
  10.451  		// Left Button	    Move Branches
  10.452  		if (e->button() == Qt::LeftButton )
  10.453  		{
  10.454 @@ -3642,6 +3738,7 @@
  10.455  			if (e->button() == Qt::MidButton )
  10.456  				toggleScroll();
  10.457  		updateActions();
  10.458 +		xelection.update();
  10.459  	} else 
  10.460  	{ // No MapObj found, we are on the scene itself
  10.461  		// Left Button	    move Pos of sceneView
  10.462 @@ -3690,6 +3787,7 @@
  10.463  			fio->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
  10.464  			fio->setRelPos();
  10.465  			fio->updateLink(); //no need for reposition, if we update link here
  10.466 +			xelection.update();
  10.467  
  10.468  			// Relink float to new mapcenter or branch, if shift is pressed	
  10.469  			// Only relink, if selection really has a new parent
  10.470 @@ -3716,12 +3814,9 @@
  10.471  					fio->getParObj()->requestReposition();
  10.472  					mapCenter->reposition();
  10.473  
  10.474 -					cout << "current relPos="<<movingObj_orgRelPos<<endl;	// FIXME testing
  10.475  					linkTo (lmo->getSelectString());
  10.476 -					cout << "setting movingObj\n";
  10.477 -					movingObj=lmosel;
  10.478 -					movingObj_orgRelPos=lmosel->getRelPos();	
  10.479 -					cout <<"ok 0\n";
  10.480 +					//movingObj=lmosel;
  10.481 +					//movingObj_orgRelPos=lmosel->getRelPos();	
  10.482  
  10.483  					mapCenter->reposition();
  10.484  				}	
  10.485 @@ -3777,6 +3872,7 @@
  10.486  				lmosel->reposition();	
  10.487  			} // depth>0
  10.488  
  10.489 +			xelection.update();
  10.490  		} // no FloatImageObj
  10.491  
  10.492  		scene()->update();
  10.493 @@ -3945,6 +4041,7 @@
  10.494  			// Draw the original link, before selection was moved around
  10.495  			mapCenter->reposition();
  10.496  		}
  10.497 +		xelection.update();
  10.498  		// Finally resize scene, if needed
  10.499  		scene()->update();
  10.500  		movingObj=NULL;		
    11.1 --- a/mapeditor.h	Sat Mar 31 09:28:27 2007 +0000
    11.2 +++ b/mapeditor.h	Sat Mar 31 09:28:27 2007 +0000
    11.3 @@ -1,7 +1,7 @@
    11.4  #ifndef MAPEDITOR_H
    11.5  #define MAPEDITOR_H
    11.6  
    11.7 -#include <QBuffer>
    11.8 +//#include <QBuffer>
    11.9  #include <QGraphicsView>
   11.10  
   11.11  #include "mapcenterobj.h"
   11.12 @@ -100,10 +100,12 @@
   11.13      BranchObj* addNewBranch(int);			// pos allows to add above/below selection
   11.14      BranchObj* addNewBranchBefore();		// insert and make selection its
   11.15      void deleteSelection();
   11.16 -	LinkableMapObj* getSelection();	// returns selection
   11.17 -	void unselect();				// before changing current noteedit
   11.18 -	void reselect();				// after  changing current noteedit
   11.19 -	bool select(const QString &);	// Select by string
   11.20 +	LinkableMapObj* getSelection();			// returns selection
   11.21 +	BranchObj* getSelectedBranch();			// returns selected branch or NULL
   11.22 +	FloatImageObj* getSelectedFloatImage();	// returns selected branch or NULL
   11.23 +	void unselect();						// before changing current noteedit
   11.24 +	void reselect();						// after  changing current noteedit
   11.25 +	bool select(const QString &);			// Select by string
   11.26  	QString getSelectString();
   11.27  private:	
   11.28  	void selectInt(LinkableMapObj*);	
   11.29 @@ -143,6 +145,8 @@
   11.30  	void deleteKeepChilds();				// remove but keep childs
   11.31  	void deleteChilds();					// remove childs
   11.32  	void editMapInfo();						// dialog to enter author, ...
   11.33 +	void ensureSelectionVisible();		
   11.34 +	void updateSelection();					// update geometry of selection
   11.35  	void updateActions();					// update e.g. format buttons
   11.36  	void updateNoteFlag();					// when TextEditor changes
   11.37  	void setMapAuthor (const QString &);
   11.38 @@ -160,6 +164,12 @@
   11.39  	int getMapDefXLinkWidth();
   11.40  	void toggleMapLinkColorHint();			// after changing linkStyles
   11.41      void selectMapLinkColor();
   11.42 +    void selectMapSelectionColor();
   11.43 +private:	
   11.44 +    void setSelectionColorInt(QColor);
   11.45 +public:	
   11.46 +    void setSelectionColor(QColor);
   11.47 +    QColor getSelectionColor();
   11.48  	bool scrollBranch();
   11.49  	bool unscrollBranch();
   11.50      void toggleScroll();
   11.51 @@ -172,7 +182,9 @@
   11.52  	void saveFloatImageInt (FloatImageObj*, const QString &, const QString &);
   11.53  public:	
   11.54  	void saveFloatImage ();
   11.55 -	void setFrame(const FrameType &);
   11.56 +	void setFrameType(const FrameType &);
   11.57 +	void setFramePenColor (const QColor &);
   11.58 +	void setFrameBrushColor (const QColor &);
   11.59  	void setIncludeImagesVer(bool);
   11.60  	void setIncludeImagesHor(bool);
   11.61  	void setHideLinkUnselected (bool);
   11.62 @@ -187,7 +199,6 @@
   11.63  											// set /mainwindo/showTestMenu=true...
   11.64  
   11.65  protected:
   11.66 -	void ensureSelectionVisible();		
   11.67  	virtual void contextMenuEvent ( QContextMenuEvent *e );
   11.68      virtual void keyPressEvent(QKeyEvent*);
   11.69      virtual void keyReleaseEvent(QKeyEvent*);
    12.1 --- a/ornamentedobj.cpp	Sat Mar 31 09:28:27 2007 +0000
    12.2 +++ b/ornamentedobj.cpp	Sat Mar 31 09:28:27 2007 +0000
    12.3 @@ -31,9 +31,10 @@
    12.4  
    12.5  OrnamentedObj::~OrnamentedObj()
    12.6  {
    12.7 -    delete (heading);
    12.8 -	delete (systemFlags);
    12.9 -	delete (standardFlags);
   12.10 +    delete heading;
   12.11 +	delete systemFlags;
   12.12 +	delete standardFlags;
   12.13 +	delete frame;
   12.14  }
   12.15  
   12.16  
   12.17 @@ -54,6 +55,8 @@
   12.18  	standardFlags->clone(standardFlagsDefault);
   12.19  	standardFlags->setName ("standardFlags");
   12.20  
   12.21 +	frame = new FrameObj (scene);
   12.22 +
   12.23  	hideExport=false;
   12.24  	hidden=false;
   12.25  
   12.26 @@ -103,6 +106,56 @@
   12.27      return heading->getColor();
   12.28  }
   12.29  
   12.30 +FrameType OrnamentedObj::getFrameType()
   12.31 +{
   12.32 +	return frame->getFrameType();
   12.33 +}
   12.34 +
   12.35 +void OrnamentedObj::setFrameType(const FrameType &t)
   12.36 +{
   12.37 +	frame->setFrameType(t);
   12.38 +	if (t == NoFrame)
   12.39 +		linkpos=LinkBottom;
   12.40 +	else	
   12.41 +		linkpos=LinkMiddle;
   12.42 +
   12.43 +	calcBBoxSize();
   12.44 +	positionBBox();
   12.45 +	requestReposition();
   12.46 +}
   12.47 +
   12.48 +void OrnamentedObj::setFrameType(const QString &t)
   12.49 +{
   12.50 +	frame->setFrameType(t);
   12.51 +	if (frame->getFrameType() == NoFrame)
   12.52 +		linkpos=LinkBottom;
   12.53 +	else	
   12.54 +		linkpos=LinkMiddle;
   12.55 +
   12.56 +	calcBBoxSize();
   12.57 +	positionBBox();
   12.58 +	requestReposition();
   12.59 +}
   12.60 +
   12.61 +void OrnamentedObj::setFramePenColor(QColor col)
   12.62 +{
   12.63 +	frame->setPenColor (col);
   12.64 +}
   12.65 +
   12.66 +QColor OrnamentedObj::getFramePenColor()
   12.67 +{
   12.68 +	return frame->getPenColor ();
   12.69 +}
   12.70 +
   12.71 +void OrnamentedObj::setFrameBrushColor(QColor col)
   12.72 +{
   12.73 +	frame->setBrushColor (col);
   12.74 +}
   12.75 +
   12.76 +QColor OrnamentedObj::getFrameBrushColor()
   12.77 +{
   12.78 +	return frame->getBrushColor ();
   12.79 +}
   12.80  
   12.81  void OrnamentedObj::positionContents()
   12.82  {
    13.1 --- a/ornamentedobj.h	Sat Mar 31 09:28:27 2007 +0000
    13.2 +++ b/ornamentedobj.h	Sat Mar 31 09:28:27 2007 +0000
    13.3 @@ -1,6 +1,7 @@
    13.4  #ifndef ORNAMENTEDOBJ_H
    13.5  #define ORNAMENTEDOBJ_H
    13.6  
    13.7 +#include "frameobj.h"
    13.8  #include "linkablemapobj.h"
    13.9  
   13.10  class OrnamentedObj:public LinkableMapObj {
   13.11 @@ -16,6 +17,15 @@
   13.12  	virtual void setLinkColor();			// sets color according to colorhint, overloaded
   13.13  	virtual void setColor(QColor);			// set the color of text and link
   13.14  	QColor getColor ();						// get color of heading
   13.15 +
   13.16 +	virtual FrameType getFrameType ();
   13.17 +	virtual void setFrameType (const FrameType &);
   13.18 +	virtual void setFrameType (const QString &);
   13.19 +	virtual void setFramePenColor (QColor);
   13.20 +	virtual QColor getFramePenColor ();
   13.21 +	virtual void setFrameBrushColor (QColor);
   13.22 +	virtual QColor getFrameBrushColor ();
   13.23 +
   13.24      virtual void positionContents();
   13.25      virtual void move   (double,double);
   13.26      virtual void move   (QPointF);
   13.27 @@ -53,6 +63,7 @@
   13.28  	bool isNoteInEditor;			// true if TextEditor has this note
   13.29  	FlagRowObj *systemFlags;		// System Flags
   13.30  	FlagRowObj *standardFlags;		// Standard Flags
   13.31 +	FrameObj *frame;				// frame around object
   13.32  	QRectF ornamentsBBox;			// bbox of flags and heading
   13.33  	QString url;					// url to external doc
   13.34  	QString vymLink;				// path to another map
    14.1 --- a/texteditor.cpp	Sat Mar 31 09:28:27 2007 +0000
    14.2 +++ b/texteditor.cpp	Sat Mar 31 09:28:27 2007 +0000
    14.3 @@ -500,7 +500,7 @@
    14.4  {
    14.5      ce->accept();	// TextEditor can be reopened with show()
    14.6      showwithmain=false;
    14.7 -	emit (textEditorClosed() );
    14.8 +	emit (windowClosed() );
    14.9      return;
   14.10  }
   14.11  
    15.1 --- a/texteditor.h	Sat Mar 31 09:28:27 2007 +0000
    15.2 +++ b/texteditor.h	Sat Mar 31 09:28:27 2007 +0000
    15.3 @@ -44,7 +44,7 @@
    15.4  
    15.5  signals:
    15.6  	void textHasChanged();
    15.7 -	void textEditorClosed();
    15.8 +	void windowClosed();
    15.9  	void fontFamilyHasChanged();
   15.10  	void fontSizeHasChanged();
   15.11  	
    16.1 --- a/version.h	Sat Mar 31 09:28:27 2007 +0000
    16.2 +++ b/version.h	Sat Mar 31 09:28:27 2007 +0000
    16.3 @@ -4,8 +4,8 @@
    16.4  #include <QString>
    16.5  
    16.6  #define __VYM_NAME "VYM"
    16.7 -#define __VYM_VERSION "1.8.69"
    16.8 -#define __VYM_BUILD_DATE "March 21, 2007"
    16.9 +#define __VYM_VERSION "1.8.70"
   16.10 +#define __VYM_BUILD_DATE "March 31, 2007"
   16.11  
   16.12  
   16.13  bool checkVersion(const QString &);