Kirix Support Forums

Docking Proportions

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

Docking Proportions

Postby mheanssgen on Fri Jan 13, 2006 9:47 am

I would like to say that wxAUI is the best and cleanest docking interface I have seen. Aside from that I have this question:

In 0.9.1 is there a way to set the proportion of the panes on a layer? I see that internally there is a dock_proportion var but it is not exposed outside wxAUI.

I quickly added a Proportion() method to wxPaneInfo to see how wxAUI would handle this and it initially sets the proportion of the panes correctly but as soon as the pane sash is dragged the pane snaps to an undesirable size (ie. 10 pixels or so)

Regards,
Mike
mheanssgen
Registered User
 
Posts: 6
Joined: Fri Jan 13, 2006 9:42 am

Postby Ben on Fri Jan 13, 2006 10:23 am

Good point. You are right when you say that we should support proportions externally.

Right now they are used internally to calculate fixed dimensions. The reason that your pane becomes so small when you drag it from one dock to another is because the other pane proportions in the destination dock are so large. Right now, panes are assigned an arbitrarily high proportion (100000 I think). This gives the panes a high resolution when translating from proportion measurements to fixed mesurements.

For now if you assigned a proportion of, say 20000 and 80000, you would get more satisfactory results.

What really needs to happen is a "proportion translation" when you drag a pane from one dock to another. I hadn't gotten around to coding that yet, but it was on my mind.

All the best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Postby mheanssgen on Fri Jan 13, 2006 10:57 am

Taking your suggestion, here is a very simple implementation that will allow proportionate docking while retaining the sizer precision. It assumes the standard way of specifying proportions (same as sizers). The problem with this is that large proportion values will overflow the internal integer value.

wxPaneInfo& Proportion(int proportion = 0) { dock_proportion = proportion * 100000; return *this; }

Mike
mheanssgen
Registered User
 
Posts: 6
Joined: Fri Jan 13, 2006 9:42 am

Return to wxAUI Questions, Thoughts & Feedback