06-21-2019 07:57 PM
I have created a UI that visually looks the way that I need it to. It is made up of 24 rows with about 15 columns of UI controls per row. In order to build out this table I did a lot of copy and pasting of UI elements but now in my list of all the UI controls it's bedlam. I want to make it easy for myself or the next developer to easily edit or restyle these controls. So I'd like the control list to show the controls for one column, then the controls for the second column, etc.
I see absolutely no way to reorder these controls. But it seems crazy that this functionality doesn't exist.
To be clear I'm not trying to put elements in front of or behind other elements visually but adjust the list of controls in the upper right corner of the screen (and I think that is directly related to the resource IDs that get assigned in .h file).
Solved! Go to Solution.
06-24-2019 02:28 AM - edited 06-24-2019 02:30 AM
This can easily be done by clicking once on the panel and pressing Ctrl + T (or executing Edit >> Tab Order... menu function which is the same): in Edit Tabbing Order window click on the controls on the window in the order you want to have them listed in the Resource Editor (the list in the upper-right corner); accept the reordering b pressing Ok to have it saved in the .UIR and .H files and have the list updated. Remember that this will also be the order in which controls will be activated when pressing Tab key at runtime.
06-24-2019 02:29 AM - edited 06-24-2019 02:31 AM
I think the right panel displays the controls according to their tab order.
To change the tab order open the uir and Edit>>Tab Order
[Edit] It seems Roberto was faster 🙂
06-24-2019 02:49 AM
Just a couple ideas about your UI.
First of all, the last note I put in my previous reply should be considered: the order you are trying to put your controls may be better from the programmer's point of view but is probably not optimal for the user. If the logic the user follows in editing the controls is by row your control arrangement is the worst given the 24 x 15 size of the UI!
Your description of the UI makes me think to a tabular schema, where control in the same "column" represent the same element, something like that:
Step Type Duration Param1 Param2 1 Work 15min 1 2 2 Rest 1hour ..... 24 Work 1min 14 20
If this is your schema then you can consider that multiple controls can be selected on screen (e.g. the "Type" column) and edited at the same time, while preserving the tab order by row that is better from the user point of view.
Next idea. Since editing 24 controls is boring and prone to errors, you could consider to create the panel with the first row only and duplicate controls at runtime before showing the panel. In my opinion this approach has some advantages: on one hand you can easily rearrange the panel to show say 10 or 30 lines, and editing one control only is enough to have all controls in the column with the same aspect
06-24-2019 03:03 AM
you could also consider grouping your controls by using ControlArrays
06-24-2019 04:27 PM
I will be using controlArrays. But I still end up with a really messy list of controls and a really messy looking .h file with all my resource IDs being a little crazy.
Almost none of my controls are actual "controls" they're text fields that will be set by application to let the user know the status tests and info about the devices under test. So this is purely an exercise in trying to wrangle some organization into this mess.
The Tab order does appear to be what I want to change but the interface is a huge problem. My controls are too densely packed to be able to easily see which controls are referred to by which "black|white" boxes in the tab order UI. Many of my text fields are smaller than the ui for describing what the order of the tab is... Making it almost impossible to click the correct field in the dense sections of my UI. And then I have to start over at tab order 0 everytime so I can't temporarily space out the dense sections and take another pass...
It's absurd that I can't simply drag the list items in that control list to change the order. Or edit a xml or .h file or something manually...
06-24-2019 05:07 PM - edited 06-24-2019 05:09 PM
You don't need to always start from 0 when editing the tab order: simply write down the desired index in the highlighted box and the next control you click will have that index
On the other end, since your controls are mainly texts I wonder if a simple table couldn't be better instead of a huge series of controls.
06-24-2019 08:03 PM
Okay. I didn't seem like I could type in that box. But I can. I can use this to get to where I want now. Thanks a lot.
You're probably right that a table might be better... Maybe I'll look into that again for the next UI. Thanks again.
07-01-2019 08:32 AM - edited 07-01-2019 08:35 AM
When designing multiple rows (or columns) of identical controls, you should put only the 1st row (or column) in your UIR file, and then dynamically create the other rows by copying the 1st at execution time.
I know of at least 5 methods:
- list the control constants of the 1st row in a C array and copy every one of them with DuplicateCtrl(), keep the resulting Ctrl numbers in your array and use that instead of the constants. Place appropriately with simple geometric rules. That's the most tedious.
- put your 1st row in a child panel, and simply copy the child panel for each row at run time. Keep the list of child panels in an array (and keep an IndexForPanel list), but otherwise use the constant names to index your controls.
- put your 1st row of controls into a ControlArray and copy that at run time.
- Use a table with only 1 row (if your controls are similar) and copy the 1 row at execution time. Use table function to figure out who's who.
Some methods require surprisingly little code and little time to work on the UI.