redisplay.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #include "globals.h"
  2. #include <grass/display.h>
  3. #include <grass/glocale.h>
  4. #include "local_proto.h"
  5. static int use = 1;
  6. int redisplay(void)
  7. {
  8. static Objects objects[] = {
  9. INFO("Redisplay Map Menu:", &use),
  10. MENU(" Map window ", redisplay_map, &use),
  11. MENU(" Zoom window ", redisplay_zoom, &use),
  12. MENU(" Both ", redisplay_both, &use),
  13. MENU(" Cancel ", cancel_redisplay, &use),
  14. {0}
  15. };
  16. Input_pointer(objects);
  17. Menu_msg("");
  18. return (0);
  19. }
  20. int redisplay_both(void)
  21. {
  22. redisplay_map();
  23. redisplay_zoom();
  24. return (-1);
  25. }
  26. int redisplay_map(void)
  27. {
  28. draw_cell(VIEW_MAP1, OVER_WRITE);
  29. if (VIEW_MAP1_ZOOM->cell.configured) {
  30. /* Outline the zoom window on the main map */
  31. R_standard_color(RED);
  32. Outline_cellhd(VIEW_MAP1, &VIEW_MAP1_ZOOM->cell.head);
  33. }
  34. return (-1);
  35. }
  36. int redisplay_zoom(void)
  37. {
  38. if (VIEW_MAP1_ZOOM->cell.configured) {
  39. draw_cell(VIEW_MAP1_ZOOM, OVER_WRITE);
  40. /*
  41. * Outline the zoom window on the main map
  42. */
  43. R_standard_color(RED);
  44. Outline_cellhd(VIEW_MAP1, &VIEW_MAP1_ZOOM->cell.head);
  45. }
  46. else
  47. G_warning(_("No zoom window is defined."));
  48. return (-1);
  49. }
  50. int cancel_redisplay(void)
  51. {
  52. return (-1);
  53. }