Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Exception in TaskPanel custom theme (XTP 10.2)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Exception in TaskPanel custom theme (XTP 10.2)

 Post Reply Post Reply
Author
Message
VioletRose View Drop Down
Newbie
Newbie
Avatar

Joined: 16 June 2005
Location: Israel
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote VioletRose Quote  Post ReplyReply Direct Link To This Post Topic: Exception in TaskPanel custom theme (XTP 10.2)
    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.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
VioletRose View Drop Down
Newbie
Newbie
Avatar

Joined: 16 June 2005
Location: Israel
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote VioletRose Quote  Post ReplyReply Direct Link To This Post 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();

}

Back to Top
VioletRose View Drop Down
Newbie
Newbie
Avatar

Joined: 16 June 2005
Location: Israel
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote VioletRose Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
VioletRose View Drop Down
Newbie
Newbie
Avatar

Joined: 16 June 2005
Location: Israel
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote VioletRose Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2006 at 6:20am
Thanks, it helped.
 
Irit.
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.063 seconds.