[wxPython-users] (Yet another) sizer question
Andrea Gavana
andrea.gavana at gmail.com
Tue Jun 6 06:24:08 PDT 2006
Hello Frank,
I didn't follow the discussion too much, but you may eventually
try to achieve what you want by using PyAUI. The splitter/sash
functionalities are there, and you can specify if a subpanel can grow
or not, if it should have a fixed size or not and so on. I don't
really know if it is possible to do what you want because I don't have
your code here, but I think it's worth a try :-)
Andrea.
On 6/6/06, Frank Millman <frank at chagford.com> wrote:
> Peter Damoc wrote:
>
> > On 6/6/06, Frank Millman <frank at chagford.com> wrote:
>
> >> ...
> >>I was hoping that, if I drag the left-hand border to the left, the left
> pane
> >>would get bigger, and the right pane would stay the same. In fact, it is
> >>still the right pane that gets bigger, and the left pane stays the same.
> >>
> >>I think that this is how the native control works. For example, if I try
> >>this with Windows Explorer, it behaves in the same way.
> >>
> >>Is it possible to achieve what I want? To do so, I would need to detect
> that
> >>the left-hand border was being dragged, and then calculate a new position
> >>for the sash, but I have not seen an event that gives this information.
> >>
> >>The question is academic - I doubt if I would actually go to these lengths
> -
> >>but it would be interesting to know if it is possible.
> >>
> >>Any suggestions?
> >>
> >>Thanks
> >>
> >>Frank
>
> >You can do anything you want! Impossible is nothing.
> >Think about it like this... you can implement an algorithm that will
> compute sizes for the panels and use the available
> >API to create the visual representation that you need. All you have to do
> is bind event handlers to the relevant events >(size changes in frame, move,
> etc) and then track the values that you need like let's say size of the
> frame plus position >of the frame using local variables. Monitoring changes
> in both size and position you can take a decision on how to change >the
> inner panels sizes and then use the SplitterWindow API to put the splitter
> in its right position.
> >
> >Peter
>
> Hi Peter
>
> In principle I agree with you. However, I am still not sure how I would put
> my particular idea into practice.
>
> You can increase the width of a frame by dragging the left-hand border to
> the left, or by dragging the right-hand border to the right. My idea is
> that, if you drag a splitter window to the left, the left panel must grow
> and the right panel must remain static, and vice versa.
>
> I know that EVT_SIZE notifies you of a change in size, but it does not tell
> you how the change occurred. Is there any way that you can distinguish
> between the two scenarios? Thinking aloud, I guess you could store the
> position of the frame, and compare it with the new position after resizing.
> From that you should be able to deduce what the user actually did.
>
> Can you think of an easier way to achieve this?
>
> Thanks
>
> Frank
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
--
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
More information about the wxpython-users
mailing list