#include <windrv.h>
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 |
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.
|
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. |
|
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. |