本文整理汇总了C++中CToolBar::AddSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ CToolBar::AddSeparator方法的具体用法?C++ CToolBar::AddSeparator怎么用?C++ CToolBar::AddSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CToolBar
的用法示例。
在下文中一共展示了CToolBar::AddSeparator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rect
void
CAssemblyWindow::AddToolBar()
{
BMessage *message;
// make the pop up menu for 'Select' tool
BPopUpMenu *selectMenu = new BPopUpMenu("", false, false);
selectMenu->SetFont(be_plain_font);
message = new BMessage(SELECT_MODE_CHANGED);
message->AddInt32("mev:mode", CEventEditor::RECTANGLE_SELECTION);
selectMenu->AddItem(new CIconMenuItem("Rectangle", message,
ResourceUtils::LoadImage("ArrowTool")));
message = new BMessage(*message);
message->ReplaceInt32("mev:mode", CEventEditor::LASSO_SELECTION);
selectMenu->AddItem(new CIconMenuItem("Lasso", message,
ResourceUtils::LoadImage("LassoTool")));
selectMenu->SetTargetForItems(this);
// make the pop up menu for 'Create' tool
BPopUpMenu *createMenu = new BPopUpMenu("", false, false);
createMenu->SetFont(be_plain_font);
message = new BMessage(NEW_EVENT_TYPE_CHANGED);
message->AddInt32("type", EvtType_Count);
createMenu->AddItem(new CIconMenuItem("Default", message,
ResourceUtils::LoadImage("PencilTool")));
createMenu->AddSeparatorItem();
message = new BMessage(*message);
message->ReplaceInt32("type", EvtType_Tempo);
createMenu->AddItem(new CIconMenuItem("Tempo", message,
ResourceUtils::LoadImage("MetroTool")));
message = new BMessage(*message);
message->ReplaceInt32("type", EvtType_TimeSig);
createMenu->AddItem(new CIconMenuItem("Time Signature", message,
ResourceUtils::LoadImage("TimeSigTool")));
message = new BMessage(*message);
message->ReplaceInt32("type", EvtType_Repeat);
createMenu->AddItem(new CIconMenuItem("Repeat", message,
ResourceUtils::LoadImage("RepeatTool")));
message = new BMessage(*message);
message->ReplaceInt32("type", EvtType_End);
createMenu->AddItem(new CIconMenuItem("Part End", message,
ResourceUtils::LoadImage("EndTool")));
createMenu->SetTargetForItems(this);
BRect rect(Bounds());
if (KeyMenuBar())
rect.top = KeyMenuBar()->Frame().bottom + 1.0;
rect.right += 1.0;
// add the tool bar
CToolBar *toolBar = new CToolBar(rect, "General");
CTool *tool;
toolBar->AddTool(tool = new CBitmapTool("Snap To Grid",
ResourceUtils::LoadImage("GridTool"),
new BMessage(CEventEditor::TOOL_GRID)));
tool->SetValue(B_CONTROL_ON);
toolBar->AddSeparator();
toolBar->AddTool(tool = new CMenuTool("Select",
ResourceUtils::LoadImage("ArrowTool"),
selectMenu,
new BMessage(CEventEditor::TOOL_SELECT)));
tool->SetValue(B_CONTROL_ON);
toolBar->AddTool(new CMenuTool("Create", ResourceUtils::LoadImage("PencilTool"),
createMenu, new BMessage(CEventEditor::TOOL_CREATE)));
toolBar->AddTool(tool = new CBitmapTool("Eraser",
ResourceUtils::LoadImage("EraserTool"),
new BMessage(CEventEditor::TOOL_ERASE)));
toolBar->MakeRadioGroup("Select", "Eraser", true);
SetToolBar(toolBar);
}