LineJoinTypeItem Class Reference

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

#include <sgline2.h>

Inheritance diagram for LineJoinTypeItem:

LineAttrItem SGDisplayItem SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 LineJoinTypeItem (JointType nJoinType, const String &strDescription)
 Constructs an line-join user-interface item.

Private Member Functions

virtual void SetAttributes (RenderRegion *pRegion) const
 Sets the line-join attributes in the given render-region to render this item correctly.
virtual void DrawItem (RenderRegion *pRegion, const DocRect &drBounds) const
 Draws this item within the bouding box. This default implementation draws a single line through the centre of the box, fine for almost all derived classes. You can override this to do something else (cf. the join-types attribute item, that must draw two lines that meet).
virtual NodeAttributeCreateNewAttribute (BOOL fIsAdjust) const
 A pointer to a NodeAttribute-derivative that this user-interface item represents, ie. a line-join attribute that can be passed to the attribute manager.
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

JointType m_nJoinType

Detailed Description

Represents a line-join 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 323 of file sgline2.h.


Constructor & Destructor Documentation

LineJoinTypeItem::LineJoinTypeItem JointType  nJoinType,
const String strDescription
 

Constructs an line-join user-interface item.

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

Errors: -

See also:
-

Definition at line 1118 of file sgline2.cpp.

01119   : LineAttrItem(strDescription, NO_LABEL),
01120     m_nJoinType(nJoinType)
01121 {
01122     // Empty.
01123 }


Member Function Documentation

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

A pointer to a NodeAttribute-derivative that this user-interface item represents, ie. a line-join attribute that can be passed to the attribute manager.

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

Errors: -

See also:
-

Implements LineAttrItem.

Definition at line 1200 of file sgline2.cpp.

01201 {
01202     AttrJoinType* pAttr = new AttrJoinType;
01203     if (pAttr != NULL) pAttr->Value.JoinType = m_nJoinType;
01204     return pAttr;
01205 }

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

Draws this item within the bouding box. This default implementation draws a single line through the centre of the box, fine for almost all derived classes. You can override this to do something else (cf. the join-types attribute item, that must draw two lines that meet).

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/3/95
Parameters:
pRegion pointer to the RenderRegion to draw into [INPUTS] drBounds reference to the bounding box rectangle to draw within
- [OUTPUTS]
Returns:
-

Errors: -

See also:
LineAttrItem::Render

Reimplemented from LineAttrItem.

Definition at line 1166 of file sgline2.cpp.

01167 {
01168     // Find the mid-points of the horizontal and vertical edges.
01169     MILLIPOINT xMid = (drBounds.lo.x + drBounds.hi.x) / 2;
01170     MILLIPOINT yMid = (drBounds.lo.y + drBounds.hi.y) / 2;
01171 
01172     // Create a right-angle path.
01173     Path pthJoinPath;
01174     pthJoinPath.Initialise();
01175     pthJoinPath.InsertMoveTo(DocCoord(xMid, drBounds.lo.y));
01176     pthJoinPath.InsertLineTo(DocCoord(xMid, yMid));
01177     pthJoinPath.InsertLineTo(DocCoord(drBounds.lo.x, yMid));
01178 
01179     // Now render the path.  The join-type will be apparent at the "cusp".
01180     pRegion->DrawPath(&pthJoinPath);
01181 }

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

01225 {
01226     static CCRuntimeClass* aprtc[] =
01227     {
01228         CC_RUNTIME_CLASS(AttrJoinType),
01229         NULL
01230     };
01231 
01232     return aprtc;
01233 }

BOOL LineJoinTypeItem::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 1252 of file sgline2.cpp.

01253 {
01254     AttrJoinType* pattr = (AttrJoinType*) *ppOtherAttribs;
01255     return pattr != NULL && pattr->Value.JoinType == m_nJoinType;
01256 }

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

Sets the line-join 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 1141 of file sgline2.cpp.

01142 {
01143     // Set the join-type and make the lines even wider.
01144     JoinTypeAttribute* pAttr = new JoinTypeAttribute;
01145     pAttr->JoinType = m_nJoinType;
01146     pRegion->SetJoinType(pAttr, TRUE);
01147     pRegion->SetLineWidth(c_nHorzSizeOfItem / 2);
01148 }


Member Data Documentation

JointType LineJoinTypeItem::m_nJoinType [private]
 

Definition at line 338 of file sgline2.h.


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