User Interface Question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: User Interface Question
I filed a bug report: https://quality.livecode.com/show_bug.cgi?id=21268
If you move the mouse pointer outside the stack window, LC can't find the target button (stack?) when you use the arrow keys.
If you move the mouse pointer outside the stack window, LC can't find the target button (stack?) when you use the arrow keys.
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: User Interface Question
Hi Barry,
Congratulations
Not sure this is a bug
Maybe that was an error to use the target in this case.
Best
Jean-Marc
Congratulations
Not sure this is a bug
Maybe that was an error to use the target in this case.
Best
Jean-Marc
https://alternatic.ch
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: User Interface Question
Can't understand why just moving the mouse pointer outside of the stack window should result in this error. Everything was working when the pointer was within the stack window. Why would an "arrowKey left" keystroke require a mouse pointer to be in any particular location?
If I use only the mouse to initiate the popups and then move the mouse pointer outside of the stack window, I can arrow up/down to choose the item and press "Return" to finish the selection (and have the field update properly). So moving the mouse outside the window is okay in this case.
I think it's a LC bug. I'm good at finding bugs...not because I'm good but just because sh*t likes to fall on me.
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: User Interface Question
More enlightenment. I tried a fresh stack with a field and an option button. In the field I put an openField handler:
What's strange is that, wherever the mouse pointer is located within the stack window, that's where the option button's choice menu pops up. When I move the mouse pointer outside the window and tab into the field (causing the openField event), the script errors.
It appears that LC insists on using the mouseLoc as the location where the menu must pop up rather than where that btn is really located.
So I can't send a "mouseDown" message to the button unless the mouse sends it (and, of course, it's then positioned in exactly the right place) but using this:
...will work regardless of the mouseLoc. It pops down the choice menu and, using a bit of code in the button, the user's choice is placed into the field.
So I think I'm making progress. BTW, you might think "well, why not just use popup btns and the mouse?" My answer is that I'm trying to eliminate the necessity of using the mouse except for specific areas where it's either unavoidable or "better" than the keyboard. I'm re-building an app that originally ran in MS-DOS and did so without a mouse. The "tab" key moved you from field to field and the up/down arrow keys permitted the choice (when a choice was available instead of typing text).
I still think this is a bug in LC as sending a mouseUp or mouseDown to a btn should, IMHO, not involve the mouseLoc (as in, "it's off the stack window so we'll error"). I have not tested a Runtime version to see if the problem persists there.
Code: Select all
on openField
send mouseDown to btn "optMenu1"
end openField
It appears that LC insists on using the mouseLoc as the location where the menu must pop up rather than where that btn is really located.
So I can't send a "mouseDown" message to the button unless the mouse sends it (and, of course, it's then positioned in exactly the right place) but using this:
Code: Select all
on openField
click at 200,98 -- the top edge of the popup btn peeking out from behind the field
end openField
So I think I'm making progress. BTW, you might think "well, why not just use popup btns and the mouse?" My answer is that I'm trying to eliminate the necessity of using the mouse except for specific areas where it's either unavoidable or "better" than the keyboard. I'm re-building an app that originally ran in MS-DOS and did so without a mouse. The "tab" key moved you from field to field and the up/down arrow keys permitted the choice (when a choice was available instead of typing text).
I still think this is a bug in LC as sending a mouseUp or mouseDown to a btn should, IMHO, not involve the mouseLoc (as in, "it's off the stack window so we'll error"). I have not tested a Runtime version to see if the problem persists there.
Re: User Interface Question
It is not a bug. Per the dictionary:
“Use the popup keyword to create a popup menu that appears under the mouse pointer.”
So you either need to have the click occur where you want the menu or use a different type. I started experimenting with a combo box but couldn’t get it working all the way right off.
“Use the popup keyword to create a popup menu that appears under the mouse pointer.”
So you either need to have the click occur where you want the menu or use a different type. I started experimenting with a combo box but couldn’t get it working all the way right off.
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: User Interface Question
Yep. So "Not a bug". Now that I understand it, I'll craft something with the "click at...".
Always helps to have multiple eyes and brains working on it. Appreciate everyone's efforts. I'll get the bug report closed.
Barry
Always helps to have multiple eyes and brains working on it. Appreciate everyone's efforts. I'll get the bug report closed.
Barry
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: User Interface Question
Hi,
I also tried using local instead the short name of the target with same results
@ bwmilby
Best regards
Jean-Marc
click at the loc create recursion issueI'll craft something with the "click at..."
I also tried using local instead the short name of the target with same results
@ bwmilby
Yes, but "if no location is specified, the menu's top left corner is at the mouse location" (doc LC 8.1.6)Use the popup keyword to create a popup menu that appears under the mouse pointer.
Best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: User Interface Question
You could track the current field and use its location as the place to pop up the menu. When the user tabs into a field you'll get an openField message. Use that to get the name of the field and pop up the button at the location of that field. This way the mouse isn't involved and the target is specified.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 222
- Joined: Wed Jun 21, 2006 7:33 pm
- Location: West of the Pecos
- Contact:
Re: User Interface Question
The popup command can't be used because it relies upon the mouse pointer being within the stack window. If you attempt to use it (even with a specific location where a btn is really located!) while the mouse pointer is outside the window, you either get an error:
"Message execution error:
Error description: subwindow: can't find stack or button"
(that was calling it from the Message box)
-or-, if called from the Message box with the mouse pointer -in- the message box, you'll get this: ...and that's no good, as well.
I'm using "click at 200,90" (or whatever valid loc) and that seems to work although some additional UI tweaking is certainly required.
I've attached a sample stack.
"Message execution error:
Error description: subwindow: can't find stack or button"
(that was calling it from the Message box)
-or-, if called from the Message box with the mouse pointer -in- the message box, you'll get this: ...and that's no good, as well.
I'm using "click at 200,90" (or whatever valid loc) and that seems to work although some additional UI tweaking is certainly required.
I've attached a sample stack.
- Attachments
-
- Tab&OptionBtnsViaKeyboard.livecode.zip
- (1.43 KiB) Downloaded 206 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: User Interface Question
Hi Barry,
Congratulations again.
Your stack works well for me. Option menu seems be the trick
I tried to use the short name of the target and it also works.
OptionMenu button (renamed bOption1 bOption2 bOption3) script
Flds Field1 Field2 Field3 script
Card script
Best regards
Jean-Marc
Congratulations again.
Your stack works well for me. Option menu seems be the trick
I tried to use the short name of the target and it also works.
OptionMenu button (renamed bOption1 bOption2 bOption3) script
Code: Select all
on mouseUp
debOptionMU
end mouseUp
Code: Select all
on focusIn
defFieldFI
end focusIn
Code: Select all
on defFieldFI
put char 6 to -1 of the short name of the target into tNumF
click at the loc of btn ("bOption" & tNumF)
end defFieldFI
on debOptionMU
put char 8 to -1 of the short name of the target into tNumF
put the label of the target into field ("Field" & tNumF)
set the label of the target to "1st Choices"
end debOptionMU
Jean-Marc
https://alternatic.ch