By default the buttons are laid out like this:
but I want them laid out like this (this is an edited image)
Here is the C++ I am using:
Code: Select all
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/xrc/xmlres.h>
class MyApp : public wxApp {
public:
virtual bool OnInit();
};
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit() {
wxXmlResource::Get()->InitAllHandlers();
wxXmlResource::Get()->Load("res.xrc");
wxFrame* MainFrame = wxXmlResource::Get()->LoadFrame(NULL, "MainFrame");
if ( !MainFrame ) {
wxLogError("A file (res.xrc) required to run is missing!");
return false;
}
MainFrame->Show();
return true;
}
Code: Select all
<?xml version="1.0" ?>
<resource>
<object class="wxFrame" name="MainFrame">
<object class="wxBoxSizer" name="TopLevelSizer">
<orient>wxVERTICAL</orient>
<!-- Various sizeritems for other controls go here -->
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxButton">
<label>Should be on left</label>
</object>
</object>
<object class="sizeritem">
<object class="wxButton">
<label>Should be on left</label>
</object>
</object>
<object class="sizeritem">
<object class="wxButton">
<label>Should be on right</label>
</object>
</object>
</object>
</object>
</object>
</object>
</resource>