home *** CD-ROM | disk | FTP | other *** search
- /*
- * Frceselrdrw.c
- */
-
- #define QForceSelectionRedraw
-
- #include "wimp.h"
- #include "QFrceselrdrw.h"
- #include "QMain.h"
- #include "QMouseclick.h"
-
- void ForceSelectionRedraw(int OSelstart, int OSelend) {
- wimp_window_state Wstate;
- int View, topoffset, botoffset, rstart, rend;
-
- if ((Selectionstart!=OSelstart) || (Selectionend!=OSelend)) {
- for (View=0; View<MaxViewers; View++) {
- if (Viewers[View] != NULL) {
- Wstate.w=Viewers[View];
- wimp_get_window_state(&Wstate);
- if ((Viewers[View]==Clickedview) && (Newscroll!=-1)) {
- Wstate.yscroll=0-Newscroll;
- wimp_open_window((wimp_open *)&Wstate);
- wimp_force_redraw(Viewers[View],Wstate.xscroll,
- Wstate.yscroll-(Wstate.visible.y1-Wstate.visible.y0),
- Wstate.xscroll+(Wstate.visible.x1-Wstate.visible.x0),
- Wstate.yscroll);
- Newscroll=-1;
- } else {
- topoffset=(0-Wstate.yscroll)/Charheight;
- botoffset=(0-Wstate.yscroll+(Wstate.visible.y1-Wstate.visible.y0)+
- Charheight-1)/Charheight;
- if (Selectionstart<OSelstart) {
- rstart=0-Selectionstart*Charheight;
- } else {
- rstart=0-OSelstart*Charheight;
- }
- if (Selectionend>OSelend) {
- rend=0-Selectionend*Charheight;
- } else {
- rend=0-OSelend*Charheight;
- }
- wimp_force_redraw(Viewers[View],
- Wstate.xscroll,
- rend,
- /* Wstate.yscroll-(Wstate.visible.y1-Wstate.visible.y0), */
- Wstate.xscroll+(Wstate.visible.x1-Wstate.visible.x0),
- rstart);
- /* Wstate.yscroll); */
- }
- }
- }
- }
- }
-