SGLibFontItem Class Reference

A library font gallery item. More...

#include <sgfonts.h>

Inheritance diagram for SGLibFontItem:

SGLibDisplayItem SGDisplayItem SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 SGLibFontItem ()
 ~SGLibFontItem ()
 SGLibFontItem (LibraryIndex LibraryIndexToDisplay, BOOL bNew=FALSE)
LibDisplayType GetDisplayType (SGMiscInfo *MiscInfo)
 Return the display type to use - this should be overridden by the library gallery using the code.
INT32 GetTextWidth (SGFormatInfo *FormatInfo, SGMiscInfo *MiscInfo)
 An overridable way of returning the width of the text description.
void GetNameText (String_256 *Result)
 Returns the name text for this item, to support simple searching and sorting operations, and generic redraw methods for library items.
void GetFullInfoText (String_256 *Result)
 Returns the full-info text for this item, to support simple searching operations, and generic redraw methods for library items. Notes: This overrides the sgdisplaynode version to give full information...
UINT32 GetFontID (void)
virtual BOOL HandleEvent (SGEventType EventType, void *EventInfo, SGMiscInfo *MiscInfo)
 Handles a SuperGallery DisplayTree event.
virtual BOOL GetNameTextPtr (TCHAR **Result)
 Returns a pointer to the filename for this item... The main use of this call is to speed sorting up, since passing pointers about is much quicker than constructing strings....
virtual void CalculateMyRect (SGFormatInfo *FormatInfo, SGMiscInfo *MiscInfo)
 Shared code for LibraryIndex items to calculate where they will appear in the grand scheme of things.
virtual void HandleRedraw (SGRedrawInfo *RedrawInfo, SGMiscInfo *MiscInfo)
 SGLibDisplayItem item redraw method - removed from the main HandleEvent method merely to make the code tidier. Notes: Scope: private.
FontClass GetType (void)
virtual INT32 CompareTo (SGDisplayNode *Other, INT32 SortKey)
 Compares this node to the 'other' node, to determine their relative positions in the display tree. Returns a value which usually indicates that the other node should be inserted before (-1, or 0) or after (+1) this item.
virtual BOOL GetThumbFileName (String_256 *path)
 To find the corresponding filename for this object's thumb.

Protected Member Functions

void MoveAfter (SGDisplayNode *NodeToMove)
 MOVES the given node (to a different position in the DisplayTree) as the previous (left) sibling of this node. If the node is not linked into a tree, it is effectively just inserted.
void MoveBefore (SGDisplayNode *NodeToMove)
 MOVES the given node (to a different position in the DisplayTree) as the previous (left) sibling of this node. If the node is not linked into a tree, it is effectively just inserted.
BOOL GetBubbleHelp (DocCoord *MousePos, String_256 *Result)
 Called by the parent gallery when bubble help is needed. The parent gallery will do a hit test to determine which node contains the pointer, and will then ask that node to supply bubble/status-line help.
BOOL GetStatusLineHelp (DocCoord *MousePos, String_256 *Result)
 Called by the parent gallery when status line help is needed. The parent gallery will do a hit test to determine which node contains the pointer, and will then ask that node to supply bubble/status-line help.

Private Member Functions

 CC_DECLARE_DYNAMIC (SGLibFontItem)

Detailed Description

A library font gallery item.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/3/95
See also:
SGClipartItem

Definition at line 619 of file sgfonts.h.


Constructor & Destructor Documentation

SGLibFontItem::SGLibFontItem  ) 
 

SGLibFontItem::~SGLibFontItem  ) 
 

SGLibFontItem::SGLibFontItem LibraryIndex  LibraryIndexToDisplay,
BOOL  bNew = FALSE
 


Member Function Documentation

virtual void SGLibFontItem::CalculateMyRect SGFormatInfo FormatInfo,
SGMiscInfo MiscInfo
[virtual]
 

Shared code for LibraryIndex items to calculate where they will appear in the grand scheme of things.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/3/95 (base generated in sgbase.cpp)
Parameters:
FormatInfo - The formatting info from which to calculate my position/size [INPUTS] MiscInfo - As usual, the useful misc info struct
member variable FormatRect - is returned filled in with the size/position of [OUTPUTS] this LibraryIndex item's display area. This is dependent upon the current display mode and format state
FormatInfo will be updated as a result of the formatting operation

Notes: LibraryIndexs supply only one display mode ("full info")

Scope: private (for use of SGLibDisplayItem class only)

Reimplemented from SGLibDisplayItem.

SGLibFontItem::CC_DECLARE_DYNAMIC SGLibFontItem   )  [private]
 

