From 4f14e4289d84a88fc9ef493b89380f2c1134ea0e Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Tue, 7 Jul 2015 10:09:16 -0400 Subject: [PATCH] Remove old file pane object, and fix travis build --- src/widgets/OldFilePane.cc | 98 -------------------------------------- src/widgets/OldFilePane.hh | 25 ---------- src/widgets/PrefPane.cpp | 2 +- 3 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 src/widgets/OldFilePane.cc delete mode 100644 src/widgets/OldFilePane.hh diff --git a/src/widgets/OldFilePane.cc b/src/widgets/OldFilePane.cc deleted file mode 100644 index fd154ad..0000000 --- a/src/widgets/OldFilePane.cc +++ /dev/null @@ -1,98 +0,0 @@ -#include "widget.h" - -extern MainFrame *Glob_main_frame; - -enum CustomFilePaneEventIds { - myFP_ID_OPEN = (wxID_HIGHEST * 2), - myFP_ID_RENAME, - myFP_ID_DELETE -}; - -/** - * Constructor - * @param parent - * @param id - * @param dir - * @param pos - * @param size - * @param style - * @param filter - */ -FilePane::FilePane( - wxWindow* parent, - const wxWindowID id, - const wxString &dir, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &filter -) : wxGenericDirCtrl(parent, id, dir, pos, size, style, filter) -{ - this->CreateContextMenu(); - this->BindEvents(); - - this->CollapseTree(); - - this->SetDefaultPath(wxStandardPaths::Get().GetDocumentsDir() + "../"); - this->SetPath(this->GetDefaultPath()); -} - -/** - * Destructor - */ -FilePane::~FilePane() -{ - wxLogDebug("File Pane Destructor Called."); - delete this->contextMenu; -} - -/** - * Bind event handlers - * - * @return void - */ -void FilePane::BindEvents() -{ - // Open files on double-click or enter - this->Bind(wxEVT_DIRCTRL_FILEACTIVATED, [=](wxTreeEvent&) { - wxLogDebug("File activated event fired"); - this->OpenSelectedFiles(); - }, wxID_ANY); - - // Context Menu - this->Bind(wxEVT_TREE_ITEM_RIGHT_CLICK, [=](wxTreeEvent&) { - this->PopupMenu(this->contextMenu); - }, wxID_ANY); - - // Open file(s) - this->Bind(wxEVT_MENU, [=](wxCommandEvent&) { - this->OpenSelectedFiles(); - }, myFP_ID_OPEN); -} - -/** - * Create the filePane Context Menu - * - * @return void - */ -void FilePane::CreateContextMenu() -{ - this->contextMenu = new wxMenu(); - this->contextMenu->Append(myFP_ID_OPEN, "&Open Ctrl+Shift+O", "Open the selected file(s)"); - //this->contextMenu->Append(myFP_ID_RENAME, "&Rename Ctrl+Shift+R", "Rename the selected file"); - //this->contextMenu->Append(myFP_ID_DELETE, "Delete", "Delete the selected file"); -} - -/** - * Open the files that are currently selected in the file pane in the current - * editor window - * - * @return void - */ -void FilePane::OpenSelectedFiles() -{ - wxArrayString paths; - this->GetPaths(paths); - Glob_main_frame->OpenFiles(paths); - this->UnselectAll(); -} \ No newline at end of file diff --git a/src/widgets/OldFilePane.hh b/src/widgets/OldFilePane.hh deleted file mode 100644 index f697802..0000000 --- a/src/widgets/OldFilePane.hh +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef TYRO_FILE_PANE_H -#define TYRO_FILE_PANE_H - -class FilePane : public wxGenericDirCtrl { -public: - FilePane( - wxWindow *parent, - const wxWindowID id = wxID_ANY, - const wxString &dir = wxDirDialogDefaultFolderStr, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxDIRCTRL_3D_INTERNAL | wxDIRCTRL_EDIT_LABELS | - wxDIRCTRL_SHOW_FILTERS | wxDIRCTRL_MULTIPLE, - const wxString &filter = wxEmptyString - ); - ~FilePane(); -private: - wxMenu *contextMenu = nullptr; - void BindEvents(); - void CreateContextMenu(); - void OpenSelectedFiles(); -}; - -#endif /* TYRO_FILE_PANE_H */ - diff --git a/src/widgets/PrefPane.cpp b/src/widgets/PrefPane.cpp index 8681f74..949757d 100644 --- a/src/widgets/PrefPane.cpp +++ b/src/widgets/PrefPane.cpp @@ -1,9 +1,9 @@ +#ifndef TRAVIS #include "src/widgets/PrefPane.h" #include "src/widgets/MainFrame.h" extern wxConfigBase *Glob_config; -#ifndef TRAVIS class GeneralPrefPanePage : public wxPanel { public: GeneralPrefPanePage(wxWindow *parent)