Page 1 of 1

AuiManger 4-way split screen

Posted: Wed Jul 31, 2019 3:49 pm
by bandali99
I am creating a 4-split screen using AUI (i know its easier with wxsplitterwindow but I am told to use Aui). I have my items on the frame however I am not able to split them evenly in the way I want. I want each textbox to occupy a corner of the screen.

here is the code that deals with the positioning, if anyone has any ideas that would be awesome

Code: Select all

		m_mgr.AddPane(text1, wxLEFT, wxT("Pane Number One"));
		m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Number Two"));
		m_mgr.AddPane(text3, wxCENTER);
		m_mgr.AddPane(text4, wxBOTTOM | wxRIGHT);


Re: AuiManger 4-way split screen

Posted: Wed Jul 31, 2019 4:52 pm
by doublemax
I want each textbox to occupy a corner of the screen.
To be clear: This layout can be done easily with sizers only. You only need additional controls when you want to make it user-resizable.

I'm not a wxAUI expert (actually i've never used it myself in 15 years), but i don't think you can create a "real" 4-way splitter with wxAUI (someone correct me if i'm wrong).

This is the best i could come up with:

Code: Select all

MyFrame::MyFrame(wxWindow* parent) : wxFrame(parent, -1, _("wxAUI Test"),
                                              wxDefaultPosition, wxDefaultSize,

  m_mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT);

  wxPanel *panel1 = new wxPanel(this, wxID_ANY); panel1->SetBackgroundColour(*wxRED);
  wxPanel *panel2 = new wxPanel(this, wxID_ANY); panel2->SetBackgroundColour(*wxGREEN);
  wxPanel *panel3 = new wxPanel(this, wxID_ANY); panel3->SetBackgroundColour(*wxBLUE);
  wxPanel *panel4 = new wxPanel(this, wxID_ANY); panel4->SetBackgroundColour(*wxYELLOW);

  m_mgr->AddPane(panel1, wxAuiPaneInfo().Name(_T("Pane11 Name")).Caption(_("Panel1 caption")).Center().Row(0).Position(0).Resizable().CloseButton(false));
  m_mgr->AddPane(panel2, wxAuiPaneInfo().Name(_T("Pane12 Name")).Caption(_("Panel2 caption")).Center().Row(0).Position(1).Resizable().CloseButton(false));
  m_mgr->AddPane(panel3, wxAuiPaneInfo().Name(_T("Pane13 Name")).Caption(_("Panel3 caption")).Center().Row(1).Position(0).Resizable().CloseButton(false));
  m_mgr->AddPane(panel4, wxAuiPaneInfo().Name(_T("Pane14 Name")).Caption(_("Panel4 caption")).Center().Row(1).Position(1).Resizable().CloseButton(false));

You'll see its limitation immediately if you run it.