Normally you add Toolbars like this:
header file ('MainFrm.h'):
.............
CMFCMenuBar m_wndMenuBar;
CMFCToolBar m_wndToolBar;
CMFCToolBar m_wndToolBar_Views3D;
CMFCToolBar m_wndToolBar_Export2D;
CMFCToolBar m_wndToolBar_Export3D;
.............
source file ('MainFrm.cpp'):.............
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Views3D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export2D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export3D.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
DockPane(&m_wndToolBar_Views3D);
DockPane(&m_wndToolBar_Export2D);
DockPane(&m_wndToolBar_Export3D);
.............
But this results in showing every toolbar on a new row .... :-(
It's very simple to change this to having all toolbars in one row,
just replace the code above (in 'MainFrm.cpp') with this one:
source file ('MainFrm.cpp'):
.............
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Views3D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export2D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export3D.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar_Export3D);
DockPaneLeftOf(&m_wndToolBar_Export2D, &m_wndToolBar_Export3D);
DockPaneLeftOf(&m_wndToolBar_Views3D, &m_wndToolBar_Export2D);
DockPaneLeftOf(&m_wndToolBar, &m_wndToolBar_Views3D);
.............
Now you have it in one row .... :-)
Keine Kommentare:
Kommentar veröffentlichen