I’m trying to put a toolbar in a resizable dialog. In the resource I have:
IDD_DOX_LIST DIALOGEX 0, 0, 296, 222
STYLE DS_SETFONT | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Measurement List"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "Incr",IDC_BTN_DEC_INCR,"Button",BS_OWNERDRAW | WS_TABSTOP,4,28,16,14
CONTROL "Decr",IDC_BTN_DEC_DECR,"Button",BS_OWNERDRAW | WS_TABSTOP,20,28,16,14
CONTROL "Print",IDC_BTN_PRINT_DOX,"Button",BS_OWNERDRAW | WS_TABSTOP,42,28,16,14
COMBOBOX IDC_CMB_DRAG_LINK,62,28,135,64,CBS_DROPDOWNLIST | WS_TABSTOP,WS_EX_CLIENTEDGE
CONTROL "Float",IDC_BTN_FLOAT_DOX,"Button",BS_OWNERDRAW | WS_TABSTOP,239,28,50,14
GROUPBOX "",IDC_ST_BTNS,1,23,292,20,WS_DISABLED
CONTROL "",IDC_GRID_DOX,"RGuiRoot",WS_CLIPCHILDREN | WS_TABSTOP,1,46,292,162
CONTROL "",IDR_DOXLST_BAR,"ProfUIS-ControlBar",WS_DLGFRAME | 0x2034,0,0,294,14
END
and
IDR_DOXLST_BAR TOOLBAR 16, 16
BEGIN
BUTTON ID_DOXLST_DEC_INCR
BUTTON ID_DOXLST_DEC_DECR
SEPARATOR
BUTTON ID_DOXLST_PRINT
SEPARATOR
BUTTON ID_DOXLST_CMB_DRAG
SEPARATOR
BUTTON ID_DOXLST_FLOAT
END
In OnInitDIalog I have the following:
CExtNCW<CExtResizableDialog>::OnInitDialog();
m_wndToolBar.LoadToolBar(IDR_DOXLST_BAR);
RepositionBars(0, 0xFFFF, IDR_DOXLST_BAR);
RepositionBars is also called in OnSize()
The toolbar appears but it takes up the entire height of the dialog.
ALSO, how do I set the toolbar button status? Do I just add ON_UPDATE_COMMAND_UI entires to the dialog message map?
I’m guessing on the style flags in the ProfUIS-ControlBar. I just copied it from examples.