#include <ngitem.h>
Inheritance diagram for SGUsedColours:
Public Member Functions | |
SGUsedColours () | |
virtual BOOL | IsMember (Node *, const StringBase &) const |
virtual BOOL | CreateItems (Node *) |
Create 'Used Names' set items for the node, as appropriate. | |
Protected Member Functions | |
virtual SGNameItem * | MakeItem (const StringBase &strName) const |
Seize control of the group's title from the base class. | |
SGUsedColourItem * | RegisterMember (Node *, const StringBase &, DocColour *pCol) |
Register a 'Used Colours' set item for the node. | |
Static Protected Member Functions | |
static const StringBase * | IsNamedColour (DocColour *pCol) |
Helper to the SGUsedColours display group. |
Definition at line 350 of file ngitem.h.
|
Definition at line 353 of file ngitem.h. 00354 : SGNameGroup(_R(IDS_NAMEGAL_COLOURS_TYPE), _R(IDS_NAMEGAL_COLOURS_TITLE)) 00355 { /* empty */ }
|
|
Create 'Used Names' set items for the node, as appropriate.
Implements SGNameGroup. Definition at line 1522 of file ngitem.cpp. 01523 { 01524 const StringBase* pstrCol; 01525 DocColour* pCol; 01526 AttrFillGeometry* pAttr; 01527 01528 for (pAttr = (AttrFillGeometry*) pNode->FindFirstAttr( &Node::IsAFillAttr ); 01529 pAttr != 0; 01530 pAttr = (AttrFillGeometry*) pAttr->FindNextAttr( &Node::IsAFillAttr )) 01531 { 01532 pCol = pAttr->GetStartColour(); 01533 if (pCol != 0) 01534 { 01535 pstrCol = IsNamedColour(pCol); 01536 if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0) 01537 return FALSE; 01538 } 01539 01540 pCol = pAttr->GetEndColour(); 01541 if (pCol != 0) 01542 { 01543 pstrCol = IsNamedColour(pCol); 01544 if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0) 01545 return FALSE; 01546 } 01547 01548 pCol = pAttr->GetEndColour2(); 01549 if (pCol != 0) 01550 { 01551 pstrCol = IsNamedColour(pCol); 01552 if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0) 01553 return FALSE; 01554 } 01555 01556 pCol = pAttr->GetEndColour3(); 01557 if (pCol != 0) 01558 { 01559 pstrCol = IsNamedColour(pCol); 01560 if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0) 01561 return FALSE; 01562 } 01563 } 01564 01565 return TRUE; 01566 }
|
|
Implements SGNameGroup. Definition at line 1462 of file ngitem.cpp. 01463 { 01464 const StringBase* pstrCol; 01465 DocColour* pCol; 01466 AttrFillGeometry* pAttr; 01467 01468 for (pAttr = (AttrFillGeometry*) pNode->FindFirstAttr( &Node::IsAFillAttr ); 01469 pAttr != 0; 01470 pAttr = (AttrFillGeometry*) pAttr->FindNextAttr( &Node::IsAFillAttr ) ) 01471 { 01472 pCol = pAttr->GetStartColour(); 01473 if (pCol != 0) 01474 { 01475 pstrCol = IsNamedColour(pCol); 01476 if (pstrCol != 0 && *pstrCol == strName) 01477 return TRUE; 01478 } 01479 01480 pCol = pAttr->GetEndColour(); 01481 if (pCol != 0) 01482 { 01483 pstrCol = IsNamedColour(pCol); 01484 if (pstrCol != 0 && *pstrCol == strName) 01485 return TRUE; 01486 } 01487 01488 pCol = pAttr->GetEndColour2(); 01489 if (pCol != 0) 01490 { 01491 pstrCol = IsNamedColour(pCol); 01492 if (pstrCol != 0 && *pstrCol == strName) 01493 return TRUE; 01494 } 01495 01496 pCol = pAttr->GetEndColour3(); 01497 if (pCol != 0) 01498 { 01499 pstrCol = IsNamedColour(pCol); 01500 if (pstrCol != 0 && *pstrCol == strName) 01501 return TRUE; 01502 } 01503 } 01504 01505 return FALSE; 01506 }
|
|
Helper to the SGUsedColours display group.
Definition at line 1441 of file ngitem.cpp. 01442 { 01443 ERROR3IF(pCol == 0, "SGUsedColours::IsNamedColour: null input"); 01444 IndexedColour* pIndex = pCol->FindParentIndexedColour(); 01445 return pIndex != 0 && pIndex->IsNamed() ? pIndex->GetName() : 0; 01446 }
|
|
Seize control of the group's title from the base class.
Reimplemented from SGNameGroup. Definition at line 363 of file ngitem.h. 00364 { return new SGUsedColourItem(strName); }
|
|
Register a 'Used Colours' set item for the node.
Definition at line 1416 of file ngitem.cpp. 01418 { 01419 SGUsedColourItem* pItem = 01420 (SGUsedColourItem*) SGNameGroup::RegisterMember(pNode, strName); 01421 ERROR3IF(pCol == 0, "SGUsedColours::RegisterMember: null input"); 01422 if (pItem != 0) pItem->SetPatchColour(pCol->FindParentIndexedColour()); 01423 return pItem; 01424 }
|