Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. PropertyPages+Sheet

PropertyPages+Sheet

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsstutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hanno25
    wrote on last edited by
    #1

    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

    R P 2 Replies Last reply
    0
    • H hanno25

      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

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      hanno25 wrote:

      parameters were referred while pressing the OK-Button

      What do you mean exactely with "refer" ? ~RaGE();

      H 1 Reply Last reply
      0
      • R Rage

        hanno25 wrote:

        parameters were referred while pressing the OK-Button

        What do you mean exactely with "refer" ? ~RaGE();

        H Offline
        H Offline
        hanno25
        wrote on last edited by
        #3

        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

        R 1 Reply Last reply
        0
        • H hanno25

          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

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          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 the OnDestroy() function, which is called when the property page is destroyed.) Before doing the propsheet.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();

          1 Reply Last reply
          0
          • H hanno25

            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

            P Offline
            P Offline
            PJ Arends
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups