GRAPHICLAYOUT::ITEM Class Reference

#include <mi32/grlayout.h>

Inheritance diagram for GRAPHICLAYOUT::ITEM:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ITEM (const ITEM &rhs, GRAPHICLAYOUT &parent)
 ITEM (GRAPHICLAYOUT &parent)
virtual ~ITEM ()
virtual void ComputeRect (DRECT2D &rect)=0
virtual ITEMCopy (GRAPHICLAYOUT &parent) const =0
virtual ITEMPROPERTYSHEETCreatePropertySheet (GRAPHICLAYOUT &grlayout, MIDIALOG *dialog)=0
void Draw (MGD::CONTEXT *gc, bool bSelected=false, const TRANS2D_MAPGEN *trans=0, double scale=1.0)
void Draw (MGD::CONTEXT *gc, const DRECT2D &rect, const TRANS2D_MAPGEN *trans, double scale)
DOUBLE GetHeight () const
const NAMEDTEXTSTYLEGetTextStyle () const
int GetTextStyleNumber () const
DOUBLE GetWidth () const
bool IsInLayout () const
bool IsSelected () const
bool IsSorted () const
void Move (const DRECT2D &rect, bool bSnap)
void Move (DOUBLE dx, DOUBLE dy, bool bSnap)
void MoveBelow (const ITEMPOSITION &above)
virtual const SERIALIZERITEMSerialGetItemDef (SERIALIZER &serializer) const =0
virtual const char * SerialGetTagName () const =0
virtual ERRVALUE SerialRead (SERIALIZER &serializer)
virtual ERRVALUE SerialWrite (SERIALIZER &serializer, const char *tagname=0) const
void SetAttachments (const ITEMPOSITION &newpos)
void SetDefaultLocation ()
void SetHidden (bool bHidden)
void SetLeftOffset (DOUBLE offset)
void SetLeftPosition (INT32 GuideNum, DOUBLE offset)
void SetRightPosition (INT32 GuideNum, DOUBLE offset)
void SetSelected (bool selected)
void SetSize (DOUBLE height, DOUBLE width)
void SetTextStyleNumber (int num)
void SetTopOffset (DOUBLE offset)
void SetTopPosition (INT32 GuideNum, DOUBLE offset)
virtual bool UsesTransparency (const MGD::CONTEXT *gc=0) const

Static Public Member Functions

static const SERIALIZERITEMGetSerialItemDef ()

Protected Attributes

bool m_bSizeKnown
GRAPHICLAYOUTm_parent

Private Member Functions

virtual void v_Draw (MGD::CONTEXT *gc, const DRECT2D &rect, const TRANS2D_MAPGEN *trans, double scale)=0

Private Attributes

bool m_bHidden
bool m_bPosKnown
bool m_bSelected
DOUBLE m_height
ITEMLIST::ITERATOR m_self
INT32 m_TextStyleNum
DOUBLE m_width

Constructor & Destructor Documentation

GRAPHICLAYOUT::ITEM::ITEM ( GRAPHICLAYOUT parent  ) 

Constructor automatically installs item in the layout.

but do we want it to? Serial Read wants to have it at the end. Normal interactive use, we want to put it at current insert position. Perhaps layout should know insert position so we can install there by default.

GRAPHICLAYOUT::ITEM::ITEM ( const ITEM rhs,
GRAPHICLAYOUT parent 
)

Copy constructor (but with copy owned by a different parent).

virtual GRAPHICLAYOUT::ITEM::~ITEM (  )  [virtual]

Destructor automatically removes item from the layout.


Member Function Documentation

virtual void GRAPHICLAYOUT::ITEM::ComputeRect ( DRECT2D rect  )  [pure virtual]

Compute the size of the item.

Should compute a default rectangle which will be used if the item has not been resized. Will only be called if m_bSizeKnown is false

virtual ITEM* GRAPHICLAYOUT::ITEM::Copy ( GRAPHICLAYOUT parent  )  const [pure virtual]

Make a copy of this item. Copy will be placed in another layout.

virtual ITEMPROPERTYSHEET* GRAPHICLAYOUT::ITEM::CreatePropertySheet ( GRAPHICLAYOUT grlayout,
MIDIALOG dialog 
) [pure virtual]
void GRAPHICLAYOUT::ITEM::Draw ( MGD::CONTEXT gc,
bool  bSelected = false,
const TRANS2D_MAPGEN trans = 0,
double  scale = 1.0 
)

Draw the item at its current location (possibly highlighting it as selected).

Parameters:
gc GC to use
bSelected Draw as selected if true
void GRAPHICLAYOUT::ITEM::Draw ( MGD::CONTEXT gc,
const DRECT2D rect,
const TRANS2D_MAPGEN trans,
double  scale 
) [inline]

Draw the item.

Derived class overrides this

Parameters:
gc GC to use
rect Where to draw
DOUBLE GRAPHICLAYOUT::ITEM::GetHeight (  )  const [inline]

Return the height that the item claims it wants.

This could be different from GetRect().height, but not likely

static const SERIALIZERITEM* GRAPHICLAYOUT::ITEM::GetSerialItemDef (  )  [static]

Called by derived classes so they can merge the ITEMDEF lists Should be protected, but then aparently derived classes also need to be nestet in GRAPHICLAYOUT.

