zoom.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <grass/gis.h>
  2. #include <grass/display.h>
  3. #include "local_proto.h"
  4. #include <grass/glocale.h>
  5. int zoomwindow(struct Cell_head *window, int quiet, double magnify)
  6. {
  7. int screen_x, screen_y, button;
  8. int end = 0;
  9. int printmenu = 1;
  10. while (!end) {
  11. if (printmenu) {
  12. fprintf(stderr, _("\n\nButtons:\n"));
  13. fprintf(stderr, _("Left: Zoom menu\n"));
  14. fprintf(stderr, _("Middle: Pan\n"));
  15. fprintf(stderr, _("Right: Quit menu\n"));
  16. printmenu = 0;
  17. }
  18. R_get_location_with_pointer(&screen_x, &screen_y, &button);
  19. if (button == 1) {
  20. /* enter zoom menu */
  21. make_window_box(window, magnify, 1, 0);
  22. printmenu = 1;
  23. }
  24. else if (button == 2) {
  25. /* pan */
  26. pan_window(window, screen_x, screen_y);
  27. }
  28. else if (button == 3) {
  29. end = 1;
  30. }
  31. }
  32. #ifdef QUIET
  33. if (!quiet) {
  34. fprintf(stderr, _("This region now saved as current region.\n\n"));
  35. fprintf(stderr,
  36. _("Note: run 'd.erase' for the new region to affect the graphics.\n"));
  37. }
  38. #endif
  39. return (0);
  40. }