CCamView Class Reference

This OIL class implements many window functions, such as scrolling and sizing the editing windows. As such, it acts as an intermediary between the kernel and the host operating system. It is derived from the wx class wxView, which provides comprehensive methods for managing the client area of a window. More...

#include <camview.h>

Inheritance diagram for CCamView:

ScreenView ScreenCamView List of all members.

Public Member Functions

 CCamView ()
 Default constructor for a CCamView window. Sets the pointers to the child windows to null, so that an incomplete construction of the view that is later destroyed won't try to delete invalid pointers. The Windows side of construction is done later, in the OnCreate() message handler.
virtual ~CCamView ()
 Destroys a CCamView window. Deletes child windows first. Updates the CCamView population counter.
virtual bool OnCreate (wxDocument *doc, long flags)
bool OnClose (bool deleteWindow=TRUE)
wxMDIChildFrame * GetParentFrame () const
CCamDocGetDocument () const
ViewStateGetViewState () const
ViewStateSetViewState (ViewState *pvs)
void SetViewStateFromThis () const
void SetThisFromViewState ()
BOOL IsTopmost () const
 Tests if this ScreenView is the active view, ie. is on top of all other views.
virtual CNativeDCGetRenderDC () const
virtual void AllocateDC () const
virtual void DoneWithDC () const
void GetClientSize (int *width, int *height) const
virtual void OnDraw (wxDC *pDc)
virtual BOOL OnPreparePrinting (CCPrintInfo *pInfo)
virtual void OnFilePrint ()
virtual void OnFilePrintPreview ()
CRenderWndGetRenderWindow () const
void InvalidateView (const OilRect *pRect=0, BOOL updatenow=FALSE)
void OnSize (wxSizeEvent &event)
 Resizes and repositions all child windows to fit the new size of the ScreenView. Updates the ViewState object with the size and position of the view, in an OS-independent manner. Resets the scroller's page and line size, and forces an immediate redraw of all affected windows.
void OnLButtonDown (wxMouseEvent &event)
 Called by MFC upon receipt of a left-button-down mouse message. Finds out which other buttons are down (eg. SHIFT) and passes the message on to the kernel. Note that the mouse message will have originally come from the RendWnd object, a child window of ScreenView.
void OnLButtonDblClk (wxMouseEvent &event)
 Passes a left-button double-click to CCamView::HandleDragEvent().
void OnLButtonUp (wxMouseEvent &event)
 Passes the event on to HandleButtonUp().
void OnMButtonDown (wxMouseEvent &event)
 Called by MFC upon receipt of a middle-button-down mouse message. Finds out which other buttons are down (eg. SHIFT) and passes the message on to the kernel. Note that the mouse message will have originally come from the RendWnd object, a child window of ScreenView.
void OnMButtonDblClk (wxMouseEvent &event)
 Passes a middle-button double-click to CCamView::HandleDragEvent().
void OnMButtonUp (wxMouseEvent &event)
 Passes the event on to HandleButtonUp().
void OnRButtonDown (wxMouseEvent &event)
 Same as for CCamView::OnLButtonDown(), but for the right mouse button.
void OnRButtonDblClk (wxMouseEvent &event)
 Same as CCamView::OnLButtonDblClk(), bit for the right button.
void OnRButtonUp (wxMouseEvent &event)
 Same as CCamView::OnLButtonUp(), but for the right mouse button.
void OnMouseMove (wxMouseEvent &event)
 Packages up OIL-layer mouse-move messages before passing them on to DocView::DragPointerMove(). If ScreenView is not in "drag mode" the event is passed to our DocView, which will forward it to the current tool. Otherwise, checks if a CLICKTYPE_DRAG message has been sent to the kernel, sending one if it hasn't (this smooths the difference between Windows and RISC OS, the former system providing little support for drag operations).
void OnMouseWheel (wxMouseEvent &event)
 Scope: Protected.
void OnScroll (wxScrollEvent &event)
 Handles all the scroll events.
void OnDragIdle (wxTimerEvent &event)
 Sends DragPointerIdle "events" to the kernel, when dragging. As Windows doesn't support such "idle" messages, the OIL drag system sets up a timer when a drag starts, and sends idle messages every time the timer elapses, until the drag is finished.
