File size: 651 Bytes
806d4b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#define GRID 5
U0 DrawMyMs(CDC *dc,I64 x,I64 y)
{
dc->thick=1;
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
GrRect(dc,x,y,GRID,GRID);
}
U0 GridDemo()
{
CGridGlbls old_grid;
U0 (*old_draw_ms)(CDC *dc,I64 x,I64 y); //Can't init this type of var.
MemCpy(&old_grid,&ms_grid,sizeof(CGridGlbls));
GridInit;
ms_grid.snap=TRUE; //You can set other stuff.
ms_grid.x=GRID;
ms_grid.y=GRID;
old_draw_ms=gr.fp_draw_ms;
gr.fp_draw_ms=&DrawMyMs;
while (!ms.lb) {//Left bttn to exit.
GrPlot(,ms.pos.x,ms.pos.y);
Yield;
}
DCFill;
gr.fp_draw_ms=old_draw_ms;
MemCpy(&ms_grid,&old_grid,sizeof(CGridGlbls));
}
GridDemo;
|