Tab Order - arghhhhhh!

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

Once again - THANK YOU.

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?

Michel:

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

Any ideas anyone?

Thank you all.

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

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.

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 :wink:

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?

No. They get added to the end.

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://showreport?report_id=15947