LineNoArrowItem Class Reference

Class to represent a no-arrowhead/tail user-interface item within the line gallery. Only used as a base class for LineNoStartArrowItem and LineNoEndArrowItem. More...

#include <sgline2.h>

Inheritance diagram for LineNoArrowItem:

LineArrowItem LineAttrItem SGDisplayItem SGDisplayNode CCObject SimpleCCObject LineNoEndArrowItem LineNoStartArrowItem List of all members.

Protected Member Functions

 LineNoArrowItem (const String &strDescription)
 Constructs a "no-arrowhead" line gallery item.

Private Member Functions

virtual MILLIPOINT GetWidth () const
 Forces a "no-arrow" item to be full-width.
virtual MILLIPOINT GetHeight () const
 Called by the line gallery formatting code.
virtual MILLIPOINT GetVertGap () const
 Called by the formatting code of the line gallery.
virtual void SetAttributes (RenderRegion *pRegion) const
 Overrides attribute setting for arrowheads to set NO attribute.
virtual void DrawItem (RenderRegion *pRegion, const DocRect &drBounds) const
 Formats and draws an arrowhead/tail.

Detailed Description

Class to represent a no-arrowhead/tail user-interface item within the line gallery. Only used as a base class for LineNoStartArrowItem and LineNoEndArrowItem.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/95
See also:
-

Definition at line 227 of file sgline2.h.


Constructor & Destructor Documentation

LineNoArrowItem::LineNoArrowItem const String strDescription  )  [protected]
 

Constructs a "no-arrowhead" line gallery item.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/95
Parameters:
strDescription text description of this item [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 742 of file sgline2.cpp.

00743   : LineArrowItem((StockArrow) -1, 0, strDescription)
00744 {
00745     // Empty.
00746 }


Member Function Documentation

void LineNoArrowItem::DrawItem RenderRegion pRegion,
const DocRect drBounds
const [private, virtual]
 

Formats and draws an arrowhead/tail.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
pRegion pointer to the RenderRegion to draw into [INPUTS] drBounds the bounds of the drawing area within the RenderRegion
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from LineArrowItem.

Definition at line 845 of file sgline2.cpp.

00846 {
00847     // Work out the difference in width between the text string and the bounding box.
00848     MILLIPOINT nWidthDiff = drBounds.Width() - (GetDescription().Length() * c_nAveCharWidth);
00849 
00850     // Draw the item's description centred within the new bounding box, if it will fit.
00851     DocRect drTextBounds(drBounds);
00852     if (nWidthDiff > 0) drTextBounds.Inflate(-nWidthDiff / 2, 0);
00853     pRegion->DrawFixedSystemText(&((String&) GetDescription()), drTextBounds);
00854 }

MILLIPOINT LineNoArrowItem::GetHeight void   )  const [private, virtual]
 

Called by the line gallery formatting code.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The height of this item, in millipoints.

Errors: -

See also:
-

Reimplemented from LineArrowItem.

Definition at line 783 of file sgline2.cpp.

00784 {
00785     return LineAttrItem::GetHeight();
00786 }

MILLIPOINT LineNoArrowItem::GetVertGap  )  const [private, virtual]
 

Called by the formatting code of the line gallery.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The vertical gap between this "no arrow" item and other "arrowhead" items within the line gallery.

Errors: -

See also:
-

Reimplemented from LineArrowItem.

Definition at line 804 of file sgline2.cpp.

00805 {
00806     return LineArrowItem::GetVertGap() / 3;
00807 }

MILLIPOINT LineNoArrowItem::GetWidth void   )  const [private, virtual]
 

Forces a "no-arrow" item to be full-width.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The width of this item, in millipoints.

Errors: -

See also:
-

Reimplemented from LineArrowItem.

Definition at line 763 of file sgline2.cpp.

00764 {
00765     return 2 * LineArrowItem::GetWidth();
00766 }

void LineNoArrowItem::SetAttributes RenderRegion pRegion  )  const [private, virtual]
 

Overrides attribute setting for arrowheads to set NO attribute.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from LineArrowItem.

Definition at line 824 of file sgline2.cpp.

00825 {
00826     // Empty, as we have no attributes required to render this item.
00827 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:58 2007 for Camelot by  doxygen 1.4.4