Add the number of total documents on windows dialog's title bar

Close #8338, close #9245
This commit is contained in:
X1ngyuL1u 2020-12-10 03:40:54 -05:00 committed by Don HO
parent 7aafa2e8fe
commit 435834651b
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
2 changed files with 19 additions and 0 deletions

View File

@ -49,6 +49,7 @@ using namespace std;
#define WD_CLMNPATH "ColumnPath"
#define WD_CLMNTYPE "ColumnType"
#define WD_CLMNSIZE "ColumnSize"
#define WD_TABTOTAL "TabsTotal"
static const TCHAR *readonlyString = TEXT(" [Read Only]");
const UINT WDN_NOTIFY = RegisterWindowMessage(TEXT("WDN_NOTIFY"));
@ -723,6 +724,7 @@ void WindowsDlg::doRefresh(bool invalidate /*= false*/)
resetSelection();
updateButtonState();
doCount();
}
}
}
@ -865,6 +867,22 @@ void WindowsDlg::doClose()
}
ListView_SetItemCount(_hList, _idxMap.size());
}
doCount();
}
//this function will be called everytime when close is performed
//as well as each time refresh is performed to keep updated
void WindowsDlg::doCount()
{
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
TCHAR count[32];
wsprintf(count, TEXT("%d"), _idxMap.size());
generic_string msg = TEXT("Windows -- ");
msg += pNativeSpeaker->getAttrNameStr(TEXT("Total documents opened: "), WD_ROOTNODE, WD_TABTOTAL);
msg += count;
SetWindowText(_hSelf,msg.c_str());
}
void WindowsDlg::doSortToTabs()

View File

@ -83,6 +83,7 @@ protected :
void updateButtonState();
void activateCurrent();
void doColumnSort();
void doCount();
HWND _hList = nullptr;
static RECT _lastKnownLocation;