void OnSetCursor (wxSetCursorEvent &event)
 Eat the cursor update requests to stop anyone else playing with them, this is needed on MSW or the cursor reverts to the normal arrow.
bool OnDropFiles (wxCoord x, wxCoord y, const wxArrayString &filenames)
void SetWorkAreaExtent (const WorkRect &area, BOOL redraw=TRUE)
void GetScrollOffset (WorkCoord *pOffset) const
void SetScrollOffset (const WorkCoord &pos, BOOL redraw=TRUE)
void ShowScrollers (BOOL Show)
void ShowRulers (BOOL Show)
WorkRect GetMaxScrollRect () const
 Find the legal area in which scroll offsets can exist.
BOOL AreRulersVisible ()
BOOL AreScrollersVisible ()
 

MouseOverRulerHit IsMouseOverRuler ()
 

void RecaptureMouseOnNextUpdate (void)
BOOL StartDrag (Operation *pOp, DragType type, BOOL KeepAccuracy)
BOOL EndDrag (Operation *pOp)
BOOL ChangeDragType (DragType Type)
 Allows someone to change the type of a drag (eg have Auto Scrolling on in some situations, but not in others). This function is mostly called from the Kernel (DocView) version of the same function.
void ClearClickState ()
BOOL InvokeDragOp (String_256 *pOpToken, OpParam *pParam, UINT32 Flags, wxPoint point)
 This func provides a mechanism that allows a drag op to be invoked as if it has been started as a result of clicking in the view. This allows drag ops to be invoked that aren't associated to a given tool.
BOOL InvokeDragOp (String_256 *pOpToken, OpParam *pParam, ClickModifiers clickmods, wxPoint point)
BOOL IsWaitingMouseMove ()
BOOL GetCurrentMousePos (OilCoord *pMousePos) const
BOOL CreateDragTarget (DragInformation *DragInfo)
 will create drag targets for appropriate drags
DocViewGetDocViewPtr () const
BOOL IsSingleClickReallyTriple () const
BOOL IsSingleClickReallyQuad () const
void DontSkipNextMouse ()

Static Public Member Functions

static BOOL ReadViewPrefs ()
static DocViewGetDocViewFromWindow (wxWindow *pWindow)
 Given a window handle of a ScreenView render window, this function will return a pointer to the kernel DocView object that renders into that window, or NULL if there isn't one.
static void SetUseVisibleDefaults (BOOL state)
static BOOL GetUseVisibleDefaults ()
static BOOL GetDefaultRulersState ()
static BOOL GetDefaultScrollersState ()
static void SetDefaultRulersState (BOOL State)
static void SetDefaultScrollersState (BOOL State)
static void GetClickMods (wxMouseEvent &event, ClickModifiers *p)
 Helps convert an OIL-layer mouse event into a form acceptable to the kernel. Sets the fields of the ClickModifier according to which button is down/up, whether the SHIFT, CONTROL, or ALT key is held down etc. Note that as the fields of a ClickModifier are only one bit wide, we must be carefule when assigning the (integer) results of logical tests to them.
static DocViewGetDocViewFromWindowID (CWindowID WindowID)
 Given a window handle of a ScreenView render window, this function will return a pointer to the kernel DocView object that renders into that window, or NULL if there isn't one.

Static Public Attributes

static INT32 s_MouseMoveEliminationPeriod

Protected Member Functions

void GrabKernelAttention () const
void SetCurrentStates ()
virtual BOOL CreateNewDocView ()
virtual BOOL IsARalphView ()
LRESULT OnRenderView (WPARAM wp, LPARAM lp)
void ScrollTo (const WorkCoord &offset)
 Scroll the client area of the window to the specified position. The offset must be converted to OS coordinates before being passed to Windows. If the new position of the view does not overlap the old position then the client area is completely redrawn. Otherwise, the Windows USER module is called to scroll the window.
void ScrollBy (INT32 dx, INT32 dy)
 Scrolls the view by asking the DocView to do it so it can remove and replace blobs.
void HandleDragEvent (UINT32 Button, UINT32 nFlags, wxPoint point, ClickType t)
 Gathers together Windows information about a mouse event and passes it on to the kernel, by calling DocView::OnClick() HandleDragEvent needs to be called from OnTimer code so rather than synthesizing a wxMouseEvent object this function has been left taking non-wx params.
