Search code examples
c++layoutwxwidgets

How to make '3 part' splitter window in wxWidgets?


I want to create 3 parts in a window or panel. All the 3 Parts should have possibility to resized by user and be automatically resized when user change size of Main window. Its something like 3 panels added to vertical box sizer, but user can resize all of three parts. I can add up to 2 panels to wxSplitterWindow.

Im working with C++, wxWidgets and wxFormBuilder.


Solution

  • Can you use wxAuiManager?

    You could use this to create 'panels' (for lack of a better word) that can be resized and moved around (even undocked and floated). For you it would look something like:

    wxAuiManager * pManager; // a pointer to the manager for the wxFrame
    wxWindow * pPanel1;
    wxWindow * pPanel2;   // the 3 panels you want to add
    wxWindow * pPanel3;   // they can be wxPanel's or any window
    
    // Add the panels to the window
    pManager->AddPane(pPanel1,wxAuiPaneInfo().Top());
    pManager->AddPane(pPanel2,wxAuiPaneInfo().Centre());
    pManager->AddPane(pPanel3,wxAuiPaneInfo().Bottom());
    

    Hopefully this works for you.