Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Adding an existing CPropertyPage as a CExtRibbonOptionsPage Collapse All
Subject Author Date
Serge Roussel Oct 1, 2007 - 10:56 AM

My company have created a standard set of PropertyPage meant to set all of the different options possible within our products. These PropertyPage ’knows’ how to retrives and save settings.

I am trying to load these property page in the a ribbon bar application menu options dialog. I have tried 2 different approch:
1- Created a new class derived from CExtRibbonOptionsPage that will be created using that exisiting property page ID. There are few visual issue, the property page have a tiltle bar and can be moved around inside the options dialog. And, of course, the property pages handler are not used, so the settings not loaded/save.
2- Created a new class derived from CExtRibbonOptionsPage; using a a new Page ID, which is a DIALOGEX in the resource file.
The property page is a member of that new class, which is displayed when OnShowWindow is called.
The problem is that the property page is NOT embedded and usable as an OptionsPage.

What would be the best solution to implement this? Please note that these existing PropertyPage can be a CPropertyPage or a CExtResizablePropertyPage depending what define I use to compile them.

Technical Support Oct 2, 2007 - 12:55 PM

You should use the CMyUserDefinedRibbonOptionsPage class from the RibbonBar sample n as a ready-to-use example. It is based on the IDD_MY_USER_DEFINED_OPTIONS_PAGE dialog template resource. The ribbon options pages are not persistent. They are always created dynamically before the ribbon options dialog appears on the screen and destroyed automatically when this dialog is closed. This means you should create a CExtRibbonOptionsPage-derived class which implements

      virtual UINT RibbonOptionsPage_GetID() const;
      virtual bool RibbonOptionsPage_InitContent();
      virtual void RibbonOptionsPage_Apply();
      virtual void RibbonOptionsPage_Cancel();
The RibbonOptionsPage_GetID()</cod> virtual method should return a resource identifier of the dialog template resource used by your page dialog. This dialog template resource should be a child visible dialog which clips both its children and siblings. The <code>RibbonOptionsPage_InitContent() virtual method is invoked to initialize data and controls of your page dialog. The next two methods notify your page dialog about closing of the entire ribbon options dialog. Besides, your CExtRibbonOptionsPage-derived class must DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE in its declaration/implementation.

To insert your page dialog into ribbon options dialog, you should override CExtRibbonBar::OnRibbonOptionsDialogInitPageRTCs() in your CExtRibbonBar-derived class as it is demonstrated in the CMyRibbonBar::OnRibbonOptionsDialogInitPageRTCs() method in the RibbonBar sample application.

Serge Roussel Oct 2, 2007 - 10:32 AM

Never mind, I have figured it out :) :)