[ENHANCE] Enhance Project Manager.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@805 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
f88cbf265e
commit
ede0a41d78
@ -172,6 +172,14 @@ IDI_MMPLAY_DIS_ICON ICON "icons\\playrecord_m_dis.ico"
|
|||||||
IDI_MMPLAY_OFF_ICON ICON "icons\\playrecord_m_off.ico"
|
IDI_MMPLAY_OFF_ICON ICON "icons\\playrecord_m_off.ico"
|
||||||
IDI_MMPLAY_ON_ICON ICON "icons\\playrecord_m_on.ico"
|
IDI_MMPLAY_ON_ICON ICON "icons\\playrecord_m_on.ico"
|
||||||
|
|
||||||
|
|
||||||
|
IDI_PROJECT_ROOT BITMAP "icons\\project_root.bmp"
|
||||||
|
IDI_PROJECT_FOLDEROPEN BITMAP "icons\\project_folder_open.bmp"
|
||||||
|
IDI_PROJECT_FOLDERCLOSE BITMAP "icons\\project_folder_close.bmp"
|
||||||
|
IDI_PROJECT_FILE BITMAP "icons\\project_file.bmp"
|
||||||
|
IDI_PROJECT_FILEINVALID BITMAP "icons\\project_file_invalid.bmp"
|
||||||
|
|
||||||
|
|
||||||
IDR_M30_MENU MENU
|
IDR_M30_MENU MENU
|
||||||
BEGIN
|
BEGIN
|
||||||
POPUP "&File"
|
POPUP "&File"
|
||||||
|
@ -1040,7 +1040,7 @@ public :
|
|||||||
};
|
};
|
||||||
|
|
||||||
void addDefaultThemeFromXml(generic_string xmlFullPath) {
|
void addDefaultThemeFromXml(generic_string xmlFullPath) {
|
||||||
_themeList.push_back(pair<generic_string, generic_string>(TEXT("Default (styles.xml)"), xmlFullPath));
|
_themeList.push_back(pair<generic_string, generic_string>(TEXT("Default (stylers.xml)"), xmlFullPath));
|
||||||
};
|
};
|
||||||
|
|
||||||
generic_string getThemeFromXmlFileName(const TCHAR *fn) const;
|
generic_string getThemeFromXmlFileName(const TCHAR *fn) const;
|
||||||
|
@ -1955,12 +1955,11 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
|
|||||||
nppParamInst->_isFindReplacing = false;
|
nppParamInst->_isFindReplacing = false;
|
||||||
break;
|
break;
|
||||||
case IDD_FINDINFILES_FIND_BUTTON :
|
case IDD_FINDINFILES_FIND_BUTTON :
|
||||||
{
|
|
||||||
nppParamInst->_isFindReplacing = true;
|
nppParamInst->_isFindReplacing = true;
|
||||||
findAllIn(FILES_IN_DIR);
|
findAllIn(FILES_IN_DIR);
|
||||||
nppParamInst->_isFindReplacing = false;
|
nppParamInst->_isFindReplacing = false;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case IDD_FINDINFILES_REPLACEINFILES :
|
case IDD_FINDINFILES_REPLACEINFILES :
|
||||||
{
|
{
|
||||||
generic_string msg = TEXT("Are you sure you want to replace all occurrences in :\r");
|
generic_string msg = TEXT("Are you sure you want to replace all occurrences in :\r");
|
||||||
|
@ -181,8 +181,10 @@ size_t Printer::doPrint(bool justDoIt)
|
|||||||
|
|
||||||
DOCINFO docInfo;
|
DOCINFO docInfo;
|
||||||
docInfo.cbSize = sizeof(DOCINFO);
|
docInfo.cbSize = sizeof(DOCINFO);
|
||||||
|
docInfo.fwType = 0;
|
||||||
docInfo.lpszDocName = _pSEView->getCurrentBuffer()->getFullPathName();
|
docInfo.lpszDocName = _pSEView->getCurrentBuffer()->getFullPathName();
|
||||||
docInfo.lpszOutput = NULL;
|
docInfo.lpszOutput = NULL;
|
||||||
|
docInfo.lpszDatatype = NULL;
|
||||||
|
|
||||||
if (::StartDoc(_pdlg.hDC, &docInfo) < 0)
|
if (::StartDoc(_pdlg.hDC, &docInfo) < 0)
|
||||||
{
|
{
|
||||||
|
@ -34,9 +34,9 @@ BOOL CALLBACK ProjectPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPar
|
|||||||
{
|
{
|
||||||
_treeView.init(_hInst, _hSelf, ID_PROJECTTREEVIEW);
|
_treeView.init(_hInst, _hSelf, ID_PROJECTTREEVIEW);
|
||||||
|
|
||||||
_treeView.initImageList(IDR_WRAP, IDR_ZOOMIN, IDR_ZOOMOUT, IDR_FIND);
|
_treeView.initImageList(IDI_PROJECT_ROOT, IDI_PROJECT_FOLDEROPEN, IDI_PROJECT_FOLDERCLOSE, IDI_PROJECT_FILE);
|
||||||
_treeView.display();
|
_treeView.display();
|
||||||
openProject(TEXT("C:\\sources\\Notepad++\\trunk\\PowerEditor\\src\\WinControls\\ProjectPanel\\demo.xml"));
|
openProject(TEXT("D:\\source\\notepad++\\trunk\\PowerEditor\\src\\WinControls\\ProjectPanel\\demo.xml"));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,9 @@ bool ProjectPanel::buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem)
|
|||||||
}
|
}
|
||||||
else if (lstrcmp(TEXT("File"), v) == 0)
|
else if (lstrcmp(TEXT("File"), v) == 0)
|
||||||
{
|
{
|
||||||
_treeView.addItem((childNode->ToElement())->Attribute(TEXT("name")), hParentItem, INDEX_LEAF);
|
const TCHAR *strValue = (childNode->ToElement())->Attribute(TEXT("name"));
|
||||||
|
TCHAR *strValueLabel = ::PathFindFileName(strValue);
|
||||||
|
_treeView.addItem(strValueLabel, hParentItem, INDEX_LEAF, strValue);
|
||||||
//::MessageBox(NULL, (childNode->ToElement())->Attribute(TEXT("name")), TEXT("File"), MB_OK);
|
//::MessageBox(NULL, (childNode->ToElement())->Attribute(TEXT("name")), TEXT("File"), MB_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,51 +125,66 @@ bool ProjectPanel::buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem)
|
|||||||
|
|
||||||
void ProjectPanel::notified(LPNMHDR notification)
|
void ProjectPanel::notified(LPNMHDR notification)
|
||||||
{
|
{
|
||||||
//LPNMTREEVIEW
|
if((notification->hwndFrom == _treeView.getHSelf()))
|
||||||
//TVITEM tv_item;
|
{
|
||||||
//TCHAR text_buffer[MAX_PATH];
|
TCHAR text_buffer[MAX_PATH];
|
||||||
|
TVITEM tvItem;
|
||||||
|
tvItem.mask = TVIF_TEXT | TVIF_PARAM;
|
||||||
|
tvItem.pszText = text_buffer;
|
||||||
|
tvItem.cchTextMax = MAX_PATH;
|
||||||
|
|
||||||
switch (notification->code)
|
switch (notification->code)
|
||||||
{
|
{
|
||||||
case NM_DBLCLK:
|
case NM_DBLCLK:
|
||||||
{
|
{
|
||||||
//printStr(TEXT("double click"));
|
tvItem.hItem = TreeView_GetSelection(_treeView.getHSelf());
|
||||||
|
::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem);
|
||||||
|
generic_string *fn = (generic_string *)tvItem.lParam;
|
||||||
|
if (fn)
|
||||||
|
::SendMessage(_hParent, NPPM_DOOPEN, 0, (LPARAM)(fn->c_str()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TVN_ENDLABELEDIT:
|
||||||
|
{
|
||||||
|
LPNMTVDISPINFO tvnotif = (LPNMTVDISPINFO)notification;
|
||||||
|
printStr(tvnotif->item.pszText);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TVN_ITEMEXPANDED:
|
||||||
|
{
|
||||||
|
LPNMTREEVIEW nmtv = (LPNMTREEVIEW)notification;
|
||||||
|
tvItem.hItem = nmtv->itemNew.hItem;
|
||||||
|
tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
|
||||||
|
::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem);
|
||||||
|
if (tvItem.iImage != INDEX_PROJECT_ROOT)
|
||||||
|
{
|
||||||
|
if (nmtv->action == TVE_COLLAPSE)
|
||||||
|
{
|
||||||
|
tvItem.iImage = INDEX_CLOSED_NODE;
|
||||||
|
tvItem.iSelectedImage = INDEX_CLOSED_NODE;
|
||||||
|
TreeView_SetItem(_treeView.getHSelf(), &tvItem);
|
||||||
|
}
|
||||||
|
else if (nmtv->action == TVE_EXPAND)
|
||||||
|
{
|
||||||
|
tvItem.iImage = INDEX_OPEN_NODE;
|
||||||
|
tvItem.iSelectedImage = INDEX_OPEN_NODE;
|
||||||
|
TreeView_SetItem(_treeView.getHSelf(), &tvItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
case NM_RCLICK:
|
case NM_RCLICK:
|
||||||
{
|
{
|
||||||
//printStr(TEXT("right click"));
|
//printStr(TEXT("right click"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TVN_SELCHANGED:
|
|
||||||
{
|
|
||||||
printStr(TEXT("TVN_SELCHANGED"));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if((notification->hdr).hwndFrom == _treeView.getHSelf())
|
|
||||||
{
|
|
||||||
if((notification->hdr).code == TVN_SELCHANGED)
|
|
||||||
{
|
|
||||||
tv_item.hItem = notification->itemNew.hItem;
|
|
||||||
tv_item.mask = TVIF_TEXT | TVIF_PARAM;
|
|
||||||
tv_item.pszText = text_buffer;
|
|
||||||
tv_item.cchTextMax = MAX_PATH;
|
|
||||||
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tv_item);
|
|
||||||
|
|
||||||
|
|
||||||
if(tv_item.lParam==DOMAIN_LEVEL)
|
|
||||||
ShowDomainContent(tv_item.pszText);
|
|
||||||
else if(tv_item.lParam==SERVER_LEVEL)
|
|
||||||
ShowServerContent(tv_item.pszText);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPanel::showContextMenu(int x, int y)
|
void ProjectPanel::showContextMenu(int x, int y)
|
||||||
|
@ -26,5 +26,5 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
|
|||||||
CAPTION "Project"
|
CAPTION "Project"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "",ID_PROJECTTREEVIEW,"SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,172,93
|
CONTROL "",ID_PROJECTTREEVIEW,"SysTreeView32", TVS_HASBUTTONS | TVS_EDITLABELS | TVS_HASLINES | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,172,93
|
||||||
END
|
END
|
||||||
|
@ -19,8 +19,9 @@
|
|||||||
#include "TreeView.h"
|
#include "TreeView.h"
|
||||||
|
|
||||||
|
|
||||||
#define CX_BITMAP 14
|
#define CX_BITMAP 16
|
||||||
#define CY_BITMAP 14
|
#define CY_BITMAP 16
|
||||||
|
#define CY_ITEMHEIGHT 18
|
||||||
#define NUM_BITMAPS 3
|
#define NUM_BITMAPS 3
|
||||||
|
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ void TreeView::init(HINSTANCE hInst, HWND parent, int treeViewID)
|
|||||||
{
|
{
|
||||||
Window::init(hInst, parent);
|
Window::init(hInst, parent);
|
||||||
_hSelf = ::GetDlgItem(parent, treeViewID);
|
_hSelf = ::GetDlgItem(parent, treeViewID);
|
||||||
|
TreeView_SetItemHeight(_hSelf, CY_ITEMHEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL TreeView::initImageList(int project_root_id, int open_node_id, int closed_node_id, int leaf_id)
|
BOOL TreeView::initImageList(int project_root_id, int open_node_id, int closed_node_id, int leaf_id)
|
||||||
@ -85,23 +87,21 @@ LRESULT TreeView::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||||||
return ::CallWindowProc(_defaultProc, hwnd, Message, wParam, lParam);
|
return ::CallWindowProc(_defaultProc, hwnd, Message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTREEITEM TreeView::addItem(const TCHAR *itemName, HTREEITEM hParentItem, int iImage)
|
HTREEITEM TreeView::addItem(const TCHAR *itemName, HTREEITEM hParentItem, int iImage, const TCHAR *filePath)
|
||||||
{
|
{
|
||||||
TVITEM tvi;
|
TVITEM tvi;
|
||||||
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
|
||||||
|
|
||||||
// Set the text of the item.
|
// Set the item label.
|
||||||
tvi.pszText = (LPTSTR)itemName;
|
tvi.pszText = (LPTSTR)itemName;
|
||||||
tvi.cchTextMax = sizeof(tvi.pszText)/sizeof(tvi.pszText[0]);
|
tvi.cchTextMax = sizeof(tvi.pszText)/sizeof(tvi.pszText[0]);
|
||||||
|
|
||||||
// Assume the item is not a parent item, so give it a
|
// Set icon
|
||||||
// document image.
|
|
||||||
tvi.iImage = iImage;//isNode?INDEX_CLOSED_NODE:INDEX_LEAF;
|
tvi.iImage = iImage;//isNode?INDEX_CLOSED_NODE:INDEX_LEAF;
|
||||||
tvi.iSelectedImage = iImage;//isNode?INDEX_OPEN_NODE:INDEX_LEAF;
|
tvi.iSelectedImage = iImage;//isNode?INDEX_OPEN_NODE:INDEX_LEAF;
|
||||||
|
|
||||||
// Save the heading level in the item's application-defined
|
// Save the full path of file in the item's application-defined data area.
|
||||||
// data area.
|
tvi.lParam = (filePath == NULL?0:(LPARAM)(new generic_string(filePath)));
|
||||||
tvi.lParam = (LPARAM)0;//nLevel;
|
|
||||||
|
|
||||||
TVINSERTSTRUCT tvInsertStruct;
|
TVINSERTSTRUCT tvInsertStruct;
|
||||||
tvInsertStruct.item = tvi;
|
tvInsertStruct.item = tvi;
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
virtual ~TreeView() {};
|
virtual ~TreeView() {};
|
||||||
virtual void init(HINSTANCE hInst, HWND parent, int treeViewID);
|
virtual void init(HINSTANCE hInst, HWND parent, int treeViewID);
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
HTREEITEM addItem(const TCHAR *itemName, HTREEITEM hParentItem, int iImage);
|
HTREEITEM addItem(const TCHAR *itemName, HTREEITEM hParentItem, int iImage, const TCHAR *filePath = NULL);
|
||||||
BOOL initImageList(int project_root_id, int open_node_id, int closed_node_id, int leaf_id);
|
BOOL initImageList(int project_root_id, int open_node_id, int closed_node_id, int leaf_id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -4,15 +4,24 @@
|
|||||||
<Project name="Notepad++" >
|
<Project name="Notepad++" >
|
||||||
<Folder name="Power Editor">
|
<Folder name="Power Editor">
|
||||||
<Folder name="src">
|
<Folder name="src">
|
||||||
<Folder name="src2">
|
<Folder name="WinControls">
|
||||||
<Folder name="src3">
|
<Folder name="ProjectPanel">
|
||||||
<File name="C:\toto.txt"/>
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\ProjectPanel\ProjectPanel.h"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\ProjectPanel\ProjectPanel.cpp"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\ProjectPanel\ProjectPanel.rc"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\ProjectPanel\TreeView.h"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\ProjectPanel\TreeView.cpp"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder name="src3-B">
|
<Folder name="AboutDlg">
|
||||||
</Folder>
|
</Folder>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\Window.h"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\WinControls\WindowInterface.h"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\Notepad_plus.h"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\Notepad_plus.cpp"/>
|
||||||
|
<File name="D:\source\notepad++\trunk\PowerEditor\src\Notepad_plus.rc"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<File name="C:\sources\Notepad++\trunk\PowerEditor\license.txt"/>
|
<File name="D:\source\notepad++\trunk\PowerEditor\license.txt"/>
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder name="Scintilla">
|
<Folder name="Scintilla">
|
||||||
</Folder>
|
</Folder>
|
||||||
|
BIN
PowerEditor/src/icons/project_file.bmp
Normal file
BIN
PowerEditor/src/icons/project_file.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 B |
BIN
PowerEditor/src/icons/project_file_invalid.bmp
Normal file
BIN
PowerEditor/src/icons/project_file_invalid.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 B |
BIN
PowerEditor/src/icons/project_folder_close.bmp
Normal file
BIN
PowerEditor/src/icons/project_folder_close.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 B |
BIN
PowerEditor/src/icons/project_folder_open.bmp
Normal file
BIN
PowerEditor/src/icons/project_folder_open.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 B |
BIN
PowerEditor/src/icons/project_root.bmp
Normal file
BIN
PowerEditor/src/icons/project_root.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 568 B |
@ -125,6 +125,12 @@
|
|||||||
#define IDI_READONLY_ICON 503
|
#define IDI_READONLY_ICON 503
|
||||||
#define IDI_FIND_RESULT_ICON 504
|
#define IDI_FIND_RESULT_ICON 504
|
||||||
|
|
||||||
|
#define IDI_PROJECT_ROOT 601
|
||||||
|
#define IDI_PROJECT_FOLDEROPEN 602
|
||||||
|
#define IDI_PROJECT_FOLDERCLOSE 603
|
||||||
|
#define IDI_PROJECT_FILE 604
|
||||||
|
#define IDI_PROJECT_FILEINVALID 605
|
||||||
|
|
||||||
#define IDC_MY_CUR 1402
|
#define IDC_MY_CUR 1402
|
||||||
#define IDC_UP_ARROW 1403
|
#define IDC_UP_ARROW 1403
|
||||||
#define IDC_DRAG_TAB 1404
|
#define IDC_DRAG_TAB 1404
|
||||||
|
@ -1611,11 +1611,11 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\Preference\resource.h"
|
RelativePath="..\src\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\resource.h"
|
RelativePath="..\src\WinControls\Preference\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
Loading…
Reference in New Issue
Block a user