Resize display issue of scroll bar |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
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).
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Think its something in your code. I never saw same :(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok :) |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
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).
|
|
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 |