Ed Leafe wrote:

2) If so, do I create any new sizers inside the pre-created sizer and leave the pre-created sizer alone?


As the Designer exists now, you would have to add a dPanel to the initial sizer. Then add a sizer to that panel, and proceed from there.

Ok, that is good to know. However, if I am going to add a dPanel immediately then I don't see what the purpose of the initial sizer is as the dPanel resizes automatically to fit the form, doesn't it?

What I'd really like to do is add that form-level panel automatically. This is an artifact of the wxWidgets design, and IMO should not have to be done by the user. For example, if you set the BackColor of the form, it should affect this 'main panel', too, since a form (as it's a wx.Frame) cannot have a BackColor.

Can anyone think of a reason why this should not be done (at least as a default behavior)? What I'm thinking of is that this panel would be handled by the framework, so that the user never has to think about it (at least when using the Designer). If you code by hand, well, then you have to handle it yourself, but if you use the Designer, the panel is added for you without even showing up in the Designer or even the .cdxml file.

This seems to make sense, but why doesn't wxWidgets work this way?

Presumably because there is some legitimate use for a wxFrame without an embedded wxPanel. I don't know enough about wxWidgets to know what that might be, but IIRC Java/Swing has a similar mechanism - but with different names - so I suspect that there is something there.

My imperfect understanding is that you need a wxPanel because wxFrame will always resize its first control to fit the wxFrame so you put a wxPanel in it which gets resized. Controls within a wxPanel do not get automatically resized like this so things work as you would expect them to do. If this is true then I guess that you could use any suitable container instead of wxPanel so maybe this is why the wxFrame and wxPanel are separated - you could choose a different top-level container.

Most (pretty much all?) of the time you choose a wxPanel so maybe the dabo Designer should do this and stick a one pane sizer[*] inside the panel instead of the form. If you do this then anyone who wants a different top-level container could either delete the panel and its sizer, or place their new container inside the panel sizer and have it resize the embedded container. There would be a wasted panel here but I don't know if that is a problem.

[*] It might be nice to tell users in some way that they are probably going to want to change this sizer before dropping controls onto it.

Of course, I don't really know what I am talking about.


Don.


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to