Problem with spacing


#1

I’m having the devil’s time trying to get things laid out correctly.
I’ve attached a screenshot so that you can get an idea of what I’m
seeing. I’ve got a very unattractive space under the two combo boxes,
and another one under the buttons. I don’t understand how to reduce
this.

I know it’s impossible to guess what idiocy I might have created.
Therefore, (even though I don’t like doing this) the .xrc file for this
screen follows. I want to thank everyone willing to look at this and
help teach this beginner with wxRuby. Here it is:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL 574,336 Contact Management wxVERTICAL 1 5 wxHORIZONTAL 0 wxALL 5 Contact Group: 0 wxALL 5 Select Group 1 wxEXPAND 5 40,0 0 wxALL 5 Contact: 0 wxRIGHT 15 1 wxEXPAND 5 6 2 0 0 0 wxALL 5 Company: 0 wxALL 5 200,-1 0 0 wxALL 5 Phone: 0 wxALL 5 125,-1 0 0 wxALL 5 Contact Name: 0 wxALL 5 200,-1 0 0 wxALL 5 Address: 0 wxALL 5 200,100 0 1 wxEXPAND 5 wxHORIZONTAL 0 wxALL 5 Add Contact 0 0 wxALL 5 _Update Contact 0 0 wxALL 5 _Delete Contact 0 0 wxALL 5 C_lear Form 0 0 wxALL 5 E_xit 0 MyMenuBar _File _Data Contact Group

#2

Hello Michael,

I went directly to your screenshot, and realized what the problem was
without even looking at your message. Then I went and read your
message.
:wink:

Anyways, the problem, is that your xrc has the problem, of telling your
wxHORIZONTAL box, to have a proportion of 1, which is what you get ,
cause
it’s taking up an even space between the three actual sizers you have in
your XRC Code.

The specific line in the XRC is here:

       <flag>wxALL</flag>
       <border>5</border>
       <object class="wxStaticText" name="groupLabel">
         <label>Contact Group:</label>
       </object>
     </object>

You need to change that 1 to 0 Which
handles the Proportion of your Horizontal box sizer. Once you do that,
you
should get the correct layout.

If your using wxFormBuilder, you can find this in the properties of the
wxHorizontal sizer, under the heading of sizeritem.

hth,

Mario


#3

Mario S. wrote:

Hello Michael,

I went directly to your screenshot, and realized what the problem was
without even looking at your message. Then I went and read your
message.
:wink:

Thank you VERY much.

I’m still trying to get the various options regarding spacers and sizers
into my head. I really appreciate you helping me here.

—Michael