mapobj.h
branchqt4-port
changeset 14 f4c37956d28d
parent 0 7a96bd401351
     1.1 --- a/mapobj.h	Sun Jan 30 12:58:47 2005 +0000
     1.2 +++ b/mapobj.h	Tue Aug 15 11:43:21 2006 +0000
     1.3 @@ -1,46 +1,51 @@
     1.4  #ifndef MAPOBJ_H
     1.5  #define MAPOBJ_H
     1.6  
     1.7 -#include <qcanvas.h>
     1.8 +#include <q3canvas.h>
     1.9  #include <iostream>
    1.10  
    1.11  #include "misc.h"
    1.12  
    1.13  using namespace std;
    1.14  
    1.15 -#define Z_BBOX     0
    1.16 -#define Z_LINK    20
    1.17 -#define Z_FRAME   50
    1.18 -#define Z_SELBOX  60
    1.19 -#define Z_ICON    80
    1.20 -#define Z_TEXT   100
    1.21 +#define Z_BBOX      0
    1.22 +#define Z_XLINK    10
    1.23 +#define Z_LINK     20
    1.24 +#define Z_FRAME    50
    1.25 +#define Z_SELBOX   60
    1.26 +#define Z_FLOATIMG 65
    1.27 +#define Z_ICON     80
    1.28 +#define Z_TEXT    100
    1.29  
    1.30  class MapObj:public xmlObj {
    1.31  public:
    1.32      MapObj ();
    1.33 -    MapObj (QCanvas*);
    1.34 +    MapObj (Q3Canvas*);
    1.35      MapObj (MapObj*);
    1.36      virtual ~MapObj ();
    1.37      virtual void init ();
    1.38      virtual void copy (MapObj*);
    1.39 -	virtual QCanvas* getCanvas();
    1.40 +	virtual Q3Canvas* getCanvas();
    1.41      virtual int x();
    1.42      virtual int y();
    1.43  	virtual int width();
    1.44  	virtual int height();
    1.45 +	virtual QPoint getAbsPos();
    1.46 +	virtual QString getPos();					// Return position as string (x,y)
    1.47      virtual void move (double x,double y);      // move to absolute Position
    1.48      virtual void moveBy (double x,double y);    // move to relative Position
    1.49 -    virtual bool inBBox(QPoint);				// Check if Point is in bbox
    1.50 +    virtual bool inBox(const QPoint&);			// Check if Point is within clickbox
    1.51      virtual QRect getBBox();					// returns bounding box
    1.52      virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
    1.53      virtual QSize getSize();					// returns size of bounding box
    1.54      virtual bool isVisibleObj();
    1.55      virtual void setVisibility(bool);
    1.56 -protected:  
    1.57 -    QCanvas* canvas;
    1.58 -    QRect bbox;									// bounding box of MO itself
    1.59      virtual void positionBBox()=0;       
    1.60  	virtual void calcBBoxSize()=0;
    1.61 +protected:  
    1.62 +    Q3Canvas* canvas;
    1.63 +    QRect bbox;									// bounding box of MO itself
    1.64 +	QRect clickBox;								// area where mouseclicks are found
    1.65      QPoint absPos;							    // Position on canvas
    1.66      bool visible;
    1.67  };