From aafb515c630037be6627d73d89b54e28ec82d0cd Mon Sep 17 00:00:00 2001 From: sirakaba Date: Sun, 18 Oct 2009 10:32:05 +0000 Subject: [PATCH] =?utf8?q?=E6=9B=B8=E5=BA=AB=E9=96=B2=E8=A6=A7=E6=99=82?= =?utf8?q?=E3=81=AB=E3=83=84=E3=83=AA=E3=83=BC=E3=83=93=E3=83=A5=E3=83=BC?= =?utf8?q?=E3=81=8B=E3=82=89=E3=81=AEDnD=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@71 9df91469-1e22-0410-86e7-ea8537beb833 --- doc/history.html | 1 + src/frontend/frm_main.cpp | 41 +++++++++++++++++++++++++++++++++++------ src/frontend/frm_main.h | 1 + 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/doc/history.html b/doc/history.html index a171179..4abf896 100644 --- a/doc/history.html +++ b/doc/history.html @@ -20,6 +20,7 @@
  • 書庫閲覧時の表示モードに一覧表示モードを追加。
  • ツールバー/ステータスバーの非表示設定を追加。
  • 書庫閲覧時のフィルタ機能を追加。
  • +
  • 書庫閲覧時にツリービューからのDnDに対応。
  • Delete,Insertキーをそれぞれ削除と追加の動作に割り当て。
  • ステータスバーの表示形式を変更。
  • ツリービューで常に選択状態で表示されるアイテムがあったバグを修正。
  • diff --git a/src/frontend/frm_main.cpp b/src/frontend/frm_main.cpp index 758eaee..4818eef 100644 --- a/src/frontend/frm_main.cpp +++ b/src/frontend/frm_main.cpp @@ -121,9 +121,10 @@ BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(XRCID("Exe_View_SelectAll"),MainFrame::OnSelectAll) // TreeView EVT_TREE_SEL_CHANGED(XRCID("TreeView"), MainFrame::OnTreeChanged) + EVT_TREE_BEGIN_DRAG( XRCID("TreeView"), MainFrame::OnTreeBeginDrag) // ListView EVT_LIST_ITEM_ACTIVATED(XRCID("ListView"), MainFrame::OnListItemDClick) - EVT_LIST_BEGIN_DRAG(XRCID("ListView"), MainFrame::OnListBeginDrag) + EVT_LIST_BEGIN_DRAG( XRCID("ListView"), MainFrame::OnListBeginDrag) // Filter EVT_TEXT(XRCID("tcFilter"), MainFrame::OnFilter) END_EVENT_TABLE() @@ -612,7 +613,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) TPI_SWITCHES swInfo; swInfo.pCustomSwitches = NULL; - // ƒ‚[ƒhŽæ“¾B’ʏí‚Í0, ŽÀs‚È‚ç1, DnD‚È‚ç2B + // ƒ‚[ƒhŽæ“¾B’ʏí‚Í0, ŽÀs‚È‚ç1, ƒtƒ@ƒCƒ‹DnD‚È‚ç2AƒfƒBƒŒƒNƒgƒŠDnD‚È‚ç3B int nMode = e.GetInt(); // ŽÀsŽž‚Ì‚ÝŽg—pB wxFileType * ftFile = NULL; @@ -639,7 +640,13 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) // ì‹ÆƒfƒBƒŒƒNƒgƒŠì¬B swInfo.fStoreDirectoryPathes = false; - swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), wxT("tpi_tmp"), true); + wxString szDestDirBase = nMode == 3 ? this->tree_ctrl->GetItemText(this->tree_ctrl->GetSelection()) : wxT("tpi_tmp"); + if (szDestDirBase == wxT("-----")) + { + // ‘ŒÉƒ‹[ƒg‚Ì‚Æ‚«‚͏‘ŒÉ–¼‚É‚µ‚Ä‚¨‚­B + szDestDirBase = wxFileName::FileName(this->statusbar->GetStatusText(4)).GetName(); + } + swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), szDestDirBase, true); if (! swInfo.fnDestinationDirectory.IsOk()) { ::ErrDlg(wxT("Unable to make the temporary directory!"), this); @@ -712,8 +719,17 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) wxFileDataObject objFile; for (size_t i = 0; i < mkDlg.files.Count(); i++) { - // ƒŠƒXƒg‚ɒljÁB - objFile.AddFile(swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName::FileName(mkDlg.files[i]).GetFullName()); + wxString szFileName = swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName::FileName(mkDlg.files[i]).GetFullName(); + if (nMode == 2) + { + // ƒŠƒXƒg‚ɒljÁB + objFile.AddFile(szFileName); + } + asFiles.Add(szFileName); + } + if (nMode == 3) + { + objFile.AddFile(swInfo.fnDestinationDirectory.GetPath()); } // DnDŠJŽnB @@ -725,7 +741,6 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) sleep(3); #endif } - asFiles = objFile.GetFilenames(); } // ƒtƒ@ƒCƒ‹‚ƈꎞƒfƒBƒŒƒNƒgƒŠ‚ðíœB @@ -863,6 +878,20 @@ void MainFrame::OnTreeChanged(wxTreeEvent& e) this->list_ctrl->SetItemCount(this->list_ctrl->showFileInfo.Count()); } +void MainFrame::OnTreeBeginDrag(wxTreeEvent& e) +{ + // TODO : ƒAƒCƒeƒ€‚ªŽqŠK‘w‚ðŽ‚Á‚Ä‚¢‚Ä‚à“WŠJ‚Å‚«‚È‚¢B + this->tree_ctrl->SelectItem(e.GetItem()); + for (int i = 0; i < this->list_ctrl->GetItemCount(); i++) + { + this->list_ctrl->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + } + + wxCommandEvent e1; + e1.SetInt(3); + this->OnArcExtract(e1); +} + // ListView void MainFrame::OnListItemDClick(wxListEvent&) diff --git a/src/frontend/frm_main.h b/src/frontend/frm_main.h index 1efa1e7..cdc5313 100644 --- a/src/frontend/frm_main.h +++ b/src/frontend/frm_main.h @@ -59,6 +59,7 @@ public: void OnSelectAll(wxCommandEvent&); void OnTreeChanged(wxTreeEvent&); + void OnTreeBeginDrag(wxTreeEvent&); void OnListItemDClick(wxListEvent&); void OnListBeginDrag( wxListEvent&); -- 2.11.0