Hi !
I have the following REDRAW problem:
I have a main dialog (shown MODAL).
The main dialog may call a sub dialog (MODAL) which has a TAB control.
Each TAB has one dialog (MODELESS) displaying a tree view. As in some sample code, they do *not* have separate DIALOG DOEVENTS message pumps.
The tree view items have context menus (right click !), calling other dialogs (editors, list tools, a.s.o - all MODAL (to avoid that two editors are opened at the same time))
MODAL dialogs have the %WS_CLIPSIBLINGS property, MODELESS dialogs have the %WS_CLIPCHILDREN property.
The whole thing is a database manager.
Now:
On the first right click on a tree view item the menu is displayed, the selected tool is started, the area under the context menu is redrawn and when the tool is closed, the portion of the tree view covered by the tool is redrawn as well. Everything seems to be perfect.
On a second (and all subsequent) right clicks everything can still be used but *nothing* is redrawn! Grey rectangles remain, where parts of the MODELESS dialog have been covered.
I added a DIALOG REDRAW (redrawing the MODELESS dialog) to the code of the tools. It is added after the DIALOG END of the tool.
Now, on the second and all subsequent right clicks, when closing the tool, the area which was under the context menu *is* redrawn, but the area of the tree view covered by the tool itself is *not*.
And to make things a little more complex:
With the DIALOG REDRAW added I can get everything redrawn upon closing of the tools, if I first left-click on a tree view item before I right click to bring up the context menu. How ? At the time of the left click, it is completely unknown, which tool is going to be displayed where. I am not processing the left click. What happens, must happen behind the scenes...?
Without the DIALOG REDRAW added, additional left clicking has no effect.
I experimented with DIALOG REDRAW, CONTROL REDRAW, %WS_CLIPSIBLINGS, %WS_CLIPCHILDREN, DIALOG DOEVENTS message pumps in various positions in my code - without any positive effect.
Unfortunately the code is to lengthy to post it here.
Still - does somebody have a bright idea, what else I could try. Or does somebody know a good (easy to understand) documentation on REDRAW issues in MODAL / MODELESS dialogs or a link to some possible help ?
I cannot believe, there is no solution for this !
Thanks !
Christian Grimsel
I have the following REDRAW problem:
I have a main dialog (shown MODAL).
The main dialog may call a sub dialog (MODAL) which has a TAB control.
Each TAB has one dialog (MODELESS) displaying a tree view. As in some sample code, they do *not* have separate DIALOG DOEVENTS message pumps.
The tree view items have context menus (right click !), calling other dialogs (editors, list tools, a.s.o - all MODAL (to avoid that two editors are opened at the same time))
MODAL dialogs have the %WS_CLIPSIBLINGS property, MODELESS dialogs have the %WS_CLIPCHILDREN property.
The whole thing is a database manager.
Now:
On the first right click on a tree view item the menu is displayed, the selected tool is started, the area under the context menu is redrawn and when the tool is closed, the portion of the tree view covered by the tool is redrawn as well. Everything seems to be perfect.
On a second (and all subsequent) right clicks everything can still be used but *nothing* is redrawn! Grey rectangles remain, where parts of the MODELESS dialog have been covered.
I added a DIALOG REDRAW (redrawing the MODELESS dialog) to the code of the tools. It is added after the DIALOG END of the tool.
Now, on the second and all subsequent right clicks, when closing the tool, the area which was under the context menu *is* redrawn, but the area of the tree view covered by the tool itself is *not*.
And to make things a little more complex:
With the DIALOG REDRAW added I can get everything redrawn upon closing of the tools, if I first left-click on a tree view item before I right click to bring up the context menu. How ? At the time of the left click, it is completely unknown, which tool is going to be displayed where. I am not processing the left click. What happens, must happen behind the scenes...?
Without the DIALOG REDRAW added, additional left clicking has no effect.
I experimented with DIALOG REDRAW, CONTROL REDRAW, %WS_CLIPSIBLINGS, %WS_CLIPCHILDREN, DIALOG DOEVENTS message pumps in various positions in my code - without any positive effect.
Unfortunately the code is to lengthy to post it here.
Still - does somebody have a bright idea, what else I could try. Or does somebody know a good (easy to understand) documentation on REDRAW issues in MODAL / MODELESS dialogs or a link to some possible help ?
I cannot believe, there is no solution for this !
Thanks !
Christian Grimsel
Comment