![]() |
Controls flicker in resizing dialog |
Post Reply ![]() |
Author | |
Warren ![]() Groupie ![]() ![]() Joined: 23 February 2005 Status: Offline Points: 64 |
![]() ![]() ![]() ![]() ![]() 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 ???? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Warren ![]() Groupie ![]() ![]() Joined: 23 February 2005 Status: Offline Points: 64 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 So it was bug in previous versions. |
|
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 |