Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPPropertySheet vs Theming
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertySheet vs Theming

 Post Reply Post Reply
Author
Message
No.Regsz View Drop Down
Groupie
Groupie


Joined: 28 December 2008
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote No.Regsz Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertySheet vs Theming
    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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.140 seconds.