Kirix Support Forums

Completely Newbie - wxAUI

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

Completely Newbie - wxAUI

Postby evstevemd on Sun Jan 24, 2010 9:50 am

Hello guys I want to use wxAUI manager and use it to manage frames with Notebooks in them.
The notebooks in turn have panels with amny other controls in the panel. I have never ever used this control so I have no Idea where to start! Please help me to get started, and If somenone can point me to very simple example (with may be three frames and one menu and one toolbar nothing else) I will appreciate.

Any other suggestion or help i welcomed
Cheers
Steve
evstevemd
Registered User
 
Posts: 5
Joined: Sun Jan 24, 2010 9:38 am

Re: Completely Newbie - wxAUI

Postby evstevemd on Sun Jan 24, 2010 10:07 am

I found example on wiki that someone pointed so I fiddled a bit on it.
Here is what I got. All I still don't know is if I cann add frames as I do to Panels/Notebooks. Also what is going on on mg_xxx? Second question is how do I add minimize/Maximize button apart from that x button?
Lastly do I just add menu to the frame containing manager? or there is separate Menu for wxAUI?

Thanks :)

Code: Select all
#include <wx/wx.h>
#include <wx/aui/aui.h>
#include <wx/notebook.h>

class MyFrame : public wxFrame {
public:
   MyFrame(wxWindow* parent) : wxFrame(parent, -1, _("wxAUI Test"),
                      wxDefaultPosition, wxSize(800,600),
                      wxDEFAULT_FRAME_STYLE)
   {
     // notify wxAUI which frame to use
     m_mgr.SetManagedWindow(this);

     // create several text controls
     wxNotebook* nb = new wxNotebook(this, wxID_ANY);
     wxTextCtrl* text1 = new wxTextCtrl(nb, -1, _("Pane 1 - sample text"),
                      wxDefaultPosition, wxSize(200,150),
                      wxNO_BORDER | wxTE_MULTILINE);

     wxPanel* pn = new wxPanel(nb, wxID_ANY);
     pn->SetBackgroundColour(wxT("red"));
     nb->AddPage(text1, wxT("This text Ctrl"));
     nb->AddPage(pn, wxT("This text Panel"));

     wxTextCtrl* text2 = new wxTextCtrl(this, -1, _("Pane 2 - sample text"),
                      wxDefaultPosition, wxSize(200,150),
                      wxNO_BORDER | wxTE_MULTILINE);

     wxTextCtrl* text3 = new wxTextCtrl(this, -1, _("Main content window"),
                      wxDefaultPosition, wxSize(200,150),
                      wxNO_BORDER | wxTE_MULTILINE);

     // add the panes to the manager
     m_mgr.AddPane(nb, wxLEFT, wxT("Pane Number One"));
     m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Number Two"));
     m_mgr.AddPane(text3, wxCENTER);

     // tell the manager to "commit" all the changes just made
     m_mgr.Update();
   }

   ~MyFrame()
   {
     // deinitialize the frame manager
     m_mgr.UnInit();
   }

private:
     wxAuiManager m_mgr;
};

  // our normal wxApp-derived class, as usual
class MyApp : public wxApp {
public:

   bool OnInit()
   {
     wxFrame* frame = new MyFrame(NULL);
     SetTopWindow(frame);
     frame->Show();
     return true;
   }
};

  DECLARE_APP(MyApp);
  IMPLEMENT_APP(MyApp);

evstevemd
Registered User
 
Posts: 5
Joined: Sun Jan 24, 2010 9:38 am

Return to wxAUI Questions, Thoughts & Feedback