LineDashItem Class Reference

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

#include <sgline2.h>

Inheritance diagram for LineDashItem:

LineAttrItem SGDisplayItem SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 LineDashItem (StockDash nDashType, const String &strDescription)
 Constructs a user-interface item representing a line's dash pattern.

Private Member Functions

virtual void SetAttributes (RenderRegion *pRegion) const
 Sets the dash-pattern attributes in the given render-region to render this item correctly.
virtual NodeAttributeCreateNewAttribute (BOOL fIsAdjust) const
virtual MILLIPOINT GetHeight () const
 Overrides the default height of items in the line gallery for dash pattern items, so they are half the usual height.
virtual CCRuntimeClass ** GetAttribRuntimeClasses () const
 Used when searching for display items representing the selection's current attributes.
virtual BOOL IsEqualValueToAny (NodeAttribute **pOtherAttribs) const
 Used when searching for display items representing the selection's current attributes.

Private Attributes

StockDash m_nDashType

Detailed Description

Represents a line dash-pattern 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 151 of file sgline2.h.


Constructor & Destructor Documentation

LineDashItem::LineDashItem StockDash  nDashType,
const String strDescription
 

Constructs a user-interface item representing a line's dash pattern.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
nDashType an enum representing a stock dash pattern [INPUTS] strDescription text description of this user-interface item
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 273 of file sgline2.cpp.

00274   : LineAttrItem(strDescription, NO_LABEL),
00275     m_nDashType(nDashType)
00276 {
00277     // Empty.
00278 }


Member Function Documentation

NodeAttribute * LineDashItem::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 dash-pattern attribute that can be passed to the attribute manager.

Errors: -

See also:
-

Implements LineAttrItem.

Definition at line 320 of file sgline2.cpp.

00321 {
00322     AttrDashPattern* pAttr = new AttrDashPattern;
00323     if (pAttr != NULL) pAttr->Value.SetStockDashPattern(m_nDashType);
00324     return pAttr;
00325 }

CCRuntimeClass ** LineDashItem::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 365 of file sgline2.cpp.

00366 {
00367     static CCRuntimeClass* aprtc[] =
00368     {
00369         CC_RUNTIME_CLASS(AttrDashPattern),
00370         NULL
00371     };
00372 
00373     return aprtc;
00374 }

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

Overrides the default height of items in the line gallery for dash pattern items, so they are half the usual height.

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

Errors: -

See also:
LineAttrItem::CalculateMyRect; LineAttrItem::GetHeight

Reimplemented from LineAttrItem.

Definition at line 343 of file sgline2.cpp.

00344 {
00345     return LineAttrItem::GetHeight() / 2;
00346 }

BOOL LineDashItem::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 393 of file sgline2.cpp.

00394 {
00395     DashPatternAttribute dpa;
00396     dpa.SetStockDashPattern(m_nDashType);
00397     AttrDashPattern* pattr = (AttrDashPattern*) *ppOtherAttribs;
00398     return pattr != NULL && pattr->Value.DashPattern == dpa.DashPattern;
00399 }

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

Sets the dash-pattern 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 pointer to the render-region to draw into [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Implements LineAttrItem.

Definition at line 296 of file sgline2.cpp.

00297 {
00298     // Set the dash pattern.
00299     pRegion->SetLineWidth(c_nDefaultLineWidth / 2);
00300     pRegion->SetDashPattern(m_nDashType);
00301 }


Member Data Documentation

StockDash LineDashItem::m_nDashType [private]
 

Definition at line 166 of file sgline2.h.


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