SGFormatInfo Struct Reference

#include <sgtree.h>

List of all members.

Public Attributes

INT32 LinePos
INT32 LineHeight
INT32 AvailableWidth
INT32 IndentLevel
BOOL AccumulateBounds
SGDisplayNodeLastInvalidNode
DocRect InvalidBounds


Detailed Description

Comment: MonoOn typedef struct { INT32 LinePos; INT32 LineHeight; INT32 AvailableWidth; INT32 IndentLevel; DocRect InvalidBounds; } SGFormatInfo; MonoOff

This structure is passed into SGDisplayNode classes when the SuperGallery asks the tree to calculate and cache item formatting information. Items calculate formatting (into 'lines' across the window) using a simple but reasonably generic system, similar to foratting paragraphs of text. As many sibling items as possible will fit themselves side by side across each 'line' - overflow continues on the next line. Moving up or down the tree acts as a 'newline', forcing the next item to move to a new line. Generally speaking, leaf-nodes of the tree are the only nodes of non- 'infinite' width (groups always fill entire lines), though there is no reason (other than style, taste, panache, and common decency) why they can't be shorter, and mix with other items on a single line.

LinePos, LineHeight are kept up to date with the Y position and size of the currently formatting display 'line'.

AvailableWidth contains the remaining width in this line - if an item cannot fit within AvailableWidth, it will format onto the next line (except when NeededWidth >= MaxWidth, when it takes the entire line for itself & truncates)

IndentLevel indicates the current tree depth; used to indent items in sub- categories further each time.

InvalidBounds is 'Empty' on entry to the formatting pass. As each item determines its format rect, it checks against its cached FormatRect, and if it has moved/resized since the last format, it includes its own y extent within the InvalidBounds rectangle. Thus, on exit, it is a rectangle which is either 'Empty' or encloses all invalid regions of the display list. Used to redraw only those portions of the list which have actually changed.

A structure is used for easy addition of other information at a later date

See also:
SuperGallery; SGDisplayNode::HandleEvent

Definition at line 305 of file sgtree.h.


Member Data Documentation

BOOL SGFormatInfo::AccumulateBounds
 

Definition at line 313 of file sgtree.h.

INT32 SGFormatInfo::AvailableWidth
 

Definition at line 310 of file sgtree.h.

INT32 SGFormatInfo::IndentLevel
 

Definition at line 311 of file sgtree.h.

DocRect SGFormatInfo::InvalidBounds
 

Definition at line 318 of file sgtree.h.

SGDisplayNode* SGFormatInfo::LastInvalidNode
 

Definition at line 314 of file sgtree.h.

INT32 SGFormatInfo::LineHeight
 

Definition at line 309 of file sgtree.h.

INT32 SGFormatInfo::LinePos
 

Definition at line 307 of file sgtree.h.


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