OpCentredDragBox Class Reference

This is a base class for drag operations that would like a drag box to be centred on the initial click point, such as (optionally) the zoom tool. Apart from providing a new default CalcDragBox function, it is used the same way as OpDragBox. More...

#include <opdragbx.h>

Inheritance diagram for OpCentredDragBox:

OpDragBox Operation MessageHandler ListItem CCObject SimpleCCObject OpZoom OpZoomIn OpZoomOut OpZoomTo100 OpZoomTo200 OpZoomTo300 OpZoomTo400 List of all members.

Protected Member Functions

 OpCentredDragBox ()
 Default constructor for a centred drag-box operation.
virtual DocRect CalcDragBox (const DocCoord &dcStartPos, const DocCoord &dcMousePos) const

Private Member Functions

 CC_DECLARE_DYNCREATE (OpCentredDragBox)

Detailed Description

This is a base class for drag operations that would like a drag box to be centred on the initial click point, such as (optionally) the zoom tool. Apart from providing a new default CalcDragBox function, it is used the same way as OpDragBox.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/4/95
See also:
class OpDragBox

Definition at line 244 of file opdragbx.h.


Constructor & Destructor Documentation

OpCentredDragBox::OpCentredDragBox  )  [protected]
 

Default constructor for a centred drag-box operation.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/4/95
See also:
class OpDragBox

Definition at line 700 of file opdragbx.cpp.

00701 {
00702     // Empty.
00703 }


Member Function Documentation

DocRect OpCentredDragBox::CalcDragBox const DocCoord dcStartPos,
const DocCoord dcMousePos
const [protected, virtual]
 

Reimplemented from OpDragBox.

Reimplemented in OpZoom.

Definition at line 720 of file opdragbx.cpp.

00722 {
00723     // Find the half of the absolute width and height of the drag box.
00724     MILLIPOINT nWidth2 = dcStartPos.x - dcMousePos.x;
00725     if (nWidth2 < 0) nWidth2 = -nWidth2;
00726     MILLIPOINT nHeight2 = dcStartPos.y - dcMousePos.y;
00727     if (nHeight2 < 0) nHeight2 = -nHeight2;
00728     
00729     // Return a rectangle of this width and height centre on the click point.
00730     return DocRect(dcStartPos.x - nWidth2, dcStartPos.y - nHeight2,
00731                    dcStartPos.x + nWidth2, dcStartPos.y + nHeight2);
00732 }

OpCentredDragBox::CC_DECLARE_DYNCREATE OpCentredDragBox   )  [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:57:35 2007 for Camelot by  doxygen 1.4.4