Print Page | Close Window

Property sheet Problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4813
Printed Date: 04 October 2024 at 1:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Property sheet Problem
Posted By: kkkfengkkk
Subject: Property sheet Problem
Date Posted: 16 August 2006 at 4:56am
Hi, I am going to implement a series of wizard dialog and used MFC's CPropertySheet and CPropertyPage at first. But I need to have XP style toolbar in each dialog, so it seems that I have to derived from CXTPCustomizeSheet and CXTPCustomizeCommandsPage,and then it is able to use CXTPCommandBar. But I failed.  how to construct CXTPCustomizeSheet and CXTPCustomizeCommandsPage, it seems defferent with MFC, Is there any sample code about Property sheet? Please give me a hand...



Replies:
Posted By: Oleg
Date Posted: 16 August 2006 at 11:35am
Hi,
You can create toolbars without CXTPCommandBars just using CreateToolBar and manually position them.
 
See Samples\UserInterface\GUI_Whidbey\PropertiesPane.cpp


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kkkfengkkk
Date Posted: 16 August 2006 at 8:09pm
Sorry, The sample of GUI_Whidbey is missing in my Samples\UserInterface\ **, is there any other sample could give me more information? I opened CommandBars_vc80.sln and search CXTPToolBar as keywords, it seems that all need a CXTPCommandBars,
i.e: CXTPToolBar* pStaticBar = (CXTPToolBar*)pCommandBars->Add(_T("Static Bar"), xtpBarTop);
 
But my dialog is derived from CPropertyPage,how to get the handle of CXTPCommandBars? It seems that I could not derived my dialog from CXTPDialog.


Posted By: Oleg
Date Posted: 16 August 2006 at 9:45pm
I guess you have single CommandBars product... Yes Gui_Whidbey sample is part of toolkit pro...
 
Some hints:
 
1. Add CXTPToolBar m_wndToolBar member to class
 
2. create it:
 
VERIFY(m_wndToolBar.CreateToolBar(WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this));
m_wndToolBar.LoadToolBar(..);
 
3. manually calc size and move in OnSize handler:
 
void CClassViewPane::OnSize(UINT nType, int cx, int cy)
{
 CWnd::OnSize(nType, cx, cy);
 int nTop = 0;
 if (m_wndToolBar.GetSafeHwnd())
 {
  CSize sz = m_wndToolBar.CalcDockingLayout(cx, /*LM_HIDEWRAP|*/ LM_HORZDOCK|LM_HORZ | LM_COMMIT);
  m_wndToolBar.MoveWindow(0, nTop, cx, sz.cy);
  m_wndToolBar.Invalidate(FALSE);
  nTop += sz.cy;
 }
 if (m_wndClassView.GetSafeHwnd())
 {
  m_wndClassView.MoveWindow(0, nTop, cx, cy - nTop);
  m_wndClassView.Invalidate(FALSE);
 }
}
 
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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