wxArt2D
|
a2dCanvas and a2dCanvasView meet eachother here. More...
#include <candoc.h>
Public Member Functions | |
a2dViewCanvas (a2dCanvasView *view, wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, a2dDrawer2D *drawer2D=0) | |
a2dViewCanvas (a2dCanvasView *view, a2dDrawingPart *drawingpart, wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle) | |
a2dCanvasView * | GetView () |
void | SetView (a2dCanvasView *view) |
![]() | |
a2dCanvas (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, a2dDrawer2D *drawer2D=0) | |
constructor More... | |
a2dCanvas (a2dDrawingPart *drawingPart, wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle) | |
constructor More... | |
virtual | ~a2dCanvas () |
destructor More... | |
a2dDrawingPart * | GetDrawingPart () |
void | SetDrawingPart (a2dDrawingPart *drawpart) |
a2dDrawing * | GetDrawing () const |
void | SetDrawing (a2dDrawing *drawing) |
a2dDrawer2D * | GetDrawer2D () const |
Get the drawer of the view. | |
void | ClearBackground () |
Clears the canvas (like wxWindow::ClearBackground) More... | |
virtual void | Refresh (bool eraseBackground=true, const wxRect *rect=NULL) |
Refresh window. More... | |
void | SetBackgroundFill (const a2dFill &backgroundfill) |
background fill for the canvas | |
void | SetGridAtFront (bool gridatfront) |
Set grid setting for drawing grid in front or back. | |
bool | GetGridAtFront () |
Get grid setting for drawing grid in front or back. | |
void | SetGridStroke (const a2dStroke &gridstroke) |
set stroke used for grid drawing | |
void | SetGridSize (wxUint16 gridsize) |
set size of grid circle | |
void | SetGridFill (const a2dFill &gridfill) |
set brush used for grid drawing | |
double | GetGridX () |
Get grid distance in X. | |
void | SetGridX (double gridx) |
Set grid distance in X. | |
double | GetGridY () |
Get grid distance in Y. | |
void | SetGridY (double gridy) |
Set grid distance in Y. | |
void | SetGrid (bool grid) |
Set grid on/off. | |
bool | GetGrid () |
Get grid setting on/off. | |
void | SetGridLines (bool gridlines) |
Get grid setting for line drawing. More... | |
bool | GetGridLines () |
set grid to draw lines instead of points | |
void | SetShowOrigin (bool show) |
Set showorigin on/off. | |
void | SetYaxis (bool up) |
set if the Yaxis goes up or down | |
bool | GetYaxis () const |
get currently used Yaxis setting | |
void | SetScaleOnResize (bool val) |
set if the drawing should be resclaed on a window resize More... | |
bool | GetScaleOnResize () |
get current setting for ScaleOnResize | |
void | SetContinuesSizeUpdate (bool val) |
set if the drawing should be rescaled on a window resize | |
bool | GetContinuesSizeUpdate () |
get current setting for ContinuesSizeUpdate flag | |
void | AppendEventHandler (wxEvtHandler *handler) |
append an eventhandler to the list, this event handler will be called if the other skipped the event to process. | |
wxEvtHandler * | RemoveLastEventHandler (bool deleteHandler) |
remove last event handler in the list | |
bool | IsFrozen () |
Returns if canvas is frozen. | |
void | Freeze () |
prevent changing the a2dCanvasView buffer and blitting it to the window More... | |
void | Thaw () |
allow a2dCanvasView buffer to be changed and blitting it to the window More... | |
void | SetMappingWidthHeight (double vx1, double vy1, double width, double height, bool scrollbars) |
Give the virtual size to be displayed, the mappingmatrix will be calculated. More... | |
void | SetMappingShowAll (bool centre=true) |
use the boundingbox of the ShowObject to set the mapping such that it will be displayed completely. More... | |
void | ZoomOut (double n) |
zoom out from the center by a factor n (zoomin if <1 ) | |
void | ZoomOutAtXy (int x, int y, double n) |
zoom out from position x,y by a factor n (zoomin if <1 ) | |
void | SetMappingUpp (double vx1, double vy1, double xpp, double ypp) |
Give the virtual size to be displayed, the mappingmatrix will be calculated. More... | |
void | SetScrollbars (double pixelsPerUnitX, double pixelsPerUnitY, double noUnitsX, double noUnitsY, double xPos=0, double yPos=0) |
set scrollbars More... | |
double | GetVisibleMinX () const |
get Minimal X of the visible part in world coordinates | |
double | GetVisibleMinY () const |
get Minimal X of the visible part in world coordinates | |
double | GetVisibleMaxX () const |
get Maximum X of the visible part in world coordinates | |
double | GetVisibleMaxY () const |
get Maximum Y of the visible part in world coordinates | |
double | GetVisibleWidth () const |
get Width of visible part in world coordinates | |
double | GetVisibleHeight () const |
get Height of visible part in world coordinates | |
double | GetUppX () const |
double | GetUppY () const |
bool | ScrollWindowConstrained (double dx, double dy) |
scroll the window in world coordinates More... | |
bool | SetScrollMaximum (double vx1, double vy1, double vx2, double vy2) |
to set the total area in world coordinates that can be scrolled to. More... | |
void | SetMinX (double vxmin) |
Set horizontal scrollbar position in world coordinates. | |
void | SetMinY (double vymin) |
Set vertical scrollbar position in world coordinates. | |
double | GetScrollMinX () const |
get the minimum scroll X in world coordinates that can be scrolled to | |
double | GetScrollMinY () const |
get the minimum scroll Y in world coordinates that can be scrolled to | |
double | GetScrollMaxX () const |
get the maximum scroll X in world coordinates that can be scrolled to | |
double | GetScrollMaxY () const |
get the maximum scroll Y in world coordinates that can be scrolled to | |
void | SetScrollStepX (double x) |
set granularity (step size) for scrolling in world units for Horizontal Scrollbar More... | |
void | SetScrollStepY (double y) |
set granularity (step size) for scrolling in world units for Vertical Scrollbar More... | |
void | FixScrollMaximum (bool fixed) |
at all times the virtual displayed area will stay within the maximum scrollable area | |
void | SetScrollBarsVisible (bool onoff) |
show scrollbars if set true. | |
void | SetScrollTrackDraw (bool scrollTrackDraw) |
if set, when dragging scrollbar handles, do a redraw, esle only at release. | |
bool | GetScrollTrackDraw () const |
if set, when dragging scrollbar handles, do a redraw, esle only at release. | |
void | ClipToScrollMaximum (bool clip) |
when scrolling outside the maximum scroll region and More... | |
bool | CheckInsideScrollMaximum (double worldminx, double worldminy) |
check if the given scroll in worldcoordinates (X and Y) will stay within ScrollMaximum. More... | |
a2dCanvasObject * | SetShowObject (const wxString &name) |
set object available in the a2dCanvasDocument to be shown on the canvas More... | |
bool | SetShowObject (a2dCanvasObject *obj) |
set top object available in the a2dCanvasDocument to be shown on the canvas More... | |
a2dCanvasObject * | GetShowObject () const |
return pointer of then currently shown object on the canvas. More... | |
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 More... | |
void | SetMouseEvents (bool onoff) |
bool | GetMouseEvents () |
bool | WriteSVG (const wxString &filename, double Width, double Height, wxString unit) |
write what you see to an SVG( scalable vector graphics file ) | |
bool | ProcessEvent (wxEvent &event) |
Protected Member Functions | |
void | OnSetDocument (a2dViewEvent &event) |
called when document of the a2dView has changed. More... | |
void | OnActivate (a2dViewEvent &viewevent) |
void | OnCloseView (a2dCloseViewEvent &event) |
void | OnUpdate (a2dDocumentEvent &event) |
calls a2dDrawingpart::Update() | |
![]() | |
bool | MakeVirtualMaxFitVisibleArea () |
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. More... | |
void | OnActivate (wxActivateEvent &event) |
void | OnPaint (wxPaintEvent &event) |
repaint damaged araes, taking into acount non updated araes in a2dCanvasView. | |
void | OnSize (wxSizeEvent &event) |
resize, adjusting buffer of a2dCanvasView if needed. | |
void | OnWheel (wxMouseEvent &event) |
mouse wheel handler | |
void | OnEraseBackground (wxEraseEvent &event) |
Not yet implemented. | |
void | OnScroll (wxScrollWinEvent &event) |
what to do while scrollling | |
void | OnChar (wxKeyEvent &event) |
what to do for characters received | |
void | DeleteAllPendingAreas () |
remove all pending update areas in a2dCanvasView | |
bool | CheckInsideScrollMaximum (int dx, int dy) |
check if the given scroll in pixels (X and Y) will be oke to stay within ScrollMaximum. More... | |
void | Init (int dvx, int dvy) |
Protected Attributes | |
a2dCanvasView * | m_view |
![]() | |
double | m_virtm_minX |
virtual coordinates of total scrollable area for the drawing, used to set scrollbars | |
double | m_virtm_minY |
double | m_virtm_maxX |
double | m_virtm_maxY |
bool | m_scaleonresize |
are scroll bars active? | |
bool | m_wantScroll |
set true by wxWindow style parameter wxVSCROLL | wxHSCROLL | |
bool | m_aboveScrolledFixedAdjustUpp |
when because resizing or setting maximum scrollable area, it becomes smaller then the visible area, More... | |
int | m_scrollrangex |
Total range of X scroll bar, which gets always adjusted by the m_scrollstepx. More... | |
int | m_scrollrangey |
Total range of Y scroll bar, which gets always adjusted by the m_scrollstepy. More... | |
int | m_thumbx |
current thumbsize of X scrollbar which gets always adjusted by the m_scrollstepx More... | |
int | m_thumby |
current thumbsize of Y scrollbar which gets always adjusted by the m_scrollstepy More... | |
double | m_scrollstepx |
step for X line up and down in world coordinates | |
double | m_scrollstepy |
step for Y line up and down in world coordinates | |
bool | m_scrolled |
are scroll bars active? | |
bool | m_xscroll_changed |
a flag for ignoring size events when scrollbars change | |
bool | m_yscroll_changed |
a flag for ignoring size events when scrollbars change | |
bool | m_has_x_scroll |
flag if there is a horizontal scrollbar | |
bool | m_has_y_scroll |
flag if there is a vertical scrollbar | |
bool | m_scrollmaxfixed |
stay within maximum scrollable area | |
bool | m_clipToScrollMax |
see ClipToScrollMaximum() | |
bool | m_scrollTrackDraw |
redraw at drag fo scrollbars | |
int | m_oldw |
to optimize onsize events | |
int | m_oldh |
int | m_prevh |
int | m_prevw |
int | m_prevClientW |
int | m_prevClientH |
int | m_delta |
oversize of buffer compared to screen width and height | |
bool | m_frozen |
prevent updating activity if true | |
int | m_oversizeX |
in future the offset from window to drawer in X | |
int | m_oversizeY |
in future the offset from window to drawer in Y | |
a2dSmrtPtr< a2dDrawingPart > | m_drawingPart |
bool | m_inSetScrollMaximum |
prevent SetScrollMaximum beeing called recursively | |
bool | m_ContinuesSizeUpdate |
at small resize also update the buffer directly. More... | |
int | m_normalize |
used to normalize scroll thumb and range | |
a2dDrawingPtr | m_drawing |
set if the canvas own the drawing | |
a2dCanvas and a2dCanvasView meet eachother here.
a2dCanvasView will use this canvas to display part of a document.
|
protected |
called when document of the a2dView has changed.
Sets the a2dCanvasDocument where the objects for this canvas are stored It will trigger boundingbox calculation and other administrative tasks to properly render the document onto this view
Definition at line 388 of file candoc.cpp.