Main Page Class Hierarchy Compound List File List Compound Members

# Canvas Class Reference

Window that is used to draw on,. More...

`#include <windrv.h>`

List of all members.

## Public Methods
| Canvas (GDSMainWindow *parent, int, int, int, int, long, char *)
| constructor
bool | Pending ()
| are there events in the queue
void | OnChar (wxKeyEvent &event)
| character events
void | OnKeyDown (wxKeyEvent &event)
| keydown events
void | OnKeyUp (wxKeyEvent &event)
| keyup events
void | OnMouseEvent (wxMouseEvent &event)
| mouse events
void | OnPaint (wxPaintEvent &)
| called by onpaint event
void | SetBackGroundColor (long color)
| set the background color of the window
wxBitmap * | GetCanvasBitmap ()
| to write bitmap data to files
void | Set_Valid_drawing (bool value)
bool | Get_Valid_drawing ()
| is the drawing in the bitmap/canvas up to date?
void | Update ()
void | ScrollIt (double xy, bool vertical)
| scroll left right or up down
void | OnSize (wxSizeEvent &event)
| for updating size of window, reallocates buffer for dubbel buffering
void | AdjustScrollBars (int posx, int dx, int totx, int posy, int dy, int toty)
| adjust the scrollbars to new position
void | OnScroll (wxScrollWinEvent &event)
| scroll events

## Detailed Description

Window that is used to draw on,.

it maintains a bitmap of all that is drawn sofar. It is derived from wxWindow. The wxClientDCbuf and wxPaintDCbuf can be used to fill this bitmap while drawing on the Canvas at the same time. The OnPaint will use the bitmap to quickly redraw if possible. Because the inheritance from wxWindow, all mouse input and keyboard input to the window is also intercepted here, class Toolcontrol, pushes an eventhandler to intercept event from from this window. Depending on the tool in action events will be redirected to the right tool using the toolcontroller.

See also:
  Toolcontrol , BaseTool , DrawDriver

## Member Function Documentation

void Canvas::Set_Valid_drawing | ( | bool | value | ) |

| Set if the drawing in the bitmap/canvas up to date if set to false a complete redraw will be the result, in order to bring the drawing up to date.

void Canvas::Update | ( |  | ) |

| redraw evrything, outside a Onpaint. Refresh(), is not a solution in some cases, since is a delayed OnPaint. Often the result needs to be directly vissible, before the next step in the program.

The documentation for this class was generated from the following file:

- windrv.h

Canvas class Reference -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page