2025-04-03 17:19:39 +08:00
|
|
|
#ifndef MODEDIRCTRL_H
|
|
|
|
#define MODEDIRCTRL_H
|
|
|
|
|
2025-04-04 16:55:15 +08:00
|
|
|
#include "transmhandler.h"
|
2025-04-05 21:58:23 +08:00
|
|
|
#include <wx/treectrl.h>
|
2025-04-04 16:55:15 +08:00
|
|
|
#include <wx/wx.h>
|
2025-04-03 17:19:39 +08:00
|
|
|
|
2025-04-05 21:58:23 +08:00
|
|
|
class CModeDirCtrl : public wxTreeCtrl
|
2025-04-04 16:55:15 +08:00
|
|
|
{
|
2025-04-03 17:19:39 +08:00
|
|
|
public:
|
2025-04-04 16:55:15 +08:00
|
|
|
CModeDirCtrl(wxWindow* parent, wxWindowID id = wxID_ANY);
|
2025-04-05 21:58:23 +08:00
|
|
|
~CModeDirCtrl() override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool SetRootPath(const wxString& path);
|
|
|
|
void RefreshCurrent();
|
2025-04-04 16:55:15 +08:00
|
|
|
|
|
|
|
protected:
|
2025-04-05 21:58:23 +08:00
|
|
|
class TreeItemData : public wxTreeItemData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit TreeItemData(const wxString& path) : path_(path)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
wxString path_;
|
|
|
|
};
|
|
|
|
|
|
|
|
void BuildTree();
|
|
|
|
void AddChildren(wxTreeItemId parent);
|
|
|
|
wxString GetFullPath(wxTreeItemId item) const;
|
|
|
|
|
|
|
|
void OnItemActivated(wxTreeEvent& event);
|
|
|
|
void OnItemExpanding(wxTreeEvent& event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString rootPath_{};
|
|
|
|
wxImageList* imageList_{};
|
2025-04-03 17:19:39 +08:00
|
|
|
};
|
|
|
|
|
2025-04-04 16:55:15 +08:00
|
|
|
#endif // MODEDIRCTRL_H
|