I'm working on a project that has tabs in the GUI that flip between different tables. On each tab is a table, along with a bunch of controls of various ui types. Each tab is the exact same with everything in the exact same position -- just different iterations of the controls. There are roughly 50 ui elements on each tab that are tied to the respective table. My question is this: does it make more sense to actually re-declare these 50 elements for every single tab, or should I make integer arrays to store the values, and then reload them into the elements on a tab change? If I have, say, 8 tabs, thats 8*50 = 400 ui elements to declare, which really bloats the GUI. So instead, I was thinking something like this:
declare const NUM_TABS := 8
declare pers ui_value_edit ve1
declare pers %ve1_vals[NUM_TABS]
declare pers ui_value_edit ve2
declare pers %ve2_vals[NUM_TABS]
function tab_change
ve1 := ve1_vals[selected_tab]
ve2 := ve2_vals[selected_tab]
end function
on ui_control (ve1)
ve1_vals[selected_tab] := ve1
end on
on ui_control (ve2)
ve2_vals[selected_tab] := ve2
end on
This is just a basic example showing 2 value edits shared by 8 tabs. Is this the most optimal way of handling this on a large scale? I just want to make sure I'm not overthinking this before commiting to writing the code this way. Thanks.
Just to be clear, I'm talking about custom tabs in the GUI -- not tabs from multiple scripts.