summaryrefslogtreecommitdiff
path: root/LiteEditor/fileexplorer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LiteEditor/fileexplorer.cpp')
-rw-r--r--LiteEditor/fileexplorer.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/LiteEditor/fileexplorer.cpp b/LiteEditor/fileexplorer.cpp
index 17ae4f4c..95d6a7b4 100644
--- a/LiteEditor/fileexplorer.cpp
+++ b/LiteEditor/fileexplorer.cpp
@@ -1,25 +1,25 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
-// copyright : (C) 2008 by Eran Ifrah
-// file name : fileexplorer.cpp
-//
+// copyright : (C) 2008 by Eran Ifrah
+// file name : fileexplorer.cpp
+//
// -------------------------------------------------------------------------
-// A
-// _____ _ _ _ _
-// / __ \ | | | | (_) |
-// | / \/ ___ __| | ___| | _| |_ ___
-// | | / _ \ / _ |/ _ \ | | | __/ _ )
-// | \__/\ (_) | (_| | __/ |___| | || __/
-// \____/\___/ \__,_|\___\_____/_|\__\___|
-//
-// F i l e
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
+// A
+// _____ _ _ _ _
+// / __ \ | | | | (_) |
+// | / \/ ___ __| | ___| | _| |_ ___
+// | | / _ \ / _ |/ _ \ | | | __/ _ )
+// | \__/\ (_) | (_| | __/ |___| | || __/
+// \____/\___/ \__,_|\___\_____/_|\__\___|
+//
+// F i l e
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#include "wx/xrc/xmlres.h"
@@ -28,7 +28,7 @@
#include "wx/sizer.h"
#include "wx/tokenzr.h"
-#include "macros.h"
+#include "macros.h"
#include "globals.h"
#include "plugin.h"
#include "editor_config.h"
@@ -62,17 +62,17 @@ void FileExplorer::CreateGUIControls()
SetSizer(mainSizer);
wxToolBar *tb = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_NODIVIDER);
-
+
mainSizer->Add(tb, 0, wxEXPAND);
-
+
#ifdef __WXMSW__
#if wxUSE_FSVOLUME
wxArrayString volumes;
Connect(wxEVT_THREAD_VOLUME_COMPLETED, wxCommandEventHandler(FileExplorer::OnVolumes), NULL, this);
-
+
m_thread.Create();
m_thread.Run();
-
+
m_volumes = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, volumes, 0 );
mainSizer->Add(m_volumes, 0, wxEXPAND|wxALL, 1);
ConnectChoice(m_volumes, FileExplorer::OnVolumeChanged);
@@ -82,13 +82,13 @@ void FileExplorer::CreateGUIControls()
m_fileTree = new FileExplorerTree(this, wxID_ANY);
m_fileTree->Connect(wxVDTC_ROOT_CHANGED, wxCommandEventHandler(FileExplorer::OnRootChanged), NULL, this);
mainSizer->Add(m_fileTree, 1, wxEXPAND|wxALL, 1);
-
+
tb->AddTool(XRCID("link_editor"), wxEmptyString, wxXmlResource::Get()->LoadBitmap(wxT("link_editor")), wxT("Link Editor"), wxITEM_CHECK);
tb->ToggleTool(XRCID("link_editor"), m_isLinkedToEditor);
tb->AddTool(XRCID("collapse_all"), wxEmptyString, wxXmlResource::Get()->LoadBitmap(wxT("collapse")), wxT("Collapse All"), wxITEM_NORMAL);
tb->AddTool(XRCID("go_home"), wxEmptyString, wxXmlResource::Get()->LoadBitmap(wxT("gohome")), wxT("Goto Current Directory"), wxITEM_NORMAL);
tb->Realize();
-
+
Connect( XRCID("link_editor"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( FileExplorer::OnLinkEditor ));
Connect( XRCID("collapse_all"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( FileExplorer::OnCollapseAll ));
Connect( XRCID("go_home"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( FileExplorer::OnGoHome ));
@@ -113,12 +113,14 @@ void FileExplorer::OnCollapseAll(wxCommandEvent &e)
if (sel.IsOk()) {
m_fileTree->EnsureVisible(sel);
}
+ m_fileTree->SetFocus();
}
void FileExplorer::OnGoHome(wxCommandEvent &e)
{
wxUnusedVar(e);
m_fileTree->ExpandToPath(wxGetCwd());
+ m_fileTree->SetFocus();
}
void FileExplorer::OnLinkEditor(wxCommandEvent &e)
@@ -179,7 +181,7 @@ void FileExplorer::OnRootChanged(wxCommandEvent &e)
m_volumes->SetStringSelection(vol);
#endif
#endif
- SendCmdEvent(wxEVT_FILE_EXP_INIT_DONE); //TODO: pass &vol?
+ SendCmdEvent(wxEVT_FILE_EXP_INIT_DONE);
}
e.Skip();
}
@@ -190,6 +192,7 @@ void FileExplorer::OnVolumeChanged(wxCommandEvent &e)
{
wxUnusedVar(e);
m_fileTree->SetRootPath(m_volumes->GetStringSelection());
+ m_fileTree->SetFocus();
}
void FileExplorer::OnVolumes(wxCommandEvent &e)