Possibly these would be better asked at wxformbuilder.org, but that seems to be down this evening, and I'm hoping someone here will happen to know the answer.
I'm still a newbie to wx, but I was able to successfully make a search window that has a right-aligned SearchCtrl at the top, a big stretchy listbox in the middle, and a left-aligned GenButton and a record count at the bottom. Tonight I tried to recreate this layout using XRC and wxFormBuilder, but I've met only mixed success.
First the SearchCtrl: wxFormBuilder doesn't seem to have this in its control palette, so I added a TextCtrl, and then changed the "subclass" name to wxSearchCtrl. This makes it appear like a SearchCtrl, except that peeking out behind the actual search field, there is a boxy border. This doesn't happen when I create the SearchCtrl myself in code, and it looks ugly. What did I do wrong?
Also, there was nothing in the palette for the buttons.GenButton I want at the bottom (to get a square bevel button). I tried adding a generic control and setting the class to buttons,GenButton, but this just generated errors. How would I do that?
Next, I couldn't get the static text at the bottom of the screen to be center-aligned between the button on its left, and the right side of the window. In code, I had to add wx.ST_NO_AUTORESIZE. But this flag doesn't appear to be available in wxFormBuilder. I tried wxFIXED_MINSIZE instead, but it doesn't seem to work.
Finally, a more general wx question: in order to get the search field right-aligned, I added a StaticText to the left of it with no label, wx.EXPAND | wx.RIGHT set, and proportion = 1. The search field has a fixed size and proportion = 0. Using a blank StaticText for this seems hackish, but without it, the search field would appear on the left in its horizontal box sizer, despite having wx.ALIGN_RIGHT | wx.ALL (or any other likely combination of flags). Is there a better way to get a control to "stick" to the right side of the window?
I'm appending the XRC code in case anyone wants to follow along at home. At the moment, I'm about ready to give up on XRC (or at least on wxFormBuilder) and just write my GUIs in code, as in my simple test at least, that went much faster and more successfully. But if anyone here has advice to get me past these initial hurdles, I'd appreciate it.
Thanks,
- Joe
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
<object class="wxFrame" name="etown_GUI">
<style>wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL</style>
<size>700,400</size>
<title>eTown Members</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxEXPAND|wxLEFT|wxRIGHT</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALIGN_RIGHT|wxRIGHT</flag>
<border>5</border>
<object class="wxTextCtrl" name="search" subclass="wxSearchCtrl">
<size>386,20</size>
<value></value>
<maxlength>0</maxlength>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxListCtrl" name="list_CTRL">
<style>wxLC_REPORT</style>
<size>700,-1</size>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxEXPAND|wxLEFT|wxRIGHT</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALIGN_BOTTOM|wxALIGN_LEFT|wxALL</flag>
<border>5</border>
<object class="wxButton" name="m_button2">
<bg>#cccccc</bg>
<label>+</label>
<default>0</default>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALIGN_CENTER|wxALL|wxFIXED_MINSIZE|wxLEFT|wxRIGHT</flag>
<border>5</border>
<object class="wxStaticText" name="m_staticText2">
<label>0 records</label>
</object>
</object>
</object>
</object>
</object>
</object>
</resource>