#include <sglcart.h>
Public Member Functions | |
SGOilClipartDragTarget (HWND TheWindow, CRect *ClientArea=NULL) | |
Constructor. | |
virtual UINT32 | GetCursorID () |
Get cursor ID. | |
virtual BOOL | GetStatusLineText (String_256 *TheText) |
Obtains status line text for when we're dragging an item of clipart over the blank mainframe area... | |
Protected Member Functions | |
virtual BOOL | ProcessEvent (DragEventType Event, DragInformation *pDragInfo, CPoint *pMousePos, KeyPress *pKeyPress) |
Process an event such as a completed drag... | |
Friends | |
class | DragManagerOp |
To remove a drag target at any time, destruct it - it automatically deregisters and cleans up.
Definition at line 509 of file sglcart.h.
|
Constructor.
Definition at line 3321 of file sglcart.cpp.
|
|
Get cursor ID.
Definition at line 3337 of file sglcart.cpp. 03338 { 03339 return _R(IDC_CANDROPONPAGE); 03340 }
|
|
Obtains status line text for when we're dragging an item of clipart over the blank mainframe area...
Definition at line 3355 of file sglcart.cpp. 03356 { 03357 ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()"); 03358 03359 DragInformation *pDragInfo = DragManagerOp::GetCurrentDragInfo(); 03360 if (pDragInfo == NULL || !pDragInfo->IsKindOf(CC_RUNTIME_CLASS(GalleryClipartDragInfo))) 03361 return(FALSE); 03362 SGClipartItem *pClipartItem = ((GalleryClipartDragInfo *)pDragInfo)->SourceItem; 03363 03364 String_256 DragString; 03365 String_256 ItemName; 03366 pClipartItem->GetNameText(&ItemName); 03367 03368 // "Dragging clipart '#1%s' : Drop to open a new document containing the clipart" 03369 DragString.MakeMsg(_R(IDS_CLIPART_DRAGGING), (TCHAR *)ItemName); 03370 DragString += String_8(_R(IDS_SGDFONTS_STAT_COLON_SEP)); 03371 DragString += String_256(_R(IDS_CLIPART_OPEN_DROP)); 03372 03373 *TheText = DragString; 03374 return TRUE; 03375 }
|
|
Process an event such as a completed drag...
Definition at line 3390 of file sglcart.cpp. 03392 { 03393 if (!pDragInfo->IsKindOf(CC_RUNTIME_CLASS(GalleryClipartDragInfo))) 03394 return(FALSE); 03395 03396 SGDisplayNode *DraggedNode = NULL; 03397 BOOL IsSimpleClipartDrag = TRUE; 03398 03399 if (IS_A(pDragInfo, GalleryClipartDragInfo)) 03400 { 03401 DraggedNode = ((GalleryClipartDragInfo *)pDragInfo)->GetDraggedClipart(); 03402 IsSimpleClipartDrag = FALSE; 03403 } 03404 03405 if (DraggedNode != NULL) 03406 { 03407 switch(Event) 03408 { 03409 case DRAGEVENT_COMPLETED: 03410 { 03411 // Open the clipart file into a brand-spanking-new document 03412 return(((GalleryClipartDragInfo *)pDragInfo)->OnMainFrameDrop(this)); 03413 } 03414 03415 case DRAGEVENT_MOUSESTOPPED: 03416 case DRAGEVENT_MOUSEMOVED: 03417 case DRAGEVENT_MOUSEIDLE: 03418 return(TRUE); // Claim the event so the mouse cursor changes 03419 } 03420 } 03421 03422 // Otherwise, we aren't interested in the event, so we don't claim it 03423 return(FALSE); 03424 }
|
|
|