const NAMEDTEXTSTYLE* GRAPHICLAYOUT::ITEM::GetTextStyle (  )  const [inline]

Get a const pointer to the text style for this item.

int GRAPHICLAYOUT::ITEM::GetTextStyleNumber (  )  const [inline]

Get the text style number for this item.

DOUBLE GRAPHICLAYOUT::ITEM::GetWidth (  )  const [inline]

Get the width of the item.

bool GRAPHICLAYOUT::ITEM::IsInLayout (  )  const

Returns true if the item is in the layout's list of items.

bool GRAPHICLAYOUT::ITEM::IsSelected (  )  const [inline]
bool GRAPHICLAYOUT::ITEM::IsSorted (  )  const

Returns true if the item is in the correct sorted place in the layout's list of items.

Also returns true if the item isn't the list at all, as that means the list isn't out of order on account of this item.

void GRAPHICLAYOUT::ITEM::Move ( const DRECT2D rect,
bool  bSnap 
) [inline]

Move this item to a new absolute position.

Parameters:
rect New location XXX May make this a point.
bSnap If true, snap to nearby guides
void GRAPHICLAYOUT::ITEM::Move ( DOUBLE  dx,
DOUBLE  dy,
bool  bSnap 
) [inline]

Move this item relative to it's current location.

Parameters:
dx delta x
dy delta y
bSnap If true, snap to nearby guides
void GRAPHICLAYOUT::ITEM::MoveBelow ( const ITEMPOSITION above  )  [inline]

Arrange for this item to be just below a specified item.

virtual const SERIALIZERITEM* GRAPHICLAYOUT::ITEM::SerialGetItemDef ( SERIALIZER serializer  )  const [pure virtual]

Derived class must provide this method.

virtual const char* GRAPHICLAYOUT::ITEM::SerialGetTagName (  )  const [pure virtual]

Method for implementing SERIALIZABLE behaviour.

Derived class must provide this method

virtual ERRVALUE GRAPHICLAYOUT::ITEM::SerialRead ( SERIALIZER serializer  )  [virtual]

Method for implementing SERIALIZABLE behaviour.

ITEM provides this for all derived classes

Implements SERIALIZABLE.

virtual ERRVALUE GRAPHICLAYOUT::ITEM::SerialWrite ( SERIALIZER serializer,
const char *  tagname = 0 
) const [virtual]

Method for implementing SERIALIZABLE behaviour.

ITEM provides this for all derived classes

Implements SERIALIZABLE.

void GRAPHICLAYOUT::ITEM::SetAttachments ( const ITEMPOSITION newpos  )  [inline]

Will also inform parent layout that it needs to recalculate layout.

void GRAPHICLAYOUT::ITEM::SetDefaultLocation (  ) 

Set the item to the default location.

That is, assume it will go at the end just past the last element and set it to that position.

void GRAPHICLAYOUT::ITEM::SetHidden ( bool  bHidden  )  [inline]

Set the "hidden" state of an item.

ITEM::Draw should ignore this state() GRAPHICLAYOUT::Draw() won't draw any hidden items, but the GUI will (to draw into an overlay GC while moving items)

void GRAPHICLAYOUT::ITEM::SetLeftOffset ( DOUBLE  offset  )  [inline]

Will also inform parent layout that it needs to recalculate layout.

void GRAPHICLAYOUT::ITEM::SetLeftPosition ( INT32  GuideNum,
DOUBLE  offset 
) [inline]
void GRAPHICLAYOUT::ITEM::SetRightPosition ( INT32  GuideNum,
DOUBLE  offset 
) [inline]

Will also inform parent layout that it needs to recalculate layout.

void GRAPHICLAYOUT::ITEM::SetSelected ( bool  selected  )  [inline]
void GRAPHICLAYOUT::ITEM::SetSize ( DOUBLE  height,
DOUBLE  width 
) [inline]
void GRAPHICLAYOUT::ITEM::SetTextStyleNumber ( int  num  )  [inline]

Set the text style number.

Will also inform parent layout that it needs to recalculate layout.

void GRAPHICLAYOUT::ITEM::SetTopOffset ( DOUBLE  offset  )  [inline]
void GRAPHICLAYOUT::ITEM::SetTopPosition ( INT32  GuideNum,
DOUBLE  offset 
) [inline]

Will also inform parent layout that it needs to recalculate layout.

Parameters:
GuideNum Use -1 if offset is relative to an item
virtual bool GRAPHICLAYOUT::ITEM::UsesTransparency ( const MGD::CONTEXT gc = 0  )  const [virtual]
virtual void GRAPHICLAYOUT::ITEM::v_Draw ( MGD::CONTEXT gc,
const DRECT2D rect,
const TRANS2D_MAPGEN trans,
double  scale 
) [private, pure virtual]

Draw the item.

Derived class overrides this

Parameters:
gc GC to use
rect Where to draw

Member Data Documentation

Not serialized.

TODO: Methods to set position relative to other things or relative to the "page" Each item should know what item is above/below it.

Could possibly handle as one MILIST for each column An item could be in > 1 column if it spans columns

ITEMLIST::ITERATOR GRAPHICLAYOUT::ITEM::m_self [private]

Used by destructor to remove self from list.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:27 2012 for TNTsdk 2012 by  doxygen 1.6.1