best way to record recent control values? wxConfigBase?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
farengeti
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Dec 16, 2004 2:11 am

best way to record recent control values? wxConfigBase?

Post by farengeti »

I have several dialogs that my user will need to use frequently but intermittently. I want to save their settings from the last use and use them to initialize the dialog on the next use. The obvious ways to do this would be to use static variables or to record the values in a parent window, but this gets messy with lots of variables and settings, and then I'd have to save them all to a file if I want to access them next time the program is run. Does wxWidgets have anything easier set up? Is wxConfigBase appropriate for this?

Furthermore, I'm quite reluctant to touch the windows registry. Would you say this is a wise reservation, or a symptom of my irrational fear of all things msWindows?

Thanks!
gururamnath
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Sat Sep 18, 2004 2:49 am
Location: California, USA

Re: best way to record recent control values? wxConfigBase?

Post by gururamnath »

You can use an ini file. CodeProject has a crossplatform inifile class that you can use.

-Guru Kathiresan
farengeti
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Dec 16, 2004 2:11 am

Post by farengeti »

Is this what you're referring to?:

https://secure.codeproject.com/file/ini.asp


So then I just create a unique identifier for each field in the ini file and read from there when I recreate a window or frame? Seems easy enough, although I'm surprised it's not automated yet.

Thanks.
Post Reply