wxWidgets 101 -17 Using AuiManager

Step 1. in mainframe ctor

    this->SetWindowStyleFlag(this->GetWindowStyleFlag() & ~wxTAB_TRAVERSAL);
    m_AuiManager.SetManagedWindow(this); //attach application main frame to AuiManager
    m_AuiManager.SetFlags(m_AuiManager.GetFlags() | wxAUI_MGR_ALLOW_ACTIVE_PANE | wxAUI_MGR_RECTANGLE_HINT);          //assign AuiManager style
    m_AuiManager.GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, wxAUI_GRADIENT_HORIZONTAL);       //setup arts for AuiManager
...

Step 2. after create controls (can be any)
...

    m_AuiManager.AddPane(xxx, wxAuiPaneInfo().
                Name(wxT("xxx")).
                Caption(_("xxx")).
                xxxPane().Top().LeftDockable(false).RightDockable(false));
...
    m_AuiManager.SetDockSizeConstraint(0.75, 0.75);
    m_AuiManger.Update()

Note: add tooltips to toolbar items

example:

    WxToolBar1->AddTool(idname, _T("idname"), m_ImageList->GetBitmap(idname_xpm_idx), _("tooltips text"), wxITEM_NORMAL);




你可能感兴趣的:(wxWidgets 101 -17 Using AuiManager)