Tab Order - arghhhhhh!

  1. ‹ Older
  2. 6 years ago

    Greg O

    24 Feb 2014 Xojo Inc scout.galaxy.barn

    Richard - just include them in the tab order. If your user is using a screen reader, it'll make life a lot easier on them. Most of the OSs automatically ignore them now anyway.

    For what it's worth, you can drag items up and down in that list to adjust the tab order. I find that a lot easier than dealing with the TabIndex properties.

  3. Argghhhhhhhhhhhhhhh ! :(

    Michael was kind enough to inform me that it SHOULD now work - but it doesn't :(

  4. Michel B

    24 Feb 2014 Pre-Release Testers, Xojo Pro

    @Richard S However, when I open the window and try to tab - nothing happens.
    It refuses to tab from the first TextField to the next PopupMenu.

    Once I click on any of the other TextFields or PopupMenus, the tabbing cycles through correctly.
    The only problem is tabbing from the first (tab index1) TextField, to the second (tab index2) PopupMenu.

    If the first TextField is TabIndex 0, it should have the focus when you open the window. Tabbing works only between focused items. If for some reason your first field was not focused as default, add firstcontrol.SetFocus in the window open event and you should be fine.

  5. Michel:
    The first control does have focus because the Carat is flashing inside it when the window opens.

    I can't understand why it cycles through all the other controls perfectly (even from the last to the first), BUT refuses to cycle from the first (tab index 0) to the second (tab index1).

    :(

  6. Michel B

    24 Feb 2014 Pre-Release Testers, Xojo Pro

    @Richard S It refuses to tab from the first TextField to the next PopupMenu.

    I just tried a quick test app, and it seems although popumenu has a tab index, it does not get the focus. However, It tabs fine to the next TextField in the order.

  7. In my project it can tab correctly from a TextField to a PopupMenu, to another TextField. (alternating between any type of control).

    It just won't tab from TabIndex 0 to TabIndex 1.

    :(

    Is this a XOJO bug then?

  8. Eli O

    is not verified 24 Feb 2014 Europe (Berlin, Germany)

    Have you set in the system preferences under "Keyboard -> Shortcuts", that all controls are reacting for tabbing ("Full keyboard access")?

  9. System preferences of Windows 8? Or are you talking about in Xojo?

  10. Using Windows, and I believe you are referring to OS X system preferences which is therefore, non-applicable in this case unfortunately.

    It simple refuses to tab from Index0 to Index 1.
    It is as if Index 0 is set not to tab to another control?

    Hope someone can work out what is going wrong.

    Thank you all for continuing to try and help.

  11. Michel B

    24 Feb 2014 Pre-Release Testers, Xojo Pro Answer
    Edited 6 years ago

    @Richard S It simple refuses to tab from Index0 to Index 1.

    Lost for lost, this should work. Add Keydown event to your first control with this :

    Function KeyDown(Key As String) As Boolean
    
      if Key = chr(9) then 
        TextField2.SetFocus
      end if
    
    End Function

    My second item is TextField2. You want to place the name of your second control there.
    I removed the tab stop from the first control in my test app and it still cycles gently from 0 to 1 :)

    *** In case you feel like starting yet another thread, don't count me in. I have waisted enough time :/

  12. Thank you so much for all your help - much appreciated!
    Sorry if I have wasted your time :(

    Once again - THANK YOU.

  13. Tim H

    24 Feb 2014 Pre-Release Testers Portland, OR USA

    If trapping the Tab key in Keydown fixes it, then it certainly is a bug of some kind, although it seems hard to duplicate. Can you duplicate it in a small project and submit it to Xojo?

  14. Michel:

    Your code solved the problem !
    Unfortunately it now causes the user's system to beep when the second control receives focus :(

    Any ideas anyone?

    Thank you all.

  15. Eli O

    is not verified 25 Feb 2014 Europe (Berlin, Germany)

    You have to "Return True" after you have handled the key press in KeyDown.

  16. last year
    Edited last year

    Sorry for necromancing this thread...

    I'm developing a desktop app, where the main GUI is setup by data from a file, placing a bunch of ContainerControls inside a GroupBox inside a GroupBox (so I can scroll the chunk using a scrollbar).

    Now, the ContainerControls (which each have a small GUI on them) are added top->down, the first added at top Y, the next at top+height_of-the_one_above+margin etc.

    But the Tab order is bottom first, and then it goes upwards, 5 - 4 -3 - 2 when hitting tab (and the correct order when hitting shift tab.

    How can you control this programatically as I do not know beforehand who will be after me (that is done at runtime, parsing a file, adding the objects. I could probably tell each of them who's next and who's before during creating, should I do my own tab handler in KeyDown for this or is there some magic API i've forgotten about / never heard of to handle it.

  17. Edited last year

    Ok, go back to sleep, I solved it using a double linked list in the parent ContainerControl, that "my" ContainerBlocks inherit from, and some init code. Xojo has come far, this is really a quite productive platform. No need to spend too much time figuring out how to do things, it's just implement, test and it works ;-)

  18. Greg O

    3 Jul 2018 Xojo Inc scout.galaxy.barn

    You don’t need to do this in code. There are two command bar buttons to help with tab order. One with a number in a box (manual) and the other looks like a Z (automatic).

  19. @Greg OLone You don’t need to do this in code. There are two command bar buttons to help with tab order. One with a number in a box (manual) and the other looks like a Z (automatic).

    Does that work with dynamically added controls as well?

  20. Greg O

    3 Jul 2018 Xojo Inc scout.galaxy.barn
    Edited last year

    @Totte A Does that work with dynamically added controls as well?

    No. They get added to the end.

  21. 5 months ago

    Dan B

    Jun 11 Pre-Release Testers, Xojo Pro

    Sorry for necromancing this thread... again

    I'm doing the similar thing as Totte was: Adding various ContainerControls to a parent ContainerControl.

    I expect the first created CC to get the focus first when hitting the tab-key. Instead it is the last created CC the recieves the tab-key.

    I suppose I could create the CC's backwards but that is not a very nice solution IMO.

    I reported this back in 2011 in this case: Feedback Case #15947

or Sign Up to reply!