5#include <wx/bmpbuttn.h>
7#include <wx/filename.h>
8#include <wx/imaglist.h>
9#include <wx/scrolwin.h>
10#include <wx/splitter.h>
11#include <wx/srchctrl.h>
13#include <wx/treectrl.h>
14#include <wx/wrapsizer.h>
44 wxBitmap
GetIcon()
const override;
86 void AddGridItem(
const wxString &name,
const wxString &fullPath,
bool isDirectory);
89 wxBitmap
LoadGridIcon(
const wxString &iconType,
const wxSize &size);
153 void ExpandAllMatching(wxTreeItemId item,
const wxString &searchText,
bool &foundAny);
157 void NavigateToPath(
const wxString &path,
bool recordHistory =
true);
161 wxTreeItemId
FindTreeItemByPath(
const wxString &path, wxTreeItemId parent = wxTreeItemId());
168 bool CreateNewFolder(
const wxString &parentPath,
const wxString &folderName);
169 bool RenameFolder(
const wxString &oldPath,
const wxString &newName);
171 bool CopyFolder(
const wxString &sourcePath,
const wxString &destPath);
172 bool MoveFolder(
const wxString &sourcePath,
const wxString &destPath);
176 bool RenameFile(
const wxString &oldPath,
const wxString &newName);
178 bool CopyFile(
const wxString &sourcePath,
const wxString &destPath);
179 bool MoveFile(
const wxString &sourcePath,
const wxString &destPath);
181 void OpenFile(
const wxString &filePath);
310 wxString
GetDisplayName(
const wxString &filename,
bool isDirectory,
bool isTreeView)
const;
virtual ~FileExplorerTab()
Destructor.
bool m_treeShowFileExtensions
bool CreateNewFolder(const wxString &parentPath, const wxString &folderName)
wxBitmap GetIcon() const override
Returns the tab icon bitmap; defaults to null.
void OnContextMenuDelete(wxCommandEvent &event)
void OnGridBackgroundContextMenu(wxMouseEvent &event)
void OpenFile(const wxString &filePath)
wxIcon LoadTreeIcon(const wxString &iconType)
void Initialize() override
Called once when the tab is first created.
wxString m_currentGridPath
bool m_gridShowHiddenFiles
bool CanMove() const override
Returns true if the tab can be moved/reordered.
void OnContextMenuOpen(wxCommandEvent &event)
void OnForwardButton(wxCommandEvent &event)
void OnSplitterSashPosChanging(wxSplitterEvent &event)
bool CopyFile(const wxString &sourcePath, const wxString &destPath)
wxPanel * m_breadcrumbContainerPanel
bool m_gridShowFileExtensions
void OnGridContextMenu(wxMouseEvent &event)
FileExplorerTab(wxWindow *parent)
Constructor.
void OnActivated() override
Called when the tab becomes active.
wxString m_contextMenuPath
void OnTreeContextMenu(wxTreeEvent &event)
void OnContextMenuCopy(wxCommandEvent &event)
void OnGridSearchTextChanged(wxCommandEvent &event)
void FilterGrid(const wxString &searchText)
void OnContextMenuPaste(wxCommandEvent &event)
void OnContextMenuProperties(wxCommandEvent &event)
void OnGridSearchCancel(wxCommandEvent &event)
std::vector< GridItem > m_gridItems
std::vector< wxString > m_forwardStack
void OnGridItemDoubleClick(wxMouseEvent &event)
static const size_t MAX_ACTIVITY_ENTRIES
wxString GetDisplayName(const wxString &filename, bool isDirectory, bool isTreeView) const
wxScrolledWindow * m_historyPanel
void OnContextMenuCut(wxCommandEvent &event)
wxScrolledWindow * m_gridCtrl
bool m_isNavigatingHistory
void ShowFileProperties(const wxString &filePath)
void OnTreeToggle(wxCommandEvent &event)
void CreateHistoryPanel(wxPanel *rightPanel, wxBoxSizer *rightSizer)
wxSplitterWindow * m_splitter
void OnHistoryButton(wxCommandEvent &event)
void PopulateHistoryPanel()
bool MoveFile(const wxString &sourcePath, const wxString &destPath)
void UpdateBreadcrumbVisibility()
void AddDirectoryToTree(const wxString &path, wxTreeItemId parentItem)
bool CopyFolder(const wxString &sourcePath, const wxString &destPath)
wxString GetTabType() const override
Returns the tab type identifier.
void OnBeginDrag(wxTreeEvent &event)
void OnContextMenuNewFolder(wxCommandEvent &event)
wxToggleButton * m_jsonFilterBtn
int CountFilesInDirectory(const wxString &path, bool recursive=true) const
void AddGridItem(const wxString &name, const wxString &fullPath, bool isDirectory)
FileExplorerTab & operator=(const FileExplorerTab &)=delete
void OnItemExpanding(wxTreeEvent &event)
wxBoxSizer * m_breadcrumbSizer
void SyncToolbarWithSplitter()
wxPanel * m_functionalPanel
void OnClosed() override
Called when the tab is closed.
wxWindow * m_selectedGridItem
std::map< wxString, wxBitmap > m_gridIcons
wxWrapSizer * m_gridSizer
bool RenameFolder(const wxString &oldPath, const wxString &newName)
wxWindow * GetWidget() override
Returns the wxWidgets window used as the tab content.
FileExplorerTab(const FileExplorerTab &)=delete
wxString GetTitle() const override
Returns the display title of the tab.
wxToggleButton * m_pngFilterBtn
void OnSelectionChanged(wxTreeEvent &event)
wxBitmap LoadGridIcon(const wxString &iconType, const wxSize &size)
wxToggleButton * m_gridToggleBtn
void UpdateToggleButtonAppearance()
void UpdateHistoryVisibility()
void OnTreeSearchCancel(wxCommandEvent &event)
void OnSplitterSashPosChanged(wxSplitterEvent &event)
void Refresh() override
Refreshes the tab content.
bool DirectoryContainsMatchingFiles(const wxString &dirPath) const
wxToggleButton * m_xmlFilterBtn
wxString GetSelectedFile() const
Get the current selected file path.
void OnGridToggle(wxCommandEvent &event)
void PopulateGrid(const wxString &path)
void OnBackButton(wxCommandEvent &event)
bool DeleteFolder(const wxString &folderPath)
void AddToNavigationHistory(const wxString &path)
wxTreeItemId FindTreeItemByPath(const wxString &path, wxTreeItemId parent=wxTreeItemId())
wxBitmapButton * m_historyButton
wxString GetDirectorySize(const wxString &path) const
void LogActivity(ActivityType type, const wxString &path, const wxString &details="")
wxImageList * m_imageList
bool DirectoryContainsFilteredFiles(const wxString &path) const
void CreateBreadcrumb(wxPanel *rightPanel, wxBoxSizer *rightSizer)
void OnItemActivated(wxTreeEvent &event)
void UpdateViewVisibility()
bool RenameFile(const wxString &oldPath, const wxString &newName)
wxSearchCtrl * m_gridSearchCtrl
void CreateFavoritesBar(wxBoxSizer *parentSizer)
void NavigateToPath(const wxString &path, bool recordHistory=true)
bool DeleteFile(const wxString &filePath)
wxString GetExecutableDirectory() const
bool m_treeShowHiddenFiles
void SetRootDirectory(const wxString &path)
Set the root directory to display.
void ShowFolderProperties(const wxString &folderPath)
void OnNavigationKeyDown(wxKeyEvent &event)
wxPanel * m_navigationPanel
void OnContextMenuRefresh(wxCommandEvent &event)
wxPanel * m_breadcrumbPanel
std::vector< wxString > m_backStack
wxSearchCtrl * m_treeSearchCtrl
void FilterTree(const wxString &searchText)
void ExpandAllMatching(wxTreeItemId item, const wxString &searchText, bool &foundAny)
wxToggleButton * m_treeToggleBtn
void OnGridItemMouseMove(wxMouseEvent &event)
void UpdateNavigationButtons()
void OnGridItemMouseUp(wxMouseEvent &event)
void OnTreeSearchTextChanged(wxCommandEvent &event)
void OnBreadcrumbClick(wxCommandEvent &event)
wxBitmapButton * m_gridBackButton
void CreateSplitLayout(wxBoxSizer *parentSizer)
wxBitmapButton * m_gridForwardButton
void CreateIconGrid(wxPanel *rightPanel, wxBoxSizer *rightSizer)
bool CanClose() const override
Returns true if the tab can be closed.
wxBoxSizer * m_contentSizer
bool MoveFolder(const wxString &sourcePath, const wxString &destPath)
void OnDeactivated() override
Called when the tab becomes inactive.
void UpdateTreeImageList()
void OnContextMenuRename(wxCommandEvent &event)
bool ItemMatchesSearch(wxTreeItemId item, const wxString &searchText) const
bool IsValid() const override
Returns true if the tab is in a valid state.
bool PassesFilter(const wxString &filename) const
std::vector< ActivityEntry > m_activityHistory
void OnGridItemMouseDown(wxMouseEvent &event)
void OnFavoriteFilter(wxCommandEvent &event)
Interface for tab-based UI components in the application.