Skip to content

Commit

Permalink
[ENHANCE] Enhance Project Manager.
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 819
  • Loading branch information
donho committed Sep 26, 2011
1 parent 59527df commit 7c0acd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,27 @@ bool ProjectPanel::buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem)
else if (lstrcmp(TEXT("File"), v) == 0)
{
const TCHAR *strValue = (childNode->ToElement())->Attribute(TEXT("name"));
generic_string fullPath = getAbsoluteFilePath(strValue);
TCHAR *strValueLabel = ::PathFindFileName(strValue);
int iImage = ::PathFileExists(strValue)?INDEX_LEAF:INDEX_LEAF_INVALID;
_treeView.addItem(strValueLabel, hParentItem, iImage, strValue);
int iImage = ::PathFileExists(fullPath.c_str())?INDEX_LEAF:INDEX_LEAF_INVALID;
_treeView.addItem(strValueLabel, hParentItem, iImage, fullPath.c_str());
}
}
return true;
}

generic_string ProjectPanel::getAbsoluteFilePath(const TCHAR * relativePath)
{
if (!::PathIsRelative(relativePath))
return relativePath;

TCHAR absolutePath[MAX_PATH];
lstrcpy(absolutePath, _workSpaceFilePath.c_str());
::PathRemoveFileSpec(absolutePath);
::PathAppend(absolutePath, relativePath);
return absolutePath;
}

void ProjectPanel::notified(LPNMHDR notification)
{
if((notification->hwndFrom == _treeView.getHSelf()))
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ class ProjectPanel : public DockingDlgInterface {
bool buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem);
void notified(LPNMHDR notification);
void showContextMenu(int x, int y);

generic_string getAbsoluteFilePath(const TCHAR * relativePath);
};
#endif // PROJECTPANEL_H

0 comments on commit 7c0acd7

Please sign in to comment.