本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}