Popup menu & menuhistory
Peter Brigham MD
pmbrig at gmail.com
Fri Apr 22 14:13:02 EDT 2011
On Apr 22, 2011, at 12:44 PM, Marty Knapp wrote:
> Thanks for the suggestion Craig. I did tinker with this some more:
>
> So in my test field I have this script:
>
> on mousedown whichButton
> if whichButton is not 3 then exit mousedown
> put the mouseLoc into ML
> get lineOffset(the text of me,btn "myPopUpButton")
> if it is not 0 then
> --For the X coordinate: move the menu over to the left a bit so it's under the cursor
> subtract 8 from item 1 of ML
>
> --For the Y coordinate: take the line number and multiply by apparent line
> --height of menu text and adjust so the menu pops up at the correct line
> subtract (it*19)-10 from item 2 of ML
> end if
> popup btn "myPopUpButton" at ML
> end mousedown
>
>
> Then in my hidden test popup menu, I have numbers 1 through 35. This works until I type in a number that causes the popup menu to hit the top of the screen. Unlike an option menu, it does not truncate itself with a scroll arrow - it just stops at the top of the screen with the first menu item at the top. Interesting, it will truncate with a scroll arrow if it hits the bottom of the screen.
>
> Any thoughts or suggestions?
The formattedrect function will give you the location (relative to the window) of a chunk of text. Don't know if that would help.
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
More information about the use-livecode
mailing list