SGLayerGroup 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 <sglayer.h>

Inheritance diagram for SGLayerGroup:

SGDisplayGroup SGDisplayNode CCObject SimpleCCObject SGFrameGroup List of all members.

Public Member Functions

 SGLayerGroup (SuperGallery *ParentGal, Document *ParentDoc=NULL, Library *ParentLib=NULL, BOOL IsForeground=TRUE)
 SGLayerGroup 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 (SGLayerGroup)

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:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/2/95
See also:
SuperGallery; SGDisplayGroup;

Definition at line 202 of file sglayer.h.


Constructor & Destructor Documentation

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

SGLayerGroup 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:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/10/94
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 199 of file sglayer.cpp.

00201                 : SGDisplayGroup(ParentGal, ParentDoc, ParentLib)
00202 {
00203     Foreground = IsForeground;
00204 }


Member Function Documentation

SGLayerGroup::CC_DECLARE_DYNAMIC SGLayerGroup   )  [private]
 

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

Handles a SuperGallery DisplayTree event.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/2/95
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 SGDisplayGroup.

Reimplemented in SGFrameGroup.

Definition at line 231 of file sglayer.cpp.

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

BOOL SGLayerGroup::IsForeground  )  [inline]
 

Reimplemented in SGFrameGroup.

Definition at line 215 of file sglayer.h.

00215 { return Foreground; }


Member Data Documentation

BOOL SGLayerGroup::Foreground [private]
 

Reimplemented in SGFrameGroup.

Definition at line 218 of file sglayer.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