Robin Dunn wrote:
Stef Mientki wrote:
In the OnSize event of each AUI pane,
the controls on that form need to be adapted to the new width of the pane.
The code below looks quit straightforward,
for each component, get X-position, and adapt its witdh according to the panes width,
while leaving the height unchanged.Any particular reason why you are not using a sizer for the layout?
As these forms are generated dynamically from a graphical design,
I think it's much easier to generate plane coordinate codes instead of sizers.
def OnSize ( self, event ):
w, h = self.GetClientSize()
for item in self.Controls :
# C contains the control to be resized
C = self.Controls [item]
C[0].SetSize (( w - C[0].GetPosition()[0] - 5, C[0].GetSize()[1] ))Now the above code doesn't work very well, the following glitches were obeserved:
- some controls got there correct position and size only after resizing the pane (they reside on) three times or more
- some controls (like the slider, but not the slider value labels) disappeared completely after drag and docking the pane they reside onIt's possible that this is related to an optimization done on Windows where resizes and moves are deferred until all children have been sized/moved.
Yes that could explain the behavior.
And in the mean time I found out that my solution wasn't good enough, I still loose the height, so I have to store that too.
Can you provide a small runnable sample?
As soon as I've cleaned up the code,
I'm now just trying to make a quick and dirty "proof of concept" for my design,
I'll make an small example that hopefully shows these artifacts,
because it would be good to know the cause of this problem.
cheers,
Stef