ViewState Class Reference

#include <vstate.h>

List of all members.

Public Member Functions

 ViewState ()
virtual ~ViewState ()
WorkCoord SetScrollPos (WorkCoord sp, BOOL fPixelise=TRUE)
 Set the scroll position in WorkCoords for use by DocView and CamView.
WorkCoord GetScrollPos (BOOL Pixelise=TRUE)
 Set the scroll position in WorkCoords for use by DocView and CamView.

Public Attributes

View * pView
Rect ScreenRect
Rect ParentRect
Rect ViewRect
Coord IconPoint
WorkRect WorkAreaExtent
FIXED16 ViewScale
BOOL IsNewView
BOOL IsMinimised
BOOL IsMaximised
BOOL AlwaysOnTop
BOOL RulersVisible
BOOL ScrollersVisible
INT32 zPos
BOOL _GridShow: 1
BOOL _GridSnap: 1
BOOL _ObjectsSnap: 1
BOOL _MagObjectsSnap: 1
BOOL _PrintBorderShow: 1
BOOL _LogicalView: 1
BOOL _GuidesSnap: 1
BOOL _GuidesShow: 1

Protected Attributes

WorkCoord ScrollPosition


Detailed Description

Definition at line 116 of file vstate.h.


Constructor & Destructor Documentation

ViewState::ViewState (   ) 
 

Definition at line 112 of file vstate.cpp.

00113 {
00114     // Set all the params to defaults
00115     pView = NULL;
00116 
00117     // Make all rects empty
00118     ScreenRect.MakeEmpty();
00119     ParentRect.MakeEmpty();
00120     ViewRect.MakeEmpty();
00121     WorkAreaExtent.MakeEmpty();
00122     IconPoint = Coord(0,0);
00123 
00124     ViewScale = 0;
00125     zPos = 0;
00126     
00127     IsNewView = TRUE;
00128     IsMinimised = FALSE;
00129     IsMaximised = FALSE;
00130     AlwaysOnTop = FALSE;
00131     RulersVisible = FALSE;
00132     ScrollersVisible = TRUE;
00133     ScrollPosition = WorkCoord(0,0);
00134 
00135     _GridShow = _GridSnap = _ObjectsSnap = _MagObjectsSnap = _PrintBorderShow = FALSE;
00136     _LogicalView = _GuidesSnap = _GuidesShow = FALSE;
00137 }

ViewState::~ViewState (   )  [virtual]
 

Definition at line 141 of file vstate.cpp.

00142 {
00143     // empty
00144 }


Member Function Documentation

WorkCoord ViewState::GetScrollPos (  BOOL  Pixelise = TRUE  ) 
 

Set the scroll position in WorkCoords for use by DocView and CamView.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/11/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
Scroll position

Errors: None

Definition at line 217 of file vstate.cpp.

00218 {
00219     ERROR3IF(!Pixelise, "ViewState::GetScrollPos called with Pixelise = FALSE");
00220     return(ScrollPosition);
00221 
00222 #if FALSE
00223     WorkCoord temp = ScrollPosition;
00224 
00225     // If we have a NULL view, return quietly, cos this is probably in 
00226     // some rendering code.
00227     if (Pixelise)
00228     {
00229         FIXED16 PixelWidth, PixelHeight;    
00230         ERROR2IF(pView == NULL, temp, "No attached view in ViewState::GetScrollPos");
00231         pView->GetPixelSize(&PixelWidth, &PixelHeight);
00232     
00233         INT32 pw = PixelWidth.MakeLong();
00234         INT32 ph = PixelHeight.MakeLong();
00235 
00236         if (temp.x < 0) temp.x -= (pw - 1);         // Overcome the flooring of negative values
00237         if (temp.y < 0) temp.y -= (ph - 1);         // towards 0 by the upcoming divisions...
00238 
00239         temp.x = (temp.x / pw) * pw;
00240         temp.y = (temp.y / ph) * ph;
00241     }
00242     return temp;
00243 #endif
00244 }

WorkCoord ViewState::SetScrollPos (  WorkCoord  sp,
BOOL  fPixelise = TRUE
) 
 

Set the scroll position in WorkCoords for use by DocView and CamView.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/11/94
Parameters:
New scroll position and whether to pixelise it. [INPUTS]
Pixelised scroll position. [OUTPUTS]
Returns:
None

Errors: None

Definition at line 162 of file vstate.cpp.

00163 {
00164     ERROR3IF(!fPixelise, "ViewState::SetScrollPos called with Pixelise = FALSE");
00165 
00166 //  TRACE( _T("VS::SetScrollPos(%d, %d)\n"), (INT32)(sp.x), (INT32)(sp.y));
00167 
00168     FIXED16 PixelWidth, PixelHeight;    
00169     ERROR2IF(pView == NULL, ScrollPosition, "No attached view in ViewState::SetScrollPos");
00170     pView->GetPixelSize(&PixelWidth, &PixelHeight);
00171 
00172     INT32 pw = PixelWidth.MakeLong();
00173     INT32 ph = PixelHeight.MakeLong();
00174 
00175     if (sp.x < 0) sp.x -= (pw - 1);         // Overcome the flooring of negative values
00176     if (sp.y < 0) sp.y -= (ph - 1);         // towards 0 by the upcoming divisions...
00177 
00178     ScrollPosition.x = (sp.x / pw) * pw;
00179     ScrollPosition.y = (sp.y / ph) * ph;
00180 
00181     return ScrollPosition;
00182 }


Member Data Documentation

BOOL ViewState::_GridShow
 

Definition at line 160 of file vstate.h.

BOOL ViewState::_GridSnap
 

Definition at line 161 of file vstate.h.

BOOL ViewState::_GuidesShow
 

Definition at line 167 of file vstate.h.

BOOL ViewState::_GuidesSnap
 

Definition at line 166 of file vstate.h.

BOOL ViewState::_LogicalView
 

Definition at line 165 of file vstate.h.

BOOL ViewState::_MagObjectsSnap
 

Definition at line 163 of file vstate.h.

BOOL ViewState::_ObjectsSnap
 

Definition at line 162 of file vstate.h.

BOOL ViewState::_PrintBorderShow
 

Definition at line 164 of file vstate.h.

BOOL ViewState::AlwaysOnTop
 

Definition at line 152 of file vstate.h.

Coord ViewState::IconPoint
 

Definition at line 138 of file vstate.h.

BOOL ViewState::IsMaximised
 

Definition at line 151 of file vstate.h.

BOOL ViewState::IsMinimised
 

Definition at line 150 of file vstate.h.

BOOL ViewState::IsNewView
 

Definition at line 149 of file vstate.h.

Rect ViewState::ParentRect
 

Definition at line 135 of file vstate.h.

View* ViewState::pView
 

Definition at line 132 of file vstate.h.

BOOL ViewState::RulersVisible
 

Definition at line 153 of file vstate.h.

Rect ViewState::ScreenRect
 

Definition at line 134 of file vstate.h.

BOOL ViewState::ScrollersVisible
 

Definition at line 154 of file vstate.h.

WorkCoord ViewState::ScrollPosition [protected]
 

Definition at line 175 of file vstate.h.

Rect ViewState::ViewRect
 

Definition at line 136 of file vstate.h.

FIXED16 ViewState::ViewScale
 

Definition at line 147 of file vstate.h.

WorkRect ViewState::WorkAreaExtent
 

Definition at line 140 of file vstate.h.

INT32 ViewState::zPos
 

Definition at line 155 of file vstate.h.


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