#include <scrvw.h>
Inheritance diagram for ScreenView:

Public Member Functions | |
| ScreenView () | |
| Default constructor for a ScreenView 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 | ~ScreenView () |
| Destroys a ScreenView window. Deletes child windows first. Updates the ScreenView population counter. | |
| void | SetViewStateFromThis () const |
| Called by a virgin ScreenView, ie. a view onto a new, unedited document. The function reads the attributes of the view window from the operating system, converts them into a device- independent form, and stores them in the ViewState. | |
| void | SetThisFromViewState () |
| Move and resize the ScreenView according to the (device-independent) settings of a ViewState object. This typically happens when a new view is opened on a saved document. | |
| virtual BOOL | IsScreenView () |
| MouseOverRulerHit | IsMouseOverRuler () |
| BOOL | IsTopmost () const |
| Tests if this ScreenView is the active view, ie. is on top of all other views. | |
| BOOL | ShouldEatClick () const |
| void | ClearEatFlag () |
| wxDC * | GetRenderDC () const |
| Allows the kernel to draw on the client area at times other than when processing WM_PAINT messages. Note that the pointer returned is temporary and should NOT be stored away for future use - it may well become invalid on the next idle event. | |
| wxWindow * | GetRenderWindow () const |
| Allows the kernel to access to the render window, useful on the odd occasion, although it does distort "encapsulation". | |
| virtual void | GetClientSize (int *width, int *height) const |
| Updates the ViewState object with the view's position, in an OS- independent form. This message is sent by the view's frame window whenever it is moved. Calculates the size of the ScreenView's RendWnd. | |
| void | InvalidateView (const OilRect *pRect=0, BOOL updatenow=FALSE) |
| Invalidates the appropriate section of the RendWnd client area - if the passed parameter is NULL then the whole client area is invalidated. The rectangle will be redrawn at some time in the (near) future. | |
| virtual void | OnDraw (wxDC *pDc) |
| Makes sure that the kernel knows which view to render into. Retrieves the clipping rectangle from the CDC. Passes the CDC and the rectangle to DocView::OnDraw(), which does the actual rendering. | |
| virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo) |
| Current just returns that value of CView::DoPreparePrinting(). | |
| BOOL | GetScrollerStyle () const |
| Tests whether proportional scroll bars are currently in operation. | |
| void | SetScrollerStyle (BOOL proportional) |
| Allows DocView to change the style - groovy or dull - of ScreenView's scroll bars. Records the setting and calls the appropriate functions of the scroll bar gadgets. | |
| void | SetWorkAreaExtent (const WorkRect &area, BOOL redraw=TRUE) |
| Provides read-only access to the WorkAreaExtent, as maintained by DocView/ScreenView. Calculates the size of the RendWnd, setting the "page size" of the scroll bars accordingly. Sets the scroll range of the scroll bars to the size of the WorkAreaExtent (note that the Y range is negated and inverted - the mother of all bodges). | |
| void | GetScrollOffset (WorkCoord *pOffset) const |
| Reads the offset from the horizontal and vertical scroll bars, combining then into a WorkCoord. | |
| void | SetScrollOffset (const WorkCoord &pos, BOOL redraw=TRUE) |
| Changes the scroll offset in the horizontal and vertical scroll bar. Note that it DOES NOT immediately scroll the client area, which is only done when the scroll bars send back a WM_SCROLLEREVENT message to the ScreenView. | |
| void | ShowScrollers (BOOL Show) |
| Hide or Show Scrollers. | |
| void | ShowRulers (BOOL Show) |
| Hide or Show Rulers. | |
| BOOL | AreRulersVisible () |
| BOOL | AreScrollersVisible () |
| void | RecaptureMouseOnNextUpdate (void) |
| Called by the OLE drag & drop system (CCamDropSource::QueryContinueDrag, winoil.cpp) when dragging a selection - if the mouse pointer goes outside the view, the selection drag is "paused", and an OLE drag is started. If the pointer comes back into our view, we cancel the OLE drag and resume the selector drag - the only thing we need to do to resume is to reclaim the mouse capture (but we must do it on the next idle to ensure that we get & keep the capture, so we flag it here and fix it up in OnTimer, above). | |
| BOOL | StartDrag (Operation *pOp, DragType type, BOOL KeepAccuracy) |
| Begins a drag operation, from the point of view of the OIL layer. Unbounds the mouse cursor, so it can go off-screen (display driver permitting). Captures all mouse input, to guarantee that the drag being started will terminate properly at some time in the future. Sets some internal variables indicating that ScreenView is in "drag mode". Finally, asks the system for a timer which is used to generate "idle" mouse events. | |
| BOOL | EndDrag (Operation *pOp) |
| Finishes a drag operation in the OIL layer. Releases mouse capture and restores the previous mouse cursor clipping rectangle (generally the screen). Sets internal variables to indicate that ScreenView is not in "drag mode". Kills the timer set in StartDrag(). | |
| 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 () |
| Clear the current click state so that any logic in progress is stopped before it does anything nasty. | |
| 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 | IsWaitingMouseMove () |
| There are some things in Camelot that are processed as a result of a mouse move message (Magnetic snapping to all the objects in the document for example). If these operations take a long time, there is little point in carrying on with the calculations if the mouse has already moved away from the coord being tested (and hence invalidating the findings of the search). This function checks to see if there is a mouse move message waiting in the queue to be processed, so that the callers can abort any processing they were doing if applicable. | |
| BOOL | GetCurrentMousePos (OilCoord *pMousePos) const |
| Finds out the current mouse position within this view window. | |
| BOOL | CreateDragTarget (DragInformation *DragInfo) |
| will create drag targets for appropriate drags | |
| virtual BOOL | IsSelected (const CObject *pDocItem) const |
| "Tests for a selected OLE client item". | |
| void | OnFilePrint () |
| void | OnFilePrintPreview () |
| Simply makes CView::OnFilePrintPreview() have public scope. Used by the menu system. | |
| DocView * | GetDocViewPtr () const |
| Used by Will's rendering system - somehow. | |
| BOOL | IsSingleClickReallyTriple () const |
| BOOL | IsSingleClickReallyQuad () const |
Static Public Member Functions | |
| static BOOL | ReadViewPrefs () |
| Tries to load preferences for ScreenView, creating them with default values if they don't exist. | |
| static INT32 | HowMany () |
| None immediately springs to mind, although one day - who knows? | |
| static DocView * | GetDocViewFromHwnd (wxWindow *hwnd) |
| 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 DocView * | GetDocViewFromWindowID (CWindowID WinID) |
| static void | SetReadyMadeViewState (ViewState *pvs) |
| Calls CCamView::Create() to attach a Windows object to the previously constructed C++ object. The view has a standard arrow cursor and a custom icon (_R(IDR_CAMTYPE)). The view is responsible for painting its background itself. The view is initially hidden, until its size and position have been properly set. Call this to set up a view-state object that ScreenView::OnInitialUpdate will use in preference to the one the ScreenView has got already. This is a nasty little "back-door" to changing the creation state of a ScreenView, used by the code that restores docs and views when the app starts. The reason we have to use code like this is that the Camelot doc/view architecture is NOT MFC. | |
| 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. | |
Protected Member Functions | |
| virtual CCamCanvas * | CreateCanvas (wxView *v, wxMDIChildFrame *frame, const wxPoint &pos, const wxSize &size, long style) |
| void | UpdateViewPosition () const |
| Updates the ViewState object shared between this ScreenView and its associated DocView with the new size of the view etc. | |
| virtual void | OnInitialUpdate () |
| virtual void | OnUpdate (wxView *sender, wxObject *hint=(wxObject *) NULL) |
| Called when the view must first display the document. Moves this view/frame to the position given in the ViewState object. | |
| virtual void | OnActivateView (bool bActivate, wxView *pActiveView, wxView *pDeactiveView) |
| Called by MFC when a view gains or loses the input focus, either due to the the user clicking about, or another application popping up a window etc etc. I would just like to point out that this MFC function is the most brain-damaged Microsoft have come up so far. It's documentation bears no resemblance to the way the function is called/used - for example, as far as I can see, the two CView* parameters are NEVER different! | |
| 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 | HandleDragEvent (UINT32 Button, wxMouseEvent &event, ClickType t) |
| Gathers together Windows information about a mouse event and passes it on to the kernel, by calling DocView::OnClick(). | |
| 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. | |
| virtual void | HandleOleDragOutOfView (wxPoint point) |
| Called when doing a DRAGTYPE_OLESCROLL and the mouse pointer moves outside the view window. The base class does nothing, so dragging continues as normal, but in the derived ScreenCamView class, this is used to cancel the internal XOR drag operation, and start an OLE drag and drop export procedure. | |
| BOOL | PrintPaper (wxDC *pPrintDC, CCPrintInfo *pPrintInfo, PrintControl *pPrintControl) |
| WinRect | GetPrintClipRect (wxDC *pPrintDC, CCPrintInfo *pPrintInfo) |
| void | EnumeratePagePatches (CCPrintInfo *pPrintInfo) |
| void | OnSize (wxSizeEvent &event) |
| Moved down to ScreenCamView. | |
| 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 ScreenView::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 ScreenView::HandleDragEvent(). | |
| void | OnMButtonUp (wxMouseEvent &event) |
| Passes the event on to HandleButtonUp(). | |
| void | OnRButtonDown (wxMouseEvent &event) |
| Same as for ScreenView::OnLButtonDown(), but for the right mouse button. | |
| void | OnRButtonDblClk (wxMouseEvent &event) |
| Same as ScreenView::OnLButtonDblClk(), bit for the right button. | |
| void | OnRButtonUp (wxMouseEvent &event) |
| Same as ScreenView::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. | |
| afx_msg void | OnDropFiles (HDROP hDropInfo) |
| Respond to files being dropped onto the view window. It sets up the current document and docview, and passes control on to the OpDroppedFile operation. | |
| afx_msg INT32 | OnMouseActivate (wxWindow *pDesktopWnd, UINT32 nHitTest, UINT32 nMessage) |
| afx_msg void | OnTimer (UINT32 nIDEvent) |
| Called when a key is pressed, so we can do something with it. It is currently only used to adjust the Pretend Pen Pressure. THIS CODE HAS BEEN COMMENTED OUT UNTIL THE NEW KEYBOARD SYSTEM IS FULLY OPERATIONAL!! 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. | |
| afx_msg void | OnCancelMode () |
| Called by the system whenever this window loses the focus to a dialogue box etc. Checks if the window is in drag mode, if it is makes sure that the drag is tidily cancelled, eg. the mouse is uncaptured and its clipping area restored. Calls DocView::DragFinished() (WITH JUNK PARAMETERS FOR THE MOUSE POSITION/BUTTONS) to indicate that the drag has been cancelled. | |
| afx_msg void | OnInsertObject () |
| "Creates an embedded OLE object with a type-name retrieved from the user" - currently unimplemented. | |
| afx_msg void | OnPaint () |
| Handles WM_PAINT messages for the ScreenView window. As the window is entirely covered by child windows, which know how to paint themselves, this function simply validates its (invisible) client area, removing the paint message. No drawing of any kind is done. | |
| afx_msg BOOL | OnSetCursor (wxWindow *pWnd, UINT32 nHitTest, UINT32 nMessage) |
| Calls the kernel DocView object to set the cursor for this ScreenView. Scope: Protected. | |
| afx_msg LRESULT | OnScrollerEvent (WPARAM wp, LPARAM lp) |
| This message is sent by the scroll bars in response to an earlier call to ScreenView::SetScrollOffset(). The scroll offset is read from the scroll bars and the ScrollPosition field of the ViewState is updated accordingly. If the WPARAM parameter is TRUE then the client area is repainted via a call to ScreenView::ScrollTo(). | |
| afx_msg LRESULT | OnRenderView (WPARAM wp, LPARAM lp) |
| Responds to a WM_PAINT message sent to the RendWnd window object. Effectively tricks MFC into painting the RendWnd as if it was a CView window, not a child of a CView - calls CView::OnPrepareDC() and ScreenView::OnDraw(). | |
| afx_msg LRESULT | OnFrameMove (WPARAM x, LPARAM y) |
| afx_msg void | OnVScroll (UINT32 nSBCode, UINT32 nPos, CScrollBar *pScrollBar) |
| The framework calls this member function when the user clicks a window's vertical scroll bar. | |
| afx_msg void | OnHScroll (UINT32 nSBCode, UINT32 nPos, CScrollBar *pScrollBar) |
| The framework calls this member function when the user clicks a window's horizontal scroll bar. | |
Protected Attributes | |
| BOOL | fSetupDone |
| bool | fInitialUpdate |
| BOOL | fJustCreated |
| CWinScroller * | HScrollBar |
| CWinScroller * | VScrollBar |
| CScrollerCorner * | Corner |
| OILHorizontalRuler * | HRuler |
| OILVerticalRuler * | VRuler |
| OriginGadget * | OGadget |
| WinRect | CurrentSize |
| WorkRect | WorkArea |
| WorkCoord | OldOffset |
| BOOL | ScrollerStyle |
| BOOL | DragKeepAccuracy |
| BOOL | AutoScrollExcludeRulers |
| ClickType | LastClickType |
| UINT32 | LastClickButton |
| wxPoint | LastClickPoint |
| wxPoint | CurrentMousePos |
| ClickModifiers | LastClickMods |
| UINT32 | FirstClickButton |
| Operation * | pCurrentDragOp |
| DragType | CurrentDragType |
| WinRect | MouseClipRect |
| BOOL | OLERecaptureMouse |
| MonotonicTime | m_OLELastOutTime |
| String_256 | DragOpToken |
| OpParam * | pDragOpParam |
| BOOL | DragOpInvoke |
| MonotonicTime | TimeOfLastClick |
| wxPoint | LastDoubleClickPos |
| BOOL | ThisSingleIsTriple |
| BOOL | ThisDoubleIsQuad |
Static Protected Attributes | |
| static INT32 | PopCount |
| static ViewState * | pReadyMadeViewState |
| static BOOL | UnzoomOnNewView = FALSE |
| static BOOL | ZoomSingleView = TRUE |
| static BOOL | PropScrollersOn = TRUE |
| static BOOL | DefaultScrollersState = TRUE |
| static BOOL | DefaultRulersState = FALSE |
| static BOOL | UseVisibleDefaults = TRUE |
| static INT32 | DragLatency = 3 |
| This function is called whenever the joystick moves. It is used currently to set the Pretend Pen Pressure from the joystick position. This function only exists under Win32. | |
| static INT32 | DragDelay = 500 |
| static MonotonicTime | DragTimer |
Classes | |
| class | ScreenCanvas |
Definition at line 162 of file scrvw.h.
|
|
Default constructor for a ScreenView 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.
Definition at line 299 of file scrvw.cpp. 00300 { 00301 // TRACEUSER( "Richard", _T("ScreenView::ScreenView()\n")); 00302 00303 // No child windows or connections yet. 00304 // RenderWindow = NULL; 00305 HScrollBar = NULL; 00306 VScrollBar = NULL; 00307 00308 PORTNOTE("other","Removed CScrollerCorner usage") 00309 #ifndef EXCLUDE_FROM_XARALX 00310 Corner = NULL; 00311 #endif 00312 00313 // WEBSTER - markn 15/1/97 00314 // No rulers in Webster 00315 #ifndef WEBSTER 00316 HRuler = NULL; 00317 VRuler = NULL; 00318 OGadget= NULL; 00319 #endif // WEBSTER 00320 00321 00322 // Set/clear these internal flags. 00323 fSetupDone = FALSE; 00324 fInitialUpdate = false; 00325 00326 // Not dragging or scrolling either. 00327 ScrollerStyle = TRUE; 00328 pCurrentDragOp = NULL; 00329 00330 OLERecaptureMouse = FALSE; 00331 00332 // Set up click event variables 00333 LastClickType = CLICKTYPE_NONE; 00334 LastClickButton = 0; 00335 LastClickPoint.x = 0; 00336 LastClickPoint.y = 0; 00337 CurrentMousePos.x = 0; 00338 CurrentMousePos.y = 0; 00339 FirstClickButton = 0; 00340 DragKeepAccuracy = TRUE; 00341 AutoScrollExcludeRulers = FALSE; 00342 00343 // Bump the population. 00344 PopCount++; 00345 00346 // Vars used by InvokeDragOp() mechanism 00347 DragOpToken = ""; 00348 pDragOpParam = NULL; 00349 DragOpInvoke = FALSE; 00350 00351 // Triple and quad click support 00352 LastDoubleClickPos = wxPoint( 0, 0 ); 00353 ThisSingleIsTriple = FALSE; 00354 ThisDoubleIsQuad = FALSE; 00355 00356 // Set this flag until we have been through OnActivateView once, after which we can 00357 // include this view in the eat-activating-click system. 00358 fJustCreated = TRUE; 00359 }
|
|
|
Destroys a ScreenView window. Deletes child windows first. Updates the ScreenView population counter.
Definition at line 379 of file scrvw.cpp. 00380 { 00381 TRACEUSER( "Richard", _T("ScreenView::~ScreenView()\n")); 00382 // Deregister for WM_DROPFILES messages 00383 // VC2 Beta 1 asserts with a zero handle here so we check 00384 PORTNOTE("other","Removed DragAcceptFiles usage") 00385 #ifndef EXCLUDE_FROM_XARALX 00386 if (m_hWnd) DragAcceptFiles(TRUE); 00387 #endif 00388 00389 // delete RenderWindow; GetCanvas()? 00390 PORTNOTE("other","Removed CWinScroller usage") 00391 #ifndef EXCLUDE_FROM_XARALX 00392 delete HScrollBar; 00393 delete VScrollBar; 00394 #endif 00395 PORTNOTE("other","Removed CScrollerCorner usage") 00396 #ifndef EXCLUDE_FROM_XARALX 00397 delete Corner; 00398 #endif 00399 00400 // WEBSTER - markn 15/1/97 00401 // No rulers in Webster 00402 #ifndef WEBSTER 00403 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00404 delete HRuler; 00405 delete VRuler; 00406 delete OGadget; 00407 #endif 00408 #endif // WEBSTER 00409 00410 PopCount--; // one less ScreenView in the world, sigh 00411 }
|
|
|
Reimplemented from CCamView. Definition at line 557 of file scrvw.cpp. 00558 { 00559 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00560 if(Status) 00561 return Status->RulersVisible; 00562 #endif 00563 return FALSE; 00564 };
|
|
|
Reimplemented from CCamView. Definition at line 580 of file scrvw.cpp. 00581 { 00582 if(Status) 00583 return Status->ScrollersVisible; 00584 return FALSE; 00585 }
|
|
||||||||||||||||||||
|
Calculates the scroll deltas due to the current mouse position being outside the allowed rectangle. Helper function.
Reimplemented from CCamView. Definition at line 3298 of file scrvw.cpp. 03299 { 03300 if( point.x < wrSize.GetLeft() ) 03301 *dx = point.x - wrSize.GetLeft(); 03302 else 03303 if( point.x >= wrSize.GetRight() ) 03304 *dx = point.x - wrSize.GetRight(); 03305 else 03306 *dx = 0; 03307 03308 if( point.y < wrSize.GetTop() ) 03309 *dy = point.y - wrSize.GetTop(); 03310 else 03311 if( point.y >= wrSize.GetBottom() ) 03312 *dy = point.y - wrSize.GetBottom(); 03313 else 03314 *dy = 0; 03315 }
|
|
|
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.
Reimplemented from CCamView. Definition at line 2982 of file scrvw.cpp. 02983 { 02984 // Change the current drag type 02985 CurrentDragType = Type; 02986 m_OLELastOutTime.Sample(); 02987 OLERecaptureMouse = FALSE; 02988 02989 return TRUE; 02990 }
|
|
|
Clear the current click state so that any logic in progress is stopped before it does anything nasty.
Reimplemented from CCamView. Definition at line 4169 of file scrvw.cpp. 04170 { 04171 LastClickType = CLICKTYPE_NONE; 04172 if( GetParentFrame()->HasCapture() ) 04173 { 04174 GetParentFrame()->ReleaseMouse(); 04175 } 04176 }
|
|
|
|
|
||||||||||||||||||||||||
|
Reimplemented in ScreenCamView. Definition at line 197 of file scrvw.h. 00198 : Correct */ long style ) 00199 { 00200 return new ScreenCanvas( v, frame, pos, size, style ); 00201 }
|
|
|
will create drag targets for appropriate drags
Reimplemented from CCamView. Definition at line 650 of file scrvw.cpp. 00651 { 00652 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00653 // TEMPORARY - only create drag targets for the selected (frontmost/input-focus) 00654 // DocView. This stops us allowing colour drags to go into the wrong document 00655 // if the user ctrl-tabs to a different window during the drag. 00656 // Ideally, drags will be allowed, but the colour will be copied to the destination 00657 // document before being applied, but currently we don't have time to implement all that 00658 if (pDocView != DocView::GetSelected()) 00659 return FALSE; 00660 00661 if (DragInfo->CanDropOnPage()) 00662 { 00663 // If the drag can be dropped onto an object or the page, then we will accept it 00664 ViewDragTarget * NewTarget; 00665 NewTarget = new ViewDragTarget(RenderWindow->m_hWnd,NULL,DragInfo); 00666 return TRUE; 00667 } 00668 #endif 00669 00670 return FALSE; 00671 }
|
|
|
Finishes a drag operation in the OIL layer. Releases mouse capture and restores the previous mouse cursor clipping rectangle (generally the screen). Sets internal variables to indicate that ScreenView is not in "drag mode". Kills the timer set in StartDrag().
Reimplemented from CCamView. Definition at line 2930 of file scrvw.cpp. 02931 { 02932 /* 02933 #ifdef _DEBUG 02934 // Prevent a very nasty recursive ENSURE! 02935 if (!CCamApp::IsDisabled()) 02936 { 02937 ENSURE(pCurrentDragOp != 0, "ScreenView::EndDrag: pCurrentDragOp is zero"); 02938 } 02939 #endif // _DEBUG 02940 */ 02941 // Restore the previous mouse clipping rectangle. Windows will move the 02942 // mouse, if necessary, so that the mouse is within the new clipping 02943 // rectangle (or so the documentation says!) 02944 //::ClipCursor(&MouseClipRect); 02945 pCurrentDragOp = 0; 02946 FirstClickButton = 0; 02947 DragKeepAccuracy = TRUE; 02948 if (m_pCanvas && m_pCanvas->GetCapture() == m_pCanvas) 02949 m_pCanvas->ReleaseMouse(); 02950 02951 // Check status of temporary tool selection - this is because we don't change tool 02952 // mid-drag! (e.g. user holds down Alt to get selector, starts drag, releases Alt, 02953 // then ends drag - we want to restore the original tool). 02954 Tool::EndDrag(); 02955 02956 // Kill the timer started in HandleDragEvent(). 02957 PORTNOTE("other","Removed FixKillTimer usage") 02958 #ifndef EXCLUDE_FROM_XARALX 02959 return ::FixKillTimer(m_hWnd, 1); 02960 #else 02961 return TRUE; 02962 #endif 02963 }
|
|
|
Reimplemented from CCamView. |
|
||||||||||||
|
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.
Reimplemented from CCamView. Definition at line 2259 of file scrvw.cpp. 02260 { 02261 *p = ClickModifiers::GetClickModifiers(event); 02262 }
|
|
||||||||||||
|
Updates the ViewState object with the view's position, in an OS- independent form. This message is sent by the view's frame window whenever it is moved. Calculates the size of the ScreenView's RendWnd.
Reimplemented from CCamView. Definition at line 1429 of file scrvw.cpp. 01429 : Correct */ 01430 { 01431 // OilRect r = CurrentSize.ToOil(pDocView); 01432 // *pWidth = r.Width(); 01433 // *pHeight = r.Height(); 01434 WinRect wrect(0,0,0,0); 01435 GetCanvas()->GetClientSize(&wrect.width,&wrect.height); 01436 OilRect orect = wrect.ToOil(pDocView); 01437 *pWidth = orect.Width(); 01438 *pHeight = orect.Height(); 01439 }
|
|
|
Finds out the current mouse position within this view window.
Reimplemented from CCamView. Definition at line 3731 of file scrvw.cpp. 03732 { 03733 // Get the Windows screen coordinates of the mouse cursor. 03734 // Convert from screen to window coordinates. 03735 WinCoord pt; 03736 *(wxPoint *)&pt = GetCanvas()->ScreenToClient( ::wxGetMousePosition() ); 03737 03738 // If the mouse is outside the view then we can do nothing more. 03739 if (!CurrentSize.Inside(pt)) return FALSE; 03740 03741 // Convert to OIL coordinates. 03742 if (pMousePos!=NULL) 03743 *pMousePos = pt.ToOil(pDocView, TRUE); 03744 03745 // We stored something useful. 03746 return TRUE; 03747 }
|
|
|
Reimplemented from CCamView. Definition at line 324 of file scrvw.h. 00324 { return DefaultRulersState;};
|
|
|
Reimplemented from CCamView. Definition at line 325 of file scrvw.h. 00325 { return DefaultScrollersState;};
|
|
|
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.
Definition at line 691 of file scrvw.cpp. 00692 { 00693 PORTNOTETRACE("other","ScreenView::GetDocViewFromHwnd - do nothing"); 00694 #ifndef EXCLUDE_FROM_XARALX 00695 // For all kernel documents in existence . . . 00696 List* pDocList = &(GetApplication()->Documents); 00697 for (Document* pKernelDoc = (Document*) pDocList->GetHead(); 00698 pKernelDoc != NULL; 00699 pKernelDoc = (Document*) pDocList->GetNext(pKernelDoc)) 00700 { 00701 00702 if(pKernelDoc->IsARalphDoc()) 00703 { 00704 // a bit unpleasent - only works because Ralph Docs have only one view.. 00705 // get the first (and only) docview 00706 DocView * pDocView = pKernelDoc->GetFirstDocView(); 00707 // check handles 00708 if(pDocView) 00709 if( pDocView->GetRenderWindow() == hwnd ) 00710 return pDocView; 00711 } 00712 else 00713 { 00714 00715 // Convert from a kernel document to an OIL document. 00716 CCamDoc* pCamDoc = pKernelDoc->GetOilDoc(); 00717 00718 // For all views onto the OIL document . . . 00719 POSITION pos = pCamDoc->GetFirstViewPosition(); 00720 while (pos != NULL) 00721 { 00722 // Compare the handle of the view's render window to the given handle, 00723 // returning the associated DocView if they match. 00724 ScreenView* pCamView = (ScreenView*) pCamDoc->GetNextView(pos); 00725 00726 // Not interested unless it is a ScreenView (it could be a print preview view) 00727 if (pCamView->IsKindOf(RUNTIME_CLASS(ScreenView))) 00728 { 00729 if (pCamView->RenderWindow->m_hWnd == hwnd) 00730 { 00731 return pCamView->pDocView; 00732 } 00733 } 00734 } 00735 } 00736 } 00737 #endif 00738 // Couldn't find the handle, so return nothing. 00739 return NULL; 00740 }
|
|
|
Reimplemented from CCamView. Definition at line 753 of file scrvw.cpp. 00754 { 00755 return GetDocViewFromHwnd( (wxWindow *)WinID ); 00756 }
|
|
|
Used by Will's rendering system - somehow.
Reimplemented from CCamView. Definition at line 4224 of file scrvw.cpp. 04225 { 04226 return pDocView; 04227 }
|
|
||||||||||||
|
Reimplemented from CCamView. |
|
|
Allows the kernel to draw on the client area at times other than when processing WM_PAINT messages. Note that the pointer returned is temporary and should NOT be stored away for future use - it may well become invalid on the next idle event.
Reimplemented from CCamView. Definition at line 1795 of file scrvw.cpp. 01796 { 01797 // 01798 // GAT: Warning - I don't think we want to be using this function anymore. 01799 // Create a DC when required. 01800 // 01801 PORTNOTETRACE("other","ScreenView::GetRenderDC - do nothing"); 01802 #ifndef EXCLUDE_FROM_XARALX 01803 return GetCanvas()->GetDC(); 01804 #else 01805 return NULL; 01806 #endif 01807 }
|
|
|
Allows the kernel to access to the render window, useful on the odd occasion, although it does distort "encapsulation".
Reimplemented from CCamView. Definition at line 1827 of file scrvw.cpp.
|
|
|
Tests whether proportional scroll bars are currently in operation.
|