#include <vstate.h>
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 |
Definition at line 116 of file vstate.h.
|
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 }
|
|
Definition at line 141 of file vstate.cpp.
|
|
Set the scroll position in WorkCoords for use by DocView and CamView.
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 }
|
|
Set the scroll position in WorkCoords for use by DocView and CamView.
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 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|