[wxPython] Using BoxSizer.Remove/Add

Hi,
I have a small application (developing) and I would like to provide the following UI feature to the operator.

An object is presented in a dialog. The object (and the corresponding dialog) consists of two sets (groups) of attributes. Each group in the dialog is created using a BoxSizer. In addition to the two BoxSizers, the dialog contains a BoxSizer containing some buttons (OK, CANCEL, HELP) - at the bottom of the dialog. I would like to let the operator have a button which will toggle (on/off) the presentation of (say) the second BoxSizer. In this way the operator may choose not to see the second set of attributes. I've partly managed this by using the wxWindow.Show method with a false parameter on each control (wx) contained in the BoxSizer and then finally use the method Remove. Then calling the methods to 'refit' the remaining BoxSizers into the dialog. This seems to work. However - when I want to reinsert the set I've had to recreate all the controls and the BoxSizer. Is there any easier way to do this - like keeping a reference to the removed BoxSizer and just add it
back in (also, I have to add it into the second (of three) positions).

Thanks for any help.
Nikolai

PS: I know I could use the 'card' feature, but I would like to be able to have all attributes presented simultaneously.

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

I havn't done anything like this yet, so take my answer as just an educated
guess...

You might try putting the hide-able part of the dialog on its own panel,
then you should just have to Show/Hide the panel to show/hide the whole
group. If the panel does it's own layout then you can just add the panel to
the overall sizer, and when you hide the panel do something like this:

    bigSizer.SetItemMinSize(panel, 0, 0)

and when the panel is shown:

    panelSizer.Fit(panel)
    w, h = panel.GetSize()
    bigSizer.SetItemMinSize(panel, w, h)

Hope this helps!

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

----- Original Message -----
From: "Nikolai Kirsebom" <nikolai@micon.no>
To: "wxPython List (E-mail)" <wxpython-users@lists.sourceforge.net>
Sent: Sunday, March 11, 2001 1:42 PM
Subject: [wxPython] Using BoxSizer.Remove/Add

Hi,
I have a small application (developing) and I would like to provide the
following UI feature to the operator.

An object is presented in a dialog. The object (and the corresponding
dialog) consists of two sets (groups) of attributes. Each group in the
dialog is created using a BoxSizer. In addition to the two BoxSizers, the
dialog contains a BoxSizer containing some buttons (OK, CANCEL, HELP) - at
the bottom of the dialog. I would like to let the operator have a button
which will toggle (on/off) the presentation of (say) the second BoxSizer.
In this way the operator may choose not to see the second set of attributes.
I've partly managed this by using the wxWindow.Show method with a false
parameter on each control (wx) contained in the BoxSizer and then finally
use the method Remove. Then calling the methods to 'refit' the remaining
BoxSizers into the dialog. This seems to work. However - when I want to
reinsert the set I've had to recreate all the controls and the BoxSizer. Is
there any easier way to do this - like keeping a reference to the removed
BoxSizer and just add it back in (also, I have to add it into the second (of
three) positions).

Thanks for any help.
Nikolai

PS: I know I could use the 'card' feature, but I would like to be able to
have all attributes presented simultaneously.

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users