Тема: Добавление ComboBox и других контролов на панель инструментов
Здравствуйте!
Ниже пример из samples добавляющий панель инструментов с кнопками, а как добавить не просто кнопку, а какой-нибудь контрол (ComboBox, EditBox) и после как можно получать сообщения от этого контрола?????
void CreateToolbars()
{
IAcadMenuGroup *mnuGrp = NULL;
if (!getAcadMenuGroup(&mnuGrp))
return ;
//now get all the popup menus
IAcadToolbars *tlbrs = NULL;
HRESULT hr = S_OK;
hr = mnuGrp->get_Toolbars(&tlbrs);
mnuGrp->Release();
//let us create toolbars for polysamp
IAcadToolbar *tlbr = NULL;
hr = tlbrs->Add(L"POLYSAMP APPLICATION", &tlbr);
if FAILED(hr)
return;
tlbrs->Release();
//now add toolbar buttons
IAcadToolbarItem *button1 = NULL;
IAcadToolbarItem *button2 = NULL;
IAcadToolbarItem *button3 = NULL;
IAcadToolbarItem *button4, *button5, *button6, *button7, *button8 = NULL;
VARIANT index;
index.vt = VT_I4;
index.lVal = 100l;
VARIANT vtFalse;
vtFalse.vt = VT_BOOL;
vtFalse.boolVal = VARIANT_FALSE;
hr = tlbr->AddToolbarButton(index, L"POLY", L"Creates poly entity", L"_poly ", vtFalse, &button1);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"DRAGPOLY", L"Creates poly entity using dragging", L"_dragpoly ", vtFalse, &button2);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"POLYEDIT", L"Edits poly entity", L"_POLYEDIT ", vtFalse, &button3);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"TRANSACT", L"Test Transaction on poly entity", L"_TRANSACT ", vtFalse, &button4);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"HILITPOLY", L"Hilight poly entity", L"_HILITPOLY ", vtFalse, &button5);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"HILITSOLID", L"Hilight solid entity", L"_HILITSOLID ", vtFalse, &button1);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"CREATEINSERT", L"Creates inserted entity", L"_CREATEINSERT ", vtFalse, &button6);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"HILITINSERT", L"Highlight inserted entity", L"_HILITINSERT ", vtFalse, &button7);
button1->Release();
hr = tlbr->AddToolbarButton(index, L"USEDRAGDATA", L"Test user dragging mechanism", L"_USEDRAGDATA ", vtFalse, &button8);
button1->Release();
tlbr->Dock(acToolbarDockLeft);
tlbr->Release();
return;
}