当前位置: 首页>>代码示例>>C++>>正文


C++ MyClientData::GetFullName方法代码示例

本文整理汇总了C++中MyClientData::GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C++ MyClientData::GetFullName方法的具体用法?C++ MyClientData::GetFullName怎么用?C++ MyClientData::GetFullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyClientData的用法示例。


在下文中一共展示了MyClientData::GetFullName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoAddFolder

wxTreeListItem SFTPTreeView::DoAddFolder(const wxTreeListItem& parent, const wxString& path)
{
    try {
        m_sftp->CreateDir(path);
        SFTPAttribute::Ptr_t attr = m_sftp->Stat(path);
        // Update the UI
        MyClientData* newCd = new MyClientData(path);
        newCd->SetIsFolder(true);
        newCd->SetInitialized(false);

        wxTreeListItem child = m_treeListCtrl->AppendItem(
            parent, newCd->GetFullName(), m_bmpLoader.GetMimeImageId(FileExtManager::TypeFolder), wxNOT_FOUND, newCd);

        if(IsTypeColumnShown()) {
            m_treeListCtrl->SetItemText(child, GetTypeColumnIndex(), attr->GetTypeAsString());
        }
        if(IsSizeColumnShown()) {
            m_treeListCtrl->SetItemText(child, GetSizeColumnIndex(), wxString() << attr->GetSize());
        }
        m_treeListCtrl->AppendItem(child, "<dummy>");
        m_treeListCtrl->SetSortColumn(0);
        return child;

    } catch(clException& e) {
        ::wxMessageBox(e.What(), "SFTP", wxICON_ERROR | wxOK | wxCENTER);
    }
    return wxTreeListItem();
}
开发者ID:Jactry,项目名称:codelite,代码行数:28,代码来源:SFTPTreeView.cpp

示例2: DoAddFile

wxTreeListItem SFTPTreeView::DoAddFile(const wxTreeListItem& parent, const wxString& path)
{
    try {
        wxMemoryBuffer memBuffer;
        m_sftp->Write(memBuffer, path);
        SFTPAttribute::Ptr_t attr = m_sftp->Stat(path);
        // Update the UI
        MyClientData* newFile = new MyClientData(path);
        newFile->SetIsFolder(false);
        newFile->SetInitialized(false);

        wxTreeListItem child = m_treeListCtrl->AppendItem(
            parent,
            newFile->GetFullName(),
            m_bmpLoader.GetMimeImageId(FileExtManager::GetType(path, FileExtManager::TypeText)),
            wxNOT_FOUND,
            newFile);

        m_treeListCtrl->SetSortColumn(0);
        return child;

    } catch(clException& e) {
        ::wxMessageBox(e.What(), "SFTP", wxICON_ERROR | wxOK | wxCENTER);
    }
    return wxTreeListItem();
}
开发者ID:capturePointer,项目名称:codelite,代码行数:26,代码来源:SFTPTreeView.cpp

示例3: Compare

int SFTPItemComparator::Compare(wxTreeListCtrl* treelist, unsigned column, wxTreeListItem first, wxTreeListItem second)
{
    // get the item data
    MyClientData *cdOne = dynamic_cast<MyClientData *>(treelist->GetItemData(first));
    MyClientData *cdTwo = dynamic_cast<MyClientData *>(treelist->GetItemData(second));
    
    if ( column != 0 )
        return 0;
    
    if ( !cdOne || !cdTwo )
        return 0;
    
    if ( cdOne->IsFolder() && !cdTwo->IsFolder())
        return -1;
        
    else if ( !cdOne->IsFolder() && cdTwo->IsFolder() )
        return 1;
    else 
        return cdOne->GetFullName() > cdTwo->GetFullName();
}
开发者ID:05storm26,项目名称:codelite,代码行数:20,代码来源:sftp_item_comparator.cpp

示例4: DoAddFolder

wxTreeItemId SFTPTreeView::DoAddFolder(const wxTreeItemId& parent, const wxString& path)
{
    try {
        m_sftp->CreateDir(path);
        SFTPAttribute::Ptr_t attr = m_sftp->Stat(path);
        // Update the UI
        MyClientData* newCd = new MyClientData(path);
        newCd->SetIsFolder(true);
        newCd->SetInitialized(false);

        wxTreeItemId child = m_treeCtrl->AppendItem(
            parent, newCd->GetFullName(), m_bmpLoader->GetMimeImageId(FileExtManager::TypeFolder), wxNOT_FOUND, newCd);

        m_treeCtrl->AppendItem(child, "<dummy>");
        return child;

    } catch(clException& e) {
        ::wxMessageBox(e.What(), "SFTP", wxICON_ERROR | wxOK | wxCENTER);
    }
    return wxTreeItemId();
}
开发者ID:stahta01,项目名称:codelite,代码行数:21,代码来源:SFTPTreeView.cpp

示例5: OnMenuRename

void SFTPTreeView::OnMenuRename(wxCommandEvent& event)
{
    wxTreeListItems items;
    m_treeListCtrl->GetSelections(items);
    if(items.empty()) return;

    try {
        for(size_t i = 0; i < items.size(); ++i) {

            MyClientData* cd = GetItemData(items.at(i));
            if(!cd) continue; // ??

            wxString new_name = ::wxGetTextFromUser(_("Enter new name:"), _("Rename"), cd->GetFullName());
            if(!new_name.IsEmpty()) {
                wxString old_path = cd->GetFullPath();
                cd->SetFullName(new_name);
                m_sftp->Rename(old_path, cd->GetFullPath());

                // Remove the selection
                m_treeListCtrl->SetItemText(items.at(i), 0, new_name);
            }
        }

    } catch(clException& e) {
        ::wxMessageBox(e.What(), "SFTP", wxICON_ERROR | wxOK | wxCENTER);
    }
}
开发者ID:Jactry,项目名称:codelite,代码行数:27,代码来源:SFTPTreeView.cpp


注:本文中的MyClientData::GetFullName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。