#include <sgline2.h>
Inheritance diagram for LineJoinTypeItem:
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 NodeAttribute * | CreateNewAttribute (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 |
Definition at line 323 of file sgline2.h.
|
Constructs an line-join user-interface item.
Definition at line 1118 of file sgline2.cpp. 01119 : LineAttrItem(strDescription, NO_LABEL), 01120 m_nJoinType(nJoinType) 01121 { 01122 // Empty. 01123 }
|
|
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.
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 }
|
|
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).
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 }
|
|
Used when searching for display items representing the selection's current attributes.
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 }
|
|
Used when searching for display items representing the selection's current attributes.
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 }
|
|
Sets the line-join attributes in the given render-region to render this item correctly.
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 }
|
|
|