floatimageobj.cpp
changeset 173 309609406650
parent 166 325958acb69b
child 218 160459d924a1
     1.1 --- a/floatimageobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     1.2 +++ b/floatimageobj.cpp	Tue Jan 03 09:44:41 2006 +0000
     1.3 @@ -6,7 +6,7 @@
     1.4  // FloatImageObj
     1.5  /////////////////////////////////////////////////////////////////
     1.6  
     1.7 -int FloatImageObj::counter=0;		// make instance 
     1.8 +uint FloatImageObj::saveCounter=0;		// make instance 
     1.9  
    1.10  
    1.11  FloatImageObj::FloatImageObj ():FloatObj()
    1.12 @@ -43,6 +43,7 @@
    1.13  	icon->move (absPos.x(), absPos.y() );
    1.14  	icon->setVisibility (true);
    1.15  	bbox.setSize (QSize(icon->size().width(), icon->size().height()));
    1.16 +	clickBox.setSize (QSize(icon->size().width(), icon->size().height()));
    1.17  	filename="";
    1.18  	originalFilename="no original name available";
    1.19  	filetype="";
    1.20 @@ -53,7 +54,9 @@
    1.21  {					
    1.22  	FloatObj::copy (other);
    1.23  	icon->copy (other->icon);
    1.24 +	filetype=other->filetype;
    1.25  	filename=other->filename;
    1.26 +	originalFilename=other->originalFilename;
    1.27  	saveInMap=other->saveInMap;
    1.28      positionBBox();
    1.29  }
    1.30 @@ -73,6 +76,7 @@
    1.31  {
    1.32    icon->load(pixmap);
    1.33    bbox.setSize (QSize(icon->size().width()+8, icon->size().height()+8));
    1.34 +  clickBox.setSize (QSize(icon->size().width()+8, icon->size().height()+8));
    1.35    positionBBox();
    1.36    filetype="PNG";
    1.37    filename="noname.png";
    1.38 @@ -130,7 +134,7 @@
    1.39  
    1.40  void FloatImageObj::positionBBox()
    1.41  {
    1.42 -	// TODO
    1.43 +	clickBox=bbox;
    1.44  }
    1.45  
    1.46  void FloatImageObj::calcBBoxSize()
    1.47 @@ -140,12 +144,14 @@
    1.48  
    1.49  QString FloatImageObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint &p)
    1.50  {
    1.51 -	counter++;
    1.52 +	saveCounter++;
    1.53  
    1.54  	QString posAttr=
    1.55  		attribut("relPosX",QString().setNum(relPos.x(),10)) +
    1.56  		attribut("relPosY",QString().setNum(relPos.y(),10)); 
    1.57  
    1.58 +	QString linkAttr=getLinkAttr();
    1.59 +	
    1.60  	QString useOrientAttr;
    1.61  	if (useOrientation)
    1.62  		useOrientAttr=attribut ("useOrientation","true");
    1.63 @@ -172,13 +178,14 @@
    1.64  	if (filetype=="GIF")
    1.65  		filetype="PNG";
    1.66  		
    1.67 -	url="images/"+prefix+"image-" + QString().number(counter,10) + "." +filetype;
    1.68 +	url="images/"+prefix+"image-" + QString().number(saveCounter,10) + "." +filetype;
    1.69  
    1.70  	// And really save the image
    1.71  	icon->save (tmpdir + "/" + url, filetype);
    1.72  
    1.73      return singleElement ("floatimage",  
    1.74  		posAttr + 
    1.75 +		linkAttr +
    1.76  		useOrientAttr + 
    1.77  		saveInMapAttr + 
    1.78  		exportAttr + 
    1.79 @@ -189,7 +196,7 @@
    1.80  
    1.81  void FloatImageObj::resetSaveCounter()
    1.82  {
    1.83 -	counter=0;
    1.84 +	saveCounter=0;
    1.85  }
    1.86  
    1.87