SGOilClipartDragTarget Class Reference

Drag Target for the mainframe, so dragging clipart into a null document situation (behind all the docs) will load a new document. More...

#include <sglcart.h>

List of all members.

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


Detailed Description

Drag Target for the mainframe, so dragging clipart into a null document situation (behind all the docs) will load a new document.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/95
Notes: Drag targets are destructed automatically when a drag finishes by the drag manager with which they were registered.

To remove a drag target at any time, destruct it - it automatically deregisters and cleans up.

See also:
DragManagerOp::StartDrag; DragInformation; DragTarget; SGColourDragTarget::ProcessEvent
Documentation: Docs.doc; Docs.doc

Definition at line 509 of file sglcart.h.


Constructor & Destructor Documentation

SGOilClipartDragTarget::SGOilClipartDragTarget HWND  TheWindow,
CRect *  ClientArea = NULL
 

Constructor.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/95
Parameters:
TheWindow - Window to use for drag target [INPUTS] ClientArea - Rectangle in window to use for drag target

Definition at line 3321 of file sglcart.cpp.

03322                     : WinoilDragTarget(TheWindow, ClientArea)
03323 {
03324 }


Member Function Documentation

UINT32 SGOilClipartDragTarget::GetCursorID void   )  [virtual]
 

Get cursor ID.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/95
Returns:
Cursor ID for clipart drags over the mainframe

Definition at line 3337 of file sglcart.cpp.

03338 {
03339     return _R(IDC_CANDROPONPAGE);
03340 }

BOOL SGOilClipartDragTarget::GetStatusLineText String_256 TheText  )  [virtual]
 

Obtains status line text for when we're dragging an item of clipart over the blank mainframe area...

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/95
Parameters:
Text for status line [OUTPUTS]
Returns:
TRUE if we extracted a wee tad of status line text

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 }

BOOL SGOilClipartDragTarget::ProcessEvent DragEventType  Event,
DragInformation pDragInfo,
CPoint *  pMousePos,
KeyPress pKeyPress
[protected, virtual]
 

Process an event such as a completed drag...

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/12/95
Parameters:
Standard drag target stuff... [INPUTS]
Returns:
TRUE if we processed our event ok...

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 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Definition at line 511 of file sglcart.h.


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