Print Page | Close Window

Problem navigating acros pages of a property sheet

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=20366
Printed Date: 16 November 2024 at 5:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem navigating acros pages of a property sheet
Posted By: Satyen
Subject: Problem navigating acros pages of a property sheet
Date Posted: 03 December 2012 at 6:48am
Hello,
 
I have developed a simple dialog application using classes -  CXTPPropertySheet and CXTPPropertyPage.
 
I am adding 5 pages in to the property sheet. Please refer the code. I want to display a modeless dialog so I am using 'Create' and 'ShowWindow' functions.
 
I am not able to navigate to any page other than the fisrt active page. When I click any of the pages first active page always gets displayed.
 
If I create modal dialog (by calling DoModal) then this problem is not seen. Please let me know what might be the reason.
 
Function 'OnInitDialog' of the page I am trying to navigate to gets called. I found that we fail in function 'CXTPPropertyPage::CreatePage' while executing this statement -
 

if (!LoadTemplate(hTemplate, hInstance))

return FALSE;

 
I am not getting the cause. If anybody knows about modeless dilaog using CXTPPropertySheet then please reply on priority.
-------------------------------------- Code  --------------------------------------------------------------
 
JFEAOptimizationMainDlg* m_pOptimizeDlg;

if(NULL == m_pOptimizeDlg)

{

      m_pOptimizeDlg = new JFEAOptimizationMainDlg( this, this);

      if (!m_pOptimizeDlg)

     {

         hr_exit(E_OUTOFMEMORY);

     }

if(m_pOptimizeDlg)

{

         CXTPPropertyPageListNavigator* pList = new CXTPPropertyPageListNavigator();

         pList->SetListStyle(xtListBoxOffice2007);

         m_pOptimizeDlg->SetNavigator(pList);

          m_pOptimizeDlg->SetResizable();

          m_pOptimizeDlg->SetPageSize(CSize(350, 250)); // in dialog units

          // First page is active page.

         m_pOptimizeDlg->SetActivePage(0);

 

              // Add pages.

            m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptObjectivePage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptLimitsPage);

            m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptVariablesPage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptCtrlParamPage);

             m_pOptimizeDlg->AddPage(&m_pOptimizeDlg->m_DesOptConvParamPage);

              // Set dialog title.

             utDilaogTitle.LoadStringResource(hInstPrevious, IDS_FEA_OPTIMIZATION_TITLE);

             m_pOptimizeDlg->SetTitle(utDilaogTitle);

             // Show the dialog

          if(!IsWindow(hWnd))

           {

               if (m_pOptimizeDlg->Create(this, WS_SYSMENU | WS_POPUP | WS_CAPTION                           DS_MODALFRAME |         DS_CONTEXTHELP | WS_VISIBLE)

               {

                             m_pOptimizeDlg->ShowWindow(SW_SHOW);

                            m_pOptimizeDlg->UpdateWindow();

               }

           }

          else

          {

                m_pOptimizeDlg->ShowWindow(SW_SHOW);

            }

}

---------------------------------- Code Ends -------------------------------------------------


-------------
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net