| Description: |
OriginalBugID: 2340 RFE
Version: 8.1.1
SubmitDate: '1999-07-07'
LastModified: '1999-12-13'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Windows 95
Machine: X86
FixedDate: '1999-12-13'
FixedInVersion: 8.3b1
Name:
Jan Nijtmans
CVS:
Juli 2, 1999
DesiredBehavior:
This function allows extensions to warp the
mouse pointer in the same way as X does it.
I know it is not recommended to do that in
general user interfaces, but for things like
playback it is the common thing to do.
Patch:
*** generic/tkInt.decls.origTue Jul 6 21:23:07 1999
--- generic/tkInt.declsTue Jul 6 21:37:38 1999
***************
*** 1505,1510 ****
void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
int x2, int y2)
}
# X functions for Mac
--- 1505,1514 ----
void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
int x2, int y2)
}
+ declare 105 win {
+ void XWarpPointer (Display* d, Window dw, int sx, int sy, \
+ unsigned int sw, unsigned int sh, int dx, int dy)
+ }
# X functions for Mac
*** win/tkWinPointer.c.origTue Jul 6 21:23:27 1999
--- win/tkWinPointer.cTue Jul 6 21:24:13 1999
***************
*** 331,336 ****
--- 331,372 ----
*mask_return = TkWinGetModifierState();
return True;
}
+
+ /*
+ *----------------------------------------------------------------------
+ *
+ * XWarpPointer --
+ *
+ *Move pointer to new location. This is not a complete
+ *implementation of this function.
+ *
+ * Results:
+ *None.
+ *
+ * Side effects:
+ *Mouse pointer changes position on screen.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ void
+ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width,
+ src_height, dest_x, dest_y)
+ Display* display;
+ Window src_w;
+ Window dest_w;
+ int src_x;
+ int src_y;
+ unsigned int src_width;
+ unsigned int src_height;
+ int dest_x;
+ int dest_y;
+ {
+ RECT r;
+
+ GetWindowRect(Tk_GetHWND(dest_w), &r);
+ SetCursorPos(r.left+dest_x, r.top+dest_y);
+ }
/*
*----------------------------------------------------------------------
PatchFiles:
tkInt.decls tkWinPointer.c
in 8.3b1
-- 12/13/1999 hobbs
|