void HandleDragEvent (UINT32 Button, ClickModifiers clickmods, wxPoint point, ClickType t)
BOOL HandleMouseWheelEvent (wxMouseEvent &event)
void HandleDragScrolling (wxPoint point)
 Checks if the view window needs to be scrolled because the cursor has been dragged outside the window. The window will be scrolled if the current mode is AUTO_SCROLL (and the Scroll Lock key isn't latched!!). The scrolling itself is done by calling the routine in DocView, not ScreenView, so that the kernel has fair warning to remove any blobbies before the blit is done.
void CalcScrollDeltas (wxPoint point, WinRect wrSize, INT32 *dx, INT32 *dy)
 Calculates the scroll deltas due to the current mouse position being outside the allowed rectangle. Helper function.
void HandleButtonUp (UINT32 Button, wxMouseEvent &event)
 Finishes the current drag, if there is one, by elucidating the state of the buttons etc and calling DragDFinished() in the kernel (DocView). Called whenever a mouse button is released.
BOOL PrintPaper (wxDC *pPrintDC, CCPrintInfo *pPrintInfo, PrintControl *pPrintControl)
WinRect GetPrintClipRect (wxDC *pPrintDC, CCPrintInfo *pPrintInfo)
void EnumeratePagePatches (CCPrintInfo *pPrintInfo)
void UpdateViewPosition () const
virtual void OnInitialUpdate ()
virtual void OnUpdate (wxView *sender, wxObject *hint=(wxObject *) NULL)
virtual void OnActivateView (bool bActivate, wxView *pActiveView, wxView *pDeactiveView)

Static Protected Member Functions

static void wxPoint2Coord (const wxPoint &point, Coord *pcoord)
 Converts a wxPoint to a kernel Coord.
static void Coord2wxPoint (const Coord &coord, wxPoint *ppoint)
 Converts a kernel Coord to a wxPoint.
static void wxRect2Rect (const wxRect &rect, Rect *pkrect)
 Converts a wxRect into a kernel Rect.
static void Rect2wxRect (const Rect &krect, wxRect *prect)
 Converts a kernel Rect into a wxRect.

Protected Attributes

wxMDIChildFrame * m_pFrame
CRenderWndRenderWindow
CWinScrollerHScrollBar
CWinScrollerVScrollBar
CScrollerCornerCorner
OILHorizontalRulerHRuler
OILVerticalRulerVRuler
OriginGadgetOGadget
DocViewpDocView
PrintViewpPrintView
ViewStateStatus
BOOL fSetupDone
BOOL fInitialUpdate
BOOL fJustCreated
WinRect CurrentSize
WorkRect WorkArea
WorkCoord OldOffset
String_256 DragOpToken
OpParampDragOpParam
BOOL DragOpInvoke
MonotonicTime TimeOfLastClick
wxPoint LastDoubleClickPos
BOOL ThisSingleIsTriple
BOOL ThisDoubleIsQuad
wxTimer m_DragIdleTimer
MonotonicTime m_OLELastOutTime
BOOL DragKeepAccuracy
BOOL AutoScrollExcludeRulers
ClickType LastClickType
UINT32 LastClickButton
wxPoint LastClickPoint
wxPoint CurrentMousePos
ClickModifiers LastClickMods
UINT32 FirstClickButton
OperationpCurrentDragOp
DragType CurrentDragType
WinRect MouseClipRect
BOOL OLERecaptureMouse
INT32 m_LastMouseState
wxPoint m_LastMousePosition
INT32 m_LastMouseUsedTimestamp
BOOL m_CouldSkipNextMouse

Static Protected Attributes

static const INT32 WID_RENDERWINDOW = 1
static const INT32 WID_HSCROLLBAR = 2
static const INT32 WID_VSCROLLBAR = 3
static const INT32 WID_SIZECORNER = 4
static const INT32 WID_HRULER = 5
static const INT32 WID_VRULER = 6
static const INT32 WID_RULERORIGIN = 7
static const INT32 DragIdleID = 100
static INT32 PopCount
static ViewStatepReadyMadeViewState
static BOOL DefaultScrollersState
static BOOL DefaultRulersState
static BOOL UseVisibleDefaults
static INT32 DragLatency
static INT32 DragDelay
static MonotonicTime DragTimer
static INT32 ScrollBarSize

Detailed Description

This OIL class implements many window functions, such as scrolling and sizing the editing windows. As such, it acts as an intermediary between the kernel and the host operating system. It is derived from the wx class wxView, which provides comprehensive methods for managing the client area of a window.

Author:
Luke_Hart (Xara Group Ltd) <camelotdev@xara.com> H
Date:
01/07/05
On creation, a CCamView asks its Document to provide a pointer to the DocView that is to be associated with this object. Once that link has been made, any changes in the state of the CCamView, eg. the user maximises it, are passed on in a device-independent form to the DocView. This trick is done using a shared ViewState object.

Definition at line 157 of file camview.h.


Constructor & Destructor Documentation

CCamView::CCamView  ) 
 

