Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Resize display issue of scroll bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Resize display issue of scroll bar

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Resize display issue of scroll bar
    Posted: 12 February 2008 at 4:56pm
I have a task panel inside a docking pane. It is hosted by the dialog inserted into the pane that is its parent window.
 
When the user resizes the docking pane to make it narrower, if the panel has a scroll bar, the display is not correct after the resize. My resizing is not constant (no update until I release the mouse).
 
In my dialog's (the parent) OnSize, I resize the taskpanel and then do the following:
 
m_TaskPanel.Reposition(FALSE);
m_TaskPanel.Invalidate();
m_TaskPanel.UpdateWindow();
 
I have tried passing TRUE to Reposition. I have also tried calling the panel's Redraw method.
 
When the panel is stretched, I have no issue but when it is made narrower, if the panel has a scroll bar, the area for the scroll bar is not refreshed correctly.
 
How do I have the panel update the scroll bar too?
 
I am adding an image. In the image on the left one can see the panel before resizing. The middle image is after the resize occurs. The blue "scroller" that one can click on to scroll is not realy there (note the missing "arrow" at the top of the scroll bar and part of the group header that appears where the arrow should be). That is, if I click on it and try to drag it nothing happens. I have to force the app to update the window (by swithing to another app and back) or resize again to be slightly larger for the display to correct itself. The image on the right is the display if I simply resize to be a pixel or two bigger (apparently any width increase fixes the issue).
 
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: 13 February 2008 at 1:16am
Hi,
Think its something in your code. I never saw same :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2008 at 12:12pm
You are correct. When I called SetWindowPos, I was adding SWP_NOREDRAW to the flags argument.
 
I was doing that to both a dialog I have at the top of my docking pane and the task panel I have under the dialog.
 
I then called the Reposition(FALSE), Invalidate and UpdateWindow() on the task panel after the SetWindowPos calls. But the task panel doesn't seem to cause the scroll bars to redisplay.
 
So I removed the SWP_NOREDRAW flag and the calls to repostion, invalidate and update the window since I could not figure out how to force the scroll bar to redisplay.
 
The user can see a bit of flashing but when all is done the display is correct.
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: 14 February 2008 at 1:06am

ok :)

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2008 at 5:26pm
Update: My change produced lots and lots of flashing. I could briefly see all the controls display starting about halfway down the panel so that I was seeing "double".
 
I eventually tripped upon adding the SWP_NOCOPYBITS flag to the SetWindowPos call.
 
That took care of all the flashing I saw (and was originally trying to avoid using the no redraw call).
 
Things move much more smoothly (except on Vista but that's yet another post).
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.141 seconds.