Here's a variation of Bruce's script using locked bars.
To move crosshair you need to click and drag crosshair center.
Middle click removes crosshair, right click follows mouse.
Uncomment one line if want follow mouse as default.
The crosshair is ghosted when following the mouse.
; ----- Locked bar version -----
;Attach following script to hot key
; activate key once to show cross hair
; again to remove.
; click and drag anchor to move cross hair.
; middle click anchor to remove cross hair.
; right click anchor to follow mouse,
; activate key to remove.
static bShowing,xpos,ypos,ev, xcrosshair, ycrosshair, xanchor
static transparency=128
local thickness=1
local anchorcolor="128 128 128"
local crosshaircolor="255 0 0"
if (!bShowing) do
//not showing, draw initial cross hair
//[EMAIL PROTECTED](0) //uncomment for follow mouse as default
bShowing=1
xpos=xmouse
ypos=ymouse
xcrosshair = cl.create("xcrosshair",1)
xcrosshair.newproperties("topmost flatflat back: "++crosshaircolor)
xcrosshair.addproperties(" left: 0 right: "++xscreen)
xcrosshair.addproperties(" top: "++ypos-thickness)
xcrosshair.addproperties(" bottom: "++ypos+thickness)
xcrosshair.lockto(1,"xanchor",50,0,50,0-thickness)
ycrosshair = cl.create("ycrosshair", 1)
ycrosshair.newproperties("topmost flatflat back: "++crosshaircolor)
ycrosshair.addproperties("top: 0 bottom: "++yscreen)
ycrosshair.addproperties("left: "++xpos-thickness)
ycrosshair.addproperties("right: "++xpos+thickness)
ycrosshair.lockto(1,"xanchor",50,0-thickness,50,0)
xanchor = cl.create("xanchor",1)
xanchor.newproperties("topmost flatflat back: "++anchorcolor)
xanchor.addproperties(" left: "++xpos-max(4,thickness))
xanchor.addproperties(" right: "++xpos+max(4,thickness))
xanchor.addproperties(" top: "++ypos-max(4,thickness))
xanchor.addproperties(" bottom: "++ypos+max(4,thickness))
xanchor.insert(0)
xanchor.addleft(0,"format","drag")
xanchor.addmiddle(0,cb("@cancel"))
xanchor.addright(0,cb("@timer",0))
bar.show("xcrosshair")
bar.show("ycrosshair")
bar.show("xanchor")
win.transmouse("xcrosshair",transparency)
win.transmouse("ycrosshair",transparency)
else //if called when showing,cancels
[EMAIL PROTECTED]
endif
quit
@cancel
win.transmouse("xanchor",0-transparency)
if (event.exists(ev))
ev=event.destroy(ev)
bar.close("xcrosshair")
bar.close("ycrosshair")
bar.close("xanchor")
bShowing=0
quit
@timer
ev = event.createms(100,arg(1),cb("@update"))
quit
// call here to query mouse pos and update
@update
static xpos, ypos,bShowing
if (!bShowing) // should never happen
quit
local xnow=xmouse
local ynow=ymouse
if (xnow != xpos || ynow != ypos) do
xpos=xnow
ypos=ynow
win.move("xanchor", xnow, ynow)
win.transmouse("xanchor",transparency)
endif
quit
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/power-pro/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/