Re: Need tutorial on Tab Controls in Windows API
Sorry for being vague- I had been working on this so long it became difficult to step back.
I did resolve this issue.
I was trying to get the code example posted early in the thread from Bond to work.
I created a win32 project, copied the code in and added comctl32.lib in the compile options in VC++ 2005.
I had a couple of compile errors first time around due to resources not being defined so I just defined them as constants which didn't work out for me. When I went back and created proper dialog resources everything seemed to work.
I stumbled across this thread looking for a refresher on tabbed dialogs. What caught my eye here was the save functionality. After getting this program to work and understanding it, I am disappointed in the save functionality.
I have 2 questions.
Is there a painless way to save the user inputs to dialog boxes without using MFC? My application will have hundreds if not thousands of inputs when I am through and to manually pull every control item out is not nice and prone to error. Preferably some way that can self discover the control items that need saving and do it autonomously.
Secondly, whats the advantage to using a property sheet over a tabbed dialog? I dont see any distinct advantage unless you needed to create a wizard.
Thanks
Re: Need tutorial on Tab Controls in Windows API
Quote:
Originally Posted by HwHack
Is there a painless way to save the user inputs to dialog boxes without using MFC? My application will have hundreds if not thousands of inputs when I am through and to manually pull every control item out is not nice and prone to error. Preferably some way that can self discover the control items that need saving and do it autonomously.
Newer frameworks have the concept of data binding which allow you to connect a control to a datasource (which usually is a collection of items). Typically this sort of framework has the ability to track changes to each item and mark the item(s) as dirty. The data transfer between the control and the underlying bound item is handled automatically and dirty items can then be saved as needed. It would be quite a bit of work, but you can replicate this functionality.
Quote:
Originally Posted by HwHack
Secondly, whats the advantage to using a property sheet over a tabbed dialog? I dont see any distinct advantage unless you needed to create a wizard.
The advantage is layout. For all but the simplest design it will be easier to keep track of the controls for each page (assuming you use the resource editor) rather than putting all the controls on a dialog and hiding/showing the controls based on the selected tab.