SGNameGroup Class Reference

A SuperGallery group of SGNameItems. Records whether this group's display needs to be updated on the next idle event because of a change to its Document's named objects. More...

#include <ngitem.h>

Inheritance diagram for SGNameGroup:

SGDisplayGroup SGDisplayGroup SGDisplayNode SGDisplayNode CCObject CCObject SimpleCCObject SimpleCCObject SGUsedBitmaps SGUsedColours SGUsedFonts SGUsedNames List of all members.

Public Member Functions

 SGNameGroup (UINT32 idType, UINT32 idTitle, Document *pDoc=0)
 Creates an abstract Name Gallery group. Notes: Uses the lowest bit of SGDisplayFlags.Reserved to track whether a group has been automatically folded because it has no items (and hence should automatically unfold if it later has new items to show).
UINT32 GetTypeID () const
virtual BOOL IsMember (Node *pNode, const StringBase &strName) const =0
virtual BOOL CreateItems (Node *pNode)=0
SGNameItemFindItem (const StringBase &strName) const
SGNameItemRegisterMember (Node *pNode, const StringBase &strName)
 Creates and inserts a SGNameItem with the given name if one doesn't exist already. Includes the given node in the set's bounds etc.
 SGNameGroup (NameGallery *pParentGal, Document *pParentDoc=0)
void SetRefresh (BOOL fR=TRUE)
BOOL NeedsRefresh ()

Protected Member Functions

virtual SGNameItemMakeItem (const StringBase &strName) const
 Seize control of the group's title from the base class.
virtual void ReadGroupTitle ()
 Seize control of the group's title from the base class.

Private Member Functions

 CC_DECLARE_DYNAMIC (SGNameGroup)

Private Attributes

const UINT32 m_idType
const UINT32 m_idTitle
BOOL m_fRefresh

Detailed Description

A SuperGallery group of SGNameItems. Records whether this group's display needs to be updated on the next idle event because of a change to its Document's named objects.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
See also:
SGNameItem; NameGallery; SGDisplayItem

Definition at line 126 of file ngitem.h.


Constructor & Destructor Documentation

SGNameGroup::SGNameGroup UINT32  idType,
UINT32  idTitle,
Document pDoc = 0
 

Creates an abstract Name Gallery group. Notes: Uses the lowest bit of SGDisplayFlags.Reserved to track whether a group has been automatically folded because it has no items (and hence should automatically unfold if it later has new items to show).

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pDoc --- the document associated with this group (by default, [INPUTS] always whatever is the currently 'selected' document)

Definition at line 986 of file ngitem.cpp.

00987   : SGDisplayGroup(NameGallery::Instance(), pDoc),
00988     m_idType(idType),
00989     m_idTitle(idTitle)
00990 {
00991     Flags.CanSelect = TRUE;
00992     Flags.Reserved &= ~1;
00993 }

SGNameGroup::SGNameGroup NameGallery pParentGal,
Document pParentDoc = 0
[inline]
 

Definition at line 194 of file sgname.h.

00195       : SGDisplayGroup(pParentGal, pParentDoc),
00196         m_fRefresh(FALSE)
00197             { Flags.CanSelect = TRUE; }


Member Function Documentation

SGNameGroup::CC_DECLARE_DYNAMIC SGNameGroup   )  [private]
 

virtual BOOL SGNameGroup::CreateItems Node pNode  )  [pure virtual]
 

Implemented in SGUsedNames, SGUsedFonts, SGUsedBitmaps, and SGUsedColours.

SGNameItem * SGNameGroup::FindItem const StringBase strName  )  const
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Returns:
The ID of a string that describes the type of items in this group.

Definition at line 1020 of file ngitem.cpp.