virtual INT32 SGLibFontItem::CompareTo SGDisplayNode Other,
INT32  SortKey
[virtual]
 

Compares this node to the 'other' node, to determine their relative positions in the display tree. Returns a value which usually indicates that the other node should be inserted before (-1, or 0) or after (+1) this item.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/4/95
Parameters:
Other - the node to compare this node to [INPUTS] SortKey - An integer identifying how to compare the items 0 = No sorting (always returns 0) 1 = Sort-by-name 2 = sort by size (memory size) 3 = sort by name length 4 = sort by type Other values will return 0, unless the derived class overrides this method in order to provide other sort modes.
Returns:
negative (I am lesser), 0 (we are equal), or positive (I am greater)
See also:
SGDisplayNode::AddItem

Reimplemented from SGLibDisplayItem.

BOOL SGLibFontItem::GetBubbleHelp DocCoord MousePos,
String_256 Result
[protected, virtual]
 

Called by the parent gallery when bubble help is needed. The parent gallery will do a hit test to determine which node contains the pointer, and will then ask that node to supply bubble/status-line help.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/6/95
Parameters:
MousePos - The current mouse position. This will generally be expected [INPUTS] to lie inside this item's FormatRect. With it, this item can provide help on specific areas of an item.
On exit, if the return value is TRUE, the string pointed at by Result [OUTPUTS] will contain a bubble help string for this item
Returns:
TRUE if it filled in the string, FALSE if it did not
Notes: The base class returns FALSE (i.e. provides no help) If you can provide help, then override the base class method to do so.

See also:
SGDisplayNode::GetStatusLineHelp

Reimplemented from SGLibDisplayItem.

LibDisplayType SGLibFontItem::GetDisplayType SGMiscInfo MiscInfo  )  [virtual]
 

Return the display type to use - this should be overridden by the library gallery using the code.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
MiscInfo - Contains a few useful bits of info that may be [INPUTS] needed for all event types.
[OUTPUTS] 
Returns:
The display mode type to use (position of text, and size of thumb)
Notes: There is the possibility that the MiscInfo passed only has a valid DisplayMode setup - the rest might be garbage

Reimplemented from SGLibDisplayItem.

UINT32 SGLibFontItem::GetFontID void   ) 
 

void SGLibFontItem::GetFullInfoText String_256 Result  )  [virtual]
 

Returns the full-info text for this item, to support simple searching operations, and generic redraw methods for library items. Notes: This overrides the sgdisplaynode version to give full information...

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
Result - String to place resulting text in [OUTPUTS]
See also:

Reimplemented from SGLibDisplayItem.

void SGLibFontItem::GetNameText String_256 Result  )  [virtual]
 

Returns the name text for this item, to support simple searching and sorting operations, and generic redraw methods for library items.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
[INPUTS] 
Result - String to place resulting text in [OUTPUTS]
Returns:
The display mode type to use (position of text, and size of thumb)

Reimplemented from SGLibDisplayItem.

virtual BOOL SGLibFontItem::GetNameTextPtr TCHAR **  Result  )  [virtual]
 

Returns a pointer to the filename for this item... The main use of this call is to speed sorting up, since passing pointers about is much quicker than constructing strings....

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/5/95
Parameters:
[INPUTS] 
Result - points to name in memory if the index file is cached [OUTPUTS]
Returns:
TRUE if index was cached and name found ok, etc...
Notes: BEWARE: If the index file is not in memory this call will probably fail !

Reimplemented from SGLibDisplayItem.

BOOL SGLibFontItem::GetStatusLineHelp DocCoord MousePos,
String_256 Result
[protected, virtual]
 

Called by the parent gallery when status line help is needed. The parent gallery will do a hit test to determine which node contains the pointer, and will then ask that node to supply bubble/status-line help.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/1/95
Parameters:
MousePos - The current mouse position. This will generally be expected [INPUTS] to lie inside this item's FormatRect. With it, this item can provide help on specific areas of an item.
On exit, if the return value is TRUE, the string pointed at by Result [OUTPUTS] will contain a status line help string for this item
Returns:
TRUE if it filled in the string, FALSE if it did not
Notes: The base class returns FALSE (i.e. provides no help) If you can provide help, then override the base class method to do so.

See also:
SGDisplayNode::GetBubbleHelp

Reimplemented from SGLibDisplayItem.

INT32 SGLibFontItem::GetTextWidth SGFormatInfo FormatInfo,
SGMiscInfo MiscInfo
[virtual]
 

An overridable way of returning the width of the text description.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/3/95
Parameters:
FormatInfo - The formatting info from which to calculate my position/size [INPUTS] MiscInfo - As usual, the useful misc info struct
Width (in millipoints) required by the description text for this mode [OUTPUTS]