Default constructor for a CCamView window. Sets the pointers to the child windows to null, so that an incomplete construction of the view that is later destroyed won't try to delete invalid pointers. The Windows side of construction is done later, in the OnCreate() message handler.

/

IMPLEMENT_DYNAMIC_CLASS( CCamView, wxView ) CC_IMPLEMENT_DYNAMIC( ViewDragTarget, OilDragTarget ) CC_IMPLEMENT_DYNCREATE( PageDropInfo, CCObject )

Declare smart memory handling in Debug builds define new CAM_DEBUG_NEW

This user preference controls how many pixels the mouse must move before a drag is initiated. INT32 CCamView::DragLatency = 3;

INT32 CCamView::s_MouseMoveEliminationPeriod = 0;

Used to start drags after user has clicked but not moved mouse for n milliseconds. INT32 CCamView::DragDelay = 500; MonotonicTime CCamView::DragTimer;

INT32 CCamView::PopCount = 0; ViewState* CCamView::pReadyMadeViewState = NULL; BOOL CCamView::DefaultScrollersState = TRUE; BOOL CCamView::DefaultRulersState = FALSE; BOOL CCamView::UseVisibleDefaults = TRUE;

Default to a nonsense size. Will be fixed up in OnSize INT32 CCamView::ScrollBarSize = 1;

BEGIN_EVENT_TABLE( CCamView, wxView ) EVT_SIZE(CCamView::OnSize) EVT_SCROLL(CCamView::OnScroll) EVT_TIMER(DragIdleID, CCamView::OnDragIdle) END_EVENT_TABLE()

