Permalink
Browse files

Move ProjectPane's DirItemData to .cpp

  • Loading branch information...
1 parent 258ab05 commit 6fdb5e3afc04f8ed85cf9d2397f6e384572653c2 @adamv adamv committed Oct 16, 2009
Showing with 45 additions and 47 deletions.
  1. +44 −30 src/ProjectPane.cpp
  2. +1 −17 src/ProjectPane.h
View
@@ -42,6 +42,50 @@
#pragma warning(pop)
#endif
+class DirItemData : public wxTreeItemData
+{
+public:
+ DirItemData(const wxString& path, const wxString& name, bool isDir, unsigned int image_id, std::vector<unsigned int>& freeImages);
+ virtual ~DirItemData();
+
+ void SetNewPath(const wxString& path);
+ void SetImage(unsigned int image_id);
+
+ wxString m_path, m_name;
+ bool m_isDir;
+ bool m_isHidden;
+ bool m_isExpanded;
+ int m_imageId;
+ std::vector<unsigned int>& m_freeImages;
+};
+
+DirItemData::DirItemData(const wxString& path, const wxString& name, bool isDir, unsigned int image_id, std::vector<unsigned int>& fi):
+ m_path(path), m_name(name),
+ m_isDir(isDir),
+ m_isHidden(false), m_isExpanded(false),
+ m_imageId(image_id),
+ m_freeImages(fi) {}
+
+DirItemData::~DirItemData() {
+ //const wxString msg = wxString::Format(wxT("delItem: %s (%d)\n"), m_path.c_str(), m_imageId);
+ //OutputDebugString(msg);
+ if (m_imageId != -1 && m_imageId != 0) m_freeImages.push_back(m_imageId); // zero is always generic folder
+}
+
+void DirItemData::SetImage(unsigned int image_id) {
+ //const wxString msg = wxString::Format(wxT("setImage: %s (%d -> %d)\n"), m_path.c_str(), m_imageId, image_id);
+ //OutputDebugString(msg);
+ if (m_imageId != -1 && m_imageId != 0) m_freeImages.push_back(m_imageId); // zero is always generic folder
+ m_imageId = image_id;
+}
+
+void DirItemData::SetNewPath(const wxString& path) {
+ m_path = path;
+ m_name = wxFileNameFromPath(path);
+}
+
+
+
// ctrl ids
enum {
ID_PRJTREE,
@@ -2003,36 +2047,6 @@ WXLRESULT ProjectPane::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPar
#endif //__WXMSW__
-//-----------------------------------------------------------------------------
-// DirItemData
-//-----------------------------------------------------------------------------
-
-ProjectPane::DirItemData::DirItemData(const wxString& path, const wxString& name, bool isDir, unsigned int image_id, std::vector<unsigned int>& fi)
-: m_path(path), m_name(name), m_isDir(isDir), m_isHidden(false), m_isExpanded(false),
- m_imageId(image_id), m_freeImages(fi) {
-}
-
-ProjectPane::DirItemData::~DirItemData() {
- //const wxString msg = wxString::Format(wxT("delItem: %s (%d)\n"), m_path.c_str(), m_imageId);
- //OutputDebugString(msg);
-
- if (m_imageId != -1 && m_imageId != 0) m_freeImages.push_back(m_imageId); // zero is always generic folder
-}
-
-void ProjectPane::DirItemData::SetImage(unsigned int image_id) {
- //const wxString msg = wxString::Format(wxT("setImage: %s (%d -> %d)\n"), m_path.c_str(), m_imageId, image_id);
- //OutputDebugString(msg);
-
- if (m_imageId != -1 && m_imageId != 0) m_freeImages.push_back(m_imageId); // zero is always generic folder
- m_imageId = image_id;
-}
-
-void ProjectPane::DirItemData::SetNewPath(const wxString& path)
-{
- m_path = path;
- m_name = wxFileNameFromPath(path);
-}
-
// -- DropTarget -----------------------------------------------------------------
ProjectPane::DropTarget::DropTarget(ProjectPane& parent) : m_parent(parent) {
View
@@ -42,6 +42,7 @@ class RemoteThread;
class RemoteProfile;
class cxRemoteListEvent;
class cxRemoteAction;
+class DirItemData; // Defined in ProjectPane.cpp
class ProjectPane : public wxPanel, public wxThreadHelper {
public:
@@ -78,23 +79,6 @@ class ProjectPane : public wxPanel, public wxThreadHelper {
#endif
private:
- class DirItemData : public wxTreeItemData
- {
- public:
- DirItemData(const wxString& path, const wxString& name, bool isDir, unsigned int image_id, std::vector<unsigned int>& freeImages);
- ~DirItemData();
-
- void SetNewPath(const wxString& path);
- void SetImage(unsigned int image_id);
-
- wxString m_path, m_name;
- bool m_isDir;
- bool m_isHidden;
- bool m_isExpanded;
- int m_imageId;
- std::vector<unsigned int>& m_freeImages;
- };
-
#ifdef __WXGTK__
static bool GetIconFromFilePath(const wxString& path, wxIcon &icon);
static bool GetDefaultIcon(wxIcon &icon);

0 comments on commit 6fdb5e3

Please sign in to comment.