[Closed] Problem with Tab controls
Just extending a script to use the active X tab controls for a nicer layout. I got it all working, but the only problem is when I switch tabs I need to destroy the other 4 rollouts like so:
RemoveSubRollout toolsRollout tab4
RemoveSubRollout toolsRollout tab3
RemoveSubRollout toolsRollout tab2
addSubRollout toolsRollout tab1
The only problem is this effectively destroys all the data in the last rollout. Is there a way to preserve this data, but still only display 1 rollout?
Thanks for any help you guys can offer…
You need to save your values in a .ini file
something like:
on MyRollout close do
(
setINIsetting myINI MySection MyVal1Name Myval1
– etc …
)
then use on MyRollout open do
(
MyVal1 = (getINISetting myINI MySection MyVal1Name) as float – (or whatever)
etc…
)
Thanks – works great!
I’m left with one last bug – Basically what I have is the following
Rollout1
(
local saveFile
outputFile = createFile (saveFile)
on Browse pressed do
(
saveFile = getSaveFileName filename:"D:\Projects" types:"txt File (*.txt)|*.txt"
Gen_Common.Name.text = saveFile
)
--user input
)
Rollout2
(
--user input
)
Rollout3
(
--user input
)
TabsRollout
(
-- to encapsulate all rollouts
)
The three rollouts now store and load their data from an INI file.
Inside Rollout1 I have a button that gathers all the info from the fields in the other rollouts and creates a file full of all the information. That seemed to work just fine before I threw the tabs in. Now I get the error:
–Unable to convert: Undefined to type: Filename.
The file name field is populated automatically by loading the string from the ini file – but for some reason it won’t take…
ot seams that the
‘outputFile=createfile savefile’
is called before savefile is defined (so it is undefined)
just move the line in the ‘on Browse’ handler
Rollout1
(
local saveFile, outputFile
on Browse pressed do
(
saveFile = getSaveFileName filename:“D:\Projects” types:“txt File (.txt)|.txt”
Gen_Common.Name.text = saveFile
outputFile = createFile (saveFile)
)
–user input
)