Print Page | Close Window

CXTPPropertySheet vs Theming

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=17963
Printed Date: 17 November 2024 at 12:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertySheet vs Theming
Posted By: No.Regsz
Subject: CXTPPropertySheet vs Theming
Date Posted: 27 February 2011 at 12:07pm
In order to make OK, Cancel and Apply buttons look consistent with entire application I have to write the following ugly code:

/*virtual*/ BOOL CPreferencesDlg::CreateClient() {
   if (!__super::CreateClient())
      return(FALSE);
 
   for (INT_PTR i = 0; i < m_arrButtons.GetSize(); ++i) {
      CButton * const pButton = m_arrButtons.GetAt(i);
      CString strButton;
      pButton->GetWindowText(strButton);
      const DWORD nID = ::GetWindowLong(pButton->GetSafeHwnd(), GWL_ID);
      
 
      CButton * const pXTPButton = new CXTPButton();
      
      if (!pXTPButton->Create(strButton, pButton->GetStyle(), CRect(0, 0, 0, 0), this, nID))
      {
         delete pXTPButton;
         continue;
      }
 
      delete pButton;
      m_arrButtons.SetAt(i, pXTPButton);
 
      pXTPButton->SendMessage(WM_SETFONT, (WPARAM)(HFONT)m_fntNormal, FALSE);
   }
 
   SendMessageToDescendants(WM_XTP_SETCONTROLTHEME, xtpControlThemeResource, 0);
   
   RecalcLayout();
 
   return(TRUE);
}
Please make some virtual methods so I can sabstitute CXTPButton.


-------------
XTP 15.0.1
7 SP1
VS 2010 SP1 Beta



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