home *** CD-ROM | disk | FTP | other *** search
- #include <LEDA/window.h>
-
- window W;
-
- double w,h;
-
- void draw_rect(double x, double y)
- { W.set_mode(xor_mode);
- W.draw_rectangle(x,y,x+w,y+h);
- W.set_mode(src_mode);
- }
-
- main()
- {
-
- real x,y,x0,y0,x1,y1;
- int k=0;
-
- segment s;
- circle c;
-
- while (W >> s) W << s;
-
- while (W >> c) W << c;
-
- while (k!=3)
- {
- W.read_mouse(x0,y0);
-
- W.read_mouse_rect(x0,y0,x1,y1);
-
- w = x1-x0;
- h = y1-y0;
-
- k = W.read_mouse_action(draw_rect,x,y);
-
- if (k==1) W.copy_rect(x0,y0,x1,y1,x,y);
- if (k==2) W.move_rect(x0,y0,x1,y1,x,y);
-
- }
-
- }
-
-