Remove old file pane object, and fix travis build

This commit is contained in:
Tim Warren 2015-07-07 10:09:16 -04:00
parent 37fbde33e3
commit 4f14e4289d
3 changed files with 1 additions and 124 deletions

View File

@ -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();
}

View File

@ -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 */

View File

@ -1,9 +1,9 @@
#ifndef TRAVIS
#include "src/widgets/PrefPane.h" #include "src/widgets/PrefPane.h"
#include "src/widgets/MainFrame.h" #include "src/widgets/MainFrame.h"
extern wxConfigBase *Glob_config; extern wxConfigBase *Glob_config;
#ifndef TRAVIS
class GeneralPrefPanePage : public wxPanel { class GeneralPrefPanePage : public wxPanel {
public: public:
GeneralPrefPanePage(wxWindow *parent) GeneralPrefPanePage(wxWindow *parent)