Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Controls flicker in resizing dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Controls flicker in resizing dialog

 Post Reply Post Reply
Author
Message
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Topic: Controls flicker in resizing dialog
    Posted: 16 December 2005 at 11:43am
I've got a resizing dialog (i.e. a dialog derived from CXTResizeDialog), and a number of my controls flicker when I resize them. I found CXTResizeGroupBox and that fixes the problem for group boxes.

The flicker still occurs for Tree controls and Check-list-boxes (which I use a LOT of in my application - so the flicker is quite noticable).

I tried using the CXTNoFlickerWnd, but when I tried it:

i.e.
writing this:
CXTNoFlickerWnd < CCheckListBox > m_list;
instead of:
CCheckListBox m_list;

The CCheckListBox did NOT draw properly (the background of the area below where there were checkboxes was grey, instead of white, and the area just a few pixels around the checkboxes didn't draw properly)

Is CXTNoFlickerWnd the proper class, and I'm just doing something slightly wrong, or should I be using something else ????
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: 18 December 2005 at 8:09am

Hi,

Some classes can't use CXTNoFlickerWnd  (see its sources to understand how it works).

for tree cotnrols you can use CXTTreeCtrl classes.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2005 at 12:02pm
Oleg,

1) Thanks for the info about the CXTTreeCtrl. All my trees are derived from one class, so that was a one line fix for me. Sweet!

2) Based on your comment above ("Some classes can't use CXTNoFlickerWnd") I didn't go down that road any further, but I still wanted to resolve my flickering issue.  My requirements for the checklistbox are the "simple" case (i.e. just a checkmark beside some text - no fancy drawing or images) Here is what I found:

i) The image on the right is the standard MFC CCheckListBox control. The drawing is correct, but it flickers when resized.

ii) The image on the left is the CXTCheckListBox. I tried using this in place of my CCheckListBox. It ASSERTed that it needed "variable" owner drawing, so I turned this on. Unfortunately the items are not being drawn correctly (the font is correct, the check boxes are the right size, but there is no space between the items).

iii) The image in the center, is from my derived class. All I did was tear out the ASSERT  (on line 228 of xtchecklistbox.cpp
void CXTCheckListBox::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
// Must be LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS    ASSERT((GetStyle() & (LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS)) ==

(LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS));

and set the control to "Fixed" Owner drawing. This mostly fixed the issue (i.e. there is no flickering), but the drawing is not quite the same as the standard control drawing:

a) The text is slightly too high, compared to the checkbox
b) The focus is not drawn around the checkmark, like the standard control.

These drawing issues are not a BIG deal for me, but I thought you should know about them.

My primary question here is: "is this the right way/control to go about solving the flicker for my CCheckListBoxes ?", and if so, can you remove the ASSERT that it must be Owner-draw variable, as owner-draw fixed seems to otherwise work.

Thanks

Warren






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: 19 December 2005 at 12:49am

Actually you can use CXTCheckListBox with OwnerDrawFixed and remove this assert

 

In the last version it looks like:

 // Must be LBS_OWNERDRAWVARIABLE or LBS_OWNERDRAWFIXED and LBS_HASSTRINGS
 ASSERT(GetStyle() & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE));
 ASSERT(GetStyle() & (LBS_HASSTRINGS));

So it was bug in previous versions.

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.047 seconds.