24 #if wxART2D_USE_AGGDRAWER
35 #define MIN_MAPSIZE 10
40 EVT_PAINT( a2dCanvas::OnPaint )
41 EVT_ERASE_BACKGROUND( a2dCanvas::OnEraseBackground )
42 EVT_SCROLLWIN( a2dCanvas::OnScroll )
43 EVT_CHAR( a2dCanvas::OnChar )
44 EVT_SIZE( a2dCanvas::OnSize )
45 EVT_MOUSEWHEEL( a2dCanvas::OnWheel )
46 EVT_ACTIVATE( a2dCanvas::OnActivate )
50 a2dCanvas::a2dCanvas( wxWindow* parent, wxWindowID
id, const wxPoint& pos, const wxSize& size,
long style,
a2dDrawer2D* drawer2D ):
51 wxWindow( parent,
id, pos, size, style | wxWANTS_CHARS )
55 if ( style & wxVSCROLL || style & wxHSCROLL )
58 m_inSetScrollMaximum =
false;
59 int dvx = size.GetWidth();
60 int dvy = size.GetHeight();
62 if ( size == wxDefaultSize )
68 GetSaveClientSize( &dvx, &dvy );
75 m_drawingPart =
new a2dDrawingPart( dvx + m_oversizeX * 2, dvy + m_oversizeY * 2 );
76 m_drawingPart->SetDisplayWindow(
this );
79 drawer2D =
new a2dMemDcDrawer( dvx + m_oversizeX * 2, dvy + m_oversizeY * 2 );
81 drawer2D->SetBufferSize( dvx + m_oversizeX * 2, dvy + m_oversizeY * 2 );
83 m_drawingPart->SetDrawer2D( drawer2D );
88 m_virtm_maxX = drawer2D->GetWidth();
89 if ( m_virtm_maxX == 0 )
91 m_virtm_maxY = drawer2D->GetHeight();
92 if ( m_virtm_maxY == 0 )
96 GetDrawer2D()->SetMappingDeviceRect( m_oversizeX, m_oversizeY, dvx, dvy );
97 m_drawingPart->SetShowObject( m_drawing->GetRootObject() );
107 const wxPoint& position,
const wxSize& size,
long style ) :
108 wxWindow( parent, id, position, size, style | wxWANTS_CHARS )
112 if ( style & wxVSCROLL || style & wxHSCROLL )
118 m_drawingPart = drawingPart;
125 m_virtm_maxX = size.GetWidth();
126 if ( m_virtm_maxX == 0 )
129 m_virtm_maxY = size.GetHeight();
130 if ( m_virtm_maxY == 0 )
148 bool a2dCanvas::ProcessEvent( wxEvent& event )
155 if ( m_drawingPart &&
159 return wxEvtHandler::ProcessEvent( event );
169 void a2dCanvas::SetDrawing(
a2dDrawing* drawing )
173 m_drawingPart = NULL;
196 m_drawingPart = drawingPart;
208 void a2dCanvas::Init(
int dvx,
int dvy )
216 double dmvy = m_virtm_maxY - m_virtm_minY;
240 m_oldw = m_oldh = m_prevh = 0;
241 m_prevClientW = m_prevClientH = 0;
252 GetClientSize( dvx, dvy );
254 if ( *dvx == 0 ) *dvx = MIN_MAPSIZE;
255 if ( *dvy == 0 ) *dvy = MIN_MAPSIZE;
262 wxWindow::ClearBackground();
267 if ( m_drawingPart && !rect )
274 wxWindow::Refresh( eraseBackground, rect );
282 m_drawingPart = NULL;
288 if ( !m_drawingPart )
296 if ( !m_drawingPart )
303 if ( !m_drawingPart )
316 wxEvtHandler* handlerA = GetEventHandler();
317 while ( handlerA->GetNextHandler() )
319 handlerA = ( wxEvtHandler* )handlerA->GetNextHandler();
321 handlerA->SetNextHandler( handler );
322 handler->SetNextHandler( ( wxEvtHandler* )NULL );
328 wxEvtHandler* handlerA = GetEventHandler();
329 wxEvtHandler* handlerB = handlerA;
331 while ( handlerA->GetNextHandler() )
334 handlerA = ( wxEvtHandler* )handlerA->GetNextHandler();
337 handlerB->SetNextHandler( ( wxEvtHandler* )NULL );
343 return GetEventHandler();
348 if ( !m_drawingPart )
355 if ( !m_drawingPart )
362 if ( !m_drawingPart )
369 if ( !m_drawingPart )
423 wxPaintDC dc(
this );
425 if ( !m_drawingPart )
430 if ( m_drawingPart->
IsFrozen() )
return;
444 bool eventHandlerEnabledState = m_drawingPart->GetEvtHandlerEnabled();
445 if ( !eventHandlerEnabledState )
446 m_drawingPart->SetEvtHandlerEnabled(
true );
454 m_drawingPart->SetEvtHandlerEnabled( eventHandlerEnabledState );
461 wxRegionIterator it( GetUpdateRegion() );
467 int w = it.GetWidth();
468 int h = it.GetHeight();
495 return m_drawingPart->
IsHitWorld( x, y, layer, option );
508 double xupp = width / dxn;
509 double yupp = height / dyn;
511 if ( yupp == 0 || xupp == 0 )
572 int clientw, clienth;
576 if ( clientw - border > 0 )
577 uppx = w / ( clientw - border );
582 if ( clienth - border > 0 )
583 uppy = h / ( clienth - border );
605 double middlexworld = untr.
GetMinX() + w / 2.0;
606 double middleyworld = untr.
GetMinY() + h / 2.0;
607 GetDrawer2D()->
SetMappingUpp( middlexworld - clientw / 2.0 * uppx, middleyworld - clienth / 2.0 * uppx, uppx, uppx );
611 int clientwNew, clienthNew;
613 if ( clientw != clientwNew || clienth != clienthNew )
616 if ( clientw - border > 0 )
617 uppx = w / ( clientw - border );
622 if ( clienth - border > 0 )
623 uppy = h / ( clienth - border );
643 double middlexworld = untr.
GetMinX() + w / 2.0;
644 double middleyworld = untr.
GetMinY() + h / 2.0;
645 GetDrawer2D()->
SetMappingUpp( middlexworld - clientwNew / 2.0 * uppx, middleyworld - clienthNew / 2.0 * uppx, uppx, uppx );
659 GetClientSize( &dx, &dy );
660 if ( dy > dx ) dx = dy;
670 GetClientSize( &dx, &dy );
671 if ( dy > dx ) dx = dy;
673 double mouse_worldx, mouse_worldy;
683 double noUnitsX,
double noUnitsY,
684 double xPos ,
double yPos )
699 SetScrollMaximum( 0, 0, dxn / pixelsPerUnitX * noUnitsX, dyn / pixelsPerUnitY * noUnitsY );
711 bool visAreaSizeChange =
false;
733 double dmvy = m_virtm_maxY - m_virtm_minY;
752 visAreaSizeChange =
true;
765 if ( m_virtm_minX - tol >= minvx ) m_virtm_minX = minvx;
766 if ( m_virtm_maxX + tol <= maxvx ) m_virtm_maxX = maxvx;
767 if ( m_virtm_minY - tol >= minvy ) m_virtm_minY = minvy;
768 if ( m_virtm_maxY + tol <= maxvy ) m_virtm_maxY = maxvy;
771 dmvy = m_virtm_maxY - m_virtm_minY;
773 visAreaSizeChange =
false;
784 if ( m_virtm_minX - tol >= minvx )
786 if ( m_virtm_maxX + tol <= maxvx )
787 { maxvx = m_virtm_maxX; clip =
true; }
788 if ( m_virtm_minY - tol >= minvy )
789 { minvy = m_virtm_minY; clip =
true; }
790 if ( m_virtm_maxY + tol <= maxvy )
791 { maxvy = m_virtm_maxY; clip =
true; }
801 if ( dmvx > dvx || dmvy > dvy )
805 if ( minvx == m_virtm_minX ) maxvx = m_virtm_minX + dvx;
806 else if ( maxvx == m_virtm_maxX ) minvx = m_virtm_maxX - dvx;
810 if ( minvy == m_virtm_minY ) maxvy = m_virtm_minY + dvy;
811 else if ( maxvy == m_virtm_maxY ) minvy = m_virtm_maxY - dvy;
823 double uppX = dmvx / ( dx + 1 );
824 double uppY = dmvy / ( dy + 1 );
835 visAreaSizeChange =
true;
856 if ( HasScrollbar( wxHORIZONTAL ) )
857 SetScrollbar( wxHORIZONTAL, 0, 1, 1,
true );
858 if ( HasScrollbar( wxVERTICAL ) )
859 SetScrollbar( wxVERTICAL, 0, 1, 1,
true );
860 return visAreaSizeChange;
872 SetScrollbar( wxVERTICAL, 0, 1, 2,
false );
884 SetScrollbar( wxHORIZONTAL, 0, 1, 2,
false );
898 SetScrollbar( wxVERTICAL, 0, 1, 2,
false );
924 SetScrollbar( wxHORIZONTAL, position,
m_thumbx, m_scrollrangex,
true );
932 SetScrollbar( wxHORIZONTAL, 0, 1, 1,
true );
969 SetScrollbar( wxVERTICAL, 0, 1, 1,
true );
975 visAreaSizeChange =
true;
980 return visAreaSizeChange;
988 wxASSERT_MSG( vx1 < vx2, wxT(
"min X bigger than max X" ) );
989 wxASSERT_MSG( vy1 < vy2, wxT(
"min Y bigger than max Y" ) );
1055 double worlddvx =
GetUppX() * dvx;
1056 double worlddvy =
GetUppY() * dvy;
1059 ( m_virtm_minX <= worldminx ) &&
1060 ( m_virtm_maxX >= worldminx + worlddvx ) &&
1061 ( m_virtm_minY <= worldminy ) &&
1062 ( m_virtm_maxY >= worldminy + worlddvy );
1067 if ( !m_drawingPart )
1083 if ( event.GetEventType() == wxEVT_SCROLLWIN_THUMBRELEASE ||
1087 if ( event.GetOrientation() == wxHORIZONTAL )
1089 double x = m_virtm_minX +
event.GetPosition() / (
m_scrollrangex * 1.0 ) * ( m_virtm_maxX - m_virtm_minX );
1096 int position =
event.GetPosition();
1101 y = m_virtm_maxY - position / (
m_scrollrangey * 1.0 ) * ( m_virtm_maxY - m_virtm_minY );
1106 y = m_virtm_minY + position / (
m_scrollrangey * 1.0 ) * ( m_virtm_maxY - m_virtm_minY );
1115 else if ( event.GetEventType() == wxEVT_SCROLLWIN_PAGEUP )
1118 if ( event.GetOrientation() == wxHORIZONTAL )
1128 else if ( event.GetEventType() == wxEVT_SCROLLWIN_PAGEDOWN )
1130 if ( event.GetOrientation() == wxHORIZONTAL )
1140 else if ( event.GetEventType() == wxEVT_SCROLLWIN_LINEUP )
1142 if ( event.GetOrientation() == wxHORIZONTAL )
1152 else if ( event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN )
1154 if ( event.GetOrientation() == wxHORIZONTAL )
1173 switch ( event.GetKeyCode() )
1222 if ( !event.ControlDown() )
1237 if ( !event.ControlDown() )
1252 if ( !event.ControlDown() )
1262 if ( !event.ControlDown() )
1272 event.ResumePropagation( wxEVENT_PROPAGATE_MAX );
1294 if( dxworld != 0 && dx == 0 )
1298 if( dyworld != 0 && dy == 0 )
1322 wxWindow::ScrollWindow( (
int ) dx, (
int ) dy, NULL );
1331 if ( dy != 0 || !oke )
1334 m_drawingPart->
Scroll( (
int ) dy,
true, !oke );
1339 if ( dx != 0 || !oke )
1342 m_drawingPart->
Scroll( (
int ) dx,
false, !oke );
1348 if ( dx != 0 || dy != 0 || !oke )
1352 m_drawingPart->
BlitBuffer( 0, 0, w, h, 0, 0 );
1365 if ( !m_drawingPart )
1399 int clientw, clienth;
1407 w += wxSystemSettings::GetMetric( wxSYS_VSCROLL_X );
1410 h += wxSystemSettings::GetMetric( wxSYS_HSCROLL_Y );
1415 if ( abs(
m_oldw - w ) > m_delta || abs( m_oldh - h ) > m_delta )
1426 if (
m_oldw != 0 && m_oldh != 0 && clientw > MIN_MAPSIZE && clienth > MIN_MAPSIZE )
1428 if ( m_prevClientW == 0 )
1429 m_prevClientW = clientw;
1430 if ( m_prevClientH == 0 )
1431 m_prevClientH = clienth;
1438 if ( clientw < clienth )
1439 upp = worldoldw / clientw;
1441 upp = worldoldh / clienth;
1450 m_prevClientW = clientw;
1451 m_prevClientH = clienth;
1510 if (
m_oldw != 0 && m_oldh != 0 && clientw > MIN_MAPSIZE && clienth > MIN_MAPSIZE )
1512 if ( m_prevClientW == 0 )
1513 m_prevClientW = clientw;
1514 if ( m_prevClientH == 0 )
1515 m_prevClientH = clienth;
1522 if ( clientw < clienth )
1523 upp = worldoldw / clientw;
1525 upp = worldoldh / clienth;
1534 m_prevClientW = clientw;
1535 m_prevClientH = clienth;
1580 int rot =
event.GetWheelRotation();
1584 if ( event.AltDown() )
1586 if ( !event.ShiftDown() )
1589 if ( !event.ControlDown() )
1602 if ( !event.ControlDown() )
1616 if ( event.AltDown() )
1618 if ( !event.ShiftDown() )
1621 if ( !event.ControlDown() )
1634 if ( !event.ControlDown() )
1648 void a2dCanvas::OnActivate( wxActivateEvent& event )
bool GetYaxis() const
get currently used Yaxis setting
void SetMappingUpp(double vx1, double vy1, double xpp, double ypp)
Give the virtual size to be displayed, the mapping matrix will be calculated.
virtual void SetYaxis(bool up)
set if the Yaxis goes up or down
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
int WorldToDeviceXRel(double x) const
convert x relative from world to device coordinates
void SetScrollBarsVisible(bool onoff)
show scrollbars if set true.
double GetHeight() const
returns height of the boundingbox
int m_oldw
to optimize onsize events
int m_normalize
used to normalize scroll thumb and range
void OnScroll(wxScrollWinEvent &event)
what to do while scrollling
void EndRefreshDisplayDisable()
see StartRefreshDisplayDisable()
double GetVisibleMaxY() const
get Maximum Y of the visible part in world coordinates
void SetBackgroundFill(const a2dFill &backgroundfill)
background fill for the canvas
void OnPaint(wxPaintEvent &event)
repaint damaged araes, taking into acount non updated araes in a2dCanvasView.
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
void SetMouseEvents(bool onoff)
bool m_aboveScrolledFixedAdjustUpp
when because resizing or setting maximum scrollable area, it becomes smaller then the visible area...
double GetVisibleMinX() const
get Minimal X of the visible part in world coordinates
bool IsFrozen()
Returns if canvas is frozen.
void Freeze()
prevent changing the a2dCanvasView buffer and blitting it to the window
a2dCanvasObject * GetRootObject() const
get the root object, which holds the objects in the document
bool m_ContinuesSizeUpdate
at small resize also update the buffer directly.
wxUint16 GetZoomOutBorder()
bool m_has_x_scroll
flag if there is a horizontal scrollbar
void ClearBackground()
Clears the canvas (like wxWindow::ClearBackground)
void SetMappingDeviceRect(int mapx, int mapy, int mapWidth, int mapHeight, bool remap=false)
to change the default mapping (to the complete buffer).
void SetScrollStepY(double y)
set granularity (step size) for scrolling in world units for Vertical Scrollbar
double DeviceToWorldYRel(double y) const
convert y relative from device to world coordinates
bool SetScrollMaximum(double vx1, double vy1, double vx2, double vy2)
to set the total area in world coordinates that can be scrolled to.
virtual void Scroll(int dxy, bool yscroll, bool total)
scroll up down or left right
int m_delta
oversize of buffer compared to screen width and height
void Update(unsigned int how=(a2dCANVIEW_UPDATE_ALL|a2dCANVIEW_UPDATE_BLIT), wxObject *hintObject=NULL)
see OnUpdate
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the canvas.
bool GetYaxis() const
get y axis orientation
void SetBackgroundFill(const a2dFill &backgroundfill)
background fill for the canvas
This class implements drawing functions for wxDC based drawing.
double GetVisibleMinY() const
get Minimal X of the visible part in world coordinates
int m_thumbx
current thumbsize of X scrollbar which gets always adjusted by the m_scrollstepx
void SetYaxis(bool up)
set if the Yaxis goes up or down
a2dCanvasObject is the base class for Canvas Objects.
void SetMinX(double vxmin)
Set horizontal scrollbar position in world coordinates.
int m_oversizeX
in future the offset from window to drawer in X
virtual void SetBufferSize(int w, int h)
sets buffersize ( if used ) for the a2dDrawer2D
a2dCanvasObject * IsHitWorld(double x, double y, int layer=wxLAYER_ALL, a2dHitOption option=a2dCANOBJHITOPTION_NOROOT|a2dCANOBJHITOPTION_LAYERS)
do a hittest on the canvas at coordinates x,y
void AppendEventHandler(wxEvtHandler *handler)
append an eventhandler to the list, this event handler will be called if the other skipped the event ...
bool GetMouseEvents() const
return true if this a2dDrawingPart allows mouse events to be processed.
void SetMappingUpp(double vx1, double vy1, double xpp, double ypp)
Give the virtual size to be displayed, the mappingmatrix will be calculated.
bool m_scrolled
are scroll bars active?
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
void GetSaveClientSize(int *dvx, int *dvy) const
same as normal client size, but when dx or dy is zero, it will be set to 1000.
double GetVisibleMaxX() const
get Maximum X of the visible part in world coordinates
void SetScrollStepX(double x)
set granularity (step size) for scrolling in world units for Horizontal Scrollbar ...
virtual void BlitBuffer(int x, int y, int width, int height, int xbuf, int ybuf)
blit part of the drawing buffer to the canvas
bool m_frozen
prevent updating activity if true
bool MakeVirtualMaxFitVisibleArea()
int m_oversizeY
in future the offset from window to drawer in Y
double GetUppX() const
return xpp Number of user units per pixel in x
virtual double GetVisibleHeight() const
get Height of visible part in world coordinates
bool m_yscroll_changed
a flag for ignoring size events when scrollbars change
a2dCanvas(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, a2dDrawer2D *drawer2D=0)
constructor
void SetMappingShowAll(bool centre=true)
use the boundingbox of the ShowObject to set the mapping such that it will be displayed completely...
int WorldToDeviceYRel(double y) const
convert y relative from world to device coordinates
bool m_xscroll_changed
a flag for ignoring size events when scrollbars change
virtual void SetDisplayWindow(wxWindow *display)
next to the base its m_display, this also sets m_drawer2d to this display
double DeviceToWorldY(double y) const
convert y from device to world coordinates
double GetMinX() const
get minimum X of the boundingbox
bool GetScaleOnResize()
get current setting for ScaleOnResize
void SetMappingWidthHeight(double vx1, double vy1, double width, double height, bool scrollbars)
Give the virtual size to be displayed, the mappingmatrix will be calculated.
void AddPendingUpdateArea(a2dCanvasObject *obj, wxUint8 id=0, bool refsalso=true)
add pending update for the area that is the boundingbox of the given object
void ZoomOutAtXy(int x, int y, double n)
zoom out from position x,y by a factor n (zoomin if <1 )
double GetVisibleMinX() const
get Minimal X of the visible part in world coordinates
the antigrain based drawing context derived from a2dDrawer2D
a2dHitOption
Enum for hit test options.
bool ScrollWindowConstrained(double dx, double dy)
scroll the window in world coordinates
virtual double GetVisibleWidth() const
get Width of visible part in world coordinates
Drawing context abstraction.
void OnWheel(wxMouseEvent &event)
mouse wheel handler
void OnEraseBackground(wxEraseEvent &event)
Not yet implemented.
int GetHeight() const
get buffer/device height
void SetMouseEvents(bool onoff)
If not set do not process mouse events.
void SetActiveDrawingPart(a2dDrawingPart *part)
get the drawing part that has the focus/is active in a window.
double GetUppY() const
return ypp Number of user units per pixel in y
Contains graphical drawing context specific classes. a2dDcDrawer and derived classes are used for dra...
double m_virtm_minX
virtual coordinates of total scrollable area for the drawing, used to set scrollbars ...
int m_thumby
current thumbsize of Y scrollbar which gets always adjusted by the m_scrollstepy
a2dDrawer2D * GetDrawer2D()
get the internal m_drawer2D that is used for rendering the document
void SetScrollbars(double pixelsPerUnitX, double pixelsPerUnitY, double noUnitsX, double noUnitsY, double xPos=0, double yPos=0)
set scrollbars
bool m_wantScroll
set true by wxWindow style parameter wxVSCROLL | wxHSCROLL
double GetVisibleMinY() const
get Minimal X of the visible part in world coordinates
wxEvtHandler * RemoveLastEventHandler(bool deleteHandler)
remove last event handler in the list
bool m_scrollTrackDraw
redraw at drag fo scrollbars
void Thaw()
allow a2dCanvasView buffer to be changed and blitting it to the window
void SetDisplay(wxWindow *window)
the display
double m_scrollstepy
step for Y line up and down in world coordinates
bool m_clipToScrollMax
see ClipToScrollMaximum()
A 2x3 affine matrix class for 2D transformations.
a2dCanvas is used to display one of the a2dCanvasObjects which are part of a a2dCanvasDocument object...
virtual ~a2dCanvas()
destructor
int GetWidth() const
get buffer/device width
double GetVisibleHeight() const
get Height of visible part in world coordinates
void MapBbox(const a2dAffineMatrix &matrix)
void OnChar(wxKeyEvent &event)
what to do for characters received
void SetMinX(double x)
Set Minimal X of the visible part in world coordinates.
int m_scrollrangex
Total range of X scroll bar, which gets always adjusted by the m_scrollstepx.
bool WriteSVG(const wxString &filename, double Width, double Height, wxString unit)
write what you see to an SVG( scalable vector graphics file )
double WorldToDeviceXRelNoRnd(double x) const
convert x relative from world to device coordinates (result not rounded to integer) ...
a2dDrawingPtr m_drawing
set if the canvas own the drawing
virtual void BeginDraw()=0
start to draw on this context (used to initialize a specific drawer)
double DeviceToWorldX(double x) const
convert x from device to world coordinates
double GetWidth() const
returns width of the boundingbox
bool m_has_y_scroll
flag if there is a vertical scrollbar
a2dCanvasObject * SetShowObject(const wxString &name)
set object available in the a2dDrawing to be shown on the drawer
void StartRefreshDisplayDisable()
when called a mapping change will result not result in a refresh of the m_display.
bool m_inSetScrollMaximum
prevent SetScrollMaximum beeing called recursively
double GetVisibleWidth() const
get Width of visible part in world coordinates
a2dDrawer2D * GetDrawer2D() const
Get the drawer of the view.
wxColour GetColour() const
return colour
a2dCanvasObject * IsHitWorld(double x, double y, int layer=wxLAYER_ALL, a2dHitOption option=a2dCANOBJHITOPTION_NONE, bool filterSelectableLayers=false)
do a hittest on the view at coordinates x,y
int m_scrollrangey
Total range of Y scroll bar, which gets always adjusted by the m_scrollstepy.
void SetMinY(double y)
Set Minimal Y of the visible part in world coordinates.
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
bool Invert(void)
Invert matrix.
void ZoomOut(double n)
zoom out from the center by a factor n (zoomin if <1 )
double GetMinY() const
get minimum Y of the boundingbox
a2dDrawing * GetDrawing() const
get drawing via top object
void UpdateViewDependentObjects()
update the transform matrix for objects with property 'PROPID_viewDependent'
virtual void EndDraw()=0
end drawing on this context (used to reset a specific drawer)
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
bool CheckInsideScrollMaximum(double worldminx, double worldminy)
check if the given scroll in worldcoordinates (X and Y) will stay within ScrollMaximum.
a2dCanvasObject * SetShowObject(const wxString &name)
set object available in the a2dCanvasDocument to be shown on the canvas
double WorldToDeviceYRelNoRnd(double y) const
convert y relative from world to device coordinates (result not rounded to integer) ...
bool m_scrollmaxfixed
stay within maximum scrollable area
double m_scrollstepx
step for X line up and down in world coordinates
void OnSize(wxSizeEvent &event)
resize, adjusting buffer of a2dCanvasView if needed.
void MouseToToolWorld(int x, int y, double &xWorldLocal, double &yWorldLocal)
void SetMinY(double vymin)
Set vertical scrollbar position in world coordinates.
double DeviceToWorldXRel(double x) const
convert x relative from device to world coordinates
a2dFill & GetBackgroundFill()
get current background fill for the canvas
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
Contain one drawing as hierarchical tree of a2dCanvasObject's.
bool m_scaleonresize
are scroll bars active?
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
Refresh window.
virtual bool ProcessEvent(wxEvent &event)
Special event handling for a2dDrawingPart class.