Reimplemented from SGLibDisplayItem.

virtual BOOL SGLibFontItem::GetThumbFileName String_256 path  )  [virtual]
 

To find the corresponding filename for this object's thumb.

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
Result - will be filled in with the full filename of the object's thumb file [OUTPUTS]
Returns:
FALSE if it failed, else TRUE

Reimplemented from SGLibDisplayItem.

FontClass SGLibFontItem::GetType void   ) 
 

virtual BOOL SGLibFontItem::HandleEvent SGEventType  EventType,
void *  EventInfo,
SGMiscInfo MiscInfo
[virtual]
 

Handles a SuperGallery DisplayTree event.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/1/95
Parameters:
EventType - An enumerated value describing what type of event is to be processed [INPUTS]
EventInfo - A structure describing the event (may be NULL). The exact thing pointed at by this pointer depends upon the event type:

MonoOn Event Thing EventInfo points at SGEVENT_FORMAT (SGFormatInfo *) SGEVENT_REDRAW (SGRedrawInfo *) SGEVENT_MOUSECLICK (SGMouseInfo *) MonoOff Use the provided SGDisplayNode::Get[Format]Info() inlines to retrieve this information - they provide useful error/type checking, and hide the cast

MiscInfo - always provided. Contains a few useful bits of info that may be needed for all event types.

Parameters:
FormatInfo is updated as appropriate [OUTPUTS]
Returns:
TRUE if the event was handled successfully FALSE if it was not
Notes: This overrides the pure virtual SGDisplayNode::HandleEvent method

A node need not handle a specific event - if it does not handle it, it should return FALSE.

Redraw and Formatting handlers should never return TRUE, as this will prevent the event from continuing through the tree.

Non-leaf-nodes must call SGDisplayNode::GiveEventToMyChildren in order to pass the event dow the tree. THIS node is a leaf-node, so it doesn't.

See also:
SGDisplayNode::HandleEvent

Reimplemented from SGLibDisplayItem.

virtual void SGLibFontItem::HandleRedraw SGRedrawInfo RedrawInfo,
SGMiscInfo MiscInfo
[virtual]
 

SGLibDisplayItem item redraw method - removed from the main HandleEvent method merely to make the code tidier. Notes: Scope: private.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/3/95 (base generated in sgbase.cpp)
Parameters:
RedrawInfo - The information on the kernel-rendered redraw area [INPUTS] MiscInfo - always provided. Contains a few useful bits of info that may be needed for all event types.
[Member variable FormatRect should be set up (before calling this method) to be the rectangle in which to draw this item]

Reimplemented from SGLibDisplayItem.

void SGLibFontItem::MoveAfter SGDisplayNode NodeToMove  )  [protected, virtual]
 

MOVES the given node (to a different position in the DisplayTree) as the previous (left) sibling of this node. If the node is not linked into a tree, it is effectively just inserted.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
NodeToMove - the node to move [INPUTS]
Notes: This base class method simply delinks the item and relinks it elsewhere in the display tree. However, derived classes will override this method so that moving display items can have a further effect of also rearranging the displayed "real" items. Before/After moving the real item, the derived class can then call this baseclass method to complete the action.

Take care when moving items between groups (e.g. if an item is "moved" from one docuemnt to another, it could be a bad thing, so be very careful in derived classes to take appropriate action)

Any attempt to move an item after *itself* is queitly ignored

Returns:
Errors: ERROR3 and quiet exit if NodeToMove == NULL
See also:
SuperGallery; SGDisplayNode::InsertAfter; SGDisplayNode::AddItem

Reimplemented from SGDisplayNode.

void SGLibFontItem::MoveBefore SGDisplayNode NodeToMove  )  [protected, virtual]
 

MOVES the given node (to a different position in the DisplayTree) as the previous (left) sibling of this node. If the node is not linked into a tree, it is effectively just inserted.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
NodeToMove - the node to move [INPUTS]
Notes: This base class method simply delinks the item and relinks it elsewhere in the display tree. However, derived classes will override this method so that moving display items can have a further effect of also rearranging the displayed "real" items. Before/After moving the real item, the derived class can then call this baseclass method to complete the action.

Take care when moving items between groups (e.g. if an item is "moved" from one docuemnt to another, it could be a bad thing, so be very careful in derived classes to take appropriate action)

Any attempt to move an item before *itself* is queitly ignored

Returns:
Errors: ERROR3 and quiet exit if NodeToMove == NULL
See also:
SuperGallery; SGDisplayNode::InsertBefore; SGDisplayNode::AddItem

Reimplemented from SGDisplayNode.


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