ViewDragTarget Class Reference

An instantiation of this class is created by each entity which wishes to provide a 'destination' to which the mouse can go to complete a drag. WinoilDragTargets are used as a base class from which to derive drag targets for WINOIL entities (an optional HWND). More...

#include <camview.h>

Inheritance diagram for ViewDragTarget:

OilDragTarget DragTarget ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ViewDragTarget (wxWindow *TheWindow, wxRect *ClientArea=NULL, DragInformation *pDragInfo=NULL)
 Constructor.
virtual UINT32 GetCursorID ()
 Base Method to set cursor over this target.
virtual BOOL GetStatusLineText (String_256 *TheText)
 provide status line text for this target
virtual BOOL GetDropInfo (PageDropInfo *)
 Get info about the current drag state of this target.
 ViewDragTarget (wxWindow *TheWindow, CRect *ClientArea=NULL, DragInformation *pDragInfo=NULL)
virtual UINT32 GetCursorID ()
 Base Method to set cursor over this target.
virtual BOOL GetStatusLineText (String_256 *TheText)
 

virtual BOOL GetDropInfo (PageDropInfo *)

Protected Member Functions

BOOL ProcessEvent (DragEventType Event, DragInformation *pDragInfo, wxPoint *pMousePos, KeyPress *pKeyPress)
 Event Handler for View Drag target.
BOOL ProcessEvent (DragEventType Event, DragInformation *pDragInfo, wxPoint *pMousePos, KeyPress *pKeyPress)
 To process a drag-specific event. By default this method does nothing, just returning FALSE so that the event is left unclaimed, and is thus passed on to other interested drag targets.

Protected Attributes

DragInformationpCurrentDragInfo
BOOL OverOutline
INT32 LineRad
DocViewpThisDoc
SpreadpSpread
DocCoord DropPos
ObjectDragTarget OverTarget
NodeRenderableInkOverNode
DragInformationpCurrentDragInfo
DocViewpThisDoc
SpreadpSpread
NodeRenderableInkOverNode

Friends

class DragManagerOp
class ColourDragInformation

Detailed Description

An instantiation of this class is created by each entity which wishes to provide a 'destination' to which the mouse can go to complete a drag. WinoilDragTargets are used as a base class from which to derive drag targets for WINOIL entities (an optional HWND).

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>.
Date:
2/1/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
Documentation: Docs.doc

Definition at line 500 of file camview.h.


Constructor & Destructor Documentation

ViewDragTarget::ViewDragTarget wxWindow *  TheWindow,
wxRect *  ClientArea = NULL,
DragInformation pDragInfo = NULL
 

Constructor.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5245 of file camview.cpp.

05246         : OilDragTarget(TheWindow,ClientArea)
05247 {
05248     pThisDoc =  CCamView::GetDocViewFromWindow(TheWindow);
05249     OverOutline = FALSE;
05250     OverNode = NULL;
05251 
05252     pCurrentDragInfo = pDragInfo;
05253 
05254     DocView::GetCurrentMousePos(&pSpread, &DropPos);
05255     
05256     // Find out the Magnetic Line Radius preference from its owner
05257     LineRad = NodeRenderableBounded::MagneticLineRadius;
05258     
05259     // Scale it according to the ScaleFactor.
05260     if (pThisDoc!=NULL)
05261     {
05262         // Get the Scale factor and modify the magnetic radius
05263         double Scale = pThisDoc->GetViewScale().MakeDouble();
05264         LineRad = (INT32) ((double)LineRad / Scale);
05265     }
05266 
05267 }

ViewDragTarget::ViewDragTarget wxWindow *  TheWindow,
CRect *  ClientArea = NULL,
DragInformation pDragInfo = NULL
 


Member Function Documentation

virtual UINT32 ViewDragTarget::GetCursorID void   )  [virtual]
 

Base Method to set cursor over this target.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/95

Reimplemented from DragTarget.

UINT32 ViewDragTarget::GetCursorID void   )  [virtual]
 

Base Method to set cursor over this target.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/95

Reimplemented from DragTarget.

Definition at line 5282 of file camview.cpp.

05283 {
05284     ERROR2IF(pCurrentDragInfo==NULL,FALSE,"No DragInfo available when getting Cursor");
05285 
05286     return pCurrentDragInfo->GetCursorID(this);
05287 }

virtual BOOL ViewDragTarget::GetDropInfo PageDropInfo  )  [virtual]
 

BOOL ViewDragTarget::GetDropInfo PageDropInfo pDropInfo  )  [virtual]
 

Get info about the current drag state of this target.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5326 of file camview.cpp.

05327 {
05328     ERROR2IF(pDropInfo==NULL,FALSE,"NULL DropInfo pass to GetDropInfo()");
05329 
05330     pDropInfo->pDocView = pThisDoc;
05331     pDropInfo->pDoc     = pThisDoc->GetDoc();
05332     pDropInfo->pSpread  = pSpread;
05333     pDropInfo->DropPos  = DropPos;
05334 
05335     pDropInfo->TargetHit    = OverTarget;
05336     pDropInfo->pObjectHit   = OverNode;
05337 
05338     return TRUE;
05339 }

