I notice a strange behaviour in a form with some static texts and several types of controls.
When I press resource/tabstops, the correct marking is displayed: all the static texts have a 'minus,' and all the data-controls a 'plus.'
But when I press resource/visit order, all the static texts are also assigned a visit order, even though they don't have the tabstop-property. This is very inconvenient.
Is this an intended behaviour?
-
- Active Member
- Posts: 36
- Joined: 27 Apr 2000 23:01
tabstops and visit order
Regards,
Audun.
Audun.
- Thomas Linder Puls
- VIP Member
- Posts: 1410
- Joined: 28 Feb 2000 0:01
Yes, it is the intended behavior, and it is indeed necessary.
If you have a static text with an accelerator, say "&Name" (= Name), then when the user press Alt+n (the accelerator), focus will be transferred to the first control with tab-stop in the visit order after "&Name". I.e. go to the static text and then follow the visit order until you meet a control that have tab-stop.
So the visit order of static texts does matter (and hence it is necessary to control it).
If you have a static text with an accelerator, say "&Name" (= Name), then when the user press Alt+n (the accelerator), focus will be transferred to the first control with tab-stop in the visit order after "&Name". I.e. go to the static text and then follow the visit order until you meet a control that have tab-stop.
So the visit order of static texts does matter (and hence it is necessary to control it).
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 36
- Joined: 27 Apr 2000 23:01
-
- Active Member
- Posts: 36
- Joined: 27 Apr 2000 23:01
- Thomas Linder Puls
- VIP Member
- Posts: 1410
- Joined: 28 Feb 2000 0:01
By default the visit order will be the order in which you add the controls to your dialog.
I.e. the first control you add to the dialog (in the dialog editor) will be visited first, the second control you add will be visited second, ...
But using the Resource -> Visit Order you can change the visit order to something different.
The visit order is not affected by accelerators, it is the opposite way: then meaning/effect of accelerators is affected by the visit order.
Let me explain the "accelerator" stuff by means of an example.
Consider controls like this:
This is what happens if a certain control has focus and the user presses Alt+A
I.e. the first control you add to the dialog (in the dialog editor) will be visited first, the second control you add will be visited second, ...
But using the Resource -> Visit Order you can change the visit order to something different.
The visit order is not affected by accelerators, it is the opposite way: then meaning/effect of accelerators is affected by the visit order.
Let me explain the "accelerator" stuff by means of an example.
Consider controls like this:
- Tabstop, no-accelerator (e.g. an edit control)
- No-tabstop, Accelerator A (e.g. a static text)
- Tabstop, no-accelerator (e.g. an edit control)
- Tabstop, Accelerator A (e.g. a button)
This is what happens if a certain control has focus and the user presses Alt+A
- Windows searches for the accelerator (forward in visit order) and finds control 2. Control 2 does not have tabstop, so Windows searches forward for a control with tabstop and finds control 3. Focus is set to control 3.
- Windows searches for the accelerator and finds control 4. Control 4 have tabstop. Focus is set to Control 4.
- Same behavior as control 2.
- Same behavior as Control 1, because searches cycles round once the last control is reached
- Tabstop, no-accelerator (e.g. an edit control)
- Tabstop, no-accelerator (e.g. an edit control)
- No-tabstop, Accelerator A (e.g. a static text)
- Tabstop, Accelerator A (e.g. a button)
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 36
- Joined: 27 Apr 2000 23:01
Yes, now I start to understand it better. Again, thanks for your patience!
In my case (I have a quite big form), the intention is that the user starts at the top, and fills in data down the "page." She will proceed from control to control using the Tab-key. No accelerators.
In that use-case, I suppose I can just assign the controls (including static text prompts) numbers from 1 and upwards?
In my case (I have a quite big form), the intention is that the user starts at the top, and fills in data down the "page." She will proceed from control to control using the Tab-key. No accelerators.
In that use-case, I suppose I can just assign the controls (including static text prompts) numbers from 1 and upwards?
Regards,
Audun.
Audun.
- Thomas Linder Puls
- VIP Member
- Posts: 1410
- Joined: 28 Feb 2000 0:01