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" ?> <resource xmlns="wxwindows.org/wxxrc" version="2.3.0.1"> <object class="wxFrame" name="mainframe" subclass="ContactFrameUI"> <style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style> <size>574,336</size> <title>Contact Management</title> <object class="wxBoxSizer"> <orient>wxVERTICAL</orient> <object class="sizeritem"> <option>1</option> <flag></flag> <border>5</border> <object class="wxBoxSizer"> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="groupLabel"> <label>Contact Group:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxComboBox" name="groupCombo"> <tooltip>Select Group</tooltip> <value></value> <content /> </object> </object> <object class="spacer"> <option>1</option> <flag>wxEXPAND</flag> <border>5</border> <size>40,0</size> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="contactLabel"> <label>Contact:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxRIGHT</flag> <border>15</border> <object class="wxComboBox" name="contactCombo"> <value></value> <content /> </object> </object> </object> </object> <object class="sizeritem"> <option>1</option> <flag>wxEXPAND</flag> <border>5</border> <object class="wxFlexGridSizer"> <rows>6</rows> <cols>2</cols> <vgap>0</vgap> <hgap>0</hgap> <growablecols></growablecols> <growablerows></growablerows> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="companylabel"> <label>Company:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxTextCtrl" name="companyText"> <size>200,-1</size> <value></value> <maxlength>0</maxlength> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="phoneLabel:"> <label>Phone:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxTextCtrl" name="phoneText"> <size>125,-1</size> <value></value> <maxlength>0</maxlength> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="contactLabel"> <label>Contact Name:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxTextCtrl" name="contactText"> <size>200,-1</size> <value></value> <maxlength>0</maxlength> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxStaticText" name="addressLabel"> <label>Address:</label> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxTextCtrl" name="addressText"> <size>200,100</size> <value></value> <maxlength>0</maxlength> </object> </object> </object> </object> <object class="sizeritem"> <option>1</option> <flag>wxEXPAND</flag> <border>5</border> <object class="wxBoxSizer"> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxButton" name="addButton"> <label>Add Contact</label> <default>0</default> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxButton" name="updateButton"> <label>_Update Contact</label> <default>0</default> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxButton" name="deleteButton"> <label>_Delete Contact</label> <default>0</default> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxButton" name="clearButton"> <label>C_lear Form</label> <default>0</default> </object> </object> <object class="sizeritem"> <option>0</option> <flag>wxALL</flag> <border>5</border> <object class="wxButton" name="quitButton"> <label>E_xit</label> <default>0</default> </object> </object> </object> </object> </object> <object class="wxMenuBar" name="m_menubar1"> <label>MyMenuBar</label> <object class="wxMenu" name="m_File"> <label>_File</label> </object> <object class="wxMenu" name="m_data"> <label>_Data</label> <object class="wxMenuItem" name="m_datagroup"> <label>Contact Group</label> <help></help> </object> </object> </object> </object> </resource> Attachments: ruby-forum.com/attachment/3547/screenshot.jpg -- Posted via ruby-forum.com.
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. ;-) 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: <snip>> <object class="wxBoxSizer"> > <orient>wxVERTICAL</orient> > <object class="sizeritem"> > *<option>1</option> > * <flag></flag> > <border>5</border> > <object class="wxBoxSizer"> > <orient>wxHORIZONTAL</orient> > <object class="sizeritem"> > <option>0</option> > <flag>wxALL</flag> > <border>5</border> > <object class="wxStaticText" name="groupLabel"> > <label>Contact Group:</label> > </object> > </object></snip> You need to change that <option>1</option> to <option>0</option> 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 -- Mario Steele trilake.net ruby-im.net rubyforge.org/projects/wxruby rubyforge.org/projects/wxride -------------- next part -------------- An HTML attachment was scrubbed... URL: <rubyforge.org/pipermail/wxruby-users/attachments/20090405/26140431/attachment.html>
Michael Satterwhite
2009-Apr-05 15:12 UTC
[wxruby-users] Problem with spacing - Thank You, Mario
Mario Steele 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. > ;-)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 -- Posted via ruby-forum.com.