--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:

I hope Buce never mind the modifications I made.

> I forgot the topmost in previous attempt.  
> 
> ;Attach following script to hot key
> ; activate key once to show cross hair
> ; again to remove.
> 
> 
> 
> static bShowing,xpos,ypos,ev, xcrosshair, ycrosshair
> if (!bShowing) do
> 
> //not showing, draw initial cross hair and set up timer
> ev = event.createms(100,0,cb("@update"))
> bShowing=1
> xpos=xmouse
> ypos=ymouse
> 
> xcrosshair = cl.create("xcrosshair",1)
> xcrosshair.newproperties("topmost back: 128 128 128  transparent: 
> 64")
> xcrosshair.addproperties(" left: 0 right: "++xscreen)
> xcrosshair.addproperties(" top: "++ypos-1)
> xcrosshair.addproperties(" bottom: "++ypos+1)
> 
> ycrosshair = cl.create("ycrosshair", 1)
> ycrosshair.newproperties("topmost back: 128 128 128  transparent: 
> 64")
> ycrosshair.addproperties("top: 0 bottom: "++yscreen)
> ycrosshair.addproperties("left: "++xpos-1)
> ycrosshair.addproperties("right: "++xpos+1)
> 
> bar.show("xcrosshair")
> bar.show("ycrosshair")
> 
> else //if called when showing,cancels
> if (event.exists(ev))
> ev=event.destroy(ev)
> bar.close("xcrosshair")
> bar.close("ycrosshair")
> bShowing=0
> endif
> 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("xcrosshair", 0, ypos-1)
> win.move("ycrosshair", xpos-1, 0)
> endif
> quit
>

A little modification to use four bars instead of two:

static bShowing,xpos,ypos,ev, xcrosshair, ycrosshair
if (!bShowing) do

//not showing, draw initial cross hair and set up timer
ev = event.createms(100,0,cb("@update"))
bShowing=1
xpos=xmouse
ypos=ymouse

xcrosshair = cl.create("xcrosshair",1)
xcrosshair.newproperties("topmost back: 128 128 128 transparent: 64")
xcrosshair.addproperties("left: 0 right: "++xpos-1)
xcrosshair.addproperties("top: "++ypos-1)
xcrosshair.addproperties("bottom: "++ypos+1)

ycrosshair = cl.create("ycrosshair", 1)
ycrosshair.newproperties("topmost back: 128 128 128 transparent: 64")
ycrosshair.addproperties("top: 0 bottom: "++ypos-1)
ycrosshair.addproperties("left: "++xpos-1)
ycrosshair.addproperties("right: "++xpos+1)

xcrosshair1 = cl.create("xcrosshair1",1)
xcrosshair1.newproperties("topmost back: 128 128 128 transparent: 64")
xcrosshair1.addproperties("left: "++xpos+1++" right: "++xscreen)
xcrosshair1.addproperties("top: "++ypos-1)
xcrosshair1.addproperties("bottom: "++ypos+1)

ycrosshair1 = cl.create("ycrosshair1", 1)
ycrosshair1.newproperties("topmost back: 128 128 128 transparent: 64")
ycrosshair1.addproperties("top: "++ypos+1++" bottom: "++yscreen)
ycrosshair1.addproperties("left: "++xpos-1)
ycrosshair1.addproperties("right: "++xpos+1)

bar.show("xcrosshair")
bar.show("ycrosshair")
bar.show("xcrosshair1")
bar.show("ycrosshair1")

else //if called when showing,cancels
if (event.exists(ev))
ev=event.destroy(ev)
bar.close("xcrosshair")
bar.close("ycrosshair")
bar.close("xcrosshair1")
bar.close("ycrosshair1")
bShowing=0
endif
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.setrect("xcrosshair",;;+
win.makerect(0,ypos-1,xpos-1,ypos+1))
win.setrect("ycrosshair",;;+
win.makerect(xpos-1,0,xpos+1,ypos-1))
win.setrect("xcrosshair1",;;+
win.makerect(xpos+1,ypos-1,xscreen,ypos+1))
win.setrect("ycrosshair1",;;+
win.makerect(xpos-1,ypos+1,xpos+1,yscreen))
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/
 



Reply via email to