home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / program / k / qzap / !QZap_c_QFrceselrd < prev    next >
Encoding:
Text File  |  1994-11-13  |  1.7 KB  |  55 lines

  1. /*
  2.  * Frceselrdrw.c
  3.  */
  4.  
  5. #define QForceSelectionRedraw
  6.  
  7. #include "wimp.h"
  8. #include "QFrceselrdrw.h"
  9. #include "QMain.h"
  10. #include "QMouseclick.h"
  11.  
  12. void ForceSelectionRedraw(int OSelstart, int OSelend) {
  13.   wimp_window_state Wstate;
  14.   int View, topoffset, botoffset, rstart, rend;
  15.  
  16.   if ((Selectionstart!=OSelstart) || (Selectionend!=OSelend)) {
  17.     for (View=0; View<MaxViewers; View++) {
  18.       if (Viewers[View] != NULL) {
  19.         Wstate.w=Viewers[View];
  20.         wimp_get_window_state(&Wstate);
  21.         if ((Viewers[View]==Clickedview) && (Newscroll!=-1)) {
  22.           Wstate.yscroll=0-Newscroll;
  23.           wimp_open_window((wimp_open *)&Wstate);
  24.           wimp_force_redraw(Viewers[View],Wstate.xscroll,
  25.               Wstate.yscroll-(Wstate.visible.y1-Wstate.visible.y0),
  26.               Wstate.xscroll+(Wstate.visible.x1-Wstate.visible.x0),
  27.               Wstate.yscroll);
  28.           Newscroll=-1;
  29.         } else {
  30.           topoffset=(0-Wstate.yscroll)/Charheight;
  31.           botoffset=(0-Wstate.yscroll+(Wstate.visible.y1-Wstate.visible.y0)+
  32.                      Charheight-1)/Charheight;
  33.           if (Selectionstart<OSelstart) {
  34.             rstart=0-Selectionstart*Charheight;
  35.           } else {
  36.             rstart=0-OSelstart*Charheight;
  37.           }
  38.           if (Selectionend>OSelend) {
  39.             rend=0-Selectionend*Charheight;
  40.           } else {
  41.             rend=0-OSelend*Charheight;
  42.           }
  43.           wimp_force_redraw(Viewers[View],
  44.               Wstate.xscroll,
  45.               rend,
  46.               /* Wstate.yscroll-(Wstate.visible.y1-Wstate.visible.y0), */
  47.               Wstate.xscroll+(Wstate.visible.x1-Wstate.visible.x0),
  48.               rstart);
  49.               /* Wstate.yscroll); */
  50.         }
  51.       }
  52.     }
  53.   }
  54. }
  55.