/*!

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
Updates the CCamView population counter. Called from somewhere deep inside MFC.
Returns:
Errors: - Scope: Protected.
See also:
CCamView::OnCreate(); CCamView::~CCamView()

Definition at line 189 of file camview.cpp.

00190 {
00191     TRACEUSER("Gerry", _T("Creating CCamView at 0x%08x\n"), this);
00192 
00193     // No child windows or connections yet.
00194     pDocView = NULL;
00195     pPrintView = NULL;
00196 
00197     // Create a ViewState object to maintain device-independent information.
00198     Status = new ViewState;
00199 
00200     RenderWindow = NULL;
00201     HScrollBar = NULL;
00202     VScrollBar = NULL;
00203     Corner = NULL;
00204     HRuler = NULL;
00205     VRuler = NULL;
00206     OGadget= NULL;
00207 
00208     // Set/clear these internal flags.
00209     fSetupDone = FALSE;
00210     fInitialUpdate = FALSE;
00211 
00212     // Not dragging or scrolling either.
00213     pCurrentDragOp = NULL;
00214 
00215     OLERecaptureMouse = FALSE;
00216 
00217     // Set up click event variables
00218     LastClickType = CLICKTYPE_NONE;
00219     LastClickButton = 0;
00220     LastClickPoint.x = 0;
00221     LastClickPoint.y = 0;
00222     CurrentMousePos.x = 0;
00223     CurrentMousePos.y = 0;
00224     FirstClickButton = 0;
00225     DragKeepAccuracy = TRUE;
00226     AutoScrollExcludeRulers = FALSE;
00227     
00228     // Bump the population.
00229     PopCount++;
00230 
00231     // Vars used by InvokeDragOp() mechanism
00232     DragOpToken = "";
00233     pDragOpParam = NULL;
00234     DragOpInvoke = FALSE;
00235 
00236     // Set up the drag idle timer
00237     m_DragIdleTimer.SetOwner(this, DragIdleID);
00238 
00239     // Triple and quad click support
00240     LastDoubleClickPos = wxPoint( 0, 0 );
00241     ThisSingleIsTriple = FALSE;
00242     ThisDoubleIsQuad = FALSE;
00243 
00244     // Set this flag until we have been through OnActivateView once, after which we can
00245     // include this view in the eat-activating-click system.
00246     fJustCreated = TRUE;
00247 
00248     // Mouse move handling
00249     m_LastMouseState=0;
00250     m_LastMousePosition=wxDefaultPosition;
00251     m_LastMouseUsedTimestamp=0;
00252     m_CouldSkipNextMouse=FALSE;
00253 
00254     OldOffset = WorkCoord(0, 0); // need to initialize it to something
00255 }

CCamView::~CCamView  )  [virtual]
 

Destroys a CCamView window. Deletes child windows first. Updates the CCamView population counter.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: Public

See also:
CCamView::CCamView()

Definition at line 273 of file camview.cpp.

00274 {
00275     TRACEUSER("Gerry", _T("Deleting CCamView at 0x%08x\n"), this);
00276 
00277     PopCount--;         // one less ScreenView in the world, sigh
00278 
00279     if(pDocView != NULL)
00280         delete pDocView;
00281     
00282     if(Status != NULL)
00283         delete Status;
00284 
00285     pDocView = NULL;
00286     Status = NULL;
00287 
00288     // We shouldn't have a print view here!
00289     if (pPrintView != NULL)
00290     {
00291         ERROR3("CCamView is dying when it still has a PrintView attached!");
00292         delete pPrintView;
00293     }
00294 }


Member Function Documentation

virtual void CCamView::AllocateDC  )  const [virtual]
 

BOOL CCamView::AreRulersVisible  ) 
 

Reimplemented in ScreenView.

BOOL CCamView::AreScrollersVisible  ) 
 

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Scroller Visible state.

Errors: - Scope: Public

Reimplemented in ScreenView.

Definition at line 2793 of file camview.cpp.

02794 { 
02795     if(Status)
02796         return Status->ScrollersVisible;
02797     return FALSE;       
02798 }

void CCamView::CalcScrollDeltas wxPoint  point,
WinRect  wrSize,
INT32 *  dx,
INT32 *  dy
[protected]
 

Calculates the scroll deltas due to the current mouse position being outside the allowed rectangle. Helper function.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com> (from Justin)
Date:
22/9/96
Parameters:
point The current position of the mouse cursor. [INPUTS] wrSize The rectangle controlling scrolling.
dx The amount to scroll in the X axis. [OUTPUTS] dy The amount to scroll in the Y axis.
Returns:
-

Errors: - Scope: Protected

See also:
CCamView::HandleDragScrolling

Reimplemented in ScreenView.

Definition at line 4908 of file camview.cpp.

04909 {
04910     if( point.x < wrSize.GetLeft() )
04911         *dx = max(point.x - wrSize.GetLeft(), -ScrollBarSize);
04912     else if( point.x >= wrSize.GetRight() )
04913         *dx = min(point.x - wrSize.GetRight(), ScrollBarSize);
04914     else
04915         *dx = 0;
04916 
04917     if( point.y < wrSize.GetTop() )
04918         *dy = max(point.y - wrSize.GetTop(), -ScrollBarSize);
04919     else if( point.y >= wrSize.GetBottom() )
04920         *dy = min(point.y - wrSize.GetBottom(), ScrollBarSize);
04921     else
04922         *dy = 0;
04923 }

BOOL CCamView::ChangeDragType DragType  Type  ) 
 

Allows someone to change the type of a drag (eg have Auto Scrolling on in some situations, but not in others). This function is mostly called from the Kernel (DocView) version of the same function.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/4/95
Parameters:
Type - the type of drag to change to [INPUTS]
Returns:
TRUE
See also:
DocView::ChangeDragType

Reimplemented in ScreenView.

Definition at line 4723 of file camview.cpp.

04724 {
04725     // Change the current drag type
04726     CurrentDragType = Type;
04727     m_OLELastOutTime.Sample();
04728     OLERecaptureMouse = FALSE;
04729 
04730     return TRUE;
04731 }

void CCamView::ClearClickState  ) 
 

Reimplemented in ScreenView.

void CCamView::Coord2wxPoint const Coord coord,
wxPoint *  ppoint
[static, protected]
 

Converts a kernel Coord to a wxPoint.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/4/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 4044 of file camview.cpp.

04045 {
04046     ppoint->x = (INT32) coord.x;
04047     ppoint->y = (INT32) coord.y;
04048 }

BOOL CCamView::CreateDragTarget DragInformation DragInfo  ) 
 

will create drag targets for appropriate drags

Author:
Chris_Parks (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/1/95
Parameters:
DragInfo : details about the current drag [INPUTS]
- [OUTPUTS]
Returns:
Errors: -

Reimplemented in ScreenView.

Definition at line 5107 of file camview.cpp.

05108 {
05109 #if !defined(EXCLUDE_FROM_RALPH)
05110     // TEMPORARY - only create drag targets for the selected (frontmost/input-focus)
05111     // DocView. This stops us allowing colour drags to go into the wrong document
05112     // if the user ctrl-tabs to a different window during the drag.
05113     // Ideally, drags will be allowed, but the colour will be copied to the destination
05114     // document before being applied, but currently we don't have time to implement all that
05115     if (pDocView != DocView::GetSelected())
05116         return FALSE;
05117 
05118     if (DragInfo->CanDropOnPage())
05119     {
05120         // If the drag can be dropped onto an object or the page, then we will accept it
05121         ViewDragTarget * NewTarget;
05122         NewTarget = new ViewDragTarget(RenderWindow,NULL,DragInfo);
05123         return TRUE;
05124     }
05125 #endif
05126     return FALSE;
05127 }

virtual BOOL CCamView::CreateNewDocView  )  [protected, virtual]
 

virtual void CCamView::DoneWithDC  )  const [virtual]
 

void CCamView::DontSkipNextMouse  )  [inline]
 

Definition at line 409 of file camview.h.

BOOL CCamView::EndDrag Operation pOp  ) 
 

Reimplemented in ScreenView.

void CCamView::EnumeratePagePatches CCPrintInfo pPrintInfo  )  [protected]
 

Reimplemented in ScreenView.

void CCamView::GetClickMods wxMouseEvent &  event,
ClickModifiers p
[static]
 

Helps convert an OIL-layer mouse event into a form acceptable to the kernel. Sets the fields of the ClickModifier according to which button is down/up, whether the SHIFT, CONTROL, or ALT key is held down etc. Note that as the fields of a ClickModifier are only one bit wide, we must be carefule when assigning the (integer) results of logical tests to them.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
ages ago
Parameters:
The mouse event passed by wx to a mouse message-handler function. [INPUTS]
Changes the ClickModifier to reflect the button flags. [OUTPUTS]
Returns:
-

Errors: - Scope: Public

See also:
CCamView::HandleDragEvent()

Reimplemented in ScreenView.

Definition at line 4883 of file camview.cpp.

04884 {
04885     *p = ClickModifiers::GetClickModifiers(event);
04886 }

void CCamView::GetClientSize int *  width,
int *  height
const
 

Reimplemented in ScreenView.

BOOL CCamView::GetCurrentMousePos OilCoord pMousePos  )  const
 

Reimplemented in ScreenView.

static BOOL CCamView::GetDefaultRulersState  )  [inline, static]
 

Reimplemented in ScreenView.

Definition at line 271 of file camview.h.

00271 { return DefaultRulersState;};

static BOOL CCamView::GetDefaultScrollersState  )  [inline, static]
 

Reimplemented in ScreenView.

Definition at line 272 of file camview.h.

00272 { return DefaultScrollersState;};

CCamDoc* CCamView::GetDocument  )  const
 

DocView * CCamView::GetDocViewFromWindow wxWindow *  pWindow  )  [static]
 

Given a window handle of a ScreenView render window, this function will return a pointer to the kernel DocView object that renders into that window, or NULL if there isn't one.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Parameters:
The handle of the render window to find. [INPUTS]
- [OUTPUTS]
Returns:
A pointer to the DocView associated with a render window, or NULL if there isn't one.

Errors: -

See also:
-

Definition at line 5047 of file camview.cpp.

05048 {
05049     // For all kernel documents in existence . . .
05050     List* pDocList = &(GetApplication()->Documents);
05051     for (Document* pKernelDoc = (Document*) pDocList->GetHead();
05052          pKernelDoc != NULL;
05053          pKernelDoc = (Document*) pDocList->GetNext(pKernelDoc))
05054     {
05055         if (pKernelDoc->IsARalphDoc())
05056         {
05057             // a bit unpleasent - only works because Ralph Docs have only one view..
05058             // get the first (and only) docview
05059             DocView * pDocView = pKernelDoc->GetFirstDocView();
05060             // check handles
05061             if (pDocView)
05062                 if( pDocView->GetRenderWindow() == pWindow )
05063                     return pDocView;
05064         }
05065         else
05066         {
05067              // Convert from a kernel document to an OIL document.
05068             CCamDoc* pCamDoc = pKernelDoc->GetOilDoc();
05069 
05070             wxNode *node = pCamDoc->GetViews().GetFirst();
05071             while (node)
05072             {
05073                 // Compare the handle of the view's render window to the given handle,
05074                 // returning the associated DocView if they match.
05075                 CCamView* pCamView = (CCamView*) node->GetData();
05076 
05077                 // Not interested unless it is a ScreenView (it could be a print preview view)
05078 //              if (pCamView->IsKindOf(RUNTIME_CLASS(CCamView)))
05079 //              {
05080                     if (pCamView->GetRenderWindow() == pWindow)
05081                     {
05082                         return pCamView->pDocView;
05083                     }
05084 //              }
05085                 node = node->GetNext();
05086             }
05087         }
05088     } 
05089 
05090     // Couldn't find the handle, so return nothing.
05091     return NULL;
05092 }   

DocView * CCamView::GetDocViewFromWindowID CWindowID  WindowID  )  [static]
 

Given a window handle of a ScreenView render window, this function will return a pointer to the kernel DocView object that renders into that window, or NULL if there isn't one.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/7/94
Parameters:
The handle of the render window to find. [INPUTS]
- [OUTPUTS]
Returns:
A pointer to the DocView associated with a render window, or NULL if there isn't one.

Errors: -

See also:
-

Reimplemented in ScreenView.

Definition at line 5146 of file camview.cpp.

05147 {
05148     // For all kernel documents in existence . . .
05149     List* pDocList = &(GetApplication()->Documents);
05150     for (Document* pKernelDoc = (Document*) pDocList->GetHead();
05151          pKernelDoc != NULL;
05152          pKernelDoc = (Document*) pDocList->GetNext(pKernelDoc))
05153     {
05154 
05155         DocView * pDocView = pKernelDoc->GetFirstDocView();
05156         
05157         while (pDocView)
05158         {
05159             if ( pDocView->GetRenderWindow() == WindowID )
05160                 return pDocView;
05161             pDocView = pKernelDoc->GetNextDocView(pDocView);
05162         }
05163     } 
05164 
05165     // Couldn't find the handle, so return nothing.
05166     return NULL;
05167 }   

DocView* CCamView::GetDocViewPtr  )  const [inline]
 

Reimplemented in ScreenView.

Definition at line 317 of file camview.h.

00318     {
00319         return pDocView;
00320     }

WorkRect CCamView::GetMaxScrollRect  )  const
 

Find the legal area in which scroll offsets can exist.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/May/2006
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
WorkRect describing legal area for scroll offsets

Errors: -

See also:
-

Definition at line 4987 of file camview.cpp.

04988 {
04989     WorkRect wrScrollRect = Status->WorkAreaExtent;
04990 
04991     FIXED16 PixelWidth, PixelHeight;
04992     pDocView->GetPixelSize(&PixelWidth, &PixelHeight);
04993 
04994     WorkCoord WindowSize;
04995     WindowSize.x = CurrentSize.GetWidth() * PixelWidth;
04996     WindowSize.y = CurrentSize.GetHeight() * PixelHeight;
04997 
04998     if (WindowSize.x > wrScrollRect.hi.x)       // If window wider than document
04999         wrScrollRect.hi.x = wrScrollRect.lo.x;  // no horz scrolling is possible
05000     else
05001         wrScrollRect.hi.x -= WindowSize.x;      // Restrict scrollable area to ensure view never sees outside workarea
05002 
05003     if (WindowSize.y < wrScrollRect.lo.y)       // If window wider than document
05004         wrScrollRect.lo.y = wrScrollRect.hi.y;  // no vert scrolling is possible
05005     else
05006         wrScrollRect.lo.y += WindowSize.y;      // Restrict scrollable area to ensure view never sees outside workarea
05007 
05008     return wrScrollRect;
05009 }

wxMDIChildFrame* CCamView::GetParentFrame  )  const [inline]
 

Definition at line 170 of file camview.h.

00171     {
00172         return m_pFrame;
00173     }

WinRect CCamView::GetPrintClipRect wxDC *  pPrintDC,
CCPrintInfo pPrintInfo
[protected]
 

Reimplemented in ScreenView.

virtual CNativeDC* CCamView::GetRenderDC  )  const [virtual]
 

Reimplemented in ScreenView.

CRenderWnd* CCamView::GetRenderWindow  )  const [inline]
 

Reimplemented in ScreenView.

Definition at line 222 of file camview.h.

00222 { return(RenderWindow); }

void CCamView::GetScrollOffset WorkCoord pOffset  )  const
 

Reimplemented in ScreenView.

static BOOL CCamView::GetUseVisibleDefaults  )  [inline, static]
 

Reimplemented in ScreenView.

Definition at line 270 of file camview.h.

00270 { return UseVisibleDefaults;};

ViewState* CCamView::GetViewState  )  const
 

void CCamView::GrabKernelAttention  )  const [protected]
 

void CCamView::HandleButtonUp UINT32  Button,
wxMouseEvent &  event
[protected]
 

Finishes the current drag, if there is one, by elucidating the state of the buttons etc and calling DragDFinished() in the kernel (DocView). Called whenever a mouse button is released.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
9th Sept 1993
Parameters:
Button - which mouse button has been released. [INPUTS] nFlags - The mouse button flags. point - the coordinate of the mouse cursor.
- [OUTPUTS]
Returns:
-

Errors: - Scope: Private

See also:
CCamView::GetClickMods(); CCamView::OnLButtonDown(); CCamView::OnRButtonDown() DocView::OnClick()

Reimplemented in ScreenView.

Definition at line 4437 of file camview.cpp.

04438 {
04439     //Graham 18/6/96: Changed the logical conditions of this function
04440     //to support clicks with one mouse button while another button is
04441     //dragging
04442     
04443     if (DocView::GetSelected() != pDocView)
04444     {
04445         ENSURE(pCurrentDragOp == NULL, "Drag operation in a view that isn't 'selected' !!");
04446 //      TRACEUSER( "JustinF", _T("Ignored button-up cos not in the selected view\n"));
04447         return;
04448     }
04449 
04450     // Set Current states...
04451     SetCurrentStates();
04452 
04453     //Graham: Here's the change - in the logical conditions only. The actual
04454     //functions called are the same.
04455 
04456     WinCoord            point;
04457     event.GetPosition( &point.x, &point.y );
04458 
04459     //Was the button that went up the first one that went down?
04460     if (Button==FirstClickButton)
04461     {
04462         //Yes it was.
04463         //Is there a drag currently running?
04464         if (pCurrentDragOp != NULL)
04465         {
04466             // Yes there is.
04467             // Release the capture and terminate the drag.  Note that we try to release
04468             // the mouse capture as soon as possible after a drag has finished, in case the
04469             // DragFinished method below brings up a dialog box or something.
04470             if (GetRenderWindow() && GetRenderWindow()->GetCapture()==GetRenderWindow())
04471                 GetRenderWindow()->ReleaseMouse();
04472             pDocView->DragFinished(pCurrentDragOp, ((WinCoord*) &point)->ToOil(pDocView, TRUE), 
04473                                LastClickMods, TRUE);
04474 
04475 
04476             // Now cater for the special case that the user used the PushCentreTool Click Modifier
04477             // and they didn't move the mouse - this means they either wanted to Centre the
04478             // view about the cursor, ZoomIn() or ZoomOut() depending on the modifiers....
04479