|
Post by jarychk on Jul 2, 2024 7:36:29 GMT
We can make an interface with some controls which the user can cycle through with the tab key. How would user otherwise know when input focus is at a checkbox control? And also how would the user put in the checkmark or remove the checkmark, OTHER THAN by directly clicking there with the mouse?
'observe that no indication if the checkbox control has or not has input focus. nomainwin
WindowWidth = 550 WindowHeight = 410
UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
textbox #chkboxtab.textbox1, 46, 81, 100, 25 textbox #chkboxtab.textbox2, 46, 116, 100, 25 checkbox #chkboxtab.checkbox3, "CheckBox Caption", [checkbox3Set], [checkbox3Reset], 46, 156, 144, 20 button #chkboxtab.button4, "Button Caption", [button4Click], UL, 334, 81, 122, 25 statictext #chkboxtab.statictext5, "tab through the controls!", 30, 31, 200, 25 open "input focus study" for window as #chkboxtab print #chkboxtab, "trapclose [quit.chkboxtab]"
print #chkboxtab, "font ms_sans_serif 10" print #chkboxtab.textbox1,"!setfocus";
wait
[quit.chkboxtab] Close #chkboxtab END
[checkbox3Set] 'Perform action for the checkbox named 'checkbox3' 'Insert your own code here notice "checkbox would be SET" wait
[checkbox3Reset] 'Perform reset for the checkbox named 'checkbox3' 'Insert your own code here notice "checkbox would be UNSET" wait
[button4Click] 'Perform action for the button named 'button4' 'Insert your own code here wait
|
|
|
Post by jarychk on Jul 2, 2024 7:47:46 GMT
I should have made a web search for part of my question. When user thinks he has input focus on the checkbox, then spacebar will either set or unset the check mark. For figuring out WHERE is the input focus, user might just keep watching what happens to buttons and textboxes as he presses the TAB key.
|
|
|
Post by tsh73 on Jul 2, 2024 9:14:42 GMT
Also if you put (&) in the control name, you can activate it by Alt-letter so with
checkbox #chkboxtab.checkbox3, "&CheckBox Caption", [checkbox3Set], [checkbox3Reset], 46, 156, 144, 20 Alt-C activate checkbox
OOPS it activates, shows message, but DOES NOT CHANGE
unexpected...
EDIT same is radiobutton - it activates but not changes
but if you setfocus it after,
#chkboxtab.rb1 "setfocus" radiobutton start changing on Alt-letter
EDIT last weird thing. Initial program, checkbox does not show selection then tabbed
But if I add (&) to say button caption, focus starts showing on checkbox!
|
|
|
Post by jarychk on Jul 2, 2024 9:57:08 GMT
tsh73
I tried adding the & but this changes nothing. I see no change in the checkbox caption, no change in checkbox control appearance.
|
|
|
Post by cundo on Jul 3, 2024 21:01:11 GMT
so the problem is that we can't see when the checkbox control has focus , doesn't ?
|
|
|
Post by jarychk on Jul 4, 2024 4:56:28 GMT
so the problem is that we can't see when the checkbox control has focus , doesn't ? RIght. I can't figure a way through this. Maybe it is not too important and I should not worry about it; but would surely be nice if user could see that a checkbox control have input focus. Really, a user can make a mouse click on that control anytime he chooses.
|
|
|
Post by tsh73 on Jul 4, 2024 15:13:04 GMT
BTW if I add another checkbox
checkbox #chkboxtab.checkbox4, "CheckBox Caption", [checkbox3Set], [checkbox3Reset], 46, 186, 144, 20 tabbing does show selected one.
And as I've said adding "&" anywhere make selection show, too
checkbox #chkboxtab.checkbox3, "&CheckBox Caption", [checkbox3Set], [checkbox3Reset], 46, 156, 144, 20
*UNHAPPY* on my current machine "&" works about ONE time after I change it. ONE DARNED TIME!!! Then it hides underscore.
Google say it's something about
or
Apparently I grow used to old ways, it was always ON. I went to my settings - found it under Keyboard options - set it ON now 1) I aways see "_" for "&" 2) I do not have initial problem in the first place! Combo box DOES selects on tab!
So as always, it's Microsoft fault. ;)
|
|
|
Post by jarychk on Jul 4, 2024 16:34:35 GMT
Part of what tsh73 says:
I opened "Settings", put in "Ease of Access" and searched, picked Ease of Access for Keyboard, and ... there is a toggle button for "Change how keyboard shortcuts work" and the part with the toggle switch, "Underline access keys when available". Amazing! User would need to know to look for this in Settings. The item on this machine is set to "OFF". I will just keep it that way for now.
|
|
|
Post by jarychk on Jul 5, 2024 5:08:20 GMT
Another very similar example exercise, difference is now TWO checkbox controls. Use TAB key to cycle through the window's controls.
nomainwin
WindowWidth = 550 WindowHeight = 410
UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
textbox #main.textbox1, 70, 61, 100, 25 checkbox #main.checkbox2, "CheckBox Caption", [checkbox2Set], [checkbox2Reset], 70, 111, 144, 20 checkbox #main.checkbox3, "CheckBox Caption", [checkbox3Set], [checkbox3Reset], 70, 151, 144, 20 textbox #main.textbox4, 70, 196, 100, 25 button #main.button5, "not yet determined to say", [button5Click], UL, 286, 61, 224, 35 open "focus study with two checkbox controls" for window as #main print #main, "trapclose [quit.main]"
print #main, "font ms_sans_serif 10" PRINT #main.textbox1,"!setfocus"
wait
[quit.main] Close #main END
[checkbox2Set] 'Perform action for the checkbox named 'checkbox2' 'Insert your own code here notice "first checkbox set" wait
[checkbox2Reset] 'Perform reset for the checkbox named 'checkbox2' 'Insert your own code here notice "first checkbox reset" wait
[checkbox3Set] 'Perform action for the checkbox named 'checkbox3' 'Insert your own code here notice "second checkbox set" wait
[checkbox3Reset] 'Perform reset for the checkbox named 'checkbox3' 'Insert your own code here notice "second checkbox is Reset" wait
[button5Click] 'Perform action for the button named 'button5' 'Insert your own code here wait
|
|