Dialog> User Interface
Moderators: JRL, Dorian (MJT support)
Dialog> User Interface
For the Dialog>..Show> construct,
1. for multiple tabpages, can the focus be programmatically set to the first item inside the page? Now, the focus is set to the page tab by default.
2. When the focus is set to an item in a Listbox, pressing ENTER won't exit the listbox.
3. OnEvent>KEY_DOWN,VK27,0,DoMeFavor won't work. Can the Dialog box be terminated by pressing ESC? How?
Thanks a lot for your help.
1. for multiple tabpages, can the focus be programmatically set to the first item inside the page? Now, the focus is set to the page tab by default.
2. When the focus is set to an item in a Listbox, pressing ENTER won't exit the listbox.
3. OnEvent>KEY_DOWN,VK27,0,DoMeFavor won't work. Can the Dialog box be terminated by pressing ESC? How?
Thanks a lot for your help.
In the sample below, the Press Tab line immediately following Show>Dialog1 will move the focus to the first item in the tab page.1. for multiple tabpages, can the focus be programmatically set to the first item inside the page? Now, the focus is set to the page tab by default.
Use the dialog "default" object. In the sample below if the focus is on a list box item and Enter is pressed, either the Result 4 or Result 6 button will be invoked, depending on which tab is current. If you just want to move to the next object, use the Tab key or your mouse.2. When the focus is set to an item in a Listbox, pressing ENTER won't exit the listbox.
The sample's first line, OnEvent --> ESC (VK27) runs the Quit subroutine that goes to the EOF (EndOFFile) label. You could also use the new Exit> function in the Quit subroutine.3. OnEvent>KEY_DOWN,VK27,0,DoMeFavor won't work. Can the Dialog box be terminated by pressing ESC? How?
Hope this is helpful,
Dick
Code: Select all
OnEvent>Key_Down,VK27,0,Quit
Dialog>Dialog1
Caption=Dialog Object Font Test
Width=327
Height=250
Top=CENTER
Left=CENTER
TabBook=msTabBook1,16,16,289,193,0
TabPage=Page1
Label=This is page one,8,8
Edit=msEdit1,16,88,121,msEdit1
ListBox=msListBox1,144,8,121,97,item 1 1%CRLF%item 1 2%CRLF%item 1 3
Button=Result 3,16,128,75,25,3
Button=Result 4,196,130,75,25,4
TabPage=Page2
Label=This is page two,8,8
Edit=msEdit2,16,88,121,msEdit2
ListBox=msListBox2,152,8,121,97,item 2 1%CRLF%item 2 2%CRLF%item 2 3
Button=Result 5,16,128,75,25,5
Button=Result 6,196,130,75,25,6
EndTabBook
Default=Result 4
Default=Result 6
EndDialog>Dialog1
Show>dialog1
Press tab
Label>Loop
GetDialogAction>dialog1,res1
If>res1=2,EOF
If>res1=3,Process
If>res1=4,Process
If>res1=5,Process
If>res1=6,Process
Wait>0.01
Goto>Loop
Label>EOF
SRT>Process
MDL>result=%res1%
ResetDialogAction>dialog1
END>Process
SRT>Quit
Goto>EOF
END>Quit
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Can the default focus issue not be fixed by changing the tab order in the dialog designer? Click the "Tab Order" button.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I've never used Tab Order before and it doesn't seem to be doing anything now when I try it. I would assume that it automagically changes the position/order of the tabpage definitions within the dialog block. The issue is that the Tab itself is the focused item when you use tabs. Placing the Press Tab line after show>dialog for some reason sets focus to the first object in the tab page when a "tab" is selected.Can the default focus issue not be fixed by changing the tab order in the dialog designer?
To illustrate, run the sample above with the Press Tab line remarked. Pick the Page2 tab with the mouse and then press the backspace key. Nothing happens. Do the preceeding again with the Press Tab line un-remarked. When you press Backspace the msEdit2 test is backspaced over. MsEdit2 is the first object in the Page2 tab.
hope this makes sense.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Tab Order is referring to "Tab Key" order - in other words, the order in which objects are focused - the order in which focus will change as you press the tab key to cycle through the objects. Nothing to do with the order of tab pages in a page control.
I just wondered if the issue of which object originally had the focus could be fixed by setting the tab order.
If you want to focus a specific object, use the Win32 SetFocus command and pass it the object handle:
LibFunc>user32,SetFocus,r,DIALOG1.MSEDIT2.HANDLE
I just wondered if the issue of which object originally had the focus could be fixed by setting the tab order.
If you want to focus a specific object, use the Win32 SetFocus command and pass it the object handle:
LibFunc>user32,SetFocus,r,DIALOG1.MSEDIT2.HANDLE
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 1
- Joined: Sun Nov 05, 2023 3:46 am
Re: Dialog> User Interface
Hello Guys,
I appreciate your assistance, but I encountered issues with both the OnEvent and Press Tab functions on my PC. Pressing ESC doesn't close the dialog window as expected. Additionally, the Press TAB statement doesn't successfully set focus to the first item in the Listbox, which is the sole object on the tab page. I apologize for any confusion and appreciate your continued support.
I appreciate your assistance, but I encountered issues with both the OnEvent and Press Tab functions on my PC. Pressing ESC doesn't close the dialog window as expected. Additionally, the Press TAB statement doesn't successfully set focus to the first item in the Listbox, which is the sole object on the tab page. I apologize for any confusion and appreciate your continued support.