|
-
January 30th, 2008, 12:33 PM
#1
Settings Dialog
Just because of curiosity, what is the best way to do a settings dialog?
Currently, I just use this:
Have an ini file to store settings.
On load, read the settings and store them in variables.
Settings dialog accessed via a menu.
Settings dialog used via DoModal
Settings dialog reads ini and stores settings in variables.
If "ok" is clicked, validate and save new settings to ini.
If DoModal returned "ok" button's ID, read ini and update variables.
This works fine, but something tells me there's a much better way to do this.
Any comments, suggestions would be helpful and appreciated 
Thanks.
-
January 30th, 2008, 05:07 PM
#2
Re: Settings Dialog
Settings dialog reads ini and stores settings in variables.
That's the only real part I would take issue with. There should be a settings object or something that stores these variables while the program is running. Are you reading the ini file every time a variable is needed?
-
January 30th, 2008, 05:07 PM
#3
Re: Settings Dialog
Regardless of how you implement it, you still have the same basic scenario. You have some external data that needs to update some program variables. The real issue is whether you want the external data easily accessible to the user. Some of the scenarios that others have used include the following:
1. Save to an archive file.
2. Use the registry API to store settings.
#2 seems to be the prevalent way of doing this, however, whatever suits your needs the best should be used.
Gort...Klaatu, Barada Nikto!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|