Expand an wxChoice object from xrc file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Expand an wxChoice object from xrc file

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

  <object class="wxPanel" name="panel1">
   
<object class="wxBoxSizer">
     
<orient>wxHORIZONTAL</orient>
     
<object class="sizeritem">
       
<object class="wxBoxSizer">
   
         
<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.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Expand an wxChoice object from xrc file

Tim Roberts
On Mar 24, 2017, at 3:40 PM, [hidden email] wrote:

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

  <object class="wxPanel" name="panel1">
   
<object class="wxBoxSizer">
     
<orient>wxHORIZONTAL</orient>
     
<object class="sizeritem">
       
<object class="wxBoxSizer">
   
         
<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?

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, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Expand an wxChoice object from xrc file

robert.pelson1
Thanks Tim, you were right!

Robert.

On Mar 24, 2017, at 3:40 PM, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1fjfMdtTAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">robert....@... wrote:

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

  <object class="wxPanel" name="panel1">
   
<object class="wxBoxSizer">
     
<orient>wxHORIZONTAL</orient>
     
<object class="sizeritem">
       
<object class="wxBoxSizer">
   
         
<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?

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, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1fjfMdtTAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.