Print Page | Close Window

Exception in TaskPanel custom theme (XTP 10.2)

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=4674
Printed Date: 10 November 2025 at 10:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Exception in TaskPanel custom theme (XTP 10.2)
Posted By: VioletRose
Subject: Exception in TaskPanel custom theme (XTP 10.2)
Date Posted: 27 July 2006 at 2:40pm
I've upgraded my application from XTP 9.60 to 10.20 (XTP 2006 Q2) and now it gets an exception because of the following code (which used to work fine):
SetTheme(xtpTaskPanelThemeCustom);
SetCustomTheme(new CCustomTaskPanelTheme));
Where CCustomTaskPanelTheme is derived from CXTPTaskPanelExplorerTheme
 
The exception is in file XTPTaskPanelPaintManager.cpp (1157):

int nAlpha = pGroup->IsExpanding() ? (255 * rc.Height()) / pGroup->GetExpandedClientHeight() : 255;

I'll appreciate any help.
 
Irit.



Replies:
Posted By: Oleg
Date Posted: 27 July 2006 at 6:41pm
Hello,
what inside CCustomTaskPanelTheme?
if you use it in our sample do you see same problme? if you don't use it in your application do you see it?


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


Posted By: VioletRose
Date Posted: 28 July 2006 at 5:11am
This is the code (2 functions):
 
 
CCustomTaskPanelTheme::CCustomTaskPanelTheme()
{

m_bExplorerTheme = true;

m_bBoldCaption = false;

m_bOfficeBorder = true;

m_clrBackground.SetCustomValue(RGB(255,255,255), RGB(255,255,255);

m_bLeftRoundedCorner = true;

m_bOfficeHighlight = true;

m_groupNormal.clrClient.SetStandardValue(RGB(243, 243, 243));

m_groupNormal.clrHead.SetStandardValue(RGB(224, 223, 227));

m_groupSpecial.clrClient.SetStandardValue(RGB(243, 243, 243));

m_groupSpecial.clrHead.SetCustomValue(RGB(0, 44, 151), RGB(196, 218, 50));

m_groupSpecial.clrHeadTextHot = m_groupSpecial.clrHeadTextNormal;

RefreshMetrics();

}

 

void CCustomTaskPanelTheme::RefreshMetrics()

{

CreateGripperBitmaps();

}



Posted By: VioletRose
Date Posted: 28 July 2006 at 5:13am

As to your other 2 questions:

I didn't try using this in your application.
If I remove the call then I don't get exception, but the application looks bad (obviously).
 
Irit.


Posted By: Oleg
Date Posted: 28 July 2006 at 12:48pm
Hi,
Try move code from constructor to refreshmetrics and call base class refreshmetrics:
 
class CCustomTaskPanelTheme : public CXTPTaskPanelExplorerTheme
{
public:
 CCustomTaskPanelTheme();
 void RefreshMetrics();
};
CCustomTaskPanelTheme::CCustomTaskPanelTheme()
{
}

void CCustomTaskPanelTheme::RefreshMetrics()
{
 CXTPTaskPanelExplorerTheme::RefreshMetrics();
 
 m_bExplorerTheme = true;
 
 m_bBoldCaption = false;
 
 m_bOfficeBorder = true;
 
 m_clrBackground.SetCustomValue(RGB(255,255,255), RGB(255,255,255));
 
 m_bLeftRoundedCorner = true;
 
 m_bOfficeHighlight = true;
 
 m_groupNormal.clrClient.SetStandardValue(RGB(243, 243, 243));
 
 m_groupNormal.clrHead.SetStandardValue(RGB(224, 223, 227));
 
 m_groupSpecial.clrClient.SetStandardValue(RGB(243, 243, 243));
 
 m_groupSpecial.clrHead.SetCustomValue(RGB(0, 44, 151), RGB(196, 218, 50));
 
 m_groupSpecial.clrHeadTextHot = m_groupSpecial.clrHeadTextNormal;
 CreateGripperBitmaps();
 
}
 
At least this code works with TaskPanel sample...
 
You never call base RefreshMetrics so caption font was not created...


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


Posted By: VioletRose
Date Posted: 30 July 2006 at 6:20am
Thanks, it helped.
 
Irit.



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