Tyro/src/widgets/FilePane.h

30 lines
804 B
C
Raw Normal View History

2016-01-13 09:29:09 -05:00
#pragma once
2019-05-14 16:23:47 -04:00
#include <unordered_set>
2015-07-07 10:01:17 -04:00
#include "src/widgets/widget.h"
class FilePane : public wxTreeListCtrl {
public:
2019-03-20 16:49:25 -04:00
explicit FilePane(
2015-07-07 10:01:17 -04:00
wxWindow *parent,
wxWindowID id=wxID_ANY,
const wxPoint &pos=wxDefaultPosition,
const wxSize &size=wxDefaultSize,
long style=wxTL_DEFAULT_STYLE,
const wxString &name=wxTreeListCtrlNameStr
);
2019-03-20 16:49:25 -04:00
~FilePane() override;
private:
2015-10-22 11:06:34 -04:00
wxString curr_path = "";
2015-07-07 10:01:17 -04:00
wxImageList *img_list = nullptr;
2019-05-14 16:23:47 -04:00
unordered_set<std::string> file_set;
unordered_set<std::string> dir_set;
2015-10-22 11:06:34 -04:00
void BindEvents();
void OpenFolder(wxTreeListEvent& event);
2019-03-20 16:49:25 -04:00
void OpenFileInEditor(wxTreeListEvent& event);
2015-07-07 10:01:17 -04:00
void InitImageList();
2019-05-14 16:23:47 -04:00
void CreateTree(const wxString &path, wxTreeListItem &root);
void DirToTree(const wxString &path, wxTreeListItem &root, const wxString &parent);
};