Expand an wxChoice object from xrc file

Hi,
I have this piece of xrc file, used to build the gui:

wxHORIZONTAL
      <object class="sizeritem">
        <object class="wxBoxSizer">

          <orient>wxVERTICAL</orient>

          <object class="sizeritem">
            <object class="wxStaticText">
            <label>Item:</label>
          </object>
          <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag>
          <ratio>0</ratio>
        </object>

        <object class="sizeritem">
          <object class="wxChoice" name="SelectItem">
            <label>Select item</label>
          </object>
          <flag>wxALL|wxEXPAND|wxALIGN_CENTRE</flag>
          <ratio>0</ratio>
        </object>

``

The problem is that the` wxChoice object doesn’t expand.
Any idea?

Thank you very much.```

Are you editing this file by hand? Because the nesting here does not seem to be correct. You have:

horizontal box sizer

sizer item #1

box sizer (unknown orientation)

sizer item #2

vertical box sizer

sizer item #3

static text

sizer item #4

wxChoice

The problem here (which is difficult to see with the spacing) is that the wxChoice sizer item #4 is nested inside sizer item #2. The sizer items should all be peers of each other, and each sizer item should contain exactly one control. I can’t tell what layout you’re really looking for here; is the wxChoice supposed to be inside of the vertical box sizer, or in the outer one? And why do you have the extra sizer inside the horizontal box?

···

On Mar 24, 2017, at 3:40 PM, robert.pelson1@gmail.com wrote:

I have this piece of xrc file, used to build the gui:

wxHORIZONTAL
      <object class="sizeritem">
        <object class="wxBoxSizer">

          <orient>wxVERTICAL</orient>

          <object class="sizeritem">
            <object class="wxStaticText">
            <label>Item:</label>
          </object>
          <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag>
          <ratio>0</ratio>
        </object>

        <object class="sizeritem">
          <object class="wxChoice" name="SelectItem">
            <label>Select item</label>
          </object>
          <flag>wxALL|wxEXPAND|wxALIGN_CENTRE</flag>
          <ratio>0</ratio>
        </object>

``

The problem is that thewxChoice object doesn't expand. Any idea?

Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim, you were right!

Robert.

···

On Mar 24, 2017, at 3:40 PM, robert....@gmail.com wrote:

I have this piece of xrc file, used to build the gui:

wxHORIZONTAL
      <object class="sizeritem">
        <object class="wxBoxSizer">

          <orient>wxVERTICAL</orient>

          <object class="sizeritem">
            <object class="wxStaticText">
            <label>Item:</label>
          </object>
          <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag>
          <ratio>0</ratio>
        </object>

        <object class="sizeritem">
          <object class="wxChoice" name="SelectItem">
            <label>Select item</label>
          </object>
          <flag>wxALL|wxEXPAND|wxALIGN_CENTRE</flag>
          <ratio>0</ratio>
        </object>

``

The problem is that thewxChoice object doesn't expand. Any idea?

Are you editing this file by hand? Because the nesting here does not seem to be correct. You have:

horizontal box sizer

sizer item #1

box sizer (unknown orientation)

sizer item #2

vertical box sizer

sizer item #3

static text

sizer item #4

wxChoice

The problem here (which is difficult to see with the spacing) is that the wxChoice sizer item #4 is nested inside sizer item #2. The sizer items should all be peers of each other, and each sizer item should contain exactly one control. I can’t tell what layout you’re really looking for here; is the wxChoice supposed to be inside of the vertical box sizer, or in the outer one? And why do you have the extra sizer inside the horizontal box?

Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.