00001 /*! \file wx/canvas/canvas.h 00002 \brief a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument. 00003 00004 a2dCanvas is doing no more then displaying the view in a window, and taking care that 00005 the view is correctly set when scrolling the view, or when resizing the window. 00006 When receiving a paint event on the window, it tells the view to redisplay the 00007 damaged parts. The view then takes those parts from its drawing buffer or if there is not one, 00008 start redrawing the document where needed. 00009 00010 \author Robert Roebling and Klaas Holwerda 00011 00012 Copyright: 2000-2004 (c) Robert Roebling 00013 00014 Licence: wxWidgets Licence 00015 00016 RCS-ID: $Id: canvas.h,v 1.17 2008/09/02 19:42:00 titato Exp $ 00017 */ 00018 00019 #ifndef __A2DCANVAS_H__ 00020 #define __A2DCANVAS_H__ 00021 00022 #ifndef WX_PRECOMP 00023 #include "wx/wx.h" 00024 #endif 00025 00026 #include "wx/image.h" 00027 #include "wx/txtstrm.h" 00028 #include "wx/geometry.h" 00029 #include "wx/canvas/candefs.h" 00030 #include "wx/canvas/canobj.h" 00031 #include "wx/artbase/bbox.h" 00032 #include "wx/canvas/drawer.h" 00033 #include "wx/canvas/candoc.h" 00034 00035 //! a2dCanvas is used to display one of the a2dCanvasObjects which are part of a a2dCanvasDocument object and all that is nested in that choosen object. 00036 /*! 00037 This is a canvas that defines the viewport in world coordinates. 00038 The area of the a2dCanvasDocument drawing in world coordinates that is visible on the canvas 00039 can be set, which is called mapping. 00040 Parts of this area can be zoomed into resulting in scroll bars 00041 to be displayed. 00042 00043 Most functions here just redirect the calls to the member a2dCanvasView. 00044 They are available for convenience, but all of them can be accessed through the GetCanvasView() 00045 member function also. 00046 00047 \sa a2dCanvasView for more documentation. 00048 00049 The main thing done is to have the result of the a2dCanvasView rendering, blitted to the screen. 00050 The scrolling bars adjust the a2dCanvasView mapping to have the right mapping again after a scroll. 00051 It is optimized to miminize redrawing. 00052 00053 An update of the damaged parts will blitted from the a2dCanvasView buffer to the screen. 00054 This is done in Idle time, but can also be forced. 00055 00056 Settings like background drawing and grid drawing is done through the a2dCanvasView member. 00057 00058 The area of the drawing in world coordinates that is visible on the canvas 00059 can be set. 00060 Parts of this area can be zoomed into resulting in scroll bars 00061 to be displayed. 00062 00063 \sa a2dCanvasView 00064 \sa a2dMemDcDrawer 00065 \sa a2dCanvasDocument 00066 \sa a2dCanvasObject 00067 00068 \ingroup drawer docview 00069 */ 00070 class A2DCANVASDLLEXP a2dCanvas: public a2dDocumentViewWindow 00071 { 00072 public: 00073 00074 //!constructor 00075 /*! 00076 construct a canvas window. 00077 00078 Internal a a2dCanvasView and a2dCanvasDocument are created 00079 to render all objects stored in the a2dCanvasDocument into this a2dCanvas window. 00080 00081 The document and view or deleted in the destructor. 00082 00083 00084 \remark used for standalone a2dCanvas windows. 00085 00086 \param parent parent window (use wxNO_FULL_REPAINT_ON_RESIZE on parent wxFrame) 00087 \param id window id 00088 \param pos position of window 00089 \param size size of window 00090 \param style type of window (wxHSCROLL|wxVSCROLL) 00091 \param drawer2D the drawer to be used to render to the window ( construct with zero size, it will be set to the canvas size ) 00092 If 0 the default is a2dMemDcDrawer() 00093 */ 00094 a2dCanvas( wxWindow *parent, wxWindowID id = -1, 00095 const wxPoint& pos = wxDefaultPosition, 00096 const wxSize& size = wxDefaultSize, 00097 long style = wxScrolledWindowStyle, a2dDrawer2D *drawer2D = 0 ); 00098 00099 //!constructor 00100 /*! 00101 construct a canvas window, normally created by a a2dCanvasView/wxView. 00102 00103 \remark used when using a2dDocumentCommandProcessor classes. 00104 00105 \param view a2dCanvasView object used to render into this window. 00106 \param parent parent window (use wxNO_FULL_REPAINT_ON_RESIZE on parent wxFrame) 00107 \param id window id 00108 \param pos position of window 00109 \param size size of window 00110 \param style type of window (wxHSCROLL|wxVSCROLL) 00111 */ 00112 a2dCanvas( a2dCanvasView* view, wxWindow *parent, wxWindowID id = -1, 00113 const wxPoint& pos = wxDefaultPosition, 00114 const wxSize& size = wxDefaultSize, 00115 long style = wxScrolledWindowStyle ); 00116 00117 //!destructor 00118 /*!when a tool controller was set is will be deleted also. 00119 */ 00120 virtual ~a2dCanvas(); 00121 00122 //!if true, this canvas controls its view, instead of a central a2dDocumentCommandProcessor 00123 /*! 00124 For standalone canvas objects, which does display one a2dCanvasDocument, which it generated internal, 00125 the control over closing the view etc. is done by a2dCanvas itself. 00126 */ 00127 void SetControlDocView( bool val ) { m_control_doc_view = val; } 00128 00129 //! what is the current view 00130 a2dCanvasView* GetCanvasView() const { return wxDynamicCast( m_view.Get(), a2dCanvasView ); } 00131 00132 //! to make the canvas use a different view. 00133 void SetCanvasView( a2dCanvasView* view ); 00134 00135 //! to make the canvas use a different view. 00136 virtual void SetView( a2dView* view ); 00137 00138 //! Get the drawer of the view 00139 a2dDrawer2D *GetDrawer2D() const { return GetCanvasView()->GetDrawer2D(); } 00140 00141 //! Clears the canvas (like wxWindow::ClearBackground) 00142 /*! 00143 * Calls internally a2dCanvas::ClearBackground() 00144 * Clear() was renamed in wxWin 2.5 to ClearBackground() 00145 * 00146 * \todo 00147 * Remove this method after wxWin 2.6 release. 00148 */ 00149 void ClearBackground(); 00150 00151 //! Refresh window 00152 /*! 00153 Next to base class, makes sure all pending objects are processed, and scrolling is set right. 00154 */ 00155 virtual void Refresh( bool eraseBackground = true, const wxRect* rect = NULL ); 00156 00157 //!background fill for the canvas 00158 void SetBackgroundFill( const a2dFill& backgroundfill ); 00159 00160 //!Set grid setting for drawing grid in front or back 00161 void SetGridAtFront(bool gridatfront) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridAtFront(gridatfront); } 00162 00163 //!Get grid setting for drawing grid in front or back 00164 bool GetGridAtFront() { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetGridAtFront(); } 00165 00166 //!set stroke used for grid drawing 00167 void SetGridStroke( const a2dStroke& gridstroke) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridStroke(gridstroke); } 00168 00169 //!set size of grid circle 00170 void SetGridSize(wxUint16 gridsize) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridSize(gridsize); } 00171 00172 //!set brush used for grid drawing 00173 void SetGridFill( const a2dFill& gridfill) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridFill(gridfill); } 00174 00175 //!Get grid distance in X 00176 double GetGridX() { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetGridX(); } 00177 00178 //!Set grid distance in X 00179 void SetGridX(double gridx) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridX(gridx); } 00180 00181 //!Get grid distance in Y 00182 double GetGridY() { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetGridY(); } 00183 00184 //!Set grid distance in Y 00185 void SetGridY(double gridy) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridY(gridy); } 00186 00187 //!Set grid on/off 00188 void SetGrid(bool grid) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGrid(grid); } 00189 00190 //!Get grid setting on/off 00191 bool GetGrid() { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetGrid(); } 00192 00193 //!Get grid setting for line drawing 00194 /*!Note: SetGridSize must be 0, if gridlines=false */ 00195 void SetGridLines(bool gridlines) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetGridLines(gridlines); } 00196 00197 //!set grid to draw lines instead of points 00198 bool GetGridLines() { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetGridLines(); } 00199 00200 //!Set showorigin on/off 00201 void SetShowOrigin(bool show) { (wxStaticCast( m_view.Get(), a2dCanvasView ) )->SetShowOrigin(show); } 00202 00203 //!set if the Yaxis goes up or down 00204 void SetYaxis(bool up); 00205 00206 //!get currently used Yaxis setting 00207 bool GetYaxis() const; 00208 00209 //!set if the drawing should be resclaed on a window resize 00210 /*! 00211 When set, each resize of the window, result in scaling the visible draing up or down. 00212 The center of the window in world coordinates is kept the same. 00213 The drawing itself is scaled to the smallest of the width or height. 00214 00215 When m_ContinuesSizeUpdate is set each resize will scale the drawing, else 00216 only after a double buffer enlargement. 00217 */ 00218 void SetScaleOnResize(bool val) { m_scaleonresize=val; } 00219 00220 //!get current setting for ScaleOnResize 00221 bool GetScaleOnResize() { return m_scaleonresize; } 00222 00223 //!set if the drawing should be rescaled on a window resize 00224 void SetContinuesSizeUpdate(bool val) { m_ContinuesSizeUpdate = val; } 00225 00226 //!get current setting for ContinuesSizeUpdate flag 00227 bool GetContinuesSizeUpdate() { return m_ContinuesSizeUpdate; } 00228 00229 //!append an eventhandler to the list, this event handler will be called if the other skipped the event to process. 00230 void AppendEventHandler(wxEvtHandler *handler); 00231 00232 //!remove last event handler in the list 00233 wxEvtHandler* RemoveLastEventHandler(bool deleteHandler); 00234 00235 //!Returns if canvas is frozen. 00236 bool IsFrozen() { return m_frozen; } 00237 00238 //!prevent changing the a2dCanvasView buffer and blitting it to the window 00239 /*! To make sure the contents displayed into the a2dCanvasView buffer does not change. 00240 Pending objects inside a root will be added to the update list of the a2dCanvasView, 00241 but not redrawn into the buffer until Thaw. 00242 */ 00243 void Freeze(); 00244 00245 //!allow a2dCanvasView buffer to be changed and blitting it to the window 00246 /*! Enable updating of the a2dCanvasView buffer contents. 00247 */ 00248 void Thaw(); 00249 00250 //!set the document where the objects for this canvas are stored 00251 /*! the a2dCanvasDocument is indirectly set to the a2dCanvasView inside a2dCanvas. 00252 depending on the type of constructor, the document is owned and released by the a2dCanvas too. 00253 This is in a single a2dCanvas situation, without a a2dDocumentCommandProcessor to maintain and 00254 control all documents. 00255 */ 00256 void SetCanvasDocument(a2dCanvasDocument* aroot); 00257 00258 //!get root group that is displayed on the canvas 00259 a2dCanvasDocument* GetCanvasDocument(); 00260 00261 //!Give the virtual size to be displayed, the mappingmatrix will be calculated. 00262 /*! 00263 The current window size in pixels is used to calculate the mapping such that 00264 at least it will display all of the area given. 00265 00266 Setting virtual area to boundingbox of a drawing (currently visible ShowObject() 00267 \code 00268 m_worldcanvas->SetMappingWidthHeight(m_worldcanvas->GetShowObject()->GetXMin(), 00269 m_worldcanvas->GetShowObject()->GetYMin(), 00270 m_worldcanvas->GetShowObject()->GetWidth(), 00271 m_worldcanvas->GetShowObject()->GetHeight()) 00272 \endcode 00273 00274 \remark do not use during start up since window size is not well defined in that case resulting in 00275 \remark bad settings for the mapping. 00276 00277 \param vx1 minimum world x coordinate 00278 \param vy1 minimum world y coordiante ( either Lower or Upper Left corner depending on SetYaxis() ) 00279 \param width minimum width in world coordinates which we want to display on this window 00280 \param height minimum height in world coordinates which we want to display on this window 00281 \param scrollbars: The scroll region are set to display this also. 00282 */ 00283 void SetMappingWidthHeight( double vx1, double vy1, double width, double height,bool scrollbars ); 00284 00285 //! use the boundingbox of the ShowObject to set the mapping such that it will be displayed completely. 00286 /*! 00287 \param centre if true centre on window, else to (0,0) of device 00288 */ 00289 void SetMappingShowAll( bool centre = true ); 00290 00291 //! zoom out from the center by a factor n (zoomin if <1 ) 00292 void ZoomOut( double n ); 00293 00294 //! zoom out from position x,y by a factor n (zoomin if <1 ) 00295 void ZoomOutAtXy( int x, int y, double n ); 00296 00297 //!Give the virtual size to be displayed, the mappingmatrix will be calculated. 00298 /*! 00299 To display all of a drawing, set this here to the boundingbox of the show object 00300 of the canvas. 00301 So vx1 and vx2 to the miminum x and y of the boundingbox. 00302 Calculate xpp and ypp in such a manner that it will show the whole drawing. 00303 00304 Setting virtual area to boundingbox of a drawing (currently visible group) 00305 00306 \code 00307 int dx2,dy2; 00308 m_canvas->GetClientSize(&dx2,&dy2); 00309 double xupp=(m_canvas->GetShowObject()->GetWidth())/dx2; 00310 double yupp=(m_canvas->GetShowObject()->GetHeight())/dy2; 00311 if (yupp > xupp) 00312 xupp=yupp; 00313 m_worldcanvas->SetMappingUpp(m_worldcanvas->GetShowObject->GetXMin(), 00314 m_worldcanvas->GetShowObject->GetYMin(),xupp,xupp); 00315 \endcode 00316 00317 If a scrollable area is set, it will be called also to adjust it. 00318 \param vx1 minimum world x coordinate 00319 \param vy1 minimum world y coordiante ( either Lower or Upper Left corner depending on SetYaxis() ) 00320 \param xpp: Number of world units per pixel in x 00321 \param ypp: Number of world units per pixel in y 00322 */ 00323 void SetMappingUpp( double vx1, double vy1, double xpp, double ypp); 00324 00325 //! set scrollbars 00326 /*! 00327 \param pixelsPerUnitX the number of pixels per world unit in X 00328 \param pixelsPerUnitY the number of pixels per world unit in Y 00329 \param noUnitsX number of scroll units in X 00330 \param noUnitsY number of scroll units in Y 00331 \param xPos position of thumb in X 00332 \param yPos position of thumb in Y 00333 */ 00334 void SetScrollbars(double pixelsPerUnitX,double pixelsPerUnitY, 00335 double noUnitsX, double noUnitsY, 00336 double xPos = 0, double yPos = 0 ); 00337 00338 //!get Minimal X of the visible part in world coordinates 00339 double GetVisibleMinX() const; 00340 //!get Minimal X of the visible part in world coordinates 00341 double GetVisibleMinY() const; 00342 //!get Maximum X of the visible part in world coordinates 00343 double GetVisibleMaxX() const; 00344 //!get Maximum Y of the visible part in world coordinates 00345 double GetVisibleMaxY() const; 00346 //!get Width of visible part in world coordinates 00347 double GetVisibleWidth() const; 00348 //!get Height of visible part in world coordinates 00349 double GetVisibleHeight() const; 00350 00351 //!\return xpp Number of world units per pixel in x 00352 double GetUppX() const; 00353 00354 //!\return ypp Number of world units per pixel in y 00355 double GetUppY() const; 00356 00357 //!scroll the window in world coordinates 00358 /*! 00359 In case of FixScrollMaximum it will be done 00360 if it fits within the scrollmaximum else best possible. 00361 \return true if succesfull. 00362 */ 00363 bool ScrollWindowConstrained( double dx, double dy ); 00364 00365 //!to set the total area in world coordinates that can be scrolled to. 00366 /*!To be able to scroll the whole of a drawing, set this here to the boundingbox 00367 of the root group of the canvas. 00368 If the current Virtual display area does not fit inside the scrollable area, 00369 and the FixScrollMaximum is not set, the scroll area will be adjusted to have it fit. 00370 else scrollbars are disabled and return value is false. 00371 */ 00372 bool SetScrollMaximum(double vx1, double vy1, double vx2, double vy2); 00373 00374 //! Set horizontal scrollbar position in world coordinates 00375 void SetMinX( double vxmin ); 00376 //! Set vertical scrollbar position in world coordinates 00377 void SetMinY( double vymin ); 00378 00379 //!get the minimum scroll X in world coordinates that can be scrolled to 00380 double GetScrollMinX() const { return m_virtm_minX; } 00381 //!get the minimum scroll Y in world coordinates that can be scrolled to 00382 double GetScrollMinY() const { return m_virtm_minY; } 00383 //!get the maximum scroll X in world coordinates that can be scrolled to 00384 double GetScrollMaxX() const { return m_virtm_maxX; } 00385 //!get the maximum scroll Y in world coordinates that can be scrolled to 00386 double GetScrollMaxY() const { return m_virtm_maxY; } 00387 00388 //!set granularity (step size) for scrolling in world units for Horizontal Scrollbar 00389 /*! 00390 Scrolling is done when receiving wxEVT_SCROLLWIN_LINEUP wxEVT_SCROLLWIN_LINEDOWN. 00391 This is function is also internaly used to redraw the scrollbar 00392 */ 00393 void SetScrollStepX(double x); 00394 00395 //!set granularity (step size) for scrolling in world units for Vertical Scrollbar 00396 /*! 00397 Scrolling is done when receiving wxEVT_SCROLLWIN_LINEUP wxEVT_SCROLLWIN_LINEDOWN. 00398 This is function is also internaly used to redraw the scrollbar 00399 */ 00400 void SetScrollStepY(double y); 00401 00402 //!at all times the virtual displayed area will stay within the maximum scrollable area 00403 void FixScrollMaximum(bool fixed) { m_scrollmaxfixed=fixed; } 00404 00405 //! show scrollbars if set true. 00406 void SetScrollBarsVisible(bool onoff); 00407 00408 //! when scrolling outside the maximum scroll region and 00409 /*! 00410 m_scrollmaxfixed is true, do clip virtual area if this is true 00411 */ 00412 void ClipToScrollMaximum(bool clip) { m_clipToScrollMax = clip; } 00413 00414 //! zoomout leafs a border of this amount of pixels around the drawing 00415 void SetZoomOutBorder( wxUint16 border ) { m_border = border; } 00416 00417 //!check if the given scroll in worldcoordinates (X and Y) will stay within ScrollMaximum. 00418 /*! 00419 \remark ONLY if m_scrollmaxfixed is set, else it return true in all cases. 00420 */ 00421 bool CheckInsideScrollMaximum( double worldminx, double worldminy); 00422 00423 //!set object available in the a2dCanvasDocument to be shown on the canvas 00424 /*! 00425 \param name: name of top object 00426 \return pointer to the object found else NULL 00427 */ 00428 a2dCanvasObject* SetShowObject(const wxString& name); 00429 00430 //!set top object available in the a2dCanvasDocument to be shown on the canvas 00431 /*! 00432 \param obj: pointer to object to show 00433 */ 00434 bool SetShowObject(a2dCanvasObject* obj); 00435 00436 //!return pointer of then currently shown object on the canvas. 00437 /*! 00438 \return pointer to the current object that is shown. 00439 */ 00440 a2dCanvasObject* GetShowObject() const { return (wxStaticCast( m_view.Get(), a2dCanvasView ) )->GetShowObject(); } 00441 00442 //!do a hittest on the canvas at coordinates x,y 00443 /*! 00444 \param x: x of point to do hittest 00445 \param y: y of point to do hittest 00446 \param layer only if object is on this layer or if set to wxLAYER_ALL ignore layer id. 00447 \param how in which way the object was hit (stroke, fill, ...) 00448 \return the top object that was hit (e.g.in case of groups) 00449 \remark hit margin is defined in a2dCanvasDocument containing the root group 00450 */ 00451 a2dCanvasObject* IsHitWorld( 00452 double x, double y, 00453 int layer = wxLAYER_ALL, 00454 a2dHitOption option = a2dCANOBJHITOPTION_NOROOT | a2dCANOBJHITOPTION_LAYERS 00455 ); 00456 00457 //! \see a2dCanvasView::SetMouseEvents() 00458 void SetMouseEvents(bool onoff); 00459 00460 //! \see a2dCanvasView::GetMouseEvents() 00461 bool GetMouseEvents(); 00462 00463 //! write what you see to an SVG( scalable vector graphics file ) 00464 bool WriteSVG(const wxString& filename, double Width, double Height, wxString unit); 00465 00466 protected: 00467 00468 //! adjust either the maximum scrollable area to contain the current visible area or 00469 //! if fixed, change the visible area to stay within. 00470 bool MakeVirtualMaxFitVisibleArea(); 00471 00472 //! same as normal client size, but when dx or dy is zero, it will be set to 1000. 00473 /*! 00474 This is to prevent an irational mapping and/or divide by zero problems. 00475 */ 00476 void GetSaveClientSize( int* dvx, int* dvy) const; 00477 00478 //!virtual coordinates of total scrollable area for the drawing, used to set scrollbars 00479 double m_virtm_minX, m_virtm_minY, m_virtm_maxX, m_virtm_maxY; 00480 00481 //! repaint damaged araes, taking into acount non updated araes in a2dCanvasView. 00482 void OnPaint( wxPaintEvent &event ); 00483 00484 //! resize, adjusting buffer of a2dCanvasView if needed. 00485 void OnSize( wxSizeEvent &event ); 00486 00487 //! mouse wheel handler 00488 void OnWheel( wxMouseEvent& event ); 00489 00490 //! Not yet implemented 00491 void OnEraseBackground( wxEraseEvent &event ); 00492 00493 //!what to do while scrollling 00494 void OnScroll(wxScrollWinEvent& event); 00495 00496 //!what to do for characters received 00497 void OnChar( wxKeyEvent &event ); 00498 00499 //! remove all pending update areas in a2dCanvasView 00500 void DeleteAllPendingAreas(); 00501 00502 //!are scroll bars active? 00503 bool m_scaleonresize; 00504 00505 //! border zoomout but leaf around a border of this amount of pixels. 00506 wxUint16 m_border; 00507 00508 //! set true by wxWindow style parameter wxVSCROLL | wxHSCROLL 00509 bool m_wantScroll; 00510 00511 //! when because resizing or setting maximum scrollable area, it becomes smaller then the visible area, 00512 /*! we can adjust it or adjust units per pixel to make it fit again. 00513 */ 00514 bool m_aboveScrolledFixedAdjustUpp; 00515 00516 //!check if the given scroll in pixels (X and Y) will be oke to stay within ScrollMaximum. 00517 /*! 00518 \remark ONLY if m_scrollmaxfixed is set, else it return true in all cases. 00519 \param dy > contents of window moves up 00520 \param dx > contents of window moves right 00521 */ 00522 bool CheckInsideScrollMaximum(int dx, int dy); 00523 00524 void Init( int dvx, int dvy ); 00525 00526 //! Total range of X scroll bar, which gets always adjusted by the m_scrollstepx 00527 /*! 00528 \remark used intenal 00529 */ 00530 int m_scrollrangex; 00531 00532 //! Total range of Y scroll bar, which gets always adjusted by the m_scrollstepy 00533 /*! 00534 \remark used internal 00535 */ 00536 int m_scrollrangey; 00537 00538 //!current thumbsize of X scrollbar which gets always adjusted by the m_scrollstepx 00539 /*! 00540 \remark used internal 00541 */ 00542 int m_thumbx; 00543 00544 //!current thumbsize of Y scrollbar which gets always adjusted by the m_scrollstepy 00545 /*! 00546 \remark used internal 00547 */ 00548 int m_thumby; 00549 00550 //!step for X line up and down in world coordinates 00551 double m_scrollstepx; 00552 00553 //!step for Y line up and down in world coordinates 00554 double m_scrollstepy; 00555 00556 //!are scroll bars active? 00557 bool m_scrolled; 00558 00559 //!a flag for ignoring size events when scrollbars change 00560 bool m_xscroll_changed; 00561 00562 //!a flag for ignoring size events when scrollbars change 00563 bool m_yscroll_changed; 00564 00565 //!flag if there is a horizontal scrollbar 00566 bool m_has_x_scroll; 00567 00568 //!flag if there is a vertical scrollbar 00569 bool m_has_y_scroll; 00570 00571 //!stay within maximum scrollable area 00572 bool m_scrollmaxfixed; 00573 00574 //! see ClipToScrollMaximum() 00575 bool m_clipToScrollMax; 00576 00577 //!to optimize onsize events 00578 int m_oldw,m_oldh,m_prevh, m_prevw, m_prevClientW, m_prevClientH; 00579 00580 //!oversize of buffer compared to screen width and height 00581 int m_delta; 00582 00583 //!prevent updating activity if true 00584 bool m_frozen; 00585 00586 //!true when used standalone without a2dDocumentCommandProcessor control. 00587 bool m_control_doc_view; 00588 00589 //!in future the offset from window to drawer in X 00590 int m_oversizeX; 00591 00592 //!in future the offset from window to drawer in Y 00593 int m_oversizeY; 00594 00595 //! to check if drawer document was changed 00596 a2dSmrtPtr<a2dCanvasDocument> m_doc; 00597 00598 //! prevent SetScrollMaximum beeing called recursively 00599 bool m_inSetScrollMaximum; 00600 00601 //! at small resize also update the buffer directly. 00602 /*! 00603 When false, updates only happen when a new buffersize is allocated. 00604 */ 00605 bool m_ContinuesSizeUpdate; 00606 00607 //! used to normalize scroll thumb and range 00608 int m_normalize; 00609 00610 DECLARE_CLASS(a2dCanvas) 00611 DECLARE_EVENT_TABLE() 00612 00613 }; 00614 00615 #endif /* __A2DCANVAS_H__ */ 00616 00617