#include <sglib.h>
Inheritance diagram for SGLibGroup:
Public Member Functions | |
SGLibGroup (SuperGallery *ParentGal, Document *ParentDoc, Library *ParentLib) | |
SGLibGroup 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 void | ReadGroupTitle (void) |
Since we now store the group text with the group, we have to overwrite the normal ReadGroupTitle member. This new one simply does nothing. | |
virtual BOOL | HandleEvent (SGEventType EventType, void *EventInfo, SGMiscInfo *MiscInfo) |
Handles a library group event - thumbnail resizing, etc... | |
virtual 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. | |
virtual 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. | |
virtual BOOL | CanVirtualise (void) |
Some groups shouldn't virtualise out to disk (the installed font group for example). Such groups should override this and return FALSE. | |
virtual BOOL | DeVirtualise (void) |
Virtualise a group back into memory. | |
Static Public Attributes | |
static BOOL | LibraryVirtualisingEnabled = TRUE |
Private Member Functions | |
CC_DECLARE_DYNAMIC (SGLibGroup) |
Definition at line 329 of file sglib.h.
|
SGLibGroup 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.
Definition at line 2440 of file sglib.cpp. 02442 : SGDisplayGroup(ParentGal, ParentDoc, ParentLib) 02443 { 02444 // Library groups can be selected 02445 Flags.CanSelect = TRUE; 02446 02447 SetVirtualisedState(FALSE); 02448 }
|
|
Some groups shouldn't virtualise out to disk (the installed font group for example). Such groups should override this and return FALSE.
Reimplemented from SGDisplayGroup. Definition at line 2705 of file sglib.cpp. 02706 { 02707 return SGLibGroup::LibraryVirtualisingEnabled; 02708 }
|
|
|
|
Virtualise a group back into memory.
Reimplemented from SGDisplayGroup. Definition at line 2723 of file sglib.cpp. 02724 { 02725 if(!IsVirtualised()) 02726 return TRUE; 02727 02728 // On older machines this can take a couple of seconds, so we need some feedback... 02729 Progress ProgMsg(_R(IDS_GALLERY_PREPARE_FOR_UNFOLD), -1/*, FALSE*/); 02730 ParentLibrary->ProgressBar = &ProgMsg; // ::Init will call update if this is non-null 02731 02732 INT32 Count = ParentLibrary->CreateItems(); 02733 02734 #ifdef _DEBUG 02735 ForceRedrawOfMyselfAndChildren(); 02736 #endif 02737 02738 ParentLibrary->ProgressBar = NULL; 02739 02740 return (Count > 0); 02741 }
|
|
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.
Reimplemented from SGDisplayNode. Definition at line 2613 of file sglib.cpp. 02614 { 02615 ERROR3IF(MousePos == NULL || Result == NULL, "Invalid NULL params"); 02616 02617 return FALSE; 02618 }
|
|
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.
Reimplemented from SGDisplayNode. Definition at line 2649 of file sglib.cpp. 02650 { 02651 ERROR3IF(MousePos == NULL || Result == NULL, "Invalid NULL params"); 02652 02653 if(MousePos->x <= GROUP_BAR_ICON_WIDTH) 02654 { 02655 if(Flags.Folded) 02656 /* "Click to open this section of the gallery"; */ 02657 Result->MakeMsg(_R(IDS_LIBRARY_FOLDER_CLICK_TO_OPEN)); 02658 else 02659 /* "Click to close this section of the gallery"; */ 02660 Result->MakeMsg(_R(IDS_LIBRARY_FOLDER_CLICK_TO_CLOSE)); 02661 } 02662 else 02663 { 02664 if(Flags.Selected) 02665 { 02666 /* "Ctrl-Click to deselect" */ 02667 Result->MakeMsg(_R(IDS_LIBRARY_SECTION_CLICK_SELECTED)); 02668 *Result += String_8(_R(IDS_SGFONTS_STATUS_LINE_SEP)); // "; " 02669 } 02670 else if(Flags.CanSelect) 02671 { 02672 /* "Click to select" */ 02673 Result->MakeMsg(_R(IDS_LIBRARY_SECTION_CLICK_DESELECTED)); 02674 *Result += String_8(_R(IDS_SGFONTS_STATUS_LINE_SEP)); // "; " 02675 } 02676 02677 String_256 DClick; 02678 if(Flags.Folded) 02679 /* "Double click to open this section of the gallery"; */ 02680 DClick.MakeMsg(_R(IDS_LIBRARY_SECTION_DCLICK_TO_OPEN)); 02681 else 02682 /* "Double click to close this section of the gallery"; */ 02683 DClick.MakeMsg(_R(IDS_LIBRARY_SECTION_DCLICK_TO_CLOSE)); 02684 02685 *Result += DClick; 02686 } 02687 return(TRUE); 02688 }
|
|
Handles a library group event - thumbnail resizing, etc...
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.
Reimplemented from SGDisplayGroup. Definition at line 2501 of file sglib.cpp. 02502 { 02503 switch (EventType) 02504 { 02505 case SGEVENT_THUMBMSG: 02506 { 02507 ThumbMessage *Msg = (ThumbMessage *) EventInfo; 02508 if(Msg != NULL) 02509 { 02510 switch (Msg->State) 02511 { 02512 // Resize the library thumbnail cache 02513 case ThumbMessage::ThumbState::CACHESIZECHANGED: 02514 { 02515 Library *TheLib = GetParentLibrary(); 02516 02517 if(TheLib == NULL) 02518 { 02519 ERROR3("SGLibGroup::HandleEvent Library == NULL for library group - bad !!!"); 02520 } 02521 else 02522 { 02523 // Thumbnail cache associated with library 02524 SGThumbs *Thumbs = TheLib->Thumbnails; 02525 02526 if(Thumbs != NULL) 02527 { 02528 // Rip the details out of the old cache 02529 PathName OldPath(*(Thumbs->GetDirectory())); 02530 SGLibType OldType = Thumbs->GetType(); 02531 SGThumbSize OldSize; 02532 Thumbs->GetSize(&OldSize); 02533 02534 // Just check the new cache will know it's maximum size 02535 SGThumbs::MaxThumbnails = Msg->NewSize; 02536 02537 // Kill off the old cache and reclaim all the memory 02538 delete Thumbs; 02539 02540 // Create the new cache 02541 Thumbs = new SGThumbs(&OldPath, OldType, OldSize); 02542 02543 // Assign the new cache to the library 02544 TheLib->Thumbnails = Thumbs; 02545 } 02546 } 02547 } 02548 break; 02549 02550 case ThumbMessage::ThumbState::KILLCACHE: 02551 { 02552 Library *TheLib = GetParentLibrary(); 02553 02554 if(TheLib == NULL) 02555 { 02556 ERROR3("SGLibGroup::HandleEvent Library == NULL for library group - bad !!!"); 02557 } 02558 else 02559 { 02560 // Thumbnail cache associated with library 02561 SGThumbs *Thumbs = TheLib->Thumbnails; 02562 02563 if(Thumbs != NULL) 02564 { 02565 if(Thumbs->GetType() == Msg->Type) 02566 { 02567 // Reclaim thumbnail cache memory 02568 Thumbs->DeleteThumbnails(); 02569 } 02570 } 02571 } 02572 } 02573 break; 02574 } 02575 } 02576 } 02577 break; 02578 } 02579 02580 // Pass back the event 02581 return SGDisplayGroup::HandleEvent(EventType, EventInfo, MiscInfo); 02582 }
|
|
Since we now store the group text with the group, we have to overwrite the normal ReadGroupTitle member. This new one simply does nothing.
Reimplemented from SGDisplayGroup. Definition at line 2463 of file sglib.cpp.
|
|
|