Print Page | Close Window

How to set a skin to CXTPropertySheet and Pages?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11665
Printed Date: 15 September 2025 at 1:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set a skin to CXTPropertySheet and Pages?
Posted By: evoX
Subject: How to set a skin to CXTPropertySheet and Pages?
Date Posted: 30 July 2008 at 1:56pm

I want to use the office 2007 skin for a CXTPropertySheet with TaskPanel navigator.

The navigator appears with the office 2007 skin, but the main property sheet not, also the pages from property sheet don't load the skin.

I have tried this line in oninitdialog and constructor, but no success

BOOL bRes=XTPSkinManager()->LoadSkin(NULL, _T("NORMALBLUE.INI"));

 




Replies:
Posted By: Oleg
Date Posted: 31 July 2008 at 1:48am
Hi,
 
Have to work in constructor.  Send sample project.


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


Posted By: evoX
Date Posted: 31 July 2008 at 8:35am
I don't have sample project, but this is the only code which deals with the property sheet
 

CPropSheetDlg::CPropSheetDlg()

{

////////////////////////////////////////////

// Apply the Skin

BOOL bRes=XTPSkinManager()->LoadSkin(NULL, _T("NORMALBLUE.INI"));

}

BOOL CPropSheetDlg::Create()

{

//////////////////////////////////////////

CFont* pFont = m_pSheet->GetFont();

if (!CXTPTaskPanel::Create(WS_VISIBLE | WS_CHILD | WS_GROUP | WS_TABSTOP, CRect(0, 0, 0, 0), m_pSheet, 1000))

return FALSE;

SetBehaviour(xtpTaskPanelBehaviourList);

SetTheme(xtpTaskPanelThemeShortcutBarOffice2007);

SetSelectItemOnFocus(TRUE);

this->m_rcNavigatorMargin.top=80;

SetIconSize(CSize(32, 32));

SetFont(pFont);

CXTPTaskPanelGroup* pGroup1 = AddGroup(0);

pGroup1->SetCaption(_T("Main"));

CXTPTaskPanelGroup* pGroup2 = AddGroup(1);

pGroup2->SetCaption(_T("Registry"));

CXTPTaskPanelGroup* pGroup3 = AddGroup(2);

pGroup3->SetCaption(_T("Internet"));

CXTPTaskPanelGroup* pGroup4 = AddGroup(3);

pGroup4->SetCaption(_T("Options"));

for (int i = 0; i < m_pSheet->GetPageCount(); i++)

{

CXTPPropertyPage* pPage = m_pSheet->GetPage(i);

CString strCaption = pPage->GetCaption();

CXTPTaskPanelGroupItem* pItem = pGroup1->AddLinkItem(i, i);

pItem->SetCaption(strCaption);

pItem->SetItemData((DWORD_PTR)pPage);

pPage->m_dwData = (DWORD_PTR)pItem;

}

GetImageManager()->SetIcon(IDR_MAINFRAME, 0);

//GetImageManager()->SetIcon(IDI_TASKS, 1);

//GetImageManager()->SetIcon(IDI_NOTES, 2);

 

m_pSheet->SetPageBorderStyle(xtpPageBorderBottomLine);

///////////////////////////////////////////

if (!m_wndCaption.Create(m_pSheet, _T("WinSysClean"), CPWS_EX_RAISED_EDGE,

WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, CRect(0,-7,900,80), 1001))

{

TRACE0("Failed to caption window.\n");

return -1;

}

return TRUE;

}

 

 

////////////////////////////////////////////////////////////////

void CPropSheetDlg::OnPageSelected(CXTPPropertyPage* pPage)

{

CXTPTaskPanelGroupItem* pItem = (CXTPTaskPanelGroupItem*)pPage->m_dwData;

SetFocusedItem(pItem);

}

void CPropSheetDlg::SetFocusedItem(CXTPTaskPanelItem* pItem, BOOL bDrawFocusRect /*= FALSE*/, BOOL bSetFocus)

{

if (m_pItemFocused != pItem && pItem && pItem->GetType() == xtpTaskItemTypeLink)

{

CXTPPropertyPage* pPage = (CXTPPropertyPage*)pItem->GetItemData();

if (!m_pSheet->SetActivePage(pPage))

{

return;

}

}

CXTPTaskPanel::SetFocusedItem(pItem, bDrawFocusRect, bSetFocus);

}



Posted By: evoX
Date Posted: 31 July 2008 at 8:56am

Is it possible to make a tabcontrol with a taskpanel navigator ? Then I can use a clasic dialog with a tabcontrol insde, instead of propertysheet.



Posted By: Oleg
Date Posted: 01 August 2008 at 2:34am
Check Samples\Controls\PropertySheet  - shows how to use TaskPanel as navigator.

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


Posted By: evoX
Date Posted: 01 August 2008 at 9:04am
but in that sample it's used as navigator for a propertysheet, not for a tabcontrol
I want to use a TabControl inside a dialog with taskpanel navigator, but propertysheet is very limited in functionality and impossible to make it the main application window.


Posted By: evoX
Date Posted: 09 August 2008 at 7:50pm
I am still trying to figure out how to make a TabControl with taskpanel customnavigator, the sample Samples\Controls\ProtpertySheet shows how to use a propertysheet with a taskpanel navigator, but this does not work for a tabcontrol


Posted By: Oleg
Date Posted: 11 August 2008 at 2:12am

Hi,

\TabControl can't be used with any navigator. Just add Taskanel and manually show hide child dialogs. without TabControl.


-------------
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