[BUG_FIXED]
1. Fix Project Panel loading non-project file bug. 2. Fix adding/hidding Language Menue item problem in Preference dialog. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@828 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
86947350c3
commit
4e7a560874
Binary file not shown.
@ -1337,7 +1337,9 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
}
|
}
|
||||||
case WM_COMMAND :
|
case WM_COMMAND :
|
||||||
{
|
{
|
||||||
if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LIST_TABSETTNG)
|
if (HIWORD(wParam) == LBN_SELCHANGE)
|
||||||
|
{
|
||||||
|
if (LOWORD(wParam) == IDC_LIST_TABSETTNG)
|
||||||
{
|
{
|
||||||
int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0);
|
int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0);
|
||||||
if (index == LB_ERR)
|
if (index == LB_ERR)
|
||||||
@ -1383,6 +1385,44 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
else if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG)
|
||||||
|
{
|
||||||
|
HWND hEnableList = ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG);
|
||||||
|
HWND hDisableList = ::GetDlgItem(_hSelf, IDC_LIST_DISABLEDLANG);
|
||||||
|
if (HIWORD(wParam) == LBN_DBLCLK)
|
||||||
|
{
|
||||||
|
if (HWND(lParam) == hEnableList)
|
||||||
|
::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0);
|
||||||
|
else if (HWND(lParam) == hDisableList)
|
||||||
|
::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
int idButton2Enable;
|
||||||
|
int idButton2Disable;
|
||||||
|
|
||||||
|
if (LOWORD(wParam) == IDC_LIST_ENABLEDLANG)
|
||||||
|
{
|
||||||
|
idButton2Enable = IDC_BUTTON_REMOVE;
|
||||||
|
idButton2Disable = IDC_BUTTON_RESTORE;
|
||||||
|
}
|
||||||
|
else //IDC_LIST_DISABLEDLANG
|
||||||
|
{
|
||||||
|
idButton2Enable = IDC_BUTTON_RESTORE;
|
||||||
|
idButton2Disable = IDC_BUTTON_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int i = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0);
|
||||||
|
if (i != LB_ERR)
|
||||||
|
{
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE);
|
||||||
|
int idListbox2Disable = (LOWORD(wParam)== IDC_LIST_ENABLEDLANG)?IDC_LIST_DISABLEDLANG:IDC_LIST_ENABLEDLANG;
|
||||||
|
::SendDlgItemMessage(_hSelf, idListbox2Disable, LB_SETCURSEL, (WPARAM)-1, 0);
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (wParam)
|
switch (wParam)
|
||||||
{
|
{
|
||||||
@ -1474,44 +1514,6 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IDC_LIST_DISABLEDLANG :
|
|
||||||
case IDC_LIST_ENABLEDLANG :
|
|
||||||
{
|
|
||||||
HWND hEnableList = ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG);
|
|
||||||
HWND hDisableList = ::GetDlgItem(_hSelf, IDC_LIST_DISABLEDLANG);
|
|
||||||
if (HIWORD(wParam) == LBN_DBLCLK)
|
|
||||||
{
|
|
||||||
if (HWND(lParam) == hEnableList)
|
|
||||||
::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0);
|
|
||||||
else if (HWND(lParam) == hDisableList)
|
|
||||||
::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
int idButton2Enable;
|
|
||||||
int idButton2Disable;
|
|
||||||
|
|
||||||
if (LOWORD(wParam) == IDC_LIST_ENABLEDLANG)
|
|
||||||
{
|
|
||||||
idButton2Enable = IDC_BUTTON_REMOVE;
|
|
||||||
idButton2Disable = IDC_BUTTON_RESTORE;
|
|
||||||
}
|
|
||||||
else //IDC_LIST_DISABLEDLANG
|
|
||||||
{
|
|
||||||
idButton2Enable = IDC_BUTTON_RESTORE;
|
|
||||||
idButton2Disable = IDC_BUTTON_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0);
|
|
||||||
if (i != LB_ERR)
|
|
||||||
{
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE);
|
|
||||||
int idListbox2Disable = (LOWORD(wParam)== IDC_LIST_ENABLEDLANG)?IDC_LIST_DISABLEDLANG:IDC_LIST_ENABLEDLANG;
|
|
||||||
::SendDlgItemMessage(_hSelf, idListbox2Disable, LB_SETCURSEL, (WPARAM)-1, 0);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDC_CHECK_LANGMENUCOMPACT :
|
case IDC_CHECK_LANGMENUCOMPACT :
|
||||||
{
|
{
|
||||||
nppGUI._isLangMenuCompact = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_LANGMENUCOMPACT), BM_GETCHECK, 0, 0));
|
nppGUI._isLangMenuCompact = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_LANGMENUCOMPACT), BM_GETCHECK, 0, 0));
|
||||||
|
@ -265,6 +265,8 @@ bool ProjectPanel::openWorkSpace(const TCHAR *projectFileName)
|
|||||||
|
|
||||||
_workSpaceFilePath = projectFileName;
|
_workSpaceFilePath = projectFileName;
|
||||||
|
|
||||||
|
_treeView.removeAllItems();
|
||||||
|
|
||||||
HTREEITEM rootItem = _treeView.addItem(TEXT("Workspace"), TVI_ROOT, INDEX_CLEAN_ROOT);
|
HTREEITEM rootItem = _treeView.addItem(TEXT("Workspace"), TVI_ROOT, INDEX_CLEAN_ROOT);
|
||||||
|
|
||||||
for ( ; childNode ; childNode = childNode->NextSibling(TEXT("Project")))
|
for ( ; childNode ; childNode = childNode->NextSibling(TEXT("Project")))
|
||||||
@ -389,7 +391,6 @@ bool ProjectPanel::buildTreeFrom(TiXmlNode *projectRoot, HTREEITEM hParentItem)
|
|||||||
const TCHAR *v = childNode->Value();
|
const TCHAR *v = childNode->Value();
|
||||||
if (lstrcmp(TEXT("Folder"), v) == 0)
|
if (lstrcmp(TEXT("Folder"), v) == 0)
|
||||||
{
|
{
|
||||||
//::MessageBox(NULL, (childNode->ToElement())->Attribute(TEXT("name")), TEXT("Folder"), MB_OK);
|
|
||||||
HTREEITEM addedItem = _treeView.addItem((childNode->ToElement())->Attribute(TEXT("name")), hParentItem, INDEX_CLOSED_NODE);
|
HTREEITEM addedItem = _treeView.addItem((childNode->ToElement())->Attribute(TEXT("name")), hParentItem, INDEX_CLOSED_NODE);
|
||||||
if (!childNode->NoChildren())
|
if (!childNode->NoChildren())
|
||||||
{
|
{
|
||||||
@ -787,9 +788,11 @@ void ProjectPanel::popupMenuCmd(int cmdID)
|
|||||||
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
|
fDlg.setExtFilter(TEXT("All types"), TEXT(".*"), NULL);
|
||||||
if (TCHAR *fn = fDlg.doOpenSingleFileDlg())
|
if (TCHAR *fn = fDlg.doOpenSingleFileDlg())
|
||||||
{
|
{
|
||||||
_treeView.removeAllItems();
|
if (!openWorkSpace(fn))
|
||||||
openWorkSpace(fn);
|
{
|
||||||
_workSpaceFilePath = fn;
|
::MessageBox(_hSelf, TEXT("Opening Workspace failed.\rIt seems the file to open is not valid project file."), TEXT("Open Workspace"), MB_OK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -811,7 +814,6 @@ void ProjectPanel::popupMenuCmd(int cmdID)
|
|||||||
|
|
||||||
if (::PathFileExists(_workSpaceFilePath.c_str()))
|
if (::PathFileExists(_workSpaceFilePath.c_str()))
|
||||||
{
|
{
|
||||||
_treeView.removeAllItems();
|
|
||||||
openWorkSpace(_workSpaceFilePath.c_str());
|
openWorkSpace(_workSpaceFilePath.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -167,7 +167,7 @@
|
|||||||
<Language name="props" ext="properties" commentLine=";">
|
<Language name="props" ext="properties" commentLine=";">
|
||||||
</Language>
|
</Language>
|
||||||
<Language name="python" ext="py pyw" commentLine="#">
|
<Language name="python" ext="py pyw" commentLine="#">
|
||||||
<Keywords name="instre1">and as assert break class continue def del elif else except exec finally for from global if import in is lambda None not or pass print raise return triple try while with yield</Keywords>
|
<Keywords name="instre1">and as assert break class continue def del elif else except exec False finally for from global if import in is lambda None not or pass print raise return triple True try while with yield</Keywords>
|
||||||
</Language>
|
</Language>
|
||||||
<Language name="r" ext="r" commentLine="#">
|
<Language name="r" ext="r" commentLine="#">
|
||||||
<Keywords name="instre1">if else repeat while function for in next break TRUE FALSE NULL NA Inf NaN</Keywords>
|
<Keywords name="instre1">if else repeat while function for in next break TRUE FALSE NULL NA Inf NaN</Keywords>
|
||||||
|
Loading…
Reference in New Issue
Block a user