SGFrameGroup Class Reference

This is a display tree group specifically for the layer gallery - it disables group things like folding, and provides column headings for the layers display. More...

#include <sgframe.h>

Inheritance diagram for SGFrameGroup:

SGLayerGroup SGDisplayGroup SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 SGFrameGroup (SuperGallery *ParentGal, Document *ParentDoc=NULL, Library *ParentLib=NULL, BOOL IsForeground=TRUE)
 SGFrameGroup constructor. Initialises the Group's parent pointers to point at its parent(s). Note that generally speaking, one of ParentDoc, ParentLib will be NULL, and the other will be non-NULL.
virtual BOOL HandleEvent (SGEventType EventType, void *EventInfo, SGMiscInfo *MiscInfo)
 Handles a SuperGallery DisplayTree event.
BOOL IsForeground ()

Private Member Functions

 CC_DECLARE_DYNAMIC (SGFrameGroup)

Private Attributes

BOOL Foreground

Detailed Description

This is a display tree group specifically for the layer gallery - it disables group things like folding, and provides column headings for the layers display.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> (Based on Jason's Layer gallery code)
Date:
16/4/97 (Based on Jason's Layer gallery code)
See also:
SuperGallery; SGDisplayGroup;

Definition at line 182 of file sgframe.h.


Constructor & Destructor Documentation

SGFrameGroup::SGFrameGroup SuperGallery ParentGal,
Document ParentDoc = NULL,
Library ParentLib = NULL,
BOOL  IsForeground = TRUE
 

SGFrameGroup constructor. Initialises the Group's parent pointers to point at its parent(s). Note that generally speaking, one of ParentDoc, ParentLib will be NULL, and the other will be non-NULL.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> (Based on Jason's Layer gallery code)
Date:
16/4/97 (Based on Jason's Layer gallery code)
Parameters:
ParentGal - points to the SuperGallery object which 'owns' this node [INPUTS] ParentDoc - NULL, or a pointer to the document this group references ParentLib - NULL, or a pointer to the library this group references
Notes: This constructor does nothing - jusat passes the call on to the baseclass constructor of identical proportions.

See also:
SGDisplayGroup::SGDisplayGroup

Definition at line 185 of file sgframe.cpp.

00187                 : SGLayerGroup(ParentGal, ParentDoc, ParentLib, IsForeground)
00188 {
00189     Foreground = IsForeground;
00190 }


Member Function Documentation

SGFrameGroup::CC_DECLARE_DYNAMIC SGFrameGroup   )  [private]
 

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

Handles a SuperGallery DisplayTree event.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> (Based on Jason's Layer gallery code)
Date:
16/4/97 (Based on Jason's Layer gallery code)
Parameters:
See SGDisplayNode::HandleEvent [INPUTS]
Returns:
TRUE if the event was handled successfully FALSE if it was not
Notes: This overrides the SGDisplayNGroup::HandleEvent method, to give a group-type thing which does wierd stuff for layer galleries (i.e. does not fold, and gives column titles in the 'group' display)

See also:
SGDisplayGroup::HandleEvent

Reimplemented from SGLayerGroup.

Definition at line 217 of file sgframe.cpp.

00219 {
00220     // And handle the specific event
00221     switch (EventType)
00222     {
00223         case SGEVENT_REDRAW:
00224             {
00225                 DocRect MyRect(FormatRect); // Rely on cached format info being correct
00226 
00227                 SGRedrawInfo *RedrawInfo = GetRedrawInfo(EventType, EventInfo);
00228 
00229                 if (IMustRedraw(RedrawInfo))
00230                 {
00231                     StartRendering(RedrawInfo, MiscInfo);
00232 
00233                     DocColour Col(192L, 192L, 192L);    //128, 128, 128);
00234 
00235                     RedrawInfo->Renderer->SetLineWidth(0);
00236                     RedrawInfo->Renderer->SetLineColour(RedrawInfo->Transparent);
00237                     RedrawInfo->Renderer->SetFillColour(Col);
00238                     RedrawInfo->Renderer->DrawRect(&MyRect);
00239 
00240                     ReadGroupTitle();       // (Re)Cache the title text
00241 
00242                     // Line up above indented items below
00243                     MyRect.lo.x += IndentWidth + MiscInfo->PixelSize;
00244 
00245                     // Render column titles above the 'locked' and 'invisible' columns
00246                     DocRect VisibleBtn;
00247                     DocRect LockedBtn;
00248                     DocRect SnapBtn;
00249                     SGDisplayFrame::CalculateButtonRects(MiscInfo, &MyRect,
00250                                                          &VisibleBtn, &LockedBtn, &SnapBtn);
00251 
00252                     DrawBitmap(RedrawInfo->Renderer, &VisibleBtn, _R(IDB_FGAL_SOLID));
00253                     DrawBitmap(RedrawInfo->Renderer, &LockedBtn,  _R(IDB_FGAL_OVERLAY));
00254 
00255                     // And finally, render the title text
00256                     MyRect.lo.x += SG_GapBeforeText;    // Leave a small gap before text
00257                     if (MyRect.lo.x < MyRect.hi.x)      // If still room left, draw title
00258                     {
00259                         RedrawInfo->Renderer->SetFixedSystemTextColours(&RedrawInfo->Foreground, &Col);
00260                         
00261                         String_256 NewTitleText;
00262 
00263                         UINT32 IDS = _R(IDS_FRAMEGAL_FRAMES);
00264 
00265                         NewTitleText.MakeMsg(IDS, (TCHAR *)TitleText);
00266                         RedrawInfo->Renderer->DrawFixedSystemText(&NewTitleText, MyRect);
00267                     }
00268 
00269                     StopRendering(RedrawInfo, MiscInfo);
00270                 }
00271 
00272                 // Check if the cliprect overlaps any of our children - if not, then we
00273                 // can return now, passing the event on quickly without bothering to give
00274                 // it to our children.
00275                 if (GetChild() == NULL ||
00276                     !ChildArea.IsIntersectedWith(RedrawInfo->Bounds))
00277                 {
00278                     return(FALSE);
00279                 }
00280             }
00281             break;
00282 
00283 
00284         case SGEVENT_MOUSECLICK:
00285             // Mouse clicks on this group type are ignored - but we claim them so that the
00286             // event is not passed on around the tree unnecessarily.
00287             {
00288                 SGMouseInfo *MouseInfo = GetMouseInfo(EventType, EventInfo);
00289                 if (FormatRect.ContainsCoord(MouseInfo->Position))
00290                     return(TRUE);
00291             }
00292             break;      
00293 
00294 
00295         default:
00296             // For all other purposes (formatting etc), let the base class handle the event
00297             return(SGDisplayGroup::HandleEvent(EventType, EventInfo, MiscInfo));
00298             break;
00299     }
00300 
00301     // Pass the event on to my children, as appropriate, and return the result
00302     return(GiveEventToMyChildren(EventType, EventInfo, MiscInfo));
00303 }

BOOL SGFrameGroup::IsForeground  )  [inline]
 

Reimplemented from SGLayerGroup.

Definition at line 195 of file sgframe.h.

00195 { return Foreground; }


Member Data Documentation

BOOL SGFrameGroup::Foreground [private]
 

Reimplemented from SGLayerGroup.

Definition at line 198 of file sgframe.h.


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