ggatling Posted November 29, 2005 Report Share Posted November 29, 2005 I really underestimated the popularity of using an xcontrol for configuration files. So by popular demand, here is the prototype. The ini file format is as follows: [tag] #use the parameters tag to reference it in code description= #this text will appear in the caption below the tree control when this parameter is selected section= #the parent of this parameter in the tree control label= #what the user sees in the tree control default= #obvious i hope type= #one of STRING|COMBO|BOOLEAN|INTEGER|DOUBLE selections= #applies only to combo boxes... separate items with a pipe (|)... add an * item to allow undefined strings (buggy) format= #applies only to double, is the format string of the numeric display minimum= #applies only to numeric types (integer, double) maximum= #applies only to numeric types (integer, double) Download File:post-478-1133280396.zip Quote Link to comment
m3nth Posted November 30, 2005 Report Share Posted November 30, 2005 Can you post a link to a previous thread or more info on what this is and how to use it... Quote Link to comment
ggatling Posted November 30, 2005 Author Report Share Posted November 30, 2005 From info-labview: I have historically used NIs ini palette because it was there and the users do seem to like the ini format. One problem has been the initial code investment... I sometimes get bogged down coding configuration panels. Then NI gave us the x control and the first thing I thought of was abstracting the configuration code. So I have made an x control that looks like a tree control and has all the code to read an ini file and let the user change the parameters. It has two methods... "load ini" and "get parameter". If anyone is interested I'd love to share the code with you and hopefully make it better. George Quote Link to comment
Mike Ashe Posted December 1, 2005 Report Share Posted December 1, 2005 Lots of downloads, I thought one of us should say: Thank You Remind me to buy :beer: if we ever meet at NI Week Quote Link to comment
DerekLV Posted December 2, 2005 Report Share Posted December 2, 2005 Yes - well done! I was just reviewing the sad state of affairs with INI files and this is just perfect. When you mention prototype, there's currently no way to write to the INI file, right? Thanks, Derek Quote Link to comment
ggatling Posted December 3, 2005 Author Report Share Posted December 3, 2005 Right... the control does not write to the INI file right now. One of the methods I was working on when I posted was "make current values default" which would rewrite the default values in the ini file with the current values in the control. What really makes this a prototype though are the UI quirks... there are several things you can do to get the control in a confusing UI state and the yellow faux tool tips that appear over the value or label in the tree control have confused the people that have tested this for me. Also, you might notice I hid the tree controls scroll bar and then added a scroll bar to the xcontrol... this is because the mouse wheel can scroll the tree control but does not trigger any LV event so its not possible for me to move the visible editor... and then things get inconsistent and confusing. An event that would have made coding this MUCH simpler is a "lost focus" event... but currently no such thing exists. Quote Link to comment
Mike Ashe Posted December 4, 2005 Report Share Posted December 4, 2005 Have you played with the Variant ConfigFile VIs in the OpenG toolkit? Very flexible for getting a large/complex data structure in and out of INI files. Perhaps you could take advantage of some of what is in there for your next round of mods to your Xcontrol Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.