PropertyPages+Sheet
-
Hi! I have a dialog based application with severeal dialogs. There is a main dialog, which calls via Button and Menu all other dialogs. Till now, I used only ordinary dialogs. But to make it more clear to the user, I tried to transform some of the dialog classes into PropertyPages. While using the dialog class, parameters were given to the main program while pressing the OK-Button. Because there is no OK-Button in a PropertyPage-dialog, I don't know, how to give over the parameters now. I Already implemented a function OnRefer(WPARAM, LPARAM), but only that was too less. I already serached in the codeproject's articles but couldn't find something accordingly. It would be great, if somebody could help me with this problem (Links, Hints or whatever)!! Hanno:) -- modified at 4:46 Wednesday 1st February, 2006
-
Hi! I have a dialog based application with severeal dialogs. There is a main dialog, which calls via Button and Menu all other dialogs. Till now, I used only ordinary dialogs. But to make it more clear to the user, I tried to transform some of the dialog classes into PropertyPages. While using the dialog class, parameters were given to the main program while pressing the OK-Button. Because there is no OK-Button in a PropertyPage-dialog, I don't know, how to give over the parameters now. I Already implemented a function OnRefer(WPARAM, LPARAM), but only that was too less. I already serached in the codeproject's articles but couldn't find something accordingly. It would be great, if somebody could help me with this problem (Links, Hints or whatever)!! Hanno:) -- modified at 4:46 Wednesday 1st February, 2006
-
hanno25 wrote:
parameters were referred while pressing the OK-Button
What do you mean exactely with "refer" ? ~RaGE();
-
Sorry about that, my mothertongue isn't the english language. I want to say: to send parameters, to give over parameters. Is that a better expression? Hanno
hanno25 wrote:
to send parameters, to give over parameters
OK! I was not sure what you meant. The idea behind the Property pages is: You have a property sheet containing property pages. You set up the property sheet, adding the property pages one by one, then the property sheet is called with a
DoModal()
from your base dialog. Now to exchange data between the property pages and your base dialog, you do the following: The data you want to retrieve is saved in each property page in member variables.( I usually save everything in each property page in theOnDestroy()
function, which is called when the property page is destroyed.) Before doing thepropsheet.Domodal()
, you initialize all member variables of the property pages. When the user clicks OK, the property sheet object still exist, and so do the property pages. You can then retrieve the data from the prop pages member variables. A small code snippet:CPage5Dlg page5; // Property page page5.m\_EnvList =m\_EnvList; // Set all member variables page5.m\_psp.dwFlags &=~PSP\_HASHELP; page5.m\_AllowMultisession=m\_AllowMultisession; page5.m\_AppendProject=m\_AppendNewProject; page5.m\_psp.dwFlags| =PSP\_USETITLE; page5.m\_psp.dwFlags& =~PSP\_HASHELP; page5.m\_psp.pszTitle ="Environment"; CPage3Dlg page3comp; // Property page page3comp.m\_ShowLog=m\_ShowCompilerLog; page3comp.m\_ShowComp=m\_ShowCompilerWindow; page3comp.m\_CheckInno=m\_CheckInno; page3comp.m\_DoComp=true; page3comp.m\_strarrNames.Copy(m\_strarrNames); page3comp.m\_strarrOpt.Copy(m\_strarrOpt); page3comp.m\_psp.dwFlags|=PSP\_USETITLE; page3comp.m\_psp.dwFlags&=~PSP\_HASHELP; page3comp.m\_psp.pszTitle="Compiler"; CPropertySheet Hello; // property sheet Hello.SetTitle("Settings..."); // sheet settings Hello.m\_psh.dwFlags&=~PSH\_HASHELP; Hello.m\_psh.dwFlags|=PSH\_NOAPPLYNOW|PSH\_USEHICON; Hello.m\_psh.hIcon=m\_hIcon; Hello.AddPage(&page5); // adding the pages Hello.AddPage(&page3comp); if (Hello.DoModal()==IDOK) { m\_EnvList = page5.m\_EnvList; // Update the settings only if m\_NamesArr = page3comp.strarrOpt; // user clicked ok. }
~RaGE();
-
Hi! I have a dialog based application with severeal dialogs. There is a main dialog, which calls via Button and Menu all other dialogs. Till now, I used only ordinary dialogs. But to make it more clear to the user, I tried to transform some of the dialog classes into PropertyPages. While using the dialog class, parameters were given to the main program while pressing the OK-Button. Because there is no OK-Button in a PropertyPage-dialog, I don't know, how to give over the parameters now. I Already implemented a function OnRefer(WPARAM, LPARAM), but only that was too less. I already serached in the codeproject's articles but couldn't find something accordingly. It would be great, if somebody could help me with this problem (Links, Hints or whatever)!! Hanno:) -- modified at 4:46 Wednesday 1st February, 2006
Use the PSM_QUERYSIBLINGS message that is designed for this purpose. http://www.codeproject.com/property/Psm_QuerySiblings.asp#xx878390xx[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!