virtual BOOL ViewDragTarget::GetStatusLineText String_256 TheText  )  [virtual]
 

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/1/95
Returns:
a cursor ID to set during this drag

Reimplemented from DragTarget.

BOOL ViewDragTarget::GetStatusLineText String_256 TheText  )  [virtual]
 

provide status line text for this target

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/1/95
Returns:
Whether String is valid

Reimplemented from DragTarget.

Definition at line 5303 of file camview.cpp.

05304 {
05305     ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");
05306     ERROR2IF(pCurrentDragInfo==NULL,FALSE,"No DragInfo available when getting Status Text");
05307 
05308     return pCurrentDragInfo->GetStatusLineText(TheText, this);
05309 }

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

To process a drag-specific event. By default this method does nothing, just returning FALSE so that the event is left unclaimed, and is thus passed on to other interested drag targets.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/1/95
Parameters:
Event - Specifies what type of event has occurred [INPUTS] pDragInfo - Specifies a descriptor describing the currently active drag pMousePos - Specifies the last known mouse coordinates, in terms of client area coordinates within the drag target window (or screen coordinates if no window was specified on registering) pKeyPress - NULL, or a pointer to the key pressed (for KEYPRESS events)
Notes: Each derived DragTarget class should override this method to handle events in a manner appropriate for the target.

BE VERY CAREFUL to only override the winoil parts of this interface!

See also:
keyword DragEventType
Documentation: Docs.doc

Reimplemented from OilDragTarget.

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

Event Handler for View Drag target.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from OilDragTarget.

Definition at line 5358 of file camview.cpp.

05361 {
05362     switch (Event)
05363     {
05364         case DRAGEVENT_INITIALISE:
05365             break;
05366         case DRAGEVENT_DEINITIALISE:
05367             break;
05368         case DRAGEVENT_ABORT:
05369             break;
05370         case DRAGEVENT_KEYPRESS:
05371             break;
05372         case DRAGEVENT_COMPLETED:
05373             {
05374                 // Do another HitTest check
05375                 OverNode = NULL;
05376                 DocView::GetCurrentMousePos(&pSpread, &DropPos);
05377                 OverTarget = pThisDoc->IsPointerOverNode(&OverNode,LineRad,FALSE,TRUE);
05378     
05379                 if (!OverNode) OverTarget = NO_TARGET;
05380     
05381                 // call doc dragfinished to do whatever is needed
05382                 return pThisDoc->DM_DragFinished(pDragInfo,this);
05383                 break;
05384             }
05385         case DRAGEVENT_MOUSESTOPPED:
05386         case DRAGEVENT_MOUSEMOVED:
05387         case DRAGEVENT_MOUSEIDLE:
05388             {
05389                 OverNode = NULL;
05390                 DocView::GetCurrentMousePos(&pSpread, &DropPos);
05391                 OverTarget = pThisDoc->IsPointerOverNode(&OverNode,LineRad, TRUE, TRUE);
05392     
05393                 if (!OverNode) OverTarget = NO_TARGET;
05394     
05395                 return TRUE;
05396                 break;
05397             }
05398         default:
05399             break;
05400     }
05401     return FALSE;
05402 }


Friends And Related Function Documentation

ColourDragInformation [friend]
 

Definition at line 503 of file camview.h.

DragManagerOp [friend]
 

Reimplemented from OilDragTarget.

Definition at line 502 of file camview.h.


Member Data Documentation

DocCoord ViewDragTarget::DropPos [protected]
 

Definition at line 531 of file camview.h.

INT32 ViewDragTarget::LineRad [protected]
 

Definition at line 527 of file camview.h.

NodeRenderableInk* ViewDragTarget::OverNode [protected]
 

Definition at line 589 of file scrvw.h.

NodeRenderableInk* ViewDragTarget::OverNode [protected]
 

Definition at line 534 of file camview.h.

BOOL ViewDragTarget::OverOutline [protected]
 

Definition at line 526 of file camview.h.

ObjectDragTarget ViewDragTarget::OverTarget [protected]
 

Definition at line 533 of file camview.h.

DragInformation* ViewDragTarget::pCurrentDragInfo [protected]
 

Definition at line 579 of file scrvw.h.

DragInformation* ViewDragTarget::pCurrentDragInfo [protected]
 

Definition at line 524 of file camview.h.

Spread* ViewDragTarget::pSpread [protected]
 

Definition at line 585 of file scrvw.h.

Spread* ViewDragTarget::pSpread [protected]
 

Definition at line 530 of file camview.h.

DocView* ViewDragTarget::pThisDoc [protected]
 

Definition at line 584 of file scrvw.h.

DocView* ViewDragTarget::pThisDoc [protected]
 

Definition at line 529 of file camview.h.


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