[Classes] [Prev] [Next] [Methods]

CWireFrame

Methods Index

Heritage
Description
Usage
Enums
Public Data Members
Protected Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Dragging and Stretching Methods
Selection Methods
Mouse Events
Inherited Utility Methods
Method for Dragging or Sizing the Owner CView Object
Protected Methods
Methods for Dragging or Sizing the Wire Frame During Mouse Dragging
Methods for Drawing/Erasing a Group Wire Frame
Methods for Checking Whether a Mouse Click is for Dragging or Sizing
Scrolling Event Methods

CWireFrame


Heritage

Superclass: CView

Subclasses: CHorizontalWireFrame, CVerticalWireFrame


Description

CWireFrame provides a type of CView that acts as a helper class to all other classes in the CView hierarchy. It is a rectangular rubberband frame that surrounds a CView object, enabling it to be dragged and sized with the mouse.


Usage

A wire frame is normally not instantiated directly; instead, it is created automatically by CView when necessary. Typically, you do not need to be aware of this class since it is used internally. However, CWireFrame is documented here in case you want to override this class and modify it so that the wire frame draws differently or alter the way that the rubberbanding, sizing, and dragging are implemented. If you do this, you can set a view's wire frame by calling CView::SetWireFrame.

Views normally use a wire frame when the user enables the sizing or dragging properties. If several views have wire frames, this class automatically takes care of selecting and deselecting views as the user clicks on various views. In order to select more than one view at a time, the user must hold down the Shift key while selecting or click the right mouse button on the view (multi-button mouse). Finally, if multiple views are selected, they move as a group when the user drags the mouse.


Enums

STATE

DRAGGING If an object is being dragged
SIZING If an object is being sized
IDLE If an object is idle
SELECTED If an object is selected
SCROLLING If an object scrolled

DRAWINGSTATE

WFSHOW If an object is visible
WFHIDE If an object is hidden
WFUPDATE If an object is being updated


Public Data Members

static const int WIRESIZE; The size difference between the wire frame and itsOwner
static const int GRABBERSIZE; The size of the sizing grabbers


Protected Data Members

STATE itsState; The current event state
DRAWSTATE itsDrawState; Internal drawing state flag
CPoint itsGrabPoint; The point that was grabbed
long itsSelectCommand; Command generated upon selection
long itsDeselectCommand; Command generated upon deselection
long itsSizeCommand; Command generated upon moving/sizing
long itsSizeSide; The side to be sized
CRect itsMinimalRegion; The smallest size possible
BOOLEAN itIsDraggable; Whether the wire frame can receive dragging events
BOOLEAN itIsSizable; Whether the wire frame can receive sizing events
PNT* itsFramePnts; The ending point of the sizing area
CView* itsOwner; The CView it sizes
CSubview* itsGroupEnclosure; The selected group enclosure
BOOLEAN itsGrabState; Internal grabber state flag
BOOLEAN isGroupMode; Whether the wire frame is in group mode
UNITS itsGroupLeft; Group's left boundary
UNITS itsGroupRight; Group's right boundary
UNITS itsGroupTop; Group's top boundary
UNITS itsGroupBottom; Group's bottom boundary


Public Methods

Constructor, Destructor, and Initializer Methods

CWireFrame(CView *theOwner, 
CSubview* theGroupEnclosure = NULL);
CWireFrame(const CWireFrame& theFrame);
CWireFrame& operator=(const CWireFrame& theFrame);
virtual ~CWireFrame(void);
virtual BOOLEAN IWireFrame(
BOOLEAN isSizable = FALSE,
BOOLEAN isDraggable = FALSE,
UNITS theMinimalWidth = 0,
UNITS theMinimalHeight = 0);

Dragging and Stretching Methods

Wire frames can generate these events: WFSelectCmd, WFDeselectCMd, and WFMoveCmd, depending on whether a view is selected, deselected, or moved/sized. DoCommands can pass along data in the form of a void pointer so that wire frame events can send along a pointer to the view object that is selected, deselected, or moved. Thus, users can trap the selection, deselection, or moving of views as these events happen by putting a case in the DoCommands.

virtual void SetDragging(BOOLEAN isDraggable);
virtual void SetSizing(BOOLEAN isSizable);
virtual BOOLEAN IsSizable(void) const;
virtual BOOLEAN IsDraggable(void) const;

Selection Methods

virtual BOOLEAN IsSelected(void) const;
virtual void Select(void);
virtual void DoDeselect(CView* theView);
virtual void Deselect(CView* theView);
virtual CView* GetOwner(void) const;
virtual CSubview* GetGroupEnclosure(void) const;
virtual void SetGroupEnclosure(CSubview* theGroupEnclosure) const;

Mouse Events

The mouse methods in this section have been overridden to implement the sizing and dragging of the wire frame. Each of the following methods has a theButton argument that specifies which mouse button is used and can have the values 0 (left), 1 (middle), or 2 (right). By default, neither the Shift key nor the Control key is used in conjunction with the mouse button.

virtual void MouseDouble(CPoint theLocation, 
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);
virtual void MouseDown(CPoint theLocation,
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);
virtual void MouseMove(CPoint theLocation,
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);
virtual void MouseUp(CPoint theLocation,
short theButton = 0,
BOOLEAN isShiftKey = FALSE,
BOOLEAN isControlKey = FALSE);

Inherited Utility Methods

virtual void Draw(const CRect& theClippingRegion);
virtual void Size(const CRect& theNewSize);
virtual void SetOrigin(const CPoint& theDeltaPoint);

virtual void SetFont(const CFont &theNewFont, 
BOOLEAN isUpdate = FALSE);

Method for Dragging or Sizing the Owner CView Object

BOOLEAN SizeOwner(void);


Protected Methods

virtual void DrawWireFrame(BOOLEAN isDrawing);
virtual void DrawFrameGrabbers(BOOLEAN isDrawing);

Methods for Dragging or Sizing the Wire Frame During Mouse Dragging

virtual void Drag(CPoint theNewLocation);
virtual void ReSize(CPoint theNewLocation);

Methods for Drawing/Erasing a Group Wire Frame

void SetGroupRegion(void);
void ClearGroupRegion(void);

Methods for Checking Whether a Mouse Click is for Dragging or Sizing

virtual BOOLEAN DoDraggingCheck(const CPoint& theLocation);
virtual BOOLEAN DoBorderCheck(const CPoint& theLocation);

Scrolling Event Methods

virtual void DoAutoScroll(UNITS theHorizontalIncrement, UNITS theVerticalIncrement);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.