#include <sglcart.h>
Inheritance diagram for SGClipartItem:
Public Member Functions | |
SGClipartItem () | |
~SGClipartItem () | |
SGClipartItem (LibraryIndex LibraryIndexToDisplay, BOOL bNew=FALSE) | |
Creates and initialises a new item for the clipart gallery Notes:. | |
LibDisplayType | GetDisplayType (SGMiscInfo *MiscInfo) |
Return the display type to use - clipart gallery override Notes:. | |
Protected Member Functions | |
virtual BOOL | HandleEvent (SGEventType EventType, void *EventInfo, SGMiscInfo *MiscInfo) |
Handles a SuperGallery DisplayTree event. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (SGClipartItem) |
Definition at line 378 of file sglcart.h.
|
Definition at line 2648 of file sglcart.cpp.
|
|
Definition at line 2652 of file sglcart.cpp. 02653 { 02654 TRACEUSER( "Matt", _T("~SGClipartItem called\n")); 02655 }
|
|
Creates and initialises a new item for the clipart gallery Notes:.
Definition at line 2641 of file sglcart.cpp. 02641 : 02642 SGLibDisplayItem(LibraryIndexToDisplay, bNew) 02643 { 02644 }
|
|
|
|
Return the display type to use - clipart gallery override Notes:.
Reimplemented from SGLibDisplayItem. Definition at line 2607 of file sglcart.cpp. 02608 { 02609 switch(MiscInfo->DisplayMode) 02610 { 02611 case 2: 02612 return LibDisplay_SmallThumbText; 02613 break; 02614 case 1: 02615 return LibDisplay_FullInfo; 02616 break; 02617 case 0: 02618 default: 02619 return LibDisplay_LargeThumbTextUnder; 02620 break; 02621 } 02622 02623 return LibDisplay_LargeThumbTextUnder; 02624 }
|
|
Handles a SuperGallery DisplayTree event.
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.
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.
Reimplemented from SGLibDisplayItem. Definition at line 2710 of file sglcart.cpp. 02711 { 02712 switch (EventType) 02713 { 02714 case SGEVENT_MOUSECLICK: 02715 { 02716 SGMouseInfo *Mouse = GetMouseInfo(EventType, EventInfo); 02717 02718 if (Mouse != NULL && FormatRect.ContainsCoord(Mouse->Position)) 02719 { 02720 if(LibClipartSGallery::DoSounds) 02721 { 02722 Library *Lib = GetParentLibrary(); 02723 if (Lib != NULL) 02724 { 02725 String_64 Key("Sample"); 02726 String_256 SampleString; 02727 Lib->GetSingleField(TheLibraryIndex, &Key, &SampleString); 02728 if(SampleString.Length() > 2) 02729 { 02730 String_256 SubPath = Lib->SubLibPath->GetPath(); 02731 BOOL Done = SGLibOil::PlayRandomSample(&SampleString, &SubPath); 02732 ERROR3IF(!Done, "Problems playing sample"); 02733 } 02734 } 02735 } 02736 02737 INT32 XSize=0, YSize=0; 02738 if(SGLibDisplayItem::StartDrag(EventType, EventInfo, MiscInfo, &XSize, &YSize)) 02739 { 02740 GalleryClipartDragInfo *DragClipart; 02741 DragClipart = new GalleryClipartDragInfo(this, Mouse, MiscInfo, 02742 Mouse->MenuClick, XSize, YSize); 02743 if (DragClipart != NULL) 02744 DragManagerOp::StartDrag(DragClipart, GetListWindow()); 02745 else 02746 { 02747 if(LibClipartSGallery::TmpDraggingBitmap != NULL) 02748 { 02749 delete LibClipartSGallery::TmpDraggingBitmap; 02750 LibClipartSGallery::TmpDraggingBitmap = NULL; 02751 } 02752 } 02753 } 02754 return TRUE; // Claim this event - nobody else can own this click 02755 } 02756 } 02757 } 02758 02759 return(SGLibDisplayItem::HandleEvent(EventType, EventInfo, MiscInfo)); 02760 }
|