GetSysColor / SkinFramework (Bug?) |
Post Reply |
Author | |
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
Posted: 17 July 2006 at 10:55am |
If skinning is disabled for a window GetSysColor (COLOR_3DFACE) still returns the color the item would get if it's skinned.
The hook function should check wheter the window is skinned or not.
|
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
How do you see it? GetSysColor is global function, how skinmanager can determine what window you want to draw?
As solution remove xtpSkinApplyColors from ApplyOptions:
XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics | xtpSkinApplyFrame);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Here is a screenshot of the sheet with skinning disabled. The Grid calls GetSysColor to get the color for the fixed cells. It's the same with the list control on the left.
If I remove the xtpSkinApplyColors flag the list control is drawn correctly, but GetSysColor still return the wrong color.
DWORD dwApplyOptions = XTPSkinManager()->GetApplyOptions ();
XTPSkinManager()->SetApplyOptions(dwApplyOptions & ~xtpSkinApplyColors); sheet.DoModal ();
XTPSkinManager()->SetApplyOptions(dwApplyOptions);
I've also noticed several other bugs with the SkinFramework.
The above code causes an assertion in CXTPSkinManagerApiHook::OnHookLoadLibraryA because GetInstance()->GetHookedFunction(xtpSkinApiLoadLibraryA); returns NULL the first time OnHookLoadLibrary is beeing called after disabling skinning / settings apply options.
I'm using the popular MFCGridCtrl and if skinning is applied and then a scrollbar arrow pressed the grid only scrolls once but doesn't keep scrolling until the button is released. So you've to click/release, click/release to scroll through the grid.
If I disable skinning with XTPSkinManager()->SetAutoApplyNewWindows (FALSE); before showing the sheet and then press the arrow button the grid keeps scrolling but the scrollbar doesn't move.
If I don't load a skin everything works correctly, you press an arrow button and the grid start and keeps scrolling whilst the scrollbar moves up or down.
|
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
easy to fix MFCGridCtrl than disable this window for SkinFramework :)
in void CGridCtrl::OnTimer(UINT nIDEvent)
replace
if (nIDEvent != WM_LBUTTONDOWN)
return;
to
if (nIDEvent != WM_LBUTTONDOWN)
{ CWnd::OnTimer(nIDEvent); return;} |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |