1.7.6 New features for floatimages and fixes
authorinsilmaril
Tue, 03 Jan 2006 09:44:41 +0000
changeset 175728f51b71e71
parent 174 3674e9236634
child 176 f75489896084
1.7.6 New features for floatimages and fixes
lang/vym_de.ts
linkablemapobj.cpp
linkablemapobj.h
main.cpp
mainwindow.cpp
mainwindow.h
mapeditor.cpp
mapeditor.h
mapobj.cpp
mapobj.h
     1.1 --- a/lang/vym_de.ts	Tue Jan 03 09:44:41 2006 +0000
     1.2 +++ b/lang/vym_de.ts	Tue Jan 03 09:44:41 2006 +0000
     1.3 @@ -548,7 +548,7 @@
     1.4      <message>
     1.5          <source>Pick color
     1.6  Hint: You can pick a color from another branch and color using CTRL+Left Button</source>
     1.7 -        <translation>Farb übernehmen
     1.8 +        <translation>Farbe übernehmen
     1.9  Tipp: Zum Kopieren einer Farbe kann man auch CTRL+linke Maustaste nehmen.</translation>
    1.10      </message>
    1.11      <message>
     2.1 --- a/linkablemapobj.cpp	Tue Jan 03 09:44:41 2006 +0000
     2.2 +++ b/linkablemapobj.cpp	Tue Jan 03 09:44:41 2006 +0000
     2.3 @@ -94,6 +94,8 @@
     2.4  
     2.5  	hideLinkUnselected=false;
     2.6  
     2.7 +	topPad=botPad=leftPad=rightPad=0;
     2.8 +
     2.9  	// initialize frame
    2.10  	frame = new FrameObj (canvas);
    2.11  	
    2.12 @@ -133,6 +135,21 @@
    2.13  	return false;
    2.14  }
    2.15  
    2.16 +int LinkableMapObj::getTopPad()
    2.17 +{
    2.18 +	return topPad;
    2.19 +}
    2.20 +
    2.21 +int LinkableMapObj::getLeftPad()
    2.22 +{
    2.23 +	return leftPad;
    2.24 +}
    2.25 +
    2.26 +int LinkableMapObj::getRightPad()
    2.27 +{
    2.28 +	return rightPad;
    2.29 +}
    2.30 +
    2.31  LinkStyle LinkableMapObj::getDefLinkStyle ()
    2.32  {
    2.33  	if (!mapEditor) return StyleUndef;
    2.34 @@ -417,7 +434,7 @@
    2.35      //	orientation
    2.36      //	childPos
    2.37      //	parPos
    2.38 -	//  offset
    2.39 +	//  bottomlineY
    2.40      //	drawing of the link itself
    2.41  
    2.42  
    2.43 @@ -432,10 +449,10 @@
    2.44  	switch (linkpos)
    2.45  	{
    2.46  		case LinkMiddle:
    2.47 -			offset=bbox.height() /2;
    2.48 +			bottomlineY=clickBox.top()+clickBox.height() /2;	// draw link to middle (of frame)
    2.49  			break;
    2.50  		default :
    2.51 -			offset=bbox.height()-1;			// draw link to bottom of bbox
    2.52 +			bottomlineY=clickBox.bottom()-1;	// draw link to bottom of bbox
    2.53  			break;
    2.54  	}
    2.55  	
    2.56 @@ -478,12 +495,12 @@
    2.57  	
    2.58      if (orientation==OrientLeftOfCenter )
    2.59      {
    2.60 -		childPos=QPoint (absPos.x(),absPos.y()+offset);
    2.61 -		parPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset );
    2.62 +		childPos=QPoint (absPos.x(),bottomlineY);
    2.63 +		parPos=QPoint (absPos.x()+ bbox.width(),  bottomlineY );
    2.64      } else
    2.65      {
    2.66 -		childPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset ); 
    2.67 -		parPos=QPoint (absPos.x(),absPos.y()+offset);
    2.68 +		childPos=QPoint (absPos.x()+ bbox.width(), bottomlineY ); 
    2.69 +		parPos=QPoint (absPos.x(),bottomlineY);
    2.70      }
    2.71  
    2.72  	double p1x=parPos.x();	// Link is drawn from P1 to P2
    2.73 @@ -715,9 +732,9 @@
    2.74  
    2.75  void LinkableMapObj::setSelBox()
    2.76  {
    2.77 -    selbox->setX (bbox.x() );
    2.78 -    selbox->setY (bbox.y() );
    2.79 -    selbox->setSize (bbox.width(), bbox.height() );
    2.80 +    selbox->setX (clickBox.x() );
    2.81 +    selbox->setY (clickBox.y() );
    2.82 +    selbox->setSize (clickBox.width(), clickBox.height() );
    2.83  }
    2.84  
    2.85  void LinkableMapObj::select()
    2.86 @@ -767,13 +784,9 @@
    2.87  
    2.88  QString LinkableMapObj::getLinkAttr ()
    2.89  {
    2.90 -	QString hideAttr;
    2.91  	if (hideLinkUnselected)
    2.92 -		// Since this is currently the
    2.93 -		// only attribut and it is switched off by default
    2.94 -		// don't write <link>  at all if it is missing
    2.95 -		return attribut ("hideLinkUnselected","true");
    2.96 +		return attribut ("hideLink","true");
    2.97  	else
    2.98 -		return "";
    2.99 +		return attribut ("hideLink","false");
   2.100  	
   2.101  }
     3.1 --- a/linkablemapobj.h	Tue Jan 03 09:44:41 2006 +0000
     3.2 +++ b/linkablemapobj.h	Tue Jan 03 09:44:41 2006 +0000
     3.3 @@ -34,6 +34,9 @@
     3.4      virtual void setParObjTmp (LinkableMapObj*,QPoint,int);	// Only for moving Obj around
     3.5  	virtual void unsetParObjTmp();						// reuse original ParObj
     3.6  	virtual bool hasParObjTmp();
     3.7 +	virtual int getTopPad();
     3.8 +	virtual int getLeftPad();
     3.9 +	virtual int getRightPad();
    3.10  	LinkStyle getDefLinkStyle();
    3.11      void setLinkStyle(LinkStyle);            
    3.12  	LinkStyle getLinkStyle();
    3.13 @@ -97,7 +100,7 @@
    3.14      LinkableMapObj* childObj;
    3.15      LinkableMapObj* parObj;
    3.16      LinkableMapObj* parObjTmpBuf;	// temporary buffer the original parent
    3.17 -    int offset;                     // vertical offset of dockpos to pos
    3.18 +    int bottomlineY;                // vertical offset of dockpos to pos
    3.19  
    3.20  	int thickness_start;			// for StylePoly*	
    3.21      LinkStyle style;				// Current style
    3.22 @@ -117,5 +120,8 @@
    3.23  	bool hideLinkUnselected;		// to hide links if unselected
    3.24  	QCanvasRectangle* selbox;
    3.25  	FrameObj *frame;				// frame around object
    3.26 +	int topPad, botPad,
    3.27 +		leftPad, rightPad;          // padding within bbox
    3.28 +
    3.29  };
    3.30  #endif
     4.1 --- a/main.cpp	Tue Jan 03 09:44:41 2006 +0000
     4.2 +++ b/main.cpp	Tue Jan 03 09:44:41 2006 +0000
     4.3 @@ -46,6 +46,7 @@
     4.4  QAction *actionEditURL;
     4.5  QAction *actionEditHeading2URL;
     4.6  QAction *actionEditBugzilla2URL;
     4.7 +QAction *actionEditFATE2URL;
     4.8  QAction *actionEditOpenVymLink;
     4.9  QAction *actionEditVymLink;
    4.10  QAction *actionEditDeleteVymLink;
    4.11 @@ -84,6 +85,8 @@
    4.12  QAction *actionFormatFrameRectangle;
    4.13  
    4.14  QActionGroup *actionGroupFormatLinkStyles;
    4.15 +QAction *actionFormatIncludeImagesVer;
    4.16 +QAction *actionFormatIncludeImagesHor;
    4.17  QAction *actionFormatHideLinkUnselected;
    4.18  QAction *actionFormatLinkStyleLine;
    4.19  QAction *actionFormatLinkStyleParabel;
     5.1 --- a/mainwindow.cpp	Tue Jan 03 09:44:41 2006 +0000
     5.2 +++ b/mainwindow.cpp	Tue Jan 03 09:44:41 2006 +0000
     5.3 @@ -12,13 +12,14 @@
     5.4  #include <qcolordialog.h>
     5.5  #include <qbitmap.h>
     5.6  #include <qinputdialog.h>
     5.7 -#include <qdatetime.h>			// for random seed
     5.8 +//#include <qdatetime.h>			// for random seed
     5.9  
    5.10  
    5.11  #include <iostream>
    5.12  #include <cstdlib>
    5.13  #include <typeinfo>
    5.14  
    5.15 +#include "file.h"
    5.16  #include "misc.h"
    5.17  #include "version.h"
    5.18  #include "aboutdialog.h"
    5.19 @@ -104,6 +105,7 @@
    5.20  extern QAction* actionEditURL;
    5.21  extern QAction* actionEditHeading2URL;
    5.22  extern QAction* actionEditBugzilla2URL;
    5.23 +extern QAction* actionEditFATE2URL;
    5.24  extern QAction *actionEditOpenVymLink;
    5.25  extern QAction *actionEditVymLink;
    5.26  extern QAction *actionEditDeleteVymLink;
    5.27 @@ -131,6 +133,8 @@
    5.28  extern QAction* actionFormatLinkColorHint;
    5.29  extern QAction* actionFormatBackColor;
    5.30  extern QAction* actionFormatLinkColor;
    5.31 +extern QAction *actionFormatIncludeImagesVer;
    5.32 +extern QAction *actionFormatIncludeImagesHor;
    5.33  
    5.34  extern QActionGroup* actionGroupModModes;
    5.35  extern QAction* actionModModeColor;
    5.36 @@ -519,6 +523,11 @@
    5.37  	actionListBranches.append(a);
    5.38  	actionEditBugzilla2URL=a;
    5.39      
    5.40 +	a = new QAction( tr( "Create URL to FATE" ), QPixmap(), tr( "Create URL to FATE" ), 0, this, "FATE2url" );
    5.41 +    connect( a, SIGNAL( activated() ), this, SLOT( editFATE2URL() ) );
    5.42 +	a->setEnabled (false);
    5.43 +	actionListBranches.append(a);
    5.44 +	actionEditFATE2URL=a;
    5.45  	
    5.46      a = new QAction( tr( "Jump to another vym map, if needed load it first" ), QPixmap(flag_vymlink_xpm), tr( "Jump to map" ), 0, this, "jumpMap" );
    5.47      connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) );
    5.48 @@ -572,6 +581,7 @@
    5.49  	a->setEnabled (false);
    5.50  	actionListBranches.append(a);
    5.51  	#if defined (Q_OS_MACX)
    5.52 +		// In OSX show different shortcut in menues, the keys work independtly always			
    5.53  		actionEditAddBranch=alt;
    5.54  	#else	
    5.55  		actionEditAddBranch=a;
    5.56 @@ -583,6 +593,9 @@
    5.57  	a->setEnabled (false);
    5.58  	actionListBranches.append(a);
    5.59  	actionEditAddBranchHere=a;
    5.60 +	a = new QAction( tr( "Add a branch by inserting and making selection its child" ),tr( "Add branch (insert)" ), ALT + Key_A, this, "newBranchHere" );
    5.61 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchHere() ) );
    5.62 +	actionListBranches.append(a);
    5.63  
    5.64  	// Add branch above
    5.65      a = new QAction( tr( "Add a branch above selection" ),tr( "Add branch above" ), SHIFT+Key_Insert, this, "newBranch" );
    5.66 @@ -590,6 +603,9 @@
    5.67  	a->setEnabled (false);
    5.68  	actionListBranches.append(a);
    5.69  	actionEditAddBranchAbove=a;
    5.70 +    a = new QAction( tr( "Add a branch above selection" ),tr( "Add branch above" ), SHIFT+Key_A, this, "newBranch" );
    5.71 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchAbove() ) );
    5.72 +	actionListBranches.append(a);
    5.73  
    5.74  	// Add branch below 
    5.75      a = new QAction( tr( "Add a branch below selection" ),tr( "Add branch below" ), CTRL +Key_Insert, this, "newBranch" );
    5.76 @@ -597,6 +613,9 @@
    5.77  	a->setEnabled (false);
    5.78  	actionListBranches.append(a);
    5.79  	actionEditAddBranchBelow=a;
    5.80 +    a = new QAction( tr( "Add a branch below selection" ),tr( "Add branch below" ), CTRL +Key_A, this, "newBranch" );
    5.81 +    connect( a, SIGNAL( activated() ), this, SLOT( editNewBranchBelow() ) );
    5.82 +	actionListBranches.append(a);
    5.83  
    5.84  	// Import at selection (adding to selection)
    5.85      a = new QAction( tr( "Add map at selection" ),tr( "Import (add)" ), 0, this, "importAdd" );
    5.86 @@ -729,6 +748,16 @@
    5.87      connect( a, SIGNAL( activated() ), this, SLOT( formatFrameRectangle() ) );
    5.88  	actionFormatFrameRectangle=a;
    5.89  
    5.90 +    a = new QAction( tr ("Include top and bottom position of images into branch"), tr( "Include images vertically" ), 0, actionFormatIncludeImagesVer, "includeImagesVer" );
    5.91 +	a->setToggleAction(true);
    5.92 +    connect( a, SIGNAL( activated() ), this, SLOT( formatIncludeImagesVer() ) );
    5.93 +	actionFormatIncludeImagesVer=a;
    5.94 +
    5.95 +    a = new QAction( tr ("Include left and right position of images into branch"), tr( "Include images horizontally" ), 0, actionFormatIncludeImagesHor, "includeImagesHor" );
    5.96 +	a->setToggleAction(true);
    5.97 +    connect( a, SIGNAL( activated() ), this, SLOT( formatIncludeImagesHor() ) );
    5.98 +	actionFormatIncludeImagesHor=a;
    5.99 +
   5.100      a = new QAction( tr( "Hide link" ),tr( "Hide link if object is not selected" ), 0, actionFormatHideLinkUnselected, "hideLinkUnselected" );
   5.101  	a->setToggleAction(true);
   5.102      connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) );
   5.103 @@ -1012,7 +1041,7 @@
   5.104      menuBar()->insertItem( tr( "&Test" ), menu );
   5.105  
   5.106      QAction *a;
   5.107 -    a = new QAction( tr( "Test Flag" ), QPixmap(), tr( "test flag" ), 0, this, "flag" );
   5.108 +    a = new QAction( tr( "Call test function" ), QPixmap(), tr( "test flag" ), 0, this, "flag" );
   5.109      connect( a, SIGNAL( activated() ), this, SLOT( testFunction() ) );
   5.110      a->addTo( menu );
   5.111  }
   5.112 @@ -1075,8 +1104,10 @@
   5.113  	actionEditURL->addTo ( branchContextMenu );
   5.114  	actionEditHeading2URL->addTo ( branchContextMenu );
   5.115      if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
   5.116 +	{
   5.117  		actionEditBugzilla2URL->addTo( branchContextMenu );
   5.118 -		
   5.119 +		actionEditFATE2URL->addTo( branchContextMenu );
   5.120 +	}	
   5.121  	branchContextMenu->insertSeparator();	
   5.122  	actionEditOpenVymLink->addTo ( branchContextMenu );
   5.123  	actionEditVymLink->addTo ( branchContextMenu );
   5.124 @@ -1086,6 +1117,8 @@
   5.125  	actionGroupFormatFrameTypes->addTo( branchContextMenu );
   5.126  
   5.127  	branchContextMenu->insertSeparator();	
   5.128 +	actionFormatIncludeImagesVer->addTo( branchContextMenu );
   5.129 +	actionFormatIncludeImagesHor->addTo( branchContextMenu );
   5.130  	actionFormatHideLinkUnselected->addTo( branchContextMenu );
   5.131  
   5.132  	// Context Menu for links in a branch menu
   5.133 @@ -1522,7 +1555,7 @@
   5.134  			me->setFilePath (fn_org);
   5.135  			
   5.136  		// Delete tmpDir
   5.137 -		system ( "rm -rf "+tmpMapDir);
   5.138 +		removeDir (QDir(tmpMapDir));
   5.139  
   5.140  		// Check for errors
   5.141  		if (err==success) 
   5.142 @@ -1662,42 +1695,7 @@
   5.143  				me->save (savemode);
   5.144  				me->setFilePath (safeFilePath);
   5.145  				
   5.146 -				// zip the temporary directory
   5.147 -				Process *zipProc=new Process ();
   5.148 -				zipProc->clearArguments();
   5.149 -				zipProc->setWorkingDirectory (QDir(tmpMapDir));
   5.150 -				zipProc->addArgument ("zip");
   5.151 -				zipProc->addArgument ("-r");
   5.152 -				zipProc->addArgument (fn);
   5.153 -				zipProc->addArgument (".");
   5.154 -
   5.155 -				if (!zipProc->start() )
   5.156 -				{	
   5.157 -					// zip could not be started
   5.158 -					QMessageBox::critical( 0, tr( "Critical Save Error" ),
   5.159 -								   tr("Couldn't start zip to compress data."));
   5.160 -					err=aborted;
   5.161 -				} else
   5.162 -				{
   5.163 -					// zip could be started
   5.164 -					zipProc->waitFinished();
   5.165 -					if (!zipProc->normalExit() )
   5.166 -					{
   5.167 -						QMessageBox::critical( 0, tr( "Critical Save Error" ),
   5.168 -									   tr("zip didn't exit normally")+
   5.169 -									   "\n" + zipProc->getErrout());
   5.170 -						err=aborted;
   5.171 -					} else
   5.172 -					{
   5.173 -						if (zipProc->exitStatus()>0)
   5.174 -						{
   5.175 -							QMessageBox::critical( 0, tr( "Critical Save Error" ),
   5.176 -									   QString("zip exit code:  %1").arg(zipProc->exitStatus() )+
   5.177 -									   "\n" + zipProc->getErrout() );
   5.178 -							err=aborted;
   5.179 -						}
   5.180 -					}
   5.181 -				}	// zip could be started
   5.182 +				zipDir (tmpMapDir,fn);
   5.183  			} // save zipped
   5.184  			else
   5.185  			{
   5.186 @@ -1720,7 +1718,7 @@
   5.187  	if (me->saveZipped())
   5.188  	{
   5.189  		// Delete tmpDir
   5.190 -		system ( "rm -rf "+ tmpMapDir );
   5.191 +		removeDir (QDir(tmpMapDir));
   5.192  	} 
   5.193  
   5.194  	if (err==success)
   5.195 @@ -2085,6 +2083,12 @@
   5.196  	    currentMapEditor()->editBugzilla2URL();
   5.197  }
   5.198  
   5.199 +void Main::editFATE2URL()
   5.200 +{
   5.201 +	if (currentMapEditor())
   5.202 +	    currentMapEditor()->editFATE2URL();
   5.203 +}
   5.204 +
   5.205  void Main::editOpenVymLink()
   5.206  {
   5.207  	// Get current path to map
   5.208 @@ -2386,6 +2390,18 @@
   5.209  		currentMapEditor()->setFrame(Rectangle);
   5.210  }
   5.211  
   5.212 +void Main::formatIncludeImagesVer()
   5.213 +{
   5.214 +	if (currentMapEditor())
   5.215 +		currentMapEditor()->setIncludeImagesVer(actionFormatIncludeImagesVer->isOn());
   5.216 +}
   5.217 +
   5.218 +void Main::formatIncludeImagesHor()
   5.219 +{
   5.220 +	if (currentMapEditor())
   5.221 +		currentMapEditor()->setIncludeImagesHor(actionFormatIncludeImagesHor->isOn());
   5.222 +}
   5.223 +
   5.224  void Main::formatHideLinkUnselected()
   5.225  {
   5.226  	if (currentMapEditor())
   5.227 @@ -2533,11 +2549,16 @@
   5.228  			docpath="doc/tex/vym.pdf";
   5.229  			if (!QFile (docpath).exists() )
   5.230  			{
   5.231 -				QMessageBox::critical(0, 
   5.232 -				tr("Critcal error"),
   5.233 -				tr("Couldn't find the documentation\n"
   5.234 -				"vym.pdf in various places."));
   5.235 -				return;
   5.236 +				// Try yet another one for Knoppix
   5.237 +				docpath="/usr/share/doc/packages/vym/vym.pdf";
   5.238 +				if (!QFile (docpath).exists() )
   5.239 +				{
   5.240 +					QMessageBox::critical(0, 
   5.241 +					tr("Critcal error"),
   5.242 +					tr("Couldn't find the documentation\n"
   5.243 +					"vym.pdf in various places."));
   5.244 +					return;
   5.245 +				}	
   5.246  			}	
   5.247  		}
   5.248  	}
     6.1 --- a/mainwindow.h	Tue Jan 03 09:44:41 2006 +0000
     6.2 +++ b/mainwindow.h	Tue Jan 03 09:44:41 2006 +0000
     6.3 @@ -12,10 +12,11 @@
     6.4  #include <qtabwidget.h>
     6.5  #include <qmap.h>
     6.6  
     6.7 +#include "file.h"
     6.8 +#include "findwindow.h"
     6.9 +#include "mapeditor.h"
    6.10 +#include "texteditor.h"
    6.11  #include "xml.h"
    6.12 -#include "texteditor.h"
    6.13 -#include "mapeditor.h"
    6.14 -#include "findwindow.h"
    6.15  
    6.16  class Main : public QMainWindow 
    6.17  {
    6.18 @@ -90,6 +91,7 @@
    6.19  	void editURL();
    6.20  	void editHeading2URL();
    6.21  	void editBugzilla2URL();
    6.22 +	void editFATE2URL();
    6.23  	void editVymLink();
    6.24  public slots:
    6.25  	void editOpenVymLink();
    6.26 @@ -137,6 +139,8 @@
    6.27      void formatToggleLinkColorHint();
    6.28  	void formatFrameNone();
    6.29  	void formatFrameRectangle();
    6.30 +	void formatIncludeImagesVer();
    6.31 +	void formatIncludeImagesHor();
    6.32  	void formatHideLinkUnselected();
    6.33  
    6.34      void viewZoomReset();
     7.1 --- a/mapeditor.cpp	Tue Jan 03 09:44:41 2006 +0000
     7.2 +++ b/mapeditor.cpp	Tue Jan 03 09:44:41 2006 +0000
     7.3 @@ -27,15 +27,15 @@
     7.4  #include "version.h"
     7.5  
     7.6  #include "api.h"
     7.7 +#include "editxlinkdialog.h"
     7.8 +#include "exports.h"
     7.9 +#include "extrainfodialog.h"
    7.10 +#include "linkablemapobj.h"
    7.11 +#include "mainwindow.h"
    7.12 +#include "misc.h"
    7.13 +#include "settings.h"
    7.14 +#include "texteditor.h"
    7.15  #include "xml.h"
    7.16 -#include "texteditor.h"
    7.17 -#include "linkablemapobj.h"
    7.18 -#include "exports.h"
    7.19 -#include "misc.h"
    7.20 -#include "mainwindow.h"
    7.21 -#include "extrainfodialog.h"
    7.22 -#include "editxlinkdialog.h"
    7.23 -#include "settings.h"
    7.24  
    7.25  
    7.26  extern TextEditor *textEditor;
    7.27 @@ -61,6 +61,7 @@
    7.28  extern QAction *actionEditURL;
    7.29  extern QAction *actionEditHeading2URL;
    7.30  extern QAction *actionEditBugzilla2URL;
    7.31 +extern QAction *actionEditFATE2URL;
    7.32  extern QAction *actionEditOpenVymLink;
    7.33  extern QAction *actionEditVymLink;
    7.34  extern QAction *actionEditDeleteVymLink;
    7.35 @@ -96,6 +97,8 @@
    7.36  extern QAction *actionFormatFrameRectangle;
    7.37  
    7.38  extern QActionGroup *actionGroupFormatLinkStyles;
    7.39 +extern QAction *actionFormatIncludeImagesVer;
    7.40 +extern QAction *actionFormatIncludeImagesHor;
    7.41  extern QAction *actionFormatHideLinkUnselected;
    7.42  extern QAction *actionFormatLinkStyleLine;
    7.43  extern QAction *actionFormatLinkStyleParabel;
    7.44 @@ -147,7 +150,7 @@
    7.45      mapCenter->setVisibility (true);
    7.46  	mapCenter->setMapEditor (this);
    7.47  	mapCenter->setHeading (tr("New Map","Heading of mapcenter in new map"));
    7.48 -	mapCenter->move(mapCanvas->width()/2-mapCenter->width()/2,mapCanvas->height()/2-mapCenter->width()/2);
    7.49 +	mapCenter->move(mapCanvas->width()/2-mapCenter->width()/2,mapCanvas->height()/2-mapCenter->height()/2);
    7.50  
    7.51      printer=NULL;
    7.52  
    7.53 @@ -312,7 +315,6 @@
    7.54  		mapCanvas->resize (cw,ch);
    7.55  		if ( (dx!=0) || (dy!=0) ) 
    7.56  		{
    7.57 -			cout << "ME:: canvas="<<cw<<","<<ch<<endl;
    7.58  			mapCenter->moveAllBy(dx,dy);
    7.59  			mapCenter->reposition();
    7.60  
    7.61 @@ -1060,7 +1062,7 @@
    7.62  void MapEditor::exportASCII()
    7.63  {
    7.64  	// TODO still experimental
    7.65 -	Export ex;
    7.66 +	ExportBase ex;
    7.67  	ex.setMapCenter(mapCenter);
    7.68  
    7.69  	QFileDialog *fd=new QFileDialog( this, tr("VYM - Export (ASCII)"));
    7.70 @@ -1082,7 +1084,7 @@
    7.71  
    7.72  			mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
    7.73  			mb.setButtonText( QMessageBox::No, tr("Cancel"));
    7.74 -			Export ex;
    7.75 +			ExportBase ex;
    7.76  			switch( mb.exec() ) 
    7.77  			{
    7.78  				case QMessageBox::Yes:
    7.79 @@ -1095,7 +1097,7 @@
    7.80  			}
    7.81  		}
    7.82  		ex.setPath (fd->selectedFile() );
    7.83 -		ex.exportMap();
    7.84 +		ex.exportXML();
    7.85  	}
    7.86  }
    7.87  
    7.88 @@ -1122,7 +1124,7 @@
    7.89  
    7.90  			mb.setButtonText( QMessageBox::Yes, tr("Overwrite") );
    7.91  			mb.setButtonText( QMessageBox::No, tr("Cancel"));
    7.92 -			Export ex;
    7.93 +			ExportLaTeX ex;
    7.94  			switch( mb.exec() ) 
    7.95  			{
    7.96  				case QMessageBox::Yes:
    7.97 @@ -1134,7 +1136,7 @@
    7.98  					break;
    7.99  			}
   7.100  		}
   7.101 -		Export ex;
   7.102 +		ExportLaTeX ex;
   7.103  		ex.setPath (fd->selectedFile() );
   7.104  		ex.setMapCenter(mapCenter);
   7.105  		ex.exportLaTeX();
   7.106 @@ -1178,10 +1180,10 @@
   7.107  			}
   7.108  		}
   7.109  		*/
   7.110 -		Export ex;
   7.111 +		ExportOO ex;
   7.112  		//ex.setPath (fd->selectedFile() );
   7.113  		ex.setMapCenter(mapCenter);
   7.114 -		ex.exportOOPresentation();
   7.115 +		ex.exportPresentation();
   7.116  //	}
   7.117  }
   7.118  
   7.119 @@ -2357,6 +2359,19 @@
   7.120  	}
   7.121  }	
   7.122  
   7.123 +void MapEditor::editFATE2URL()
   7.124 +{
   7.125 +	if (selection && (typeid(*selection) == typeid(BranchObj) ||
   7.126 +			typeid(*selection) == typeid(MapCenterObj)) )
   7.127 +	{		
   7.128 +		BranchObj *bo=(BranchObj*)selection;
   7.129 +		QString url= "http://keeper.suse.de:8080/webfate/match/id?value=ID"+bo->getHeading();
   7.130 +		saveState("setURL (\""+bo->getURL()+"\")","setURL (\""+url+"\")");	
   7.131 +		bo->setURL (url);
   7.132 +		updateActions();
   7.133 +	}
   7.134 +}	
   7.135 +
   7.136  void MapEditor::editVymLink()
   7.137  {
   7.138  	if (selection && (typeid(*selection) == typeid(BranchObj) ||
   7.139 @@ -2588,8 +2603,12 @@
   7.140  				default:
   7.141  					break;
   7.142  			}	
   7.143 +			actionFormatIncludeImagesVer->setOn
   7.144 +				( ((BranchObj*)selection)->getIncludeImagesVer());
   7.145 +			actionFormatIncludeImagesHor->setOn
   7.146 +				( ((BranchObj*)selection)->getIncludeImagesHor());
   7.147  			actionFormatHideLinkUnselected->setOn
   7.148 -				( selection->getHideLinkUnselected());
   7.149 +				(selection->getHideLinkUnselected());
   7.150  		}
   7.151  		if ( (typeid(*selection) == typeid(FloatImageObj)) )
   7.152  		{
   7.153 @@ -2876,6 +2895,24 @@
   7.154  	}
   7.155  }
   7.156  
   7.157 +void MapEditor::setIncludeImagesVer(bool b)
   7.158 +{
   7.159 +	if (selection && 
   7.160 +		(typeid(*selection) == typeid(BranchObj)) || 
   7.161 +		(typeid(*selection) == typeid(MapCenterObj))  )
   7.162 +		((BranchObj*)selection)->setIncludeImagesVer(b);
   7.163 +		mapCenter->reposition();
   7.164 +}
   7.165 +
   7.166 +void MapEditor::setIncludeImagesHor(bool b)
   7.167 +{
   7.168 +	if (selection && 
   7.169 +		(typeid(*selection) == typeid(BranchObj)) || 
   7.170 +		(typeid(*selection) == typeid(MapCenterObj))  )
   7.171 +		((BranchObj*)selection)->setIncludeImagesHor(b);
   7.172 +		mapCenter->reposition();
   7.173 +}
   7.174 +
   7.175  void MapEditor::setHideLinkUnselected (bool b)
   7.176  {
   7.177  	if (selection && 
   7.178 @@ -3009,7 +3046,7 @@
   7.179  void MapEditor::testFunction()
   7.180  {
   7.181  	cout << "MapEditor::testFunction() called\n";
   7.182 -	load (clipboardDir+"/part.xml",ImportAdd);
   7.183 +	mapCenter->move(mapCenter->x(),mapCenter->y());
   7.184  }
   7.185  
   7.186  void MapEditor::ensureSelectionVisible()
   7.187 @@ -3234,11 +3271,6 @@
   7.188  		{
   7.189  			FloatObj *fo=(FloatObj*)selection;
   7.190  			saveState("move "+qpointToString(movingObj_orgPos),fo->getSelectString() );
   7.191 -			if (fo->getLinkStyle()==StyleUndef) 
   7.192 -			{
   7.193 -				fo->setLinkStyle(fo->getDefLinkStyle());
   7.194 -				fo->setLinkColor(fo->getParObj()->getLinkColor());
   7.195 -			}	
   7.196  			fo->move   (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );		
   7.197  			fo->setRelPos();
   7.198  			fo->reposition();
   7.199 @@ -3264,11 +3296,7 @@
   7.200  					selection=(LinkableMapObj*)(fio);
   7.201  					selection->select();
   7.202  					movingObj=(MapObj*)(fio);
   7.203 -					// setLinkStyle calls updateLink, only set it once
   7.204 -					if (fio->getLinkStyle()!=fio->getDefLinkStyle() ) 
   7.205 -						fio->setLinkStyle (fio->getDefLinkStyle());
   7.206  				}	
   7.207 -				// TODO if (typeid(*selection) == typeid(FloatTextObj))
   7.208  			}
   7.209  		} else	// selection != a FloatObj
   7.210  		{
   7.211 @@ -3291,9 +3319,9 @@
   7.212  					if (lmosel->getOrientation() == OrientLeftOfCenter)
   7.213  						// Add width of bbox here, otherwise alignRelTo will cause jumping around
   7.214  						lmosel->move(p.x() -movingObj_start.x()+lmosel->getBBox().width(), 
   7.215 -							p.y()-movingObj_start.y() );		
   7.216 +							p.y()-movingObj_start.y() +lmosel->getTopPad() );		
   7.217  					else	
   7.218 -						lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() );
   7.219 +						lmosel->move(p.x() -movingObj_start.x(), p.y()-movingObj_start.y() -lmosel->getTopPad());
   7.220  				} 
   7.221  				// reposition subbranch
   7.222  				lmosel->reposition();	
   7.223 @@ -3316,7 +3344,7 @@
   7.224  				} else	
   7.225  				{
   7.226  					lmosel->unsetParObjTmp();
   7.227 -					/*
   7.228 +					/* FIXME not needed anymore?
   7.229  					if (lmo &&(lmo==selection))   
   7.230  						// Could link to myself (happens sometimes...)
   7.231  						lmosel->unsetParObjTmp();
   7.232 @@ -3403,6 +3431,13 @@
   7.233      // Have we been moving something?
   7.234      if ( selection && movingObj ) 
   7.235      {	
   7.236 +		// Moved FloatObj? Maybe we need to reposition
   7.237 +		if(typeid(*selection)==typeid (FloatImageObj))
   7.238 +		{
   7.239 +			selection->getParObj()->requestReposition();
   7.240 +			mapCenter->reposition();
   7.241 +		}	
   7.242 +
   7.243  		// Check if we are over another branch, but ignore 
   7.244  		// any found LMOs, which are FloatObjs
   7.245  		dst=mapCenter->findMapObj(inverseWorldMatrix().map(e->pos() ), 
     8.1 --- a/mapeditor.h	Tue Jan 03 09:44:41 2006 +0000
     8.2 +++ b/mapeditor.h	Tue Jan 03 09:44:41 2006 +0000
     8.3 @@ -10,6 +10,7 @@
     8.4  #include <qbuffer.h>
     8.5  
     8.6  #include "mapcenterobj.h"
     8.7 +#include "file.h"
     8.8  #include "misc.h"
     8.9  
    8.10  class QNetworkOperation;
    8.11 @@ -125,6 +126,7 @@
    8.12  	void editURL();							// edit the URL
    8.13  	void editHeading2URL();					// copy heading to URL
    8.14  	void editBugzilla2URL();				// create URL to Bugzilla
    8.15 +	void editFATE2URL();					// create URL to FATE
    8.16  	void editVymLink();						// edit link to another map
    8.17  	void deleteVymLink();					// delete link to another map
    8.18  	QString getVymLink();					// return path to map
    8.19 @@ -152,6 +154,8 @@
    8.20  	void saveFloatImage (int);
    8.21  	void toggleFloatExport();
    8.22  	void setFrame(const FrameType &);
    8.23 +	void setIncludeImagesVer(bool);
    8.24 +	void setIncludeImagesHor(bool);
    8.25  	void setHideLinkUnselected (bool);
    8.26  	bool getHideLinkUnselected ();
    8.27  private:	
     9.1 --- a/mapobj.cpp	Tue Jan 03 09:44:41 2006 +0000
     9.2 +++ b/mapobj.cpp	Tue Jan 03 09:44:41 2006 +0000
     9.3 @@ -82,17 +82,22 @@
     9.4      absPos.setX( xi);
     9.5      absPos.setY( yi);
     9.6      bbox.moveTopLeft(QPoint(xi,yi));
     9.7 +    clickBox.moveTopLeft(QPoint(xi,yi));
     9.8  }
     9.9  
    9.10  void MapObj::moveBy (double x, double y) 
    9.11  {
    9.12 +	int ix=(int)x;
    9.13 +	int iy=(int)y;
    9.14      move (x+absPos.x(),y+absPos.y() );
    9.15 +	bbox.moveBy (ix,iy);
    9.16 +	clickBox.moveBy (ix,iy);
    9.17  }
    9.18  
    9.19 -bool MapObj::inBBox(QPoint p)
    9.20 +bool MapObj::inBox(const QPoint &p)
    9.21  {
    9.22 -    if (p.x() >= bbox.left() && p.x() <= bbox.right()  
    9.23 -	&& p.y() <= bbox.bottom() && p.y() >= bbox.top() )
    9.24 +    if (p.x() >= clickBox.left() && p.x() <= clickBox.right()  
    9.25 +	&& p.y() <= clickBox.bottom() && p.y() >= clickBox.top() )
    9.26  		return true;
    9.27      return false;	
    9.28  }
    9.29 @@ -103,7 +108,9 @@
    9.30  }
    9.31  
    9.32  QRect MapObj::addBBox(QRect r1, QRect r2)
    9.33 -{
    9.34 +{	
    9.35 +	// Find smallest QRect containing given rectangles
    9.36 +
    9.37  	QRect n;
    9.38  	// Set left border
    9.39  	if (r1.left() <= r2.left() )
    10.1 --- a/mapobj.h	Tue Jan 03 09:44:41 2006 +0000
    10.2 +++ b/mapobj.h	Tue Jan 03 09:44:41 2006 +0000
    10.3 @@ -32,17 +32,18 @@
    10.4  	virtual QString getPos();					// Return position as string (x,y)
    10.5      virtual void move (double x,double y);      // move to absolute Position
    10.6      virtual void moveBy (double x,double y);    // move to relative Position
    10.7 -    virtual bool inBBox(QPoint);				// Check if Point is in bbox
    10.8 +    virtual bool inBox(const QPoint&);			// Check if Point is within clickbox
    10.9      virtual QRect getBBox();					// returns bounding box
   10.10      virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
   10.11      virtual QSize getSize();					// returns size of bounding box
   10.12      virtual bool isVisibleObj();
   10.13      virtual void setVisibility(bool);
   10.14 +    virtual void positionBBox()=0;       
   10.15 +	virtual void calcBBoxSize()=0;
   10.16  protected:  
   10.17      QCanvas* canvas;
   10.18      QRect bbox;									// bounding box of MO itself
   10.19 -    virtual void positionBBox()=0;       
   10.20 -	virtual void calcBBoxSize()=0;
   10.21 +	QRect clickBox;								// area where mouseclicks are found
   10.22      QPoint absPos;							    // Position on canvas
   10.23      bool visible;
   10.24  };