本文整理汇总了C++中ItemData::IsProject方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemData::IsProject方法的具体用法?C++ ItemData::IsProject怎么用?C++ ItemData::IsProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemData
的用法示例。
在下文中一共展示了ItemData::IsProject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnNewFolder
void PHPWorkspaceView::OnNewFolder(wxCommandEvent& e)
{
wxUnusedVar(e);
wxString name = wxGetTextFromUser(_("New Folder Name:"), _("New Folder"));
if(name.IsEmpty()) return;
wxString project = DoGetSelectedProject();
if(project.IsEmpty()) return;
wxTreeItemId parent = m_treeCtrlView->GetSelection();
CHECK_ITEM_RET(parent);
ItemData* itemData = DoGetItemData(parent);
CHECK_PTR_RET(itemData);
if(!itemData->IsFolder() && !itemData->IsProject()) return;
PHPProject::Ptr_t proj = PHPWorkspace::Get()->GetProject(project);
CHECK_PTR_RET(proj);
wxString folder;
if(itemData->IsFolder()) {
folder << itemData->GetFolderPath() << "/" << name;
} else {
folder << name;
}
PHPFolder::Ptr_t pFolder = proj->AddFolder(folder);
proj->Save();
// Update the UI
DoAddFolder(parent, pFolder, proj);
}
示例2: OnSetProjectActive
void PHPWorkspaceView::OnSetProjectActive(wxCommandEvent& e)
{
wxString project = DoGetSelectedProject();
if(project.IsEmpty()) return;
PHPWorkspace::Get()->SetProjectActive(project);
wxTreeItemIdValue cookie;
wxTreeItemId child = m_treeCtrlView->GetFirstChild(m_treeCtrlView->GetRootItem(), cookie);
while(child.IsOk()) {
ItemData* id = DoGetItemData(child);
if(id && id->IsProject()) {
id->SetActive(id->GetProjectName() == project);
m_treeCtrlView->SetItemBold(child, id->IsActive());
}
child = m_treeCtrlView->GetNextChild(m_treeCtrlView->GetRootItem(), cookie);
}
}
示例3: OnDeleteProject
void PHPWorkspaceView::OnDeleteProject(wxCommandEvent& e)
{
// Prompt user
wxTreeItemId selection = m_treeCtrlView->GetSelection();
if(selection.IsOk()) {
ItemData* itemData = DoGetItemData(selection);
if ( itemData && itemData->IsProject() ) {
if(wxMessageBox(wxString() << _("Are you sure you want to delete\nproject '") << itemData->GetProjectName() << "'?",
_("CodeLite"),
wxYES_NO| wxCANCEL,
wxTheApp->GetTopWindow()) == wxYES) {
PHPWorkspace::Get()->DeleteProject(itemData->GetProjectName());
m_treeCtrlView->Delete( selection );
}
}
}
}