LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically generate a .tui file?

I am developing an application that will allow the user to configure the GUI during run-time. I would like to allow the user to save the gui set-up and recall it later. I don't think that SavePanelState and RecallPanelState are the correct answer because they do not save attribute information(like graph control size). I think that using the *.tui file maybe the right answer. I noticed the LoadPanel function can load from a *.tui file. How do I programmatically save panel and control attributes and values to a *.tui file?
0 Kudos
Message 1 of 4
(3,224 Views)
I assume you must be using the run-time movable controls instrument driver tool since it sounds like you are moving/sizing controls at runtime. The SavePanelState/RecallPanelState functions weren't designed to take into account design-time changes like movement of controls. Unfortunately, there isn't a way to do what you need built-in. What you would have to do is write your own data file to save off the position and sizes of the controls (using GetCtrlAttribute to get the sizes/positions) and read that in and reset all of the controls based on the sizes and positions in the file.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(3,224 Views)
Thank you for your quick response. I was afraid that was going to be the answer. I quess it wont be that bad. I am going to move/size at runtime, but also plan on inserting and deleting controls during runtime. I am assumeing that would be not any (much) different that attributes.
0 Kudos
Message 3 of 4
(3,224 Views)
Yea, same story. You'll have to keep track of the new controls in your new file. I would just write a routine that looped through all currently existing controls (based on control constant) and saved off the size and position to a file.

Chris
0 Kudos
Message 4 of 4
(3,224 Views)