Tyro/src/widgets/FilePane.cpp

55 lines
987 B
C++
Raw Normal View History

2015-07-07 10:01:17 -04:00
#include "src/widgets/FilePane.h"
FilePane::FilePane(
wxWindow* parent,
2015-07-07 10:01:17 -04:00
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString &name
) : wxTreeListCtrl(parent, id, pos, size, style, name)
{
2015-07-07 10:01:17 -04:00
this->dir = new wxDir();
this->InitImageList();
this->SetImageList(this->img_list);
this->dir->Open(".");
2015-07-07 10:01:17 -04:00
this->AppendColumn("",
wxCOL_WIDTH_AUTOSIZE,
wxALIGN_LEFT,
wxCOL_RESIZABLE | wxCOL_SORTABLE);
2015-07-07 10:01:17 -04:00
wxTreeListItem root = this->GetRootItem();
}
FilePane::~FilePane()
{
2015-07-07 10:01:17 -04:00
}
2015-07-07 10:01:17 -04:00
void FilePane::InitImageList()
{
2015-07-07 10:01:17 -04:00
wxSize iconSize = wxArtProvider::GetSizeHint(wxART_LIST);
2015-07-07 10:01:17 -04:00
if (iconSize == wxDefaultSize)
{
iconSize = wxSize(16, 16);
}
2015-07-07 10:01:17 -04:00
this->img_list = new wxImageList(iconSize.x, iconSize.y);
static const char* icons[] =
{
wxART_NORMAL_FILE,
wxART_FOLDER,
wxART_FOLDER_OPEN
};
for (unsigned n = 0; n < WXSIZEOF(icons); n++)
{
this->img_list->Add(
wxArtProvider::GetIcon(icons[n], wxART_LIST, iconSize)
);
}
}