01021 {
01022     // Iterate over all the items looking a matching name.
01023     for (SGNameItem* pItem = (SGNameItem*) GetChild();
01024          pItem != 0;
01025          pItem = (SGNameItem*) pItem->GetNext())
01026     {
01027         if (pItem->GetNameTextPtr()->CompareTo(strName) == 0)
01028             return pItem;
01029     }
01030 
01031     // Can't find an item with that name.
01032     return 0;
01033 }

UINT32 SGNameGroup::GetTypeID  )  const
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Returns:
The ID of a string that describes the type of items in this group.

Definition at line 1005 of file ngitem.cpp.

01006 {
01007     return m_idType;
01008 }

virtual BOOL SGNameGroup::IsMember Node pNode,
const StringBase strName
const [pure virtual]
 

Implemented in SGUsedNames, SGUsedFonts, SGUsedBitmaps, and SGUsedColours.

SGNameItem * SGNameGroup::MakeItem const StringBase strName  )  const [protected, virtual]
 

Seize control of the group's title from the base class.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99

Reimplemented in SGUsedColours.

Definition at line 1098 of file ngitem.cpp.

01099 {
01100     return new SGNameItem(strName);
01101 }

BOOL SGNameGroup::NeedsRefresh  )  [inline]
 

Definition at line 204 of file sgname.h.

00205             { BOOL fR = m_fRefresh; m_fRefresh = FALSE; return fR; }

void SGNameGroup::ReadGroupTitle void   )  [protected, virtual]
 

Seize control of the group's title from the base class.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99

Reimplemented from SGDisplayGroup.

Definition at line 1113 of file ngitem.cpp.

01114 {
01115     TitleText.Load(m_idTitle);
01116 }

SGNameItem * SGNameGroup::RegisterMember Node pNode,
const StringBase strName
 

Creates and inserts a SGNameItem with the given name if one doesn't exist already. Includes the given node in the set's bounds etc.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to register as a member [INPUTS] strName --- the name of the new item to make if one doesn't exist already
Returns:
Errors: Out of memory.

Definition at line 1050 of file ngitem.cpp.

01051 {
01052     // Only make a new item if there isn't one already.
01053     SGNameItem* pItem;
01054     for ( pItem = (SGNameItem*) GetChild();
01055          pItem != 0 && !pItem->IsEqual(strName);
01056          pItem = (SGNameItem*) pItem->GetNext())
01057             /* empty */ ;
01058 
01059     if (pItem == 0)
01060     {
01061         // If we previously had no children and folded because of that then
01062         // automatically unfold.
01063         if (GetChild() == 0 && (Flags.Reserved & 1))
01064         {
01065             Flags.Reserved &= ~1;
01066             Flags.Folded = FALSE;
01067         }
01068         
01069         // We must create a new set item for this 'attribute value'.
01070         pItem = MakeItem(strName);
01071         ERRORIF(pItem == 0, _R(IDE_NOMORE_MEMORY), 0);
01072         
01073         // Insert in alphabetical order.
01074         SGSortKey sk[2] = { { SGSORTKEY_BYNAME } };
01075         AddItem(pItem, sk);
01076     }
01077 /*
01078     TRACEUSER( "JustinF", _T("Registering %s at 0x%p as a member of %s\n"),
01079                 (LPCTSTR) pNode->GetRuntimeClass()->m_lpszClassName,
01080                 (LPVOID) pNode, (LPCTSTR) strName);
01081 */
01082     // 'Register' the node with the set item which will note its selection
01083     // status, bounds etc.
01084     pItem->Include(pNode);
01085     return pItem;
01086 }

void SGNameGroup::SetRefresh BOOL  fR = TRUE  )  [inline]
 

Definition at line 200 of file sgname.h.

00201             { m_fRefresh = fR; }


Member Data Documentation

BOOL SGNameGroup::m_fRefresh [private]
 

Definition at line 208 of file sgname.h.

const UINT32 SGNameGroup::m_idTitle [private]
 

Definition at line 162 of file ngitem.h.

const UINT32 SGNameGroup::m_idType [private]
 

Definition at line 161 of file ngitem.h.


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