1 /*******************************************************************************
2 TPI - flexible but useless plug-in framework.
3 Copyright (C) 2002-2009 Silky
5 This library is free software; you can redistribute it and/or modify it under
6 the terms of the GNU Lesser General Public License as published by the Free
7 Software Foundation; either version 2.1 of the License, or (at your option)
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15 You should have received a copy of the GNU Lesser General Public License along
16 with this library; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 $Id: frm_main.cpp,v 1.42 2009/09/05 03:24:58 sirakaba Exp $
20 *******************************************************************************/
25 #include "cls_filedroptarget.h"
27 #include "dlg_process.h"
28 #include "functions.h"
30 #include <wx/fileconf.h>
31 #include <wx/arrimpl.cpp>
33 WX_DEFINE_OBJARRAY(ArrayTPI_FILEINFO);
35 #define SetMenuToolState(id, state) this->toolbar->EnableTool(XRCID(id), state); this->menubar->Enable(XRCID(id), state)
37 //******************************************************************************
38 //
\83O
\83\8d\81[
\83o
\83\8b\95Ï
\90\94
39 //******************************************************************************
41 wxImageList g_hIconT(16, 16), g_hIconLL(32, 32), g_hIconLS(16, 16);
45 //******************************************************************************
47 //******************************************************************************
49 MainFrame::MainFrame(): wxFrame()
53 MainFrame::~MainFrame()
58 //
\90Ý
\92è
\82ð
\8bL
\98^
\81B
59 wxFileConfig fc(wxEmptyString, wxEmptyString, ::wxGetCwd() + wxT("/frontend.conf"), wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
60 if (! this->IsIconized() && ! this->IsMaximized())
63 this->GetSize(& a, & b);
64 fc.Write(wxT("Window-Width"), a);
65 fc.Write(wxT("Window-Height"), b);
66 this->GetPosition(& a, & b);
67 fc.Write(wxT("Window-X"), a);
68 fc.Write(wxT("Window-Y"), b);
70 fc.Write(wxT("Splitter-Pos"), this->window_splitter->GetSashPosition());
71 fc.Write(wxT("LastOpenPath"), this->fnLastOpenPath.GetFullPath());
73 //
\83c
\81[
\83\8b\83o
\81[/
\83X
\83e
\81[
\83^
\83X
\83o
\81[
\8aÖ
\98A
\81B
74 fc.Write(wxT("StatusBar-Show"), this->statusbar->IsShown());
75 fc.Write(wxT("ToolBar-Show"), this->toolbar->IsShown());
77 // ListView
\8aÖ
\98A
\81B
78 fc.Write(wxT("ListView-IconMode"), this->menubar->IsChecked(XRCID("Exe_View_Icons")) ? 1 : this->menubar->IsChecked(XRCID("Exe_View_List")) ? 2 : 0);
79 if (this->menubar->IsChecked(XRCID("Exe_View_Details")))
81 fc.Write(wxT("ListView-C-Filename"), this->list_ctrl->GetColumnWidth(0));
82 fc.Write(wxT("ListView-C-Unpacked"), this->list_ctrl->GetColumnWidth(1));
83 fc.Write(wxT("ListView-C-Packed"), this->list_ctrl->GetColumnWidth(2));
84 fc.Write(wxT("ListView-C-Ratio"), this->list_ctrl->GetColumnWidth(3));
85 fc.Write(wxT("ListView-C-Method"), this->list_ctrl->GetColumnWidth(4));
86 fc.Write(wxT("ListView-C-Attr"), this->list_ctrl->GetColumnWidth(5));
87 fc.Write(wxT("ListView-C-Lastmodified"), this->list_ctrl->GetColumnWidth(6));
88 fc.Write(wxT("ListView-C-Path"), this->list_ctrl->GetColumnWidth(7));
89 fc.Write(wxT("ListView-C-Type"), this->list_ctrl->GetColumnWidth(8));
90 fc.Write(wxT("ListView-C-No"), this->list_ctrl->GetColumnWidth(9));
91 fc.Write(wxT("ListView-SortColumn"), g_nSortColumn);
92 fc.Write(wxT("ListView-SortAscend"), g_fSortAscend);
98 //******************************************************************************
100 //******************************************************************************
102 BEGIN_EVENT_TABLE(MainFrame, wxFrame)
103 EVT_INIT_DIALOG( MainFrame::OnInit)
105 EVT_MENU(XRCID("Arc_Create"), MainFrame::OnArcCreate)
106 EVT_MENU(XRCID("Arc_Open"), MainFrame::OnArcOpen)
107 EVT_MENU(XRCID("Arc_Close"), MainFrame::OnArcClose)
108 EVT_MENU(XRCID("Arc_Add"), MainFrame::OnArcAdd)
109 EVT_MENU(XRCID("Arc_SFX"), MainFrame::OnArcConvert)
110 EVT_MENU(XRCID("Arc_UnSFX"), MainFrame::OnArcConvert)
111 EVT_MENU(XRCID("Exe_Exit"), MainFrame::OnExit)
112 EVT_MENU(XRCID("Arc_Extract"), MainFrame::OnArcExtract)
113 EVT_MENU(XRCID("Arc_Delete"), MainFrame::OnArcDelete)
114 EVT_MENU(XRCID("Arc_Test"), MainFrame::OnArcTest)
115 EVT_MENU(XRCID("Arc_Repair"), MainFrame::OnArcRepair)
116 EVT_MENU(XRCID("Exe_View_Icons"), MainFrame::OnViewMode)
117 EVT_MENU(XRCID("Exe_View_Details"),MainFrame::OnViewMode)
118 EVT_MENU(XRCID("Exe_View_List"), MainFrame::OnViewMode)
119 EVT_MENU(XRCID("Exe_View_ToolBar"),MainFrame::OnShowToolBar)
120 EVT_MENU(XRCID("Exe_View_StatusBar"),MainFrame::OnShowStatusBar)
121 EVT_MENU(XRCID("Exe_View_SelectAll"),MainFrame::OnSelectAll)
123 EVT_TREE_SEL_CHANGED(XRCID("TreeView"), MainFrame::OnTreeChanged)
124 EVT_TREE_BEGIN_DRAG( XRCID("TreeView"), MainFrame::OnTreeBeginDrag)
126 EVT_LIST_ITEM_ACTIVATED(XRCID("ListView"), MainFrame::OnListItemDClick)
127 EVT_LIST_BEGIN_DRAG( XRCID("ListView"), MainFrame::OnListBeginDrag)
129 EVT_TEXT(XRCID("tcFilter"), MainFrame::OnFilter)
132 //******************************************************************************
134 //******************************************************************************
136 void MainFrame::OnInit(wxInitDialogEvent&)
138 // XRC
\82Æ
\8c\8b\82Ñ
\82Â
\82¯
\81B
139 this->menubar = this->GetMenuBar();
140 this->toolbar = this->GetToolBar();
141 this->statusbar = XRCCTRL(* this, "statusbar", wxStatusBar);
142 this->tree_ctrl = XRCCTRL(* this, "TreeView", wxTreeCtrl);
143 this->list_ctrl = XRCCTRL(* this, "ListView", myListCtrl);
144 this->window_splitter = XRCCTRL(* this, "window_splitter", wxSplitterWindow);
145 this->tcFilter = XRCCTRL(* this->toolbar, "tcFilter", wxTextCtrl);
147 //
\90Ý
\92è
\82ð
\93Ç
\82Ý
\8d\9e\82Ý
\81B
148 wxFileConfig fc(wxEmptyString, wxEmptyString, ::wxGetCwd() + wxT("/frontend.conf"), wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
149 this->SetSize(fc.Read(wxT("Window-X"), 0l), fc.Read(wxT("Window-Y"), 0l), fc.Read(wxT("Window-Width"), 800), fc.Read(wxT("Window-Height"), 400));
150 this->fnLastOpenPath = wxFileName::DirName(fc.Read(wxT("LastOpenPath"), ::wxGetCwd()));
151 wxTheMimeTypesManager->Initialize(wxMAILCAP_ALL);
153 //
\8f\89\8aú
\92l
\90Ý
\92è
\81B
156 icon.CopyFromBitmap(wxBitmap(FE_DIR_S_ICO wxT("app.png"), wxBITMAP_TYPE_ANY));
162 //
\83X
\83v
\83\8a\83b
\83^
\81[
\90Ý
\92è
\81B
163 this->window_splitter->SetSashPosition(fc.Read(wxT("Splitter-Pos"), 200));
165 //
\83\8a\83X
\83g
\83r
\83\85\81[
\90Ý
\92è
\81B
166 int nIconMode = fc.Read(wxT("ListView-IconMode"), 0l);
167 e.SetId(nIconMode == 1 ? XRCID("Exe_View_Icons") : (nIconMode == 2 ? XRCID("Exe_View_List") : XRCID("Exe_View_Details")));
169 // wxGTK
\82Å
\82Í
\92¼
\90ÚwxLC_VIRTUAL
\82ð
\8ew
\92è
\82µ
\82È
\82¢
\82Æ
\94½
\89f
\82³
\82ê
\82È
\82¢
\81B
170 this->list_ctrl->SetSingleStyle(wxLC_VIRTUAL);
171 this->list_ctrl->InsertColumn(0, wxT("Filename"), wxLIST_FORMAT_LEFT, fc.Read(wxT("ListView-C-Filename"), 140));
172 this->list_ctrl->InsertColumn(1, wxT("Unpacked"), wxLIST_FORMAT_RIGHT, fc.Read(wxT("ListView-C-Unpacked"), 80));
173 this->list_ctrl->InsertColumn(2, wxT("Packed"), wxLIST_FORMAT_RIGHT, fc.Read(wxT("ListView-C-Packed"), 80));
174 this->list_ctrl->InsertColumn(3, wxT("Ratio"), wxLIST_FORMAT_RIGHT, fc.Read(wxT("ListView-C-Ratio"), 50));
175 this->list_ctrl->InsertColumn(4, wxT("Method"), wxLIST_FORMAT_LEFT, fc.Read(wxT("ListView-C-Method"), 60));
176 this->list_ctrl->InsertColumn(5, wxT("Attr"), wxLIST_FORMAT_LEFT, fc.Read(wxT("ListView-C-Attr"), 50));
177 this->list_ctrl->InsertColumn(6, wxT("Last modified"), wxLIST_FORMAT_RIGHT, fc.Read(wxT("ListView-C-Lastmodified"), 150));
178 this->list_ctrl->InsertColumn(7, wxT("Path"), wxLIST_FORMAT_LEFT, fc.Read(wxT("ListView-C-Path"), 100));
179 this->list_ctrl->InsertColumn(8, wxT("Type"), wxLIST_FORMAT_LEFT, fc.Read(wxT("ListView-C-Type"), 100));
180 this->list_ctrl->InsertColumn(9, wxT("No."), wxLIST_FORMAT_RIGHT, fc.Read(wxT("ListView-C-No"), 35));
181 g_nSortColumn = fc.Read(wxT("ListView-SortColumn"), 9);
182 g_fSortAscend = fc.Read(wxT("ListView-SortAscend"), 1) == 1;
183 this->list_ctrl->SetDropTarget(new myFileDropTarget(this));
185 //
\83c
\81[
\83\8b\83o
\81[/
\83X
\83e
\81[
\83^
\83X
\83o
\81[
\90Ý
\92è
\81B
186 int nStatusBarParts[] = {70, 70, 180, 50, -1};
187 this->statusbar->SetFieldsCount(5, nStatusBarParts);
188 this->SetStatusBarPane(-1);
189 bool fShow = fc.Read(wxT("StatusBar-Show"), 1) == 1;
190 this->menubar->Check(XRCID("Exe_View_StatusBar"), fShow);
191 this->statusbar->Show(fShow);
192 fShow = fc.Read(wxT("ToolBar-Show"), 1) == 1;
193 this->menubar->Check(XRCID("Exe_View_ToolBar"), fShow);
194 this->toolbar->Show(fShow);
196 //
\83R
\83}
\83\93\83h
\83\89\83C
\83\93\93Ç
\82Ý
\8d\9e\82Ý
\81B
197 this->cmdLine.SetSwitchChars(wxT("-"));
198 this->cmdLine.AddSwitch(wxT("x"), wxEmptyString, wxT("(command) Extract filenames in archive."));
199 this->cmdLine.AddSwitch(wxT("l"), wxEmptyString, wxT("(command) List archive(default)."));
200 this->cmdLine.AddParam(wxT("archive"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
201 this->cmdLine.AddParam(wxT("filenames"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE);
202 if (this->cmdLine.Parse() == 0)
204 if (this->cmdLine.GetParamCount() == 0)
209 //
\8f\91\8cÉ
\82ð
\8aJ
\82
\81B
210 wxFileName fnArchive(this->cmdLine.GetParam(0));
211 fnArchive.Normalize(wxPATH_NORM_ALL, this->szCurrentPath);
212 e.SetString(fnArchive.GetFullPath());
214 if (this->cmdLine.Found(wxT("x")))
216 //
\8f\91\8cÉ
\82ð
\93W
\8aJ
\81B
217 this->OnArcExtract(e);
225 void MainFrame::OnExit(wxCommandEvent&)
230 void MainFrame::OnArcCreate(wxCommandEvent& e)
233 swInfo.pCustomSwitches = NULL;
235 //
\8dì
\90¬
\83_
\83C
\83A
\83\8d\83O
\82ð
\90Ý
\92è
\81B
237 ::wxXmlResource::Get()->Load(FE_DIR_S_XRC wxT("dlg_make.xrc"));
238 ::wxXmlResource::Get()->LoadDialog(& mkDlg, this, wxT("dlg_make"));
240 if (e.GetClientData() == NULL)
242 //
\8f\88\97\9d\91Î
\8fÛ
\82Ì
\83t
\83@
\83C
\83\8b\82ð
\91I
\91ð
\81B
243 wxFileDialog fd(this, wxT("Choose files to compress"), this->fnLastOpenPath.GetFullPath());
244 fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE);
245 if (fd.ShowModal() == wxID_CANCEL)
249 //
\82±
\82±
\82ÅwxFileName::FileName
\82ð
\97p
\82¢
\82Ä
\82¢
\82é
\82Ì
\82Í
\81A
\8cã
\82Å
\83f
\83B
\83\8c\83N
\83g
\83\8a\96¼
\82ð
\95K
\97v
\82Æ
\82·
\82é
\8fê
\8d\87\82ª
\82 \82é
\82½
\82ß
\81B
250 //
\82 \82Ü
\82è
\82æ
\82¢
\8ed
\97l
\82Å
\82Í
\82È
\82¢
\82ª
\93®
\82
\82Ì
\82Å
\82Æ
\82è
\82 \82¦
\82¸
\95ú
\92u
\81B
251 this->fnLastOpenPath = wxFileName::FileName(fd.GetDirectory());
252 swInfo.fnDestinationDirectory = wxFileName::DirName(this->fnLastOpenPath.GetFullPath());
253 this->statusbar->SetStatusText(swInfo.fnDestinationDirectory.GetFullPath(), 4);
255 fd.GetFilenames(mkDlg.files);
259 mkDlg.files = * (wxArrayString *) e.GetClientData();
260 swInfo.fnDestinationDirectory = wxFileName::DirName(wxFileName::FileName(mkDlg.files[0]).GetPath());
261 //
\91\8a\91Î
\83p
\83X
\82É
\95Ï
\8a·
\81B
262 for (size_t n = 0; n < mkDlg.files.Count(); n++)
264 wxFileName fn(mkDlg.files[n]);
265 bool fIsDir = fn.DirExists() && ! fn.FileExists();
266 fn.MakeRelativeTo(swInfo.fnDestinationDirectory.GetPath());
267 mkDlg.files[n] = fn.GetFullPath();
270 mkDlg.files[n] += fn.GetPathSeparator();
276 mkDlg.cbDir->SetValue(swInfo.fnDestinationDirectory.GetPath());
277 //
\8f\91\8cÉ
\96¼
\82Í
\83t
\83@
\83C
\83\8b\96¼
\82Ì
\8ag
\92£
\8eq
\82æ
\82è
\91O
\81A
\82à
\82µ
\82
\82Í
\83f
\83B
\83\8c\83N
\83g
\83\8a\96¼
\81B
278 wxFileName fnFirstFile(mkDlg.files[0]);
279 mkDlg.cbFileName->SetValue(mkDlg.files.GetCount() == 1 ? (fnFirstFile.GetName().IsEmpty() ? fnFirstFile.GetDirs().Last() : fnFirstFile.GetName()) : swInfo.fnDestinationDirectory.GetDirs().Last());
281 //
\83_
\83C
\83A
\83\8d\83O
\82ð
\95\
\8e¦
\81B
282 if (mkDlg.ShowModal() == wxID_CANCEL)
284 this->statusbar->SetStatusText(wxEmptyString, 4);
287 this->statusbar->SetStatusText(wxEmptyString, 4);
289 //
\8ae
\8eí
\90Ý
\92è
\81B
290 swInfo.fStoreDirectoryPathes= ! mkDlg.cbIgnorePath->IsChecked();
291 swInfo.fMakeSFX = mkDlg.cbMakeSFX->IsChecked();
292 swInfo.fSolid = mkDlg.cbSolid->IsChecked();
293 swInfo.fMMOptimize = mkDlg.cbMMOptimize->IsChecked();
294 swInfo.fEncryptHeader = mkDlg.cbEncryptHeader->IsChecked();
295 swInfo.sCompressLevel = mkDlg.scLevel->GetValue();
296 swInfo.sRecoveryRecord = mkDlg.scRR->GetValue();
297 swInfo.szPassword = mkDlg.tcPassword->GetValue();
298 swInfo.szKeyFile = mkDlg.tcKeyfile->GetValue();
299 swInfo.szComment = mkDlg.tcComment->GetValue();
302 mkDlg.cbSplitSize->GetValue().ToULongLong(& ll);
303 swInfo.llSplitSize = ll;
306 // TPI
\82ð
\93Ç
\82Ý
\8d\9e\82Ý
\81B
307 int nSelected = mkDlg.chType->GetSelection();
308 wxFileName fnArchive = wxFileName::DirName(mkDlg.cbDir->GetValue());
309 fnArchive.SetName(mkDlg.cbFileName->GetValue());
310 fnArchive.SetExt(swInfo.fMakeSFX ? EXE_EXT : mkDlg.afInfo[nSelected].szSuffix.BeforeFirst(wxT(';')));
311 if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, fnArchive.GetFullPath(), mkDlg.afInfo[nSelected].llTypeId))
313 ::ErrDlg(wxT("InitLibrary()!"), this);
317 //
\83R
\81[
\83\8b\83o
\83b
\83N
\8aÖ
\90\94\82ð
\90Ý
\92è
\81B
318 if (tpi.SetCallbackProc(TPICallbackProc) != TPI_ERROR_SUCCESS)
320 ::ErrDlg(wxT("SetCallbackProc()!"), this);
323 //
\8f\88\97\9d\82ð
\8ds
\82¤
\81B
324 ProcessDialog procDlg;
325 procDlg.InitDialog();
327 int nErrorCode = this->ErrorCheck(tpi.Command(TPI_COMMAND_ADD, & swInfo, fnArchive.GetFullPath(), mkDlg.files));
330 if (nErrorCode != TPI_ERROR_SUCCESS)
335 if (mkDlg.cbOpenAfter->IsChecked())
337 //
\8dì
\90¬
\90æ
\82ð
\8aJ
\82
\81B
339 ::wxExecute(wxT("explorer ") + swInfo.fnDestinationDirectory.GetFullPath());
343 if (mkDlg.cbExitAfter->IsChecked())
349 //
\8fI
\97¹
\82µ
\82È
\82¢
\8fê
\8d\87\82Í
\8f\91\8cÉ
\82ð
\8aJ
\82
\81B
350 e.SetString(fnArchive.GetFullPath());
354 void MainFrame::OnArcOpen(wxCommandEvent& e)
356 //
\8f\91\8cÉ
\82ð
\91I
\91ð
\81B
357 wxString szFileName = e.GetString();
358 if (szFileName.IsEmpty())
360 wxFileDialog fd(this);
361 fd.SetDirectory(this->fnLastOpenPath.GetFullPath());
362 fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST);
363 if (fd.ShowModal() == wxID_CANCEL)
367 this->fnLastOpenPath = wxFileName::DirName(fd.GetDirectory());
368 szFileName = fd.GetPath();
372 //
\90i
\92»
\83_
\83C
\83A
\83\8d\83O
\95\
\8e¦
\81B
373 ProcessDialog procDlg;
374 procDlg.InitDialog();
377 // TPI
\82ð
\93Ç
\82Ý
\8d\9e\82Ý
\81A
\8dÅ
\8f\89\82Ì
\83R
\81[
\83\8b\83o
\83b
\83N
\82ð
\91\97\90M
\81B
378 TPI_PROCESSINFO piInfo;
379 piInfo.uMessage = TPI_MESSAGE_STATUS;
380 piInfo.uStatus = 0x1000;
381 piInfo.llProcessedSize = 0;
382 piInfo.fiInfo.fnFileName = wxFileName::FileName(szFileName);
383 piInfo.fiInfo.llUnpackedSize = this->LoadTPI(szFileName);
384 if ((signed) piInfo.fiInfo.llUnpackedSize.ToULong() == -1)
388 ::ErrDlg(wxT("No plug-in supporting this archive was found!"), this);
391 TPICallbackProc(TPI_NOTIFY_COMMON, & piInfo);
393 //
\94z
\97ñ
\82Ì
\83T
\83C
\83Y
\82ð
\8am
\95Û
\81B
394 this->fileinfo.Alloc(piInfo.fiInfo.llUnpackedSize.ToULong());
396 //
\8f\91\8cÉ
\82ð
\8aJ
\82
\81B
397 if (tpi.OpenArchive(szFileName) != TPI_ERROR_SUCCESS)
401 ::ErrDlg(wxT("OpenArchive()!"), this);
405 //
\8f\91\8cÉ
\82Ì
\83A
\83C
\83R
\83\93\82ð
\8eæ
\93¾
\82µ
\81A
\8f\91\8cÉ
\83\8b\81[
\83g
\82ð
\8dì
\90¬
\81B
406 g_hIconT.Add(wxBitmap(FE_DIR_S_ICO wxT("folder_closed.png"), wxBITMAP_TYPE_ANY));
407 g_hIconT.Add(wxBitmap(FE_DIR_S_ICO wxT("folder_open.png"), wxBITMAP_TYPE_ANY));
408 this->tree_ctrl->SetImageList(& g_hIconT);
410 idRoot = this->tree_ctrl->AddRoot(wxEmptyString),
412 idArchive = this->tree_ctrl->AppendItem(idRoot, piInfo.fiInfo.fnFileName.GetFullName(), g_hIconT.Add(GetFileTypeIcon(piInfo.fiInfo.fnFileName))),
414 idArchive = this->tree_ctrl->AppendItem(idRoot, piInfo.fiInfo.fnFileName.GetFullName(), g_hIconT.Add(GetFileTypeIcon(piInfo.fiInfo.fnFileName).ConvertToImage().Rescale(16, 16))),
416 idArcRoot = this->tree_ctrl->AppendItem(idRoot, wxT("-----"), 0, 1);
418 //
\83t
\83@
\83C
\83\8b\8fî
\95ñ
\82ð
\83\8d\81[
\83h
\81B
419 if (tpi.GetFileInformation(& piInfo.fiInfo, true) == TPI_ERROR_SUCCESS)
421 piInfo.uStatus = 0x1001;
424 piInfo.llProcessedSize++;
425 if (this->ErrorCheck(TPICallbackProc(TPI_NOTIFY_COMMON, & piInfo)) == TPI_CALLBACK_CANCEL)
434 //
\83c
\83\8a\81[
\83r
\83\85\81[
\82É
\94½
\89f
\81B
435 TreeView_CheckNewerItem(this->tree_ctrl, idArcRoot, piInfo.fiInfo.fnFileName.GetPath(wxPATH_GET_VOLUME), true);
437 //
\83f
\83B
\83\8c\83N
\83g
\83\8a\91®
\90«
\82ð
\8aÜ
\82Þ
\82à
\82Ì
\82É
\82Â
\82¢
\82Ä
\82Í
\8f\9c\8b\8e\81B
438 if (piInfo.fiInfo.dwAttribute & TPI_ATTRIBUTE_DIRECTORY)
443 //
\83Z
\83L
\83\85\83\8a\83e
\83B
\83`
\83F
\83b
\83N
\81B
445 if (piInfo.fiInfo.fnFileName.GetPathWithSep().Find(wxT("..")) != wxNOT_FOUND)
447 piInfo.fiInfo.uDanger = TRUE;
448 ::WrnDlg(wxT("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
450 //
\8bó
\94\92\82Ì
\98A
\91±
\82É
\82æ
\82é
\8ag
\92£
\8eq
\8bU
\91\95\82ð
\8c\9f\8d¸
\81B
451 if (piInfo.fiInfo.fnFileName.GetFullName().Find(wxT(" ")) != wxNOT_FOUND)
453 piInfo.fiInfo.uDanger = TRUE;
454 ::WrnDlg(wxT("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
456 // Unicode
\90§
\8cä
\95¶
\8e\9a\82ð
\8c\9f\8d¸
\81B
457 for (wxChar c = 0x200c; c <= 0x206f; c++)
459 if (piInfo.fiInfo.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)
461 piInfo.fiInfo.uDanger = TRUE;
462 ::WrnDlg(wxT("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
466 case 0x200f: c = 0x2027; break;
467 case 0x202e: c = 0x2060; break;
471 //
\8fî
\95ñ
\82ð
\95Û
\91¶
\82µ
\82Ä
\83J
\83E
\83\93\83g
\83A
\83b
\83v
\81B
472 this->fileinfo.Add(piInfo.fiInfo);
474 while (tpi.GetFileInformation(& piInfo.fiInfo, false) == TPI_ERROR_SUCCESS);
477 //
\8f\91\8cÉ
\82Ì
\8fî
\95ñ
\82ð
\8eæ
\93¾
\81B
478 TPI_ARCHIVEINFO aiInfo;
479 if (tpi.GetArchiveInformation(& aiInfo) != TPI_ERROR_SUCCESS)
483 ::ErrDlg(wxT("GetArchiveInformation()!"), this);
487 //
\8f\91\8cÉ
\82ð
\95Â
\82¶
\82é
\81B
488 if (tpi.CloseArchive() != TPI_ERROR_SUCCESS)
490 ::ErrDlg(wxT("CloseArchive()!"), this);
493 //
\83R
\81[
\83\8b\83o
\83b
\83N
\8aÖ
\90\94\82ð
\90Ý
\92è
\81B
494 if (tpi.SetCallbackProc(TPICallbackProc) != TPI_ERROR_SUCCESS)
496 ::ErrDlg(wxT("SetCallbackProc()!"), this);
499 //
\88È
\89º
\81AUI
\8f\88\97\9d\81B
500 this->fileinfo.Shrink();
501 this->tree_ctrl->ExpandAll();
502 this->tree_ctrl->ScrollTo(idArchive);
503 this->tree_ctrl->SelectItem(idArchive);
504 this->list_ctrl->atDangerItem.SetTextColour(* wxRED);
506 //
\83X
\83e
\81[
\83^
\83X
\83o
\81[
\90Ý
\92è
\81B
507 this->statusbar->SetStatusText(aiInfo.fiInfo.szTypeName, 0);
508 this->statusbar->SetStatusText(wxString::Format(wxT("%d file(s)"), this->fileinfo.Count()), 1);
509 this->statusbar->SetStatusText(aiInfo.llUnpackedSize.ToString() + wxT(" B -> ") + aiInfo.llPackedSize.ToString() + wxT(" B"), 2);
510 this->statusbar->SetStatusText(wxString::Format(wxT("%3.1f%%"), aiInfo.wCompressRatio / 10.0), 3);
511 this->statusbar->SetStatusText(szFileName, 4);
513 //
\83c
\81[
\83\8b\83o
\81[
\81E
\83\81\83j
\83\85\81[
\83o
\81[
\90Ý
\92è
\81B
514 SetMenuToolState("Arc_Close", true);
515 SetMenuToolState("Arc_Add", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_ADD) == TPI_COMMAND_ADD);
516 SetMenuToolState("Arc_SFX", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_SFX) == TPI_COMMAND_SFX && aiInfo.nSFXType == 0);
517 SetMenuToolState("Arc_UnSFX", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_UNSFX) == TPI_COMMAND_UNSFX && aiInfo.nSFXType != 0);
518 SetMenuToolState("Arc_Extract", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_EXTRACT)== TPI_COMMAND_EXTRACT);
519 SetMenuToolState("Arc_Delete", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_DELETE) == TPI_COMMAND_DELETE);
520 SetMenuToolState("Arc_Test", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_TEST) == TPI_COMMAND_TEST);
521 SetMenuToolState("Arc_Repair", (aiInfo.fiInfo.llSupportedCommand & TPI_COMMAND_REPAIR) == TPI_COMMAND_REPAIR);
526 void MainFrame::OnArcClose(wxCommandEvent&)
528 //
\83c
\83\8a\81[
\83r
\83\85\81[
\81E
\83\8a\83X
\83g
\83r
\83\85\81[
\90Ý
\92è
\81B
529 this->tree_ctrl->DeleteAllItems();
530 this->list_ctrl->DeleteAllItems();
531 this->list_ctrl->showFileInfo.Clear();
533 //
\83c
\81[
\83\8b\83o
\81[
\81E
\83\81\83j
\83\85\81[
\83o
\81[
\90Ý
\92è
\81B
534 SetMenuToolState("Arc_Close", false);
535 SetMenuToolState("Arc_Add", false);
536 SetMenuToolState("Arc_SFX", false);
537 SetMenuToolState("Arc_UnSFX", false);
538 SetMenuToolState("Arc_Extract", false);
539 SetMenuToolState("Arc_Delete", false);
540 SetMenuToolState("Arc_Test", false);
541 SetMenuToolState("Arc_Repair", false);
543 for (int i = 0; i < this->statusbar->GetFieldsCount(); i++)
545 this->statusbar->SetStatusText(wxEmptyString, i);
547 this->fileinfo.Clear();
549 g_hIconT.RemoveAll();
550 g_hIconLL.RemoveAll();
551 g_hIconLS.RemoveAll();
552 this->tpi.FreeLibrary();
555 void MainFrame::OnArcAdd(wxCommandEvent& e)
557 //
\8f\88\97\9d\91Î
\8fÛ
\82Ì
\83t
\83@
\83C
\83\8b\82ð
\91I
\91ð
\81B
559 wxFileDialog fd(this, wxT("Choose files to add"), this->fnLastOpenPath.GetFullPath());
560 fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE);
561 if (fd.ShowModal() == wxID_CANCEL)
565 fd.GetFilenames(files);
567 //
\8ae
\8eí
\90Ý
\92è
\81B
569 swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory());
570 swInfo.fMakeSFX = false;
571 swInfo.pCustomSwitches = NULL;
572 wxString szArcName = this->statusbar->GetStatusText(4);
574 ProcessDialog procDlg;
575 procDlg.InitDialog();
577 this->ErrorCheck(this->tpi.Command(TPI_COMMAND_ADD, & swInfo, szArcName, files));
580 //
\8f\91\8cÉ
\82ð
\8dÄ
\93Ç
\82Ý
\8d\9e\82Ý
\81B
581 e.SetString(szArcName);
585 void MainFrame::OnArcConvert(wxCommandEvent& e)
588 swInfo.fMakeSFX = e.GetId() == XRCID("Arc_SFX");
590 //
\95Û
\91¶
\90æ
\82ð
\90q
\82Ë
\82é
\81B
591 wxFileName fnArchive(this->statusbar->GetStatusText(4));
592 wxFileDialog fd(this, swInfo.fMakeSFX ? wxT("Save as SFX") : wxT("Save as normal archive"), fnArchive.GetPath(wxPATH_GET_VOLUME), fnArchive.GetName() + (swInfo.fMakeSFX ? EXE_EXT : (wxString) wxEmptyString));
593 fd.SetWindowStyleFlag(wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
594 if (fd.ShowModal() == wxID_CANCEL)
598 swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory());
599 this->fnLastOpenPath = swInfo.fnDestinationDirectory;
602 files.Add(fd.GetPath());
604 ProcessDialog procDlg;
605 procDlg.InitDialog();
607 this->ErrorCheck(this->tpi.Command(swInfo.fMakeSFX ? TPI_COMMAND_SFX : TPI_COMMAND_UNSFX, & swInfo, fnArchive.GetFullPath(), files));
611 void MainFrame::OnArcExtract(wxCommandEvent& e)
614 swInfo.pCustomSwitches = NULL;
616 //
\83\82\81[
\83h
\8eæ
\93¾
\81B
\92Ê
\8fí
\82Í0,
\8eÀ
\8ds
\82È
\82ç1,
\83t
\83@
\83C
\83\8bDnD
\82È
\82ç2
\81A
\83f
\83B
\83\8c\83N
\83g
\83\8aDnD
\82È
\82ç3
\81B
617 int nMode = e.GetInt();
618 //
\8eÀ
\8ds
\8e\9e\82Ì
\82Ý
\8eg
\97p
\81B
619 wxFileType * ftFile = NULL;
621 //
\93W
\8aJ
\83_
\83C
\83A
\83\8d\83O
\82ð
\8dì
\90¬
\81BDnD
\82Ü
\82½
\82Í
\8eÀ
\8ds
\8e\9e\82Í
\95\
\8e¦
\82µ
\82È
\82¢
\81B
623 ::wxXmlResource::Get()->Load(FE_DIR_S_XRC wxT("dlg_make.xrc"));
624 ::wxXmlResource::Get()->LoadDialog(& mkDlg, this, wxT("dlg_make"));
625 mkDlg.bIsMake = false;
626 mkDlg.files = MakeTargetFileList(this, nMode == 1);
632 //
\83R
\83}
\83\93\83h
\82ð
\8eæ
\93¾
\81B
633 ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(wxFileName::FileName(mkDlg.files[0]).GetExt());
636 ::ErrDlg(wxT("Unable to get the file type!"), this);
641 //
\8dì
\8bÆ
\83f
\83B
\83\8c\83N
\83g
\83\8a\8dì
\90¬
\81B
642 swInfo.fStoreDirectoryPathes = false;
643 wxString szDestDirBase = nMode == 3 ? this->tree_ctrl->GetItemText(this->tree_ctrl->GetSelection()) : wxT("tpi_tmp");
644 if (szDestDirBase == wxT("-----"))
646 //
\8f\91\8cÉ
\83\8b\81[
\83g
\82Ì
\82Æ
\82«
\82Í
\8f\91\8cÉ
\96¼
\82É
\82µ
\82Ä
\82¨
\82
\81B
647 szDestDirBase = wxFileName::FileName(this->statusbar->GetStatusText(4)).GetName();
649 swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), szDestDirBase, true);
650 if (! swInfo.fnDestinationDirectory.IsOk())
652 ::ErrDlg(wxT("Unable to make the temporary directory!"), this);
659 if (mkDlg.ShowModal() == wxID_CANCEL)
664 //
\8ae
\8eí
\90Ý
\92è
\81B
665 swInfo.fStoreDirectoryPathes = ! mkDlg.cbIgnorePath->IsChecked();
666 swInfo.fnDestinationDirectory = wxFileName::DirName(mkDlg.cbDir->GetValue());
667 swInfo.szPassword = mkDlg.tcPassword->GetValue();
668 swInfo.szKeyFile = mkDlg.tcKeyfile->GetValue();
670 //
\95K
\97v
\82È
\82ç
\8f\91\8cÉ
\96¼
\82Å
\83f
\83B
\83\8c\83N
\83g
\83\8a\82ð
\8dì
\90¬
\82·
\82é
\81B
671 if (WillMakeDirByArcName(this, & mkDlg))
673 swInfo.fnDestinationDirectory = MakeDirPath(swInfo.fnDestinationDirectory, wxFileName::FileName(this->statusbar->GetStatusText(4)).GetName(), true);
674 if (! swInfo.fnDestinationDirectory.IsOk())
676 ::ErrDlg(wxT("Unable to make the destination directory!"), this);
682 ProcessDialog procDlg;
683 procDlg.InitDialog();
685 int nErrorCode = this->ErrorCheck(this->tpi.Command(TPI_COMMAND_EXTRACT, & swInfo, this->statusbar->GetStatusText(4), mkDlg.files));
690 if (mkDlg.cbOpenAfter->IsChecked())
692 //
\93W
\8aJ
\90æ
\82ð
\8aJ
\82
\81B
694 ::wxExecute(wxT("explorer ") + swInfo.fnDestinationDirectory.GetFullPath());
698 if (mkDlg.cbExitAfter->IsChecked())
706 wxArrayString asFiles;
709 //
\83R
\83}
\83\93\83h
\82ð
\8eÀ
\8ds
\81B
710 asFiles.Add(swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName::FileName(mkDlg.files[0]).GetFullName());
711 if (nErrorCode == TPI_ERROR_SUCCESS)
713 ::wxExecute(ftFile->GetOpenCommand(asFiles[0]), wxEXEC_SYNC);
718 //
\93W
\8aJ
\91Î
\8fÛ
\82ð
\8c\88\92è
\81B
719 wxFileDataObject objFile;
720 for (size_t i = 0; i < mkDlg.files.Count(); i++)
722 wxString szFileName = swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName::FileName(mkDlg.files[i]).GetFullName();
725 //
\83\8a\83X
\83g
\82É
\92Ç
\89Á
\81B
726 objFile.AddFile(szFileName);
728 asFiles.Add(szFileName);
732 objFile.AddFile(swInfo.fnDestinationDirectory.GetPath());
736 wxDropSource dropSource(objFile, this);
737 if (dropSource.DoDragDrop() != wxDragMove)
740 // Linux
\82Å
\82Í
\82Ü
\82¾
\8f\88\97\9d\82ª
\8fI
\82í
\82Á
\82Ä
\82¢
\82È
\82¢(
\83R
\83\93\83e
\83L
\83X
\83g
\83\81\83j
\83\85\81[
\82ª
\95\
\8e¦
\82³
\82ê
\82Ä
\82¢
\82é)
\82Ì
\82Å
\81A
\82Æ
\82è
\82 \82¦
\82¸3
\95b
\82¾
\82¯
\91Ò
\82Â
\81B
746 //
\83t
\83@
\83C
\83\8b\82Æ
\88ê
\8e\9e\83f
\83B
\83\8c\83N
\83g
\83\8a\82ð
\8dí
\8f\9c\81B
747 for (size_t i = 0; i < asFiles.GetCount(); i++)
749 ::wxRemoveFile(asFiles[i]);
751 ::wxRmdir(swInfo.fnDestinationDirectory.GetFullPath());
755 void MainFrame::OnArcDelete(wxCommandEvent& e)
757 //
\91S
\83t
\83@
\83C
\83\8b\8dí
\8f\9c\82Í
\8aë
\8c¯
\82Å
\82Í
\82È
\82¢
\82©
\82Æ
\81B
758 if (this->list_ctrl->GetSelectedItemCount() == 0)
763 if (::AskDlg(wxT("Are you sure to delete selected files?"), this) == wxNO)
768 //
\8ae
\8eí
\90Ý
\92è
\81B
770 wxString szArcName = this->statusbar->GetStatusText(4);
771 wxArrayString files = MakeTargetFileList(this, false);
773 ProcessDialog procDlg;
774 procDlg.InitDialog();
776 this->ErrorCheck(this->tpi.Command(TPI_COMMAND_DELETE, & swInfo, szArcName, files));
779 //
\8f\91\8cÉ
\82ð
\8dÄ
\93Ç
\82Ý
\8d\9e\82Ý
\82·
\82é
\81B
780 e.SetString(szArcName);
784 void MainFrame::OnArcTest(wxCommandEvent&)
786 //
\8ae
\8eí
\90Ý
\92è
\81B
787 wxArrayString files = MakeTargetFileList(this, false);
790 ProcessDialog procDlg;
791 procDlg.InitDialog();
793 if (this->ErrorCheck(this->tpi.Command(TPI_COMMAND_TEST, & swInfo, this->statusbar->GetStatusText(4), files)) == TPI_ERROR_SUCCESS)
795 ::MsgDlg(wxT("This is a correct archive."), & procDlg, wxICON_INFORMATION);
800 void MainFrame::OnArcRepair(wxCommandEvent&)
802 //
\8ae
\8eí
\90Ý
\92è
\81B
803 wxArrayString files = MakeTargetFileList(this, false);
806 ProcessDialog procDlg;
807 procDlg.InitDialog();
809 this->ErrorCheck(this->tpi.Command(TPI_COMMAND_REPAIR, & swInfo, this->statusbar->GetStatusText(4), files));
813 void MainFrame::OnViewMode(wxCommandEvent & e)
816 this->menubar->Check(n, true);
817 this->list_ctrl->SetSingleStyle(wxLC_REPORT, n == XRCID("Exe_View_Details"));
818 this->list_ctrl->SetSingleStyle(wxLC_ICON, n == XRCID("Exe_View_Icons"));
819 this->list_ctrl->SetSingleStyle(wxLC_LIST, n == XRCID("Exe_View_List"));
822 void MainFrame::OnShowToolBar(wxCommandEvent & e)
824 this->toolbar->Show(e.IsChecked());
827 void MainFrame::OnShowStatusBar(wxCommandEvent & e)
829 this->statusbar->Show(e.IsChecked());
832 void MainFrame::OnSelectAll(wxCommandEvent &)
834 for (int i = 0; i < this->list_ctrl->GetItemCount(); i++)
836 this->list_ctrl->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
842 void MainFrame::OnTreeChanged(wxTreeEvent& e)
844 //
\83c
\83\8a\81[
\83r
\83\85\81[
\82©
\82ç
\83p
\83X
\82ð
\8eæ
\93¾
\81B
845 wxString szNodePath = TreeView_GetItemPath(this->tree_ctrl, e.GetItem());
846 //
\83\8a\83X
\83g
\83r
\83\85\81[
\82ð
\8f\89\8aú
\89»
\81B
847 this->list_ctrl->showFileInfo.Clear();
848 g_hIconLL.RemoveAll();
849 g_hIconLS.RemoveAll();
851 //
\83A
\83C
\83R
\83\93\90Ý
\92è
\81B
852 this->list_ctrl->SetImageList(& g_hIconLL, wxIMAGE_LIST_NORMAL);
853 this->list_ctrl->SetImageList(& g_hIconLS, wxIMAGE_LIST_SMALL);
855 //
\94z
\97ñ
\82Æ
\94ä
\8ar
\82µ
\81A
\83p
\83X
\82ª
\88ê
\92v
\82µ
\82È
\82¯
\82ê
\82Î
\8fÁ
\82·
\81B
856 for (size_t i = 0; i < this->fileinfo.GetCount(); i++)
858 //
\83p
\83X
\82ð
\94ä
\8ar
\81B
859 if (szNodePath == wxT("*") || szNodePath == this->fileinfo[i].fnFileName.GetPath())
861 //
\8d\80\96Ú
\82ª
\83t
\83H
\83\8b\83_
\82Å
\82 \82é
\82È
\82ç
\96³
\8e\8b\81B
862 if (this->fileinfo[i].fnFileName.IsDir() || ! TreeView_CheckNewerItem(this->tree_ctrl, this->tree_ctrl->GetLastChild(this->tree_ctrl->GetRootItem()), this->fileinfo[i].fnFileName.GetFullPath(), false))
867 //
\83t
\83B
\83\8b\83^
\82É
\82©
\82©
\82ç
\82È
\82¯
\82ê
\82Î
\96³
\8e\8b\81B
868 if (this->fileinfo[i].fnFileName.GetFullName().MakeLower().Find(this->tcFilter->GetValue().MakeLower()) == wxNOT_FOUND)
873 this->list_ctrl->showFileInfo.Add(this->fileinfo[i]);
877 //
\83\
\81[
\83g
\82µ
\82Ä
\95\
\8e¦
\81B
878 this->list_ctrl->showFileInfo.Sort(& ListCtrlCompareProc);
879 this->list_ctrl->SetItemCount(this->list_ctrl->showFileInfo.Count());
882 void MainFrame::OnTreeBeginDrag(wxTreeEvent& e)
884 // TODO :
\83A
\83C
\83e
\83\80\82ª
\8eq
\8aK
\91w
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82Ä
\82à
\93W
\8aJ
\82Å
\82«
\82È
\82¢
\81B
885 this->tree_ctrl->SelectItem(e.GetItem());
886 for (int i = 0; i < this->list_ctrl->GetItemCount(); i++)
888 this->list_ctrl->SetItemState(i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
893 this->OnArcExtract(e1);
898 void MainFrame::OnListItemDClick(wxListEvent&)
902 this->OnArcExtract(e);
905 void MainFrame::OnListBeginDrag(wxListEvent&)
907 if (this->list_ctrl->GetSelectedItemCount() == 0)
909 //
\83A
\83C
\83e
\83\80\82ð
\91I
\91ð
\82¹
\82¸
\83h
\83\89\83b
\83O
\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\8fê
\8d\87\81B
915 this->OnArcExtract(e);
920 void MainFrame::OnFilter(wxCommandEvent&)
923 e.SetItem(this->tree_ctrl->GetSelection());
924 this->OnTreeChanged(e);
927 //
\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89\88È
\8aO
\81B
929 int MainFrame::LoadTPI(wxString & szFileName)
931 // TPI
\82ð
\93Ç
\82Ý
\8d\9e\82Ý
\81B
933 fs.ChangePathTo(FE_DIR_B_LIB, true);
934 wxString szTPIName = fs.FindFirst(wxT("*" TPI_EXT), wxFILE);
936 while (! szTPIName.IsEmpty())
938 //
\91Î
\89\9e\8am
\94F
\81B
939 if (! tpi.InitLibrary(szTPIName, szFileName, 0) || ! tpi.CheckArchive(szFileName, & nFileCount) || nFileCount < 0)
942 szTPIName = fs.FindNext();
950 int MainFrame::ErrorCheck(int nErrorCode)
954 //
\82Ç
\82¿
\82ç
\82à
\92l
\82ªTRUE
\82È
\82Ì
\82Å
\8eb
\92è
\93I
\82É
\83R
\83\81\83\93\83g
\83A
\83E
\83g
\81B
955 case TPI_ERROR_SUCCESS:
956 // case TPI_CALLBACK_CONTINUE:
958 case TPI_ERROR_D_UNSUPPORTED:
959 ::ErrDlg(wxT("Sorry, this function is not supported yet."), this);
961 case TPI_ERROR_D_SKIPPED:
962 case TPI_CALLBACK_CANCEL:
963 ::ErrDlg(wxT("This operation is canceled by the user."), this);
966 ::ErrDlg(wxT("Error code is ") + wxString::Format(wxT("%d."), nErrorCode), this);