Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - GetSysColor / SkinFramework (Bug?)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetSysColor / SkinFramework (Bug?)

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

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Topic: GetSysColor / SkinFramework (Bug?)
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 17 July 2006 at 12:43pm
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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2006 at 1:29pm
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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 17 July 2006 at 3:47pm
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
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.203 seconds.