Print Page | Close Window

CCheckListBox draws with mixed themes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=24596
Printed Date: 21 August 2025 at 4:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CCheckListBox draws with mixed themes
Posted By: rdhd
Subject: CCheckListBox draws with mixed themes
Date Posted: 21 August 2025 at 9:52am
When we apply our skin and display a CDialog that has a CCheckListBox in it we initially see the skin applied to all the items in the list box. But scroll the mouse wheel and the items draw incorrectly. The items draw using the system theme. Checking and unchecking items result in them redrawing using the skin. I thought CJ skinning was categorized as Visual C++ MFC meaning it works well with MFC. CCheckListBox is a MFC class but it does do custom drawing. In the image I am going to (try) and paste here one can see our theme background and the theme text color. But the "View 1" checked box is drawn using the system theme. "Front" is not checked and is using the system theme. "Back" is checked and uses the skin (yes the check box is quite pixelized as we wait and hope for SVG support for check/radio button). The other white boxes are system themed. "Dimetric" is unchecked and using our skin. I got this image by launching the dialog and then checking elements. Then I scrolled. After that I unchecked and checked "Back" and then unchecked "Dimetric".

How do I address this issue?





Replies:
Posted By: rdhd
Date Posted: 21 August 2025 at 10:00am
Here is an image of the dialog when first launched and then right after I scroll the mouse wheel.




Posted By: rdhd
Date Posted: 21 August 2025 at 12:28pm
I found that scrolling the view resulted in OnHookDrawThemeBackground to bypass the skinning code because the DC has no hWnd associated with it and IsDCSkinned(hDC) returned FALSE. I have to apply the xtpSkinApplyDCs skin option before invoking the dialog. Unfortunately for me, that causes all windows to repaint when I apply it and also when I remove it. Apparently I never set that option when we start up because when I first worked with skins, it wasn't available. And we decided back then to not use CJ skinning as we were just experimenting with them.

Basically our app originally set the same options CJ does in the skin manager ctor and I used that to change the options to observe the skinning effects.

I also see a xtpSkinApplyCommandBarsFrame option is now available. But we skin the frame and CJ indicates the two are incompatible.



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