wxString DisplayDropHighlight(wxPoint point) { wxTreeItemId hit = GetHit(point); if (!hit) { ClearDropHighlight(); return _T(""); } wxString dir = GetDirFromItem(hit); if (dir == _T("")) { ClearDropHighlight(); return _T(""); } const wxTreeItemId dropHighlight = m_pLocalTreeView->m_dropHighlight; if (dropHighlight != wxTreeItemId()) m_pLocalTreeView->SetItemDropHighlight(dropHighlight, false); m_pLocalTreeView->SetItemDropHighlight(hit, true); m_pLocalTreeView->m_dropHighlight = hit; return dir; }
CServerPath DisplayDropHighlight(wxPoint point) { wxTreeItemId hit = GetHit(point); if (!hit) { ClearDropHighlight(); return CServerPath(); } const CServerPath& path = m_pRemoteTreeView->GetPathFromItem(hit); if (path.IsEmpty()) { ClearDropHighlight(); return CServerPath(); } const wxTreeItemId dropHighlight = m_pRemoteTreeView->m_dropHighlight; if (dropHighlight != wxTreeItemId()) m_pRemoteTreeView->SetItemDropHighlight(dropHighlight, false); m_pRemoteTreeView->SetItemDropHighlight(hit, true); m_pRemoteTreeView->m_dropHighlight = hit; return path; }
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { if (def == wxDragError || def == wxDragNone || def == wxDragCancel) { ClearDropHighlight(); return def; } if (m_pLocalListView->m_fileData.empty()) { ClearDropHighlight(); return wxDragNone; } const wxString& subdir = DisplayDropHighlight(wxPoint(x, y)); if (subdir == _T("")) { if (!CState::LocalDirIsWriteable(m_pLocalListView->m_dir)) return wxDragNone; } else { wxString dir = CState::Canonicalize(m_pLocalListView->m_dir, subdir); if (dir == _T("") || !CState::LocalDirIsWriteable(dir)) return wxDragNone; } if (def == wxDragLink) def = wxDragCopy; return def; }
wxString DisplayDropHighlight(wxPoint point) { wxString subDir; int flags; int hit = m_pLocalListView->HitTest(point, flags, 0); if (!(flags & wxLIST_HITTEST_ONITEM)) hit = -1; if (hit != -1) { const CLocalListView::t_fileData* const data = m_pLocalListView->GetData(hit); if (!data || !data->dir) hit = -1; else subDir = data->name; } if (hit != m_pLocalListView->m_dropTarget) { ClearDropHighlight(); if (hit != -1) { m_pLocalListView->SetItemState(hit, wxLIST_STATE_DROPHILITED, wxLIST_STATE_DROPHILITED); m_pLocalListView->m_dropTarget = hit; } } return subDir; }
virtual bool OnDrop(wxCoord x, wxCoord y) { ClearDropHighlight(); if (m_pLocalListView->m_fileData.empty()) return false; return true; }
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { CListCtrlDropTarget::OnDragOver(x, y, def); if (def == wxDragError || def == wxDragNone || def == wxDragCancel) { ClearDropHighlight(); return def; } if (m_pLocalListView->m_fileData.empty()) { ClearDropHighlight(); return wxDragNone; } const wxString& subdir = DoDisplayDropHighlight(wxPoint(x, y)); CLocalPath dir = m_pLocalListView->m_pState->GetLocalDir(); if (subdir == _T("")) { const CDragDropManager* pDragDropManager = CDragDropManager::Get(); if (pDragDropManager && pDragDropManager->localParent == m_pLocalListView->m_dir) return wxDragNone; } else { if (!dir.ChangePath(subdir)) return wxDragNone; } if (!dir.IsWriteable()) return wxDragNone; if (def == wxDragLink) def = wxDragCopy; return def; }
virtual bool OnDrop(wxCoord x, wxCoord y) { ClearDropHighlight(); wxTreeItemId hit = GetHit(wxPoint(x, y)); if (!hit) return false; const CServerPath& path = m_pRemoteTreeView->GetPathFromItem(hit); if (path.IsEmpty()) return false; return true; }
virtual bool OnDrop(wxCoord x, wxCoord y) { ClearDropHighlight(); wxTreeItemId hit = GetHit(wxPoint(x, y)); if (!hit) return false; const wxString dir = GetDirFromItem(hit); if (dir == _T("") || !CLocalPath(dir).IsWriteable()) return false; return true; }
virtual bool OnDrop(wxCoord x, wxCoord y) { if (!CScrollableDropTarget<wxTreeCtrlEx>::OnDrop(x, y)) { return false; } ClearDropHighlight(); wxTreeItemId hit = GetHit(wxPoint(x, y)); if (!hit) return false; const CServerPath& path = m_pRemoteTreeView->GetPathFromItem(hit); if (path.empty()) return false; return true; }
virtual bool OnDrop(wxCoord x, wxCoord y) { if (!CScrollableDropTarget<wxTreeCtrlEx>::OnDrop(x, y)) { return false; } ClearDropHighlight(); wxTreeItemId hit = GetHit(wxPoint(x, y)); if (!hit) return false; const wxString dir = GetDirFromItem(hit); if (dir.empty() || !CLocalPath(dir).IsWriteable()) return false; return true; }
virtual wxString DoDisplayDropHighlight(wxPoint point) { wxString subDir; int flags; int hit = m_pLocalListView->HitTest(point, flags, 0); if (!(flags & wxLIST_HITTEST_ONITEM)) hit = -1; if (hit != -1) { const CLocalFileData* const data = m_pLocalListView->GetData(hit); if (!data || !data->dir) hit = -1; else { const CDragDropManager* pDragDropManager = CDragDropManager::Get(); if (pDragDropManager && pDragDropManager->pDragSource == m_pLocalListView) { if (m_pLocalListView->GetItemState(hit, wxLIST_STATE_SELECTED)) hit = -1; else subDir = data->name; } else subDir = data->name; } } if (hit != m_pLocalListView->m_dropTarget) { ClearDropHighlight(); if (hit != -1) { m_pLocalListView->m_dropTarget = hit; #ifdef __WXMSW__ m_pLocalListView->SetItemState(hit, wxLIST_STATE_DROPHILITED, wxLIST_STATE_DROPHILITED); #else m_pLocalListView->RefreshItem(hit); #endif } } return subDir; }
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { if (def == wxDragError || def == wxDragNone || def == wxDragCancel) { ClearDropHighlight(); return def; } const wxString& dir = DisplayDropHighlight(wxPoint(x, y)); if (dir == _T("")) return wxDragNone; if (def == wxDragLink) def = wxDragCopy; return def; }
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { if (def == wxDragError || def == wxDragNone || def == wxDragCancel) { ClearDropHighlight(); return def; } const CServerPath& path = DisplayDropHighlight(wxPoint(x, y)); if (path.IsEmpty()) return wxDragNone; if (def == wxDragLink) def = wxDragCopy; return def; }
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { def = CScrollableDropTarget<wxTreeCtrlEx>::OnDragOver(x, y, def); if (def == wxDragError || def == wxDragNone || def == wxDragCancel) { ClearDropHighlight(); return def; } wxTreeItemId hit = DisplayDropHighlight(wxPoint(x, y)); if (!hit.IsOk()) return wxDragNone; if (def == wxDragLink) def = wxDragCopy; return def; }
virtual void OnLeave() { ClearDropHighlight(); }
virtual void OnLeave() { CScrollableDropTarget<wxTreeCtrlEx>::OnLeave(); ClearDropHighlight(); }
virtual void OnLeave() { CListCtrlDropTarget::OnLeave(); ClearDropHighlight(); }