Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: BrienKing on October 05, 2015, 01:02:26 AM

Title: Feature Request: Add Tab Order to controls
Post by: BrienKing on October 05, 2015, 01:02:26 AM
Right now, I am fighting with Tabbing through controls.

Inside a panel, I have two input boxes and two buttons.  On all the controls I added the "UI Key Navigation" script. 

The Text Boxes have a "Tab" option, but the buttons do not.  So I decided to leave them all blank to take the default behavior.

When I hit Tab, it goes from Useraname to Password to Create New Account and then it just cycles between Password and Create New Account.  I can fix the cycle somewhat, but it will still leave out the "Username".

Ultimately though, it should go Username->Password->Sign In->Create New Account-><back to Username>.

If we had a "Tab Order" field it would be pretty simple to search for the next control in order and move to it. 

The quicker fix would be if the Button had a Tab object I could attach to like the Text Boxes.
Title: Re: Feature Request: Add Tab Order to controls
Post by: ArenMook on October 07, 2015, 07:47:38 PM
There is indeed an order. Open UIKeyNavigation.cs, go to line 270. First it uses the Tab field, then if none was found it will use Right, Down, Up and finally -- Left field values. If you hold Shift, the order is reversed.
Title: Re: Feature Request: Add Tab Order to controls
Post by: BrienKing on October 07, 2015, 09:19:27 PM
Except that Buttons do not have the onTab property on them, so you cannot set that.  So instead it has to do the GoLeft/Right/etc...

If every control had a "TabOrder" field (int) and the code searched for the control with the next control where the tab order was greater than the current controls tab order, you could skip the whole searching in different directions and would give us a lot more control over how the tabbing worked.
Title: Re: Feature Request: Add Tab Order to controls
Post by: ArenMook on October 10, 2015, 10:49:39 PM
Hmm? UIKeyNavigation has a "tab" option... I think you should update your NGUI, because input fields don't have a tab option and haven't had it for about 2 years now, I think...