LineWidthItem Class Reference

Represents a line-width user-interface item within the line gallery. More...

#include <sgline2.h>

Inheritance diagram for LineWidthItem:

LineAttrItem SGDisplayItem SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 LineWidthItem (double nPointWidth, const String &strDescription)
 Constructs a user-interface item representing a line's width.

Private Member Functions

virtual void SetAttributes (RenderRegion *pRegion) const
 Sets the line-width attributes in the given render-region to render this item correctly.
virtual NodeAttributeCreateNewAttribute (BOOL fIsAdjust) const
virtual MILLIPOINT GetWidth () const
 Called by the line gallery formatting code.
virtual CCRuntimeClass ** GetAttribRuntimeClasses () const
 Used when searching for display items representing the selection's current attributes.
virtual BOOL IsEqualValueToAny (NodeAttribute **ppOtherAttribs) const
 Used when searching for display items representing the selection's current attributes.

Private Attributes

MILLIPOINT m_nWidth

Detailed Description

Represents a line-width user-interface item within the line gallery.

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

Definition at line 122 of file sgline2.h.


Constructor & Destructor Documentation

LineWidthItem::LineWidthItem double  nPointWidth,
const String strDescription
 

Constructs a user-interface item representing a line's width.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
nPointWidth the width of the line, in points [INPUTS] strDescription a text description of this user-interface item
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 129 of file sgline2.cpp.

00130   : LineAttrItem(strDescription, LEFT),
00131     m_nWidth((MILLIPOINT) (nPointWidth * 1000.0))
00132 {
00133     // Empty.
00134 }


Member Function Documentation

NodeAttribute * LineWidthItem::CreateNewAttribute BOOL  fIsAdjust  )  const [private, virtual]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A pointer to a NodeAttribute-derivative that this user-interface item represents, ie. a line-width attribute that can be passed to the attribute manager.

Errors: -

See also:
-

Implements LineAttrItem.

Definition at line 179 of file sgline2.cpp.

00180 {
00181     AttrLineWidth* pAttr = new AttrLineWidth;
00182     if (pAttr != NULL) pAttr->Value.LineWidth = m_nWidth;
00183     return pAttr;
00184 }

CCRuntimeClass ** LineWidthItem::GetAttribRuntimeClasses  )  const [private, virtual]
 

Used when searching for display items representing the selection's current attributes.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/4/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The run-time class of the line attribute this type of display item represents.

Errors: -

See also:
LineAttrItem::UpdateCurrentAttribStatus

Implements LineAttrItem.

Definition at line 223 of file sgline2.cpp.

00224 {
00225     static CCRuntimeClass* aprtc[] =
00226     {
00227         CC_RUNTIME_CLASS(AttrLineWidth),
00228         NULL
00229     };
00230 
00231     return aprtc;
00232 }

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

Called by the line gallery formatting code.

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

Errors: -

See also:
LineAttrItem::GetSize

Reimplemented from LineAttrItem.

Definition at line 201 of file sgline2.cpp.

00202 {
00203     return 2 * LineAttrItem::GetWidth() / 3;
00204 }

BOOL LineWidthItem::IsEqualValueToAny NodeAttribute **  ppOtherAttribs  )  const [private, virtual]
 

Used when searching for display items representing the selection's current attributes.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/4/95
Parameters:
pOtherAttrib the attribute value to compare this item to [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this item represents the same attribute value as the given attribute.

Errors: -

See also:
LineAttrItem::UpdateCurrentAttribStatus

Implements LineAttrItem.

Definition at line 251 of file sgline2.cpp.

00252 {
00253     AttrLineWidth* pattr = (AttrLineWidth*) *ppOtherAttribs;
00254     return pattr != NULL && pattr->Value.LineWidth == m_nWidth;
00255 }

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

Sets the line-width attributes in the given render-region to render this item correctly.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
pRegion the render-region to draw into [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Implements LineAttrItem.

Definition at line 152 of file sgline2.cpp.

00153 {
00154     // Set the line width (this overrides the "default" line width set by the caller).
00155     pRegion->SetLineWidth(m_nWidth);
00156 
00157     // If the line is only a pixel thick then draw it in red, to distinguish it from
00158     // other very thin lines.
00159     if (m_nWidth == 0) pRegion->SetLineColour(COLOUR_RED);
00160 }


Member Data Documentation

MILLIPOINT LineWidthItem::m_nWidth [private]
 

Definition at line 137 of file sgline2.h.


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