本文整理汇总了C++中ItemData::GetKind方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemData::GetKind方法的具体用法?C++ ItemData::GetKind怎么用?C++ ItemData::GetKind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemData
的用法示例。
在下文中一共展示了ItemData::GetKind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMenu
void PHPWorkspaceView::OnMenu(wxTreeEvent& event)
{
wxTreeItemId item = event.GetItem();
if(item.IsOk()) {
// Ensure that the item is selected
m_treeCtrlView->SelectItem(event.GetItem());
ItemData* data = DoGetItemData(item);
if(data) {
switch(data->GetKind()) {
case ItemData::Kind_File: {
wxMenu menu;
menu.Append(wxID_OPEN, _("Open"));
menu.Append(XRCID("rename_php_file"), _("Rename"));
menu.AppendSeparator();
menu.Append(wxID_REMOVE, _("Remove file"));
menu.AppendSeparator();
menu.Append(XRCID("make_index"), _("Set as Index file"));
m_treeCtrlView->PopupMenu(&menu);
} break;
case ItemData::Kind_Workspace: {
wxMenu menu;
menu.Append(XRCID("php_reload_workspace"), _("Reload workspace"));
menu.Append(XRCID("php_close_workspace"), _("Close workspace"));
menu.AppendSeparator();
menu.Append(XRCID("new_project"),
_("Add a new project...")); // This will trigger codelite's "New Project Wizard"
menu.AppendSeparator();
menu.Append(XRCID("php_reparse_workspace"), _("Retag workspace..."));
menu.AppendSeparator();
menu.Append(XRCID("rename_php_workspace"), _("Rename"));
m_treeCtrlView->PopupMenu(&menu);
} break;
case ItemData::Kind_Project: {
wxMenu menu;
menu.Append(XRCID("php_set_project_active"), _("Set as active project"));
menu.AppendSeparator();
menu.Append(XRCID("php_delete_project"), _("Delete project"));
menu.AppendSeparator();
menu.Append(XRCID("php_add_folder"), _("Add a folder..."));
menu.Append(XRCID("php_import_files"), _("Import files from a directory..."));
menu.AppendSeparator();
menu.Append(XRCID("php_run_project"), _("Run project..."));
menu.AppendSeparator();
menu.Append(XRCID("php_project_settings"), _("Project settings..."));
m_treeCtrlView->PopupMenu(&menu);
} break;
case ItemData::Kind_Folder: {
wxMenu menu;
menu.Append(XRCID("php_new_class"), _("New Class..."));
menu.Append(XRCID("php_new_file"), _("Add a new file..."));
menu.Append(XRCID("php_add_existing_file"), _("Add an existing file..."));
menu.AppendSeparator();
menu.Append(XRCID("php_add_folder"), _("Add a folder..."));
menu.AppendSeparator();
menu.Append(XRCID("php_delete_folder"), _("Delete this folder"));
m_treeCtrlView->PopupMenu(&menu);
} break;
default:
break;
}
}
}
}