Re: structures, and tabitem right-click hittest

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks Derek, I'll give it a try!

Dan Moyer

>
> >
> > Jordah, Derek, Euman, etc:
> >
> > Not knowing what I was doing, I tried to modify Jordah's example2.exw
(using
> > his llrtns.ew), to indicate which tabitem is right-clicked on, with the
> > following tacked on at the end of example2.exw, just before WinMain, but
it
> > doesn't work.  Fails trying to read memory at FFFFFFFF.   (I made
"htFlags"
> > = 0 because it failed at the store without something there as a value,
not
> > for any other reason.)  Relevant structure info(?) is after code.
Without
> > the tabitem hittest part, the mouse rightclick on tab position is
returned
> > just fine.
> >
> > Can anyone make this work right?  It tacks onto end of Jordah's
> > Example2.exw, which can be found with his llrtns.ew low level routines
> > library at:
> >
> > http://www.rapideuphoria.com/llrtns.zip
> >
> > Dan Moyer
> >
> >

<snip>

>
> Dan,
> I didn't use the structure library you mentioned. Instead I used the one
built into win32lib and got this result, which didn't crash.
>
>
> constant
>     TCHITTESTINFO_ptX       = W32_allot( Long ),
>     TCHITTESTINFO_ptY       = W32_allot( Long ),
>     TCHITTESTINFO_flags     = W32_allot( UInt ),
>     SIZEOF_TCHITTESTINFO    = W32_allotted_size()
>
> function rtClickedTab(atom Tab, integer x, integer y)
>     atom lHT
>     atom lTab
>     atom lRC
>
>     lHT = acquire_mem(0, SIZEOF_TCHITTESTINFO)
>     store(lHT, TCHITTESTINFO_ptX, x)
>     store(lHT, TCHITTESTINFO_ptY, y)
>
>     lTab = sendMessage(Tab, TCM_HITTEST, 0, lHT)
>     lRC = fetch(lHT, TCHITTESTINFO_flags)
>
>     release_mem(lHT)
>     -- Return both the tab index and where inside the tab the mouse is.
>     return {lTab,lRC}
> end function
>
> -- 
> Derek
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu