Inialize all memebers of struct (instead of its 1st member) to zero
The curly brace initiator in C/C++ is quite confusing (at least to me). The C style array uses {0} for initializing all the array to 0, whereas C++ struct uses {0} for initializing only the 1st member's value to 0. If we want to set all members' value in a struct to 0, we should use {} instread of {0}. This commit fix the error which initialize only the 1st member's value to 0 in the structures. Ref: 1. https://docs.microsoft.com/en-us/cpp/cpp/initializing-classes-and-structs-without-constructors-cpp?view=msvc-170 2. https://en.cppreference.com/w/c/language/struct_initializationpull/11174/head
parent
2e9342ae24
commit
785453147b
|
@ -136,7 +136,7 @@ void writeLog(const TCHAR *logFileName, const char *log2write)
|
||||||
offset.QuadPart = 0;
|
offset.QuadPart = 0;
|
||||||
::SetFilePointerEx(hFile, offset, NULL, FILE_END);
|
::SetFilePointerEx(hFile, offset, NULL, FILE_END);
|
||||||
|
|
||||||
SYSTEMTIME currentTime = { 0 };
|
SYSTEMTIME currentTime = {};
|
||||||
::GetLocalTime(¤tTime);
|
::GetLocalTime(¤tTime);
|
||||||
generic_string dateTimeStrW = getDateTimeStrFrom(TEXT("yyyy-MM-dd HH:mm:ss"), currentTime);
|
generic_string dateTimeStrW = getDateTimeStrFrom(TEXT("yyyy-MM-dd HH:mm:ss"), currentTime);
|
||||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||||
|
@ -1064,7 +1064,7 @@ HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText,
|
||||||
NppDarkMode::setDarkTooltips(hwndTip, NppDarkMode::ToolTipsType::tooltip);
|
NppDarkMode::setDarkTooltips(hwndTip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
|
||||||
// Associate the tooltip with the tool.
|
// Associate the tooltip with the tool.
|
||||||
TOOLINFO toolInfo = { 0 };
|
TOOLINFO toolInfo = {};
|
||||||
toolInfo.cbSize = sizeof(toolInfo);
|
toolInfo.cbSize = sizeof(toolInfo);
|
||||||
toolInfo.hwnd = hDlg;
|
toolInfo.hwnd = hDlg;
|
||||||
toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
|
toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
|
||||||
|
@ -1105,7 +1105,7 @@ HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszTe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Associate the tooltip with the tool.
|
// Associate the tooltip with the tool.
|
||||||
TOOLINFO toolInfo = { 0 };
|
TOOLINFO toolInfo = {};
|
||||||
toolInfo.cbSize = sizeof(toolInfo);
|
toolInfo.cbSize = sizeof(toolInfo);
|
||||||
toolInfo.hwnd = hWnd;
|
toolInfo.hwnd = hWnd;
|
||||||
toolInfo.uFlags = TTF_SUBCLASS;
|
toolInfo.uFlags = TTF_SUBCLASS;
|
||||||
|
@ -1307,7 +1307,7 @@ bool deleteFileOrFolder(const generic_string& f2delete)
|
||||||
actionFolder[len] = 0;
|
actionFolder[len] = 0;
|
||||||
actionFolder[len + 1] = 0;
|
actionFolder[len + 1] = 0;
|
||||||
|
|
||||||
SHFILEOPSTRUCT fileOpStruct = { 0 };
|
SHFILEOPSTRUCT fileOpStruct = {};
|
||||||
fileOpStruct.hwnd = NULL;
|
fileOpStruct.hwnd = NULL;
|
||||||
fileOpStruct.pFrom = actionFolder;
|
fileOpStruct.pFrom = actionFolder;
|
||||||
fileOpStruct.pTo = NULL;
|
fileOpStruct.pTo = NULL;
|
||||||
|
@ -1504,7 +1504,7 @@ HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestPar
|
||||||
{
|
{
|
||||||
HDC hdc = GetDC(hDestParent);
|
HDC hdc = GetDC(hDestParent);
|
||||||
|
|
||||||
LOGFONT logFont = { 0 };
|
LOGFONT logFont = {};
|
||||||
logFont.lfHeight = -MulDiv(fontSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
|
logFont.lfHeight = -MulDiv(fontSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
|
||||||
if (isBold)
|
if (isBold)
|
||||||
logFont.lfWeight = FW_BOLD;
|
logFont.lfWeight = FW_BOLD;
|
||||||
|
|
|
@ -127,12 +127,12 @@ bool SecurityGard::verifySignedLibrary(const std::wstring& filepath, NppModule m
|
||||||
|
|
||||||
// Initialize the WINTRUST_FILE_INFO structure.
|
// Initialize the WINTRUST_FILE_INFO structure.
|
||||||
LPCWSTR pwszfilepath = filepath.c_str();
|
LPCWSTR pwszfilepath = filepath.c_str();
|
||||||
WINTRUST_FILE_INFO file_data = { 0 };
|
WINTRUST_FILE_INFO file_data = {};
|
||||||
file_data.cbStruct = sizeof(WINTRUST_FILE_INFO);
|
file_data.cbStruct = sizeof(WINTRUST_FILE_INFO);
|
||||||
file_data.pcwszFilePath = pwszfilepath;
|
file_data.pcwszFilePath = pwszfilepath;
|
||||||
|
|
||||||
// Initialise WinTrust data
|
// Initialise WinTrust data
|
||||||
WINTRUST_DATA winTEXTrust_data = { 0 };
|
WINTRUST_DATA winTEXTrust_data = {};
|
||||||
winTEXTrust_data.cbStruct = sizeof(winTEXTrust_data);
|
winTEXTrust_data.cbStruct = sizeof(winTEXTrust_data);
|
||||||
winTEXTrust_data.dwUIChoice = WTD_UI_NONE; // do not display optional dialog boxes
|
winTEXTrust_data.dwUIChoice = WTD_UI_NONE; // do not display optional dialog boxes
|
||||||
winTEXTrust_data.dwUnionChoice = WTD_CHOICE_FILE; // we are not checking catalog signed files
|
winTEXTrust_data.dwUnionChoice = WTD_CHOICE_FILE; // we are not checking catalog signed files
|
||||||
|
@ -229,7 +229,7 @@ bool SecurityGard::verifySignedLibrary(const std::wstring& filepath, NppModule m
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the signer certificate from temporary certificate store.
|
// Get the signer certificate from temporary certificate store.
|
||||||
CERT_INFO cert_info = { 0 };
|
CERT_INFO cert_info = {};
|
||||||
cert_info.Issuer = pSignerInfo->Issuer;
|
cert_info.Issuer = pSignerInfo->Issuer;
|
||||||
cert_info.SerialNumber = pSignerInfo->SerialNumber;
|
cert_info.SerialNumber = pSignerInfo->SerialNumber;
|
||||||
PCCERT_CONTEXT context = ::CertFindCertificateInStore(hStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)&cert_info, NULL);
|
PCCERT_CONTEXT context = ::CertFindCertificateInStore(hStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)&cert_info, NULL);
|
||||||
|
|
|
@ -27,7 +27,7 @@ void Process::run(bool isElevationRequired) const
|
||||||
|
|
||||||
unsigned long Process::runSync(bool isElevationRequired) const
|
unsigned long Process::runSync(bool isElevationRequired) const
|
||||||
{
|
{
|
||||||
SHELLEXECUTEINFO ShExecInfo = { 0 };
|
SHELLEXECUTEINFO ShExecInfo = {};
|
||||||
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
|
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
|
||||||
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
|
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||||
ShExecInfo.hwnd = NULL;
|
ShExecInfo.hwnd = NULL;
|
||||||
|
|
|
@ -2264,7 +2264,7 @@ void Notepad_plus::setupColorSampleBitmapsOnMainMenuItems()
|
||||||
{ IDM_SEARCH_GONEXTMARKER_DEF, SCE_UNIVERSAL_FOUND_STYLE, { IDM_SEARCH_GOPREVMARKER_DEF, IDM_SEARCH_MARKEDTOCLIP } }
|
{ IDM_SEARCH_GONEXTMARKER_DEF, SCE_UNIVERSAL_FOUND_STYLE, { IDM_SEARCH_GOPREVMARKER_DEF, IDM_SEARCH_MARKEDTOCLIP } }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int j = 0; j < sizeof(bitmapOnStyleMenuItemsInfo) / sizeof(bitmapOnStyleMenuItemsInfo[0]); ++j)
|
for (size_t j = 0; j < sizeof(bitmapOnStyleMenuItemsInfo) / sizeof(bitmapOnStyleMenuItemsInfo[0]); ++j)
|
||||||
{
|
{
|
||||||
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByID(bitmapOnStyleMenuItemsInfo[j].styleIndic);
|
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByID(bitmapOnStyleMenuItemsInfo[j].styleIndic);
|
||||||
if (pStyle)
|
if (pStyle)
|
||||||
|
@ -5778,7 +5778,7 @@ bool Notepad_plus::dumpFiles(const TCHAR * outdir, const TCHAR * fileprefix)
|
||||||
//start dumping unsaved files to recovery directory
|
//start dumping unsaved files to recovery directory
|
||||||
bool somethingsaved = false;
|
bool somethingsaved = false;
|
||||||
bool somedirty = false;
|
bool somedirty = false;
|
||||||
TCHAR savePath[MAX_PATH] = {0};
|
TCHAR savePath[MAX_PATH] = { '\0' };
|
||||||
|
|
||||||
//rescue primary
|
//rescue primary
|
||||||
for (size_t i = 0; i < MainFileManager.getNbBuffers(); ++i)
|
for (size_t i = 0; i < MainFileManager.getNbBuffers(); ++i)
|
||||||
|
@ -6578,7 +6578,7 @@ void Notepad_plus::launchClipboardHistoryPanel()
|
||||||
|
|
||||||
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
||||||
bool isRTL = pNativeSpeaker->isRTL();
|
bool isRTL = pNativeSpeaker->isRTL();
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pClipboardHistoryPanel->create(&data, isRTL);
|
_pClipboardHistoryPanel->create(&data, isRTL);
|
||||||
|
|
||||||
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pClipboardHistoryPanel->getHSelf()));
|
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pClipboardHistoryPanel->getHSelf()));
|
||||||
|
@ -6631,7 +6631,7 @@ void Notepad_plus::launchDocumentListPanel()
|
||||||
_pDocumentListPanel->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), hImgLst);
|
_pDocumentListPanel->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), hImgLst);
|
||||||
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
||||||
bool isRTL = pNativeSpeaker->isRTL();
|
bool isRTL = pNativeSpeaker->isRTL();
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pDocumentListPanel->create(&data, isRTL);
|
_pDocumentListPanel->create(&data, isRTL);
|
||||||
|
|
||||||
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pDocumentListPanel->getHSelf()));
|
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pDocumentListPanel->getHSelf()));
|
||||||
|
@ -6682,7 +6682,7 @@ void Notepad_plus::launchAnsiCharPanel()
|
||||||
|
|
||||||
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker();
|
||||||
bool isRTL = pNativeSpeaker->isRTL();
|
bool isRTL = pNativeSpeaker->isRTL();
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pAnsiCharPanel->create(&data, isRTL);
|
_pAnsiCharPanel->create(&data, isRTL);
|
||||||
|
|
||||||
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pAnsiCharPanel->getHSelf()));
|
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pAnsiCharPanel->getHSelf()));
|
||||||
|
@ -6806,7 +6806,7 @@ void Notepad_plus::checkProjectMenuItem()
|
||||||
{
|
{
|
||||||
UINT const ids [] = {IDM_VIEW_PROJECT_PANEL_1, IDM_VIEW_PROJECT_PANEL_2, IDM_VIEW_PROJECT_PANEL_3};
|
UINT const ids [] = {IDM_VIEW_PROJECT_PANEL_1, IDM_VIEW_PROJECT_PANEL_2, IDM_VIEW_PROJECT_PANEL_3};
|
||||||
UINT id = GetMenuItemID (subMenu, j);
|
UINT id = GetMenuItemID (subMenu, j);
|
||||||
for (int k = 0; k < _countof(ids); k++)
|
for (size_t k = 0; k < _countof(ids); k++)
|
||||||
{
|
{
|
||||||
if (id == ids [k])
|
if (id == ids [k])
|
||||||
{
|
{
|
||||||
|
@ -6905,7 +6905,7 @@ void Notepad_plus::launchDocMap()
|
||||||
_pDocMap = new DocumentMap();
|
_pDocMap = new DocumentMap();
|
||||||
_pDocMap->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView);
|
_pDocMap->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView);
|
||||||
|
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pDocMap->create(&data);
|
_pDocMap->create(&data);
|
||||||
|
|
||||||
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pDocMap->getHSelf()));
|
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pDocMap->getHSelf()));
|
||||||
|
@ -6952,7 +6952,7 @@ void Notepad_plus::launchFunctionList()
|
||||||
_pFuncList = new FunctionListPanel();
|
_pFuncList = new FunctionListPanel();
|
||||||
_pFuncList->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView);
|
_pFuncList->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView);
|
||||||
|
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pFuncList->create(&data);
|
_pFuncList->create(&data);
|
||||||
|
|
||||||
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pFuncList->getHSelf()));
|
::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pFuncList->getHSelf()));
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct VisibleGUIConf final
|
||||||
bool _isStatusbarShown = true;
|
bool _isStatusbarShown = true;
|
||||||
|
|
||||||
//used by fullscreen
|
//used by fullscreen
|
||||||
WINDOWPLACEMENT _winPlace = {0};
|
WINDOWPLACEMENT _winPlace = {};
|
||||||
|
|
||||||
//used by distractionFree
|
//used by distractionFree
|
||||||
bool _was2ViewModeOn = false;
|
bool _was2ViewModeOn = false;
|
||||||
|
|
|
@ -181,7 +181,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
GetClientRect(hwnd, &rc);
|
GetClientRect(hwnd, &rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -70,11 +70,11 @@ void Notepad_plus::command(int id)
|
||||||
case IDM_EDIT_INSERT_DATETIME_SHORT:
|
case IDM_EDIT_INSERT_DATETIME_SHORT:
|
||||||
case IDM_EDIT_INSERT_DATETIME_LONG:
|
case IDM_EDIT_INSERT_DATETIME_LONG:
|
||||||
{
|
{
|
||||||
SYSTEMTIME currentTime = { 0 };
|
SYSTEMTIME currentTime = {};
|
||||||
::GetLocalTime(¤tTime);
|
::GetLocalTime(¤tTime);
|
||||||
|
|
||||||
wchar_t dateStr[128] = { 0 };
|
wchar_t dateStr[128] = { '\0' };
|
||||||
wchar_t timeStr[128] = { 0 };
|
wchar_t timeStr[128] = { '\0' };
|
||||||
|
|
||||||
int dateFlag = (id == IDM_EDIT_INSERT_DATETIME_SHORT) ? DATE_SHORTDATE : DATE_LONGDATE;
|
int dateFlag = (id == IDM_EDIT_INSERT_DATETIME_SHORT) ? DATE_SHORTDATE : DATE_LONGDATE;
|
||||||
GetDateFormatEx(LOCALE_NAME_USER_DEFAULT, dateFlag, ¤tTime, NULL, dateStr, sizeof(dateStr) / sizeof(dateStr[0]), NULL);
|
GetDateFormatEx(LOCALE_NAME_USER_DEFAULT, dateFlag, ¤tTime, NULL, dateStr, sizeof(dateStr) / sizeof(dateStr[0]), NULL);
|
||||||
|
@ -103,7 +103,7 @@ void Notepad_plus::command(int id)
|
||||||
|
|
||||||
case IDM_EDIT_INSERT_DATETIME_CUSTOMIZED:
|
case IDM_EDIT_INSERT_DATETIME_CUSTOMIZED:
|
||||||
{
|
{
|
||||||
SYSTEMTIME currentTime = { 0 };
|
SYSTEMTIME currentTime = {};
|
||||||
::GetLocalTime(¤tTime);
|
::GetLocalTime(¤tTime);
|
||||||
|
|
||||||
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();
|
NppGUI& nppGUI = NppParameters::getInstance().getNppGUI();
|
||||||
|
|
|
@ -551,7 +551,7 @@ namespace NppDarkMode
|
||||||
case WM_UAHDRAWMENU:
|
case WM_UAHDRAWMENU:
|
||||||
{
|
{
|
||||||
UAHMENU* pUDM = (UAHMENU*)lParam;
|
UAHMENU* pUDM = (UAHMENU*)lParam;
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
|
|
||||||
// get the menubar rect
|
// get the menubar rect
|
||||||
{
|
{
|
||||||
|
@ -579,7 +579,7 @@ namespace NppDarkMode
|
||||||
UAHDRAWMENUITEM* pUDMI = (UAHDRAWMENUITEM*)lParam;
|
UAHDRAWMENUITEM* pUDMI = (UAHDRAWMENUITEM*)lParam;
|
||||||
|
|
||||||
// get the menu item string
|
// get the menu item string
|
||||||
wchar_t menuString[256] = { 0 };
|
wchar_t menuString[256] = { '\0' };
|
||||||
MENUITEMINFO mii = { sizeof(mii), MIIM_STRING };
|
MENUITEMINFO mii = { sizeof(mii), MIIM_STRING };
|
||||||
{
|
{
|
||||||
mii.dwTypeData = menuString;
|
mii.dwTypeData = menuString;
|
||||||
|
@ -677,11 +677,11 @@ namespace NppDarkMode
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rcClient = { 0 };
|
RECT rcClient = {};
|
||||||
GetClientRect(hWnd, &rcClient);
|
GetClientRect(hWnd, &rcClient);
|
||||||
MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2);
|
MapWindowPoints(hWnd, nullptr, (POINT*)&rcClient, 2);
|
||||||
|
|
||||||
RECT rcWindow = { 0 };
|
RECT rcWindow = {};
|
||||||
GetWindowRect(hWnd, &rcWindow);
|
GetWindowRect(hWnd, &rcWindow);
|
||||||
|
|
||||||
OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
|
OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
|
||||||
|
@ -760,8 +760,8 @@ namespace NppDarkMode
|
||||||
|
|
||||||
void renderButton(HWND hwnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID)
|
void renderButton(HWND hwnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID)
|
||||||
{
|
{
|
||||||
RECT rcClient = { 0 };
|
RECT rcClient = {};
|
||||||
WCHAR szText[256] = { 0 };
|
WCHAR szText[256] = { '\0' };
|
||||||
DWORD nState = static_cast<DWORD>(SendMessage(hwnd, BM_GETSTATE, 0, 0));
|
DWORD nState = static_cast<DWORD>(SendMessage(hwnd, BM_GETSTATE, 0, 0));
|
||||||
DWORD uiState = static_cast<DWORD>(SendMessage(hwnd, WM_QUERYUISTATE, 0, 0));
|
DWORD uiState = static_cast<DWORD>(SendMessage(hwnd, WM_QUERYUISTATE, 0, 0));
|
||||||
DWORD nStyle = GetWindowLong(hwnd, GWL_STYLE);
|
DWORD nStyle = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
|
@ -769,7 +769,7 @@ namespace NppDarkMode
|
||||||
HFONT hFont = nullptr;
|
HFONT hFont = nullptr;
|
||||||
HFONT hOldFont = nullptr;
|
HFONT hOldFont = nullptr;
|
||||||
HFONT hCreatedFont = nullptr;
|
HFONT hCreatedFont = nullptr;
|
||||||
LOGFONT lf = { 0 };
|
LOGFONT lf = {};
|
||||||
if (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf)))
|
if (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf)))
|
||||||
{
|
{
|
||||||
hCreatedFont = CreateFontIndirect(&lf);
|
hCreatedFont = CreateFontIndirect(&lf);
|
||||||
|
@ -881,7 +881,7 @@ namespace NppDarkMode
|
||||||
GetThemeTransitionDuration(buttonData.hTheme, iPartID, buttonData.iStateID, iStateID, TMT_TRANSITIONDURATIONS, &animParams.dwDuration);
|
GetThemeTransitionDuration(buttonData.hTheme, iPartID, buttonData.iStateID, iStateID, TMT_TRANSITIONDURATIONS, &animParams.dwDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rcClient = { 0 };
|
RECT rcClient = {};
|
||||||
GetClientRect(hwnd, &rcClient);
|
GetClientRect(hwnd, &rcClient);
|
||||||
|
|
||||||
HDC hdcFrom = nullptr;
|
HDC hdcFrom = nullptr;
|
||||||
|
@ -953,7 +953,7 @@ namespace NppDarkMode
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd))
|
if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd))
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps = { 0 };
|
PAINTSTRUCT ps = {};
|
||||||
HDC hdc = reinterpret_cast<HDC>(wParam);
|
HDC hdc = reinterpret_cast<HDC>(wParam);
|
||||||
if (!hdc)
|
if (!hdc)
|
||||||
{
|
{
|
||||||
|
@ -1007,7 +1007,7 @@ namespace NppDarkMode
|
||||||
iStateID = GBS_DISABLED;
|
iStateID = GBS_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rcClient = { 0 };
|
RECT rcClient = {};
|
||||||
GetClientRect(hwnd, &rcClient);
|
GetClientRect(hwnd, &rcClient);
|
||||||
|
|
||||||
RECT rcText = rcClient;
|
RECT rcText = rcClient;
|
||||||
|
@ -1016,7 +1016,7 @@ namespace NppDarkMode
|
||||||
HFONT hFont = nullptr;
|
HFONT hFont = nullptr;
|
||||||
HFONT hOldFont = nullptr;
|
HFONT hOldFont = nullptr;
|
||||||
HFONT hCreatedFont = nullptr;
|
HFONT hCreatedFont = nullptr;
|
||||||
LOGFONT lf = { 0 };
|
LOGFONT lf = {};
|
||||||
if (SUCCEEDED(GetThemeFont(buttonData.hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf)))
|
if (SUCCEEDED(GetThemeFont(buttonData.hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf)))
|
||||||
{
|
{
|
||||||
hCreatedFont = CreateFontIndirect(&lf);
|
hCreatedFont = CreateFontIndirect(&lf);
|
||||||
|
@ -1030,7 +1030,7 @@ namespace NppDarkMode
|
||||||
|
|
||||||
hOldFont = static_cast<HFONT>(::SelectObject(hdc, hFont));
|
hOldFont = static_cast<HFONT>(::SelectObject(hdc, hFont));
|
||||||
|
|
||||||
WCHAR szText[256] = { 0 };
|
WCHAR szText[256] = { '\0' };
|
||||||
GetWindowText(hwnd, szText, _countof(szText));
|
GetWindowText(hwnd, szText, _countof(szText));
|
||||||
|
|
||||||
auto style = static_cast<long>(::GetWindowLongPtr(hwnd, GWL_STYLE));
|
auto style = static_cast<long>(::GetWindowLongPtr(hwnd, GWL_STYLE));
|
||||||
|
@ -1038,7 +1038,7 @@ namespace NppDarkMode
|
||||||
|
|
||||||
if (szText[0])
|
if (szText[0])
|
||||||
{
|
{
|
||||||
SIZE textSize = { 0 };
|
SIZE textSize = {};
|
||||||
GetTextExtentPoint32(hdc, szText, static_cast<int>(wcslen(szText)), &textSize);
|
GetTextExtentPoint32(hdc, szText, static_cast<int>(wcslen(szText)), &textSize);
|
||||||
|
|
||||||
int centerPosX = isCenter ? ((rcClient.right - rcClient.left - textSize.cx) / 2) : 7;
|
int centerPosX = isCenter ? ((rcClient.right - rcClient.left - textSize.cx) / 2) : 7;
|
||||||
|
@ -1052,7 +1052,7 @@ namespace NppDarkMode
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SIZE textSize = { 0 };
|
SIZE textSize = {};
|
||||||
GetTextExtentPoint32(hdc, L"M", 1, &textSize);
|
GetTextExtentPoint32(hdc, L"M", 1, &textSize);
|
||||||
rcBackground.top += textSize.cy / 2;
|
rcBackground.top += textSize.cy / 2;
|
||||||
}
|
}
|
||||||
|
@ -1120,7 +1120,7 @@ namespace NppDarkMode
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd))
|
if (NppDarkMode::isEnabled() && pButtonData->ensureTheme(hWnd))
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps = { 0 };
|
PAINTSTRUCT ps = {};
|
||||||
HDC hdc = reinterpret_cast<HDC>(wParam);
|
HDC hdc = reinterpret_cast<HDC>(wParam);
|
||||||
if (!hdc)
|
if (!hdc)
|
||||||
{
|
{
|
||||||
|
@ -1196,7 +1196,7 @@ namespace NppDarkMode
|
||||||
HFONT hFont = reinterpret_cast<HFONT>(SendMessage(hWnd, WM_GETFONT, 0, 0));
|
HFONT hFont = reinterpret_cast<HFONT>(SendMessage(hWnd, WM_GETFONT, 0, 0));
|
||||||
auto hOldFont = SelectObject(hdc, hFont);
|
auto hOldFont = SelectObject(hdc, hFont);
|
||||||
|
|
||||||
POINT ptCursor = { 0 };
|
POINT ptCursor = {};
|
||||||
::GetCursorPos(&ptCursor);
|
::GetCursorPos(&ptCursor);
|
||||||
ScreenToClient(hWnd, &ptCursor);
|
ScreenToClient(hWnd, &ptCursor);
|
||||||
|
|
||||||
|
@ -1205,10 +1205,10 @@ namespace NppDarkMode
|
||||||
int nSelTab = TabCtrl_GetCurSel(hWnd);
|
int nSelTab = TabCtrl_GetCurSel(hWnd);
|
||||||
for (int i = 0; i < nTabs; ++i)
|
for (int i = 0; i < nTabs; ++i)
|
||||||
{
|
{
|
||||||
RECT rcItem = { 0 };
|
RECT rcItem = {};
|
||||||
TabCtrl_GetItemRect(hWnd, i, &rcItem);
|
TabCtrl_GetItemRect(hWnd, i, &rcItem);
|
||||||
|
|
||||||
RECT rcIntersect = { 0 };
|
RECT rcIntersect = {};
|
||||||
if (IntersectRect(&rcIntersect, &ps.rcPaint, &rcItem))
|
if (IntersectRect(&rcIntersect, &ps.rcPaint, &rcItem))
|
||||||
{
|
{
|
||||||
bool bHot = PtInRect(&rcItem, ptCursor);
|
bool bHot = PtInRect(&rcItem, ptCursor);
|
||||||
|
@ -1235,7 +1235,7 @@ namespace NppDarkMode
|
||||||
SetBkMode(hdc, TRANSPARENT);
|
SetBkMode(hdc, TRANSPARENT);
|
||||||
|
|
||||||
TCHAR label[MAX_PATH];
|
TCHAR label[MAX_PATH];
|
||||||
TCITEM tci = { 0 };
|
TCITEM tci = {};
|
||||||
tci.mask = TCIF_TEXT;
|
tci.mask = TCIF_TEXT;
|
||||||
tci.pszText = label;
|
tci.pszText = label;
|
||||||
tci.cchTextMax = MAX_PATH - 1;
|
tci.cchTextMax = MAX_PATH - 1;
|
||||||
|
@ -1305,7 +1305,7 @@ namespace NppDarkMode
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
::GetClientRect(hWnd, &rc);
|
::GetClientRect(hWnd, &rc);
|
||||||
|
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
|
@ -1354,7 +1354,7 @@ namespace NppDarkMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
POINT ptCursor = { 0 };
|
POINT ptCursor = {};
|
||||||
::GetCursorPos(&ptCursor);
|
::GetCursorPos(&ptCursor);
|
||||||
ScreenToClient(hWnd, &ptCursor);
|
ScreenToClient(hWnd, &ptCursor);
|
||||||
|
|
||||||
|
@ -1418,7 +1418,7 @@ namespace NppDarkMode
|
||||||
EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) WINAPI_LAMBDA {
|
EnumChildWindows(hwndParent, [](HWND hwnd, LPARAM lParam) WINAPI_LAMBDA {
|
||||||
auto& p = *reinterpret_cast<Params*>(lParam);
|
auto& p = *reinterpret_cast<Params*>(lParam);
|
||||||
const size_t classNameLen = 16;
|
const size_t classNameLen = 16;
|
||||||
TCHAR className[classNameLen] = { 0 };
|
TCHAR className[classNameLen] = { '\0' };
|
||||||
GetClassName(hwnd, className, classNameLen);
|
GetClassName(hwnd, className, classNameLen);
|
||||||
|
|
||||||
if (wcscmp(className, WC_COMBOBOX) == 0)
|
if (wcscmp(className, WC_COMBOBOX) == 0)
|
||||||
|
|
|
@ -124,7 +124,7 @@ void resolveLinkFile(generic_string& linkFilePath)
|
||||||
{
|
{
|
||||||
IShellLink* psl;
|
IShellLink* psl;
|
||||||
WCHAR targetFilePath[MAX_PATH];
|
WCHAR targetFilePath[MAX_PATH];
|
||||||
WIN32_FIND_DATA wfd = {0};
|
WIN32_FIND_DATA wfd = {};
|
||||||
|
|
||||||
HRESULT hres = CoInitialize(NULL);
|
HRESULT hres = CoInitialize(NULL);
|
||||||
if (SUCCEEDED(hres))
|
if (SUCCEEDED(hres))
|
||||||
|
|
|
@ -232,7 +232,7 @@ struct CmdLineParams
|
||||||
int _column2go = -1;
|
int _column2go = -1;
|
||||||
int _pos2go = -1;
|
int _pos2go = -1;
|
||||||
|
|
||||||
POINT _point = { 0 };
|
POINT _point = {};
|
||||||
bool _isPointXValid = false;
|
bool _isPointXValid = false;
|
||||||
bool _isPointYValid = false;
|
bool _isPointYValid = false;
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ struct CmdLineParamsDTO
|
||||||
struct FloatingWindowInfo
|
struct FloatingWindowInfo
|
||||||
{
|
{
|
||||||
int _cont = 0;
|
int _cont = 0;
|
||||||
RECT _pos = { 0 };
|
RECT _pos = {};
|
||||||
|
|
||||||
FloatingWindowInfo(int cont, int x, int y, int w, int h)
|
FloatingWindowInfo(int cont, int x, int y, int w, int h)
|
||||||
: _cont(cont)
|
: _cont(cont)
|
||||||
|
@ -573,7 +573,7 @@ struct PrintSettings final {
|
||||||
int _footerFontStyle = 0;
|
int _footerFontStyle = 0;
|
||||||
int _footerFontSize = 0;
|
int _footerFontSize = 0;
|
||||||
|
|
||||||
RECT _marge = {0};
|
RECT _marge = {};
|
||||||
|
|
||||||
PrintSettings() {
|
PrintSettings() {
|
||||||
_marge.left = 0; _marge.top = 0; _marge.right = 0; _marge.bottom = 0;
|
_marge.left = 0; _marge.top = 0; _marge.right = 0; _marge.bottom = 0;
|
||||||
|
@ -742,9 +742,9 @@ struct NppGUI final
|
||||||
|
|
||||||
bool _checkHistoryFiles = false;
|
bool _checkHistoryFiles = false;
|
||||||
|
|
||||||
RECT _appPos = {0};
|
RECT _appPos = {};
|
||||||
|
|
||||||
RECT _findWindowPos = { 0 };
|
RECT _findWindowPos = {};
|
||||||
|
|
||||||
bool _isMaximized = false;
|
bool _isMaximized = false;
|
||||||
bool _isMinimizedToTray = false;
|
bool _isMinimizedToTray = false;
|
||||||
|
|
|
@ -846,7 +846,7 @@ bool FileManager::deleteFile(BufferID id)
|
||||||
if (!PathFileExists(fileNamePath.c_str()))
|
if (!PathFileExists(fileNamePath.c_str()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SHFILEOPSTRUCT fileOpStruct = {0};
|
SHFILEOPSTRUCT fileOpStruct = {};
|
||||||
fileOpStruct.hwnd = NULL;
|
fileOpStruct.hwnd = NULL;
|
||||||
fileOpStruct.pFrom = fileNamePath.c_str();
|
fileOpStruct.pFrom = fileNamePath.c_str();
|
||||||
fileOpStruct.pTo = NULL;
|
fileOpStruct.pTo = NULL;
|
||||||
|
@ -1462,7 +1462,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
|
||||||
bool success = true;
|
bool success = true;
|
||||||
EolType format = EolType::unknown;
|
EolType format = EolType::unknown;
|
||||||
int sciStatus = SC_STATUS_OK;
|
int sciStatus = SC_STATUS_OK;
|
||||||
TCHAR szException[64] = { 0 };
|
TCHAR szException[64] = { '\0' };
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
// First allocate enough memory for the whole file (this will reduce memory copy during loading)
|
// First allocate enough memory for the whole file (this will reduce memory copy during loading)
|
||||||
|
|
|
@ -751,7 +751,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -932,7 +932,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2614,7 +2614,7 @@ void FindReplaceDlg::findAllIn(InWhat op)
|
||||||
_pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView);
|
_pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView);
|
||||||
_pFinder->setVolatiled(false);
|
_pFinder->setVolatiled(false);
|
||||||
|
|
||||||
tTbData data = {0};
|
tTbData data = {};
|
||||||
_pFinder->create(&data);
|
_pFinder->create(&data);
|
||||||
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pFinder->getHSelf()));
|
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<LPARAM>(_pFinder->getHSelf()));
|
||||||
// define the default docking behaviour
|
// define the default docking behaviour
|
||||||
|
@ -2746,7 +2746,7 @@ Finder * FindReplaceDlg::createFinder()
|
||||||
Finder *pFinder = new Finder();
|
Finder *pFinder = new Finder();
|
||||||
pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView);
|
pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView);
|
||||||
|
|
||||||
tTbData data = { 0 };
|
tTbData data = {};
|
||||||
bool isRTL = _pFinder->_scintView.isTextDirectionRTL();
|
bool isRTL = _pFinder->_scintView.isTextDirectionRTL();
|
||||||
pFinder->create(&data, isRTL);
|
pFinder->create(&data, isRTL);
|
||||||
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<WPARAM>(pFinder->getHSelf()));
|
::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast<WPARAM>(pFinder->getHSelf()));
|
||||||
|
@ -4698,7 +4698,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rcClient = { 0 };
|
RECT rcClient = {};
|
||||||
GetClientRect(_hSelf, &rcClient);
|
GetClientRect(_hSelf, &rcClient);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -4848,7 +4848,7 @@ Progress::Progress(HINSTANCE hInst) : _hwnd(NULL), _hCallerWnd(NULL)
|
||||||
{
|
{
|
||||||
_hInst = hInst;
|
_hInst = hInst;
|
||||||
|
|
||||||
WNDCLASSEX wcex = {0};
|
WNDCLASSEX wcex = {};
|
||||||
wcex.cbSize = sizeof(wcex);
|
wcex.cbSize = sizeof(wcex);
|
||||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wcex.lpfnWndProc = wndProc;
|
wcex.lpfnWndProc = wndProc;
|
||||||
|
@ -4859,7 +4859,7 @@ Progress::Progress(HINSTANCE hInst) : _hwnd(NULL), _hCallerWnd(NULL)
|
||||||
|
|
||||||
::RegisterClassEx(&wcex);
|
::RegisterClassEx(&wcex);
|
||||||
|
|
||||||
INITCOMMONCONTROLSEX icex = {0};
|
INITCOMMONCONTROLSEX icex = {};
|
||||||
icex.dwSize = sizeof(icex);
|
icex.dwSize = sizeof(icex);
|
||||||
icex.dwICC = ICC_STANDARD_CLASSES | ICC_PROGRESS_CLASS;
|
icex.dwICC = ICC_STANDARD_CLASSES | ICC_PROGRESS_CLASS;
|
||||||
|
|
||||||
|
@ -5078,7 +5078,7 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
GetClientRect(hwnd, &rc);
|
GetClientRect(hwnd, &rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -362,11 +362,11 @@ protected :
|
||||||
void combo2ExtendedMode(int comboID);
|
void combo2ExtendedMode(int comboID);
|
||||||
|
|
||||||
private :
|
private :
|
||||||
RECT _initialWindowRect = {0};
|
RECT _initialWindowRect = {};
|
||||||
LONG _deltaWidth = 0;
|
LONG _deltaWidth = 0;
|
||||||
LONG _initialClientWidth = 0;
|
LONG _initialClientWidth = 0;
|
||||||
|
|
||||||
DIALOG_TYPE _currentStatus = FIND_DLG;
|
DIALOG_TYPE _currentStatus = DIALOG_TYPE::FIND_DLG;
|
||||||
RECT _findClosePos, _replaceClosePos, _findInFilesClosePos, _markClosePos;
|
RECT _findClosePos, _replaceClosePos, _findInFilesClosePos, _markClosePos;
|
||||||
RECT _countInSelFramePos, _replaceInSelFramePos;
|
RECT _countInSelFramePos, _replaceInSelFramePos;
|
||||||
RECT _countInSelCheckPos, _replaceInSelCheckPos;
|
RECT _countInSelCheckPos, _replaceInSelCheckPos;
|
||||||
|
@ -375,7 +375,7 @@ private :
|
||||||
Finder *_pFinder = nullptr;
|
Finder *_pFinder = nullptr;
|
||||||
generic_string _findResTitle;
|
generic_string _findResTitle;
|
||||||
|
|
||||||
std::vector<Finder *> _findersOfFinder;
|
std::vector<Finder*> _findersOfFinder{};
|
||||||
|
|
||||||
HWND _shiftTrickUpTip = nullptr;
|
HWND _shiftTrickUpTip = nullptr;
|
||||||
HWND _2ButtonsTip = nullptr;
|
HWND _2ButtonsTip = nullptr;
|
||||||
|
@ -471,7 +471,7 @@ private :
|
||||||
FindStatus _findStatus = FSFound;
|
FindStatus _findStatus = FSFound;
|
||||||
|
|
||||||
ReBar* _pRebar = nullptr;
|
ReBar* _pRebar = nullptr;
|
||||||
REBARBANDINFO _rbBand = { 0 };
|
REBARBANDINFO _rbBand = {};
|
||||||
|
|
||||||
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
void markSelectedTextInc(bool enable, FindOption *opt = NULL);
|
void markSelectedTextInc(bool enable, FindOption *opt = NULL);
|
||||||
|
|
|
@ -63,7 +63,7 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
struct NPP_RangeToFormat {
|
struct NPP_RangeToFormat {
|
||||||
HDC hdc = nullptr;
|
HDC hdc = nullptr;
|
||||||
HDC hdcTarget = nullptr;
|
HDC hdcTarget = nullptr;
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
RECT rcPage = { 0 };
|
RECT rcPage = {};
|
||||||
Sci_CharacterRange chrg = { 0 };
|
Sci_CharacterRange chrg = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Printer
|
class Printer
|
||||||
|
@ -43,7 +43,7 @@ public :
|
||||||
size_t doPrint(bool justDoIt);
|
size_t doPrint(bool justDoIt);
|
||||||
|
|
||||||
private :
|
private :
|
||||||
PRINTDLG _pdlg = { 0 };
|
PRINTDLG _pdlg = {};
|
||||||
ScintillaEditView *_pSEView = nullptr;
|
ScintillaEditView *_pSEView = nullptr;
|
||||||
size_t _startPos = 0;
|
size_t _startPos = 0;
|
||||||
size_t _endPos = 0;
|
size_t _endPos = 0;
|
||||||
|
|
|
@ -1592,7 +1592,7 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -368,7 +368,7 @@ private :
|
||||||
CommentStyleDialog _commentStyleDlg;
|
CommentStyleDialog _commentStyleDlg;
|
||||||
SymbolsStyleDialog _symbolsStyleDlg;
|
SymbolsStyleDialog _symbolsStyleDlg;
|
||||||
bool _status = UNDOCK;
|
bool _status = UNDOCK;
|
||||||
RECT _dlgPos = { 0 };
|
RECT _dlgPos = {};
|
||||||
int _currentHight = 0;
|
int _currentHight = 0;
|
||||||
int _yScrollPos = 0;
|
int _yScrollPos = 0;
|
||||||
int _prevHightVal = 0;
|
int _prevHightVal = 0;
|
||||||
|
|
|
@ -83,7 +83,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -58,7 +58,7 @@ public :
|
||||||
COLORREF getSelColour(){return _colour;};
|
COLORREF getSelColour(){return _colour;};
|
||||||
|
|
||||||
private :
|
private :
|
||||||
RECT _rc = {0};
|
RECT _rc = {};
|
||||||
COLORREF _colour = RGB(0xFF, 0xFF, 0xFF);
|
COLORREF _colour = RGB(0xFF, 0xFF, 0xFF);
|
||||||
|
|
||||||
static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
|
@ -599,7 +599,7 @@ bool WordStyleDlg::isDocumentMapStyle()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
constexpr size_t styleNameLen = 128;
|
constexpr size_t styleNameLen = 128;
|
||||||
TCHAR styleName[styleNameLen + 1] = { 0 };
|
TCHAR styleName[styleNameLen + 1] = { '\0' };
|
||||||
const auto lbTextLen = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETTEXTLEN, i, 0);
|
const auto lbTextLen = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETTEXTLEN, i, 0);
|
||||||
if (lbTextLen > styleNameLen)
|
if (lbTextLen > styleNameLen)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct tTbData {
|
||||||
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
|
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
|
||||||
|
|
||||||
// internal data, do not use !!!
|
// internal data, do not use !!!
|
||||||
RECT rcFloat = {0}; // floating position
|
RECT rcFloat = {}; // floating position
|
||||||
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
|
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
|
||||||
const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
|
const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
|
||||||
};
|
};
|
||||||
|
@ -65,7 +65,7 @@ struct tTbData {
|
||||||
|
|
||||||
struct tDockMgr {
|
struct tDockMgr {
|
||||||
HWND hWnd = nullptr; // the docking manager wnd
|
HWND hWnd = nullptr; // the docking manager wnd
|
||||||
RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs
|
RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ tTbData* DockingCont::getDataOfActiveTb()
|
||||||
|
|
||||||
if (iItem != -1)
|
if (iItem != -1)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
|
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
|
::SendMessage(_hContTab, TCM_GETITEM, iItem, reinterpret_cast<LPARAM>(&tcItem));
|
||||||
|
@ -239,7 +239,7 @@ tTbData* DockingCont::getDataOfActiveTb()
|
||||||
vector<tTbData*> DockingCont::getDataOfVisTb()
|
vector<tTbData*> DockingCont::getDataOfVisTb()
|
||||||
{
|
{
|
||||||
vector<tTbData*> vTbData;
|
vector<tTbData*> vTbData;
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
@ -254,7 +254,7 @@ vector<tTbData*> DockingCont::getDataOfVisTb()
|
||||||
|
|
||||||
bool DockingCont::isTbVis(tTbData* data)
|
bool DockingCont::isTbVis(tTbData* data)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
@ -335,7 +335,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
||||||
}
|
}
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
POINT pt = {0};
|
POINT pt = {};
|
||||||
|
|
||||||
// get correct cursor position
|
// get correct cursor position
|
||||||
::GetCursorPos(&pt);
|
::GetCursorPos(&pt);
|
||||||
|
@ -394,8 +394,8 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
|
||||||
}
|
}
|
||||||
case WM_MOUSEHOVER:
|
case WM_MOUSEHOVER:
|
||||||
{
|
{
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
POINT pt = {0};
|
POINT pt = {};
|
||||||
|
|
||||||
|
|
||||||
// get mouse position
|
// get mouse position
|
||||||
|
@ -445,7 +445,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
RECT rc = pDrawItemStruct->rcItem;
|
RECT rc = pDrawItemStruct->rcItem;
|
||||||
HDC hDc = pDrawItemStruct->hDC;
|
HDC hDc = pDrawItemStruct->hDC;
|
||||||
HPEN hPen = ::CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_BTNSHADOW));
|
HPEN hPen = ::CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_BTNSHADOW));
|
||||||
BITMAP bmp = {0};
|
BITMAP bmp = {};
|
||||||
HBITMAP hBmpCur = NULL;
|
HBITMAP hBmpCur = NULL;
|
||||||
HBITMAP hBmpOld = NULL;
|
HBITMAP hBmpOld = NULL;
|
||||||
HBITMAP hBmpNew = NULL;
|
HBITMAP hBmpNew = NULL;
|
||||||
|
@ -510,7 +510,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
|
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_LEFT | DT_SINGLELINE | DT_VCENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
|
||||||
|
|
||||||
// calculate text size and if its trankated...
|
// calculate text size and if its trankated...
|
||||||
SIZE size = {0};
|
SIZE size = {};
|
||||||
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
|
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
|
||||||
_bCaptionTT = (((rc.right - rc.left) < size.cx) ? TRUE : FALSE);
|
_bCaptionTT = (((rc.right - rc.left) < size.cx) ? TRUE : FALSE);
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX);
|
::DrawText(hDc, _pszCaption.c_str(), length, &rc, DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX);
|
||||||
|
|
||||||
// calculate text size and if its trankated...
|
// calculate text size and if its trankated...
|
||||||
SIZE size = {0};
|
SIZE size = {};
|
||||||
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
|
GetTextExtentPoint32(hDc, _pszCaption.c_str(), length, &size);
|
||||||
_bCaptionTT = (((rc.bottom - rc.top) < size.cy) ? TRUE : FALSE);
|
_bCaptionTT = (((rc.bottom - rc.top) < size.cy) ? TRUE : FALSE);
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already?
|
dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already?
|
||||||
|
|
||||||
RECT rcIntersect = { 0 };
|
RECT rcIntersect = {};
|
||||||
if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem))
|
if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem))
|
||||||
{
|
{
|
||||||
dis.rcItem.top += NppParameters::getInstance()._dpiManager.scaleY(1);
|
dis.rcItem.top += NppParameters::getInstance()._dpiManager.scaleY(1);
|
||||||
|
@ -788,7 +788,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
{
|
{
|
||||||
int iItem = 0;
|
int iItem = 0;
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
// get selected sub item
|
// get selected sub item
|
||||||
info.pt.x = LOWORD(lParam);
|
info.pt.x = LOWORD(lParam);
|
||||||
|
@ -807,8 +807,8 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
{
|
{
|
||||||
int iItem = 0;
|
int iItem = 0;
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
// get selected sub item
|
// get selected sub item
|
||||||
info.pt.x = LOWORD(lParam);
|
info.pt.x = LOWORD(lParam);
|
||||||
|
@ -835,7 +835,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
int iItem = 0;
|
int iItem = 0;
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
// get selected sub item
|
// get selected sub item
|
||||||
info.pt.x = LOWORD(lParam);
|
info.pt.x = LOWORD(lParam);
|
||||||
|
@ -873,8 +873,8 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
else if (iItem != _iLastHovered)
|
else if (iItem != _iLastHovered)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
|
|
||||||
// destroy old tooltip
|
// destroy old tooltip
|
||||||
toolTip.destroy();
|
toolTip.destroy();
|
||||||
|
@ -904,9 +904,9 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
case WM_MOUSEHOVER:
|
case WM_MOUSEHOVER:
|
||||||
{
|
{
|
||||||
int iItem = 0;
|
int iItem = 0;
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
// get selected sub item
|
// get selected sub item
|
||||||
info.pt.x = LOWORD(lParam);
|
info.pt.x = LOWORD(lParam);
|
||||||
|
@ -941,7 +941,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
if ((lpnmhdr->hwndFrom == _hContTab) && (lpnmhdr->code == TCN_GETOBJECT))
|
if ((lpnmhdr->hwndFrom == _hContTab) && (lpnmhdr->code == TCN_GETOBJECT))
|
||||||
{
|
{
|
||||||
int iItem = 0;
|
int iItem = 0;
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
// get selected sub item
|
// get selected sub item
|
||||||
info.pt.x = LOWORD(lParam);
|
info.pt.x = LOWORD(lParam);
|
||||||
|
@ -961,7 +961,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
RECT rc = pDrawItemStruct->rcItem;
|
RECT rc = pDrawItemStruct->rcItem;
|
||||||
|
|
||||||
int nTab = pDrawItemStruct->itemID;
|
int nTab = pDrawItemStruct->itemID;
|
||||||
|
@ -1023,7 +1023,7 @@ void DockingCont::drawTabItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
if ((hImageList != NULL) && (iPosImage >= 0))
|
if ((hImageList != NULL) && (iPosImage >= 0))
|
||||||
{
|
{
|
||||||
// Get height of image so we
|
// Get height of image so we
|
||||||
IMAGEINFO info = {0};
|
IMAGEINFO info = {};
|
||||||
RECT & imageRect = info.rcImage;
|
RECT & imageRect = info.rcImage;
|
||||||
|
|
||||||
ImageList_GetImageInfo(hImageList, iPosImage, &info);
|
ImageList_GetImageInfo(hImageList, iPosImage, &info);
|
||||||
|
@ -1106,7 +1106,7 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1133,8 +1133,8 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
||||||
}
|
}
|
||||||
case WM_NCLBUTTONDBLCLK :
|
case WM_NCLBUTTONDBLCLK :
|
||||||
{
|
{
|
||||||
RECT rcWnd = {0};
|
RECT rcWnd = {};
|
||||||
RECT rcClient = {0};
|
RECT rcClient = {};
|
||||||
POINT pt = {HIWORD(lParam), LOWORD(lParam)};
|
POINT pt = {HIWORD(lParam), LOWORD(lParam)};
|
||||||
|
|
||||||
getWindowRect(rcWnd);
|
getWindowRect(rcWnd);
|
||||||
|
@ -1184,9 +1184,9 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
void DockingCont::onSize()
|
void DockingCont::onSize()
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
RECT rcTemp = {0};
|
RECT rcTemp = {};
|
||||||
UINT iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
UINT iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
UINT iTabOff = 0;
|
UINT iTabOff = 0;
|
||||||
|
|
||||||
|
@ -1309,7 +1309,7 @@ void DockingCont::doClose(BOOL closeAll)
|
||||||
|
|
||||||
// Always close active tab first
|
// Always close active tab first
|
||||||
int iItemCur = getActiveTb();
|
int iItemCur = getActiveTb();
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
::SendMessage(_hContTab, TCM_GETITEM, iItemCur, reinterpret_cast<LPARAM>(&tcItem));
|
::SendMessage(_hContTab, TCM_GETITEM, iItemCur, reinterpret_cast<LPARAM>(&tcItem));
|
||||||
if (tcItem.lParam)
|
if (tcItem.lParam)
|
||||||
|
@ -1329,7 +1329,7 @@ void DockingCont::doClose(BOOL closeAll)
|
||||||
int iItemOff = 0;
|
int iItemOff = 0;
|
||||||
for (int iItem = 0; iItem < iItemCnt; ++iItem)
|
for (int iItem = 0; iItem < iItemCnt; ++iItem)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
// get item data
|
// get item data
|
||||||
selectTab(iItemOff);
|
selectTab(iItemOff);
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
@ -1427,7 +1427,7 @@ int DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient)
|
||||||
|
|
||||||
void DockingCont::viewToolbar(tTbData *pTbData)
|
void DockingCont::viewToolbar(tTbData *pTbData)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
|
||||||
if (iItemCnt > 0)
|
if (iItemCnt > 0)
|
||||||
|
@ -1474,7 +1474,7 @@ void DockingCont::viewToolbar(tTbData *pTbData)
|
||||||
|
|
||||||
int DockingCont::searchPosInTab(tTbData* pTbData)
|
int DockingCont::searchPosInTab(tTbData* pTbData)
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
|
||||||
tcItem.mask = TCIF_PARAM;
|
tcItem.mask = TCIF_PARAM;
|
||||||
|
@ -1496,8 +1496,8 @@ void DockingCont::selectTab(int iTab)
|
||||||
if (iTab != -1)
|
if (iTab != -1)
|
||||||
{
|
{
|
||||||
const TCHAR *pszMaxTxt = NULL;
|
const TCHAR *pszMaxTxt = NULL;
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
SIZE size = {0};
|
SIZE size = {};
|
||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
|
||||||
|
|
||||||
|
@ -1592,7 +1592,7 @@ bool DockingCont::updateCaption()
|
||||||
if (!_hContTab)
|
if (!_hContTab)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItem = getActiveTb();
|
int iItem = getActiveTb();
|
||||||
|
|
||||||
if (iItem < 0)
|
if (iItem < 0)
|
||||||
|
@ -1628,7 +1628,7 @@ bool DockingCont::updateCaption()
|
||||||
|
|
||||||
void DockingCont::focusClient()
|
void DockingCont::focusClient()
|
||||||
{
|
{
|
||||||
TCITEM tcItem = {0};
|
TCITEM tcItem = {};
|
||||||
int iItem = getActiveTb();
|
int iItem = getActiveTb();
|
||||||
|
|
||||||
if (iItem != -1)
|
if (iItem != -1)
|
||||||
|
|
|
@ -187,7 +187,7 @@ private:
|
||||||
BOOL _isMouseDown = FALSE;
|
BOOL _isMouseDown = FALSE;
|
||||||
BOOL _isMouseClose = FALSE;
|
BOOL _isMouseClose = FALSE;
|
||||||
BOOL _isMouseOver = FALSE;
|
BOOL _isMouseOver = FALSE;
|
||||||
RECT _rcCaption = {0};
|
RECT _rcCaption = {};
|
||||||
|
|
||||||
// tab style
|
// tab style
|
||||||
BOOL _bDrawOgLine = FALSE;
|
BOOL _bDrawOgLine = FALSE;
|
||||||
|
|
|
@ -104,7 +104,7 @@ protected :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -85,8 +85,8 @@ public :
|
||||||
|
|
||||||
private :
|
private :
|
||||||
Window **_ppWindow = nullptr;
|
Window **_ppWindow = nullptr;
|
||||||
RECT _rcWork = { 0 };
|
RECT _rcWork = {};
|
||||||
RECT _rect = { 0 };
|
RECT _rect = {};
|
||||||
Window **_ppMainWindow = nullptr;
|
Window **_ppMainWindow = nullptr;
|
||||||
std::vector<HWND> _vImageList;
|
std::vector<HWND> _vImageList;
|
||||||
HIMAGELIST _hImageList = nullptr;
|
HIMAGELIST _hImageList = nullptr;
|
||||||
|
|
|
@ -152,7 +152,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -209,8 +209,8 @@ LRESULT Gripper::runProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
void Gripper::create()
|
void Gripper::create()
|
||||||
{
|
{
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
POINT pt = {0};
|
POINT pt = {};
|
||||||
|
|
||||||
// start hooking
|
// start hooking
|
||||||
::SetWindowPos(_pCont->getHSelf(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
::SetWindowPos(_pCont->getHSelf(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
||||||
|
@ -283,8 +283,8 @@ void Gripper::onButtonUp()
|
||||||
{
|
{
|
||||||
POINT pt = {0,0};
|
POINT pt = {0,0};
|
||||||
POINT ptBuf = {0,0};
|
POINT ptBuf = {0,0};
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
RECT rcCorr = {0};
|
RECT rcCorr = {};
|
||||||
|
|
||||||
::GetCursorPos(&pt);
|
::GetCursorPos(&pt);
|
||||||
getMousePoints(&pt, &ptBuf);
|
getMousePoints(&pt, &ptBuf);
|
||||||
|
@ -381,14 +381,14 @@ void Gripper::doTabReordering(POINT pt)
|
||||||
/* search only if container is visible */
|
/* search only if container is visible */
|
||||||
if (::IsWindowVisible(hTab) == TRUE)
|
if (::IsWindowVisible(hTab) == TRUE)
|
||||||
{
|
{
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
|
|
||||||
::GetWindowRect(hTab, &rc);
|
::GetWindowRect(hTab, &rc);
|
||||||
|
|
||||||
/* test if cursor points in tab window */
|
/* test if cursor points in tab window */
|
||||||
if (::PtInRect(&rc, pt) == TRUE)
|
if (::PtInRect(&rc, pt) == TRUE)
|
||||||
{
|
{
|
||||||
TCHITTESTINFO info = {0};
|
TCHITTESTINFO info = {};
|
||||||
|
|
||||||
if (_hTab == NULL)
|
if (_hTab == NULL)
|
||||||
{
|
{
|
||||||
|
@ -512,8 +512,8 @@ void Gripper::drawRectangle(const POINT* pPt)
|
||||||
{
|
{
|
||||||
HBRUSH hbrushOrig= NULL;
|
HBRUSH hbrushOrig= NULL;
|
||||||
HBITMAP hbmOrig = NULL;
|
HBITMAP hbmOrig = NULL;
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
RECT rcNew = {0};
|
RECT rcNew = {};
|
||||||
RECT rcOld = _rcPrev;
|
RECT rcOld = _rcPrev;
|
||||||
|
|
||||||
// Get a screen device context with backstage redrawing disabled - to have a consistently
|
// Get a screen device context with backstage redrawing disabled - to have a consistently
|
||||||
|
@ -632,7 +632,7 @@ void Gripper::getMousePoints(POINT* pt, POINT* ptPrev)
|
||||||
|
|
||||||
void Gripper::getMovingRect(POINT pt, RECT *rc)
|
void Gripper::getMovingRect(POINT pt, RECT *rc)
|
||||||
{
|
{
|
||||||
RECT rcCorr = {0};
|
RECT rcCorr = {};
|
||||||
DockingCont* pContHit = NULL;
|
DockingCont* pContHit = NULL;
|
||||||
|
|
||||||
/* test if mouse hits a container */
|
/* test if mouse hits a container */
|
||||||
|
@ -695,7 +695,7 @@ DockingCont* Gripper::contHitTest(POINT pt)
|
||||||
{
|
{
|
||||||
if (vCont[iCont]->isFloating())
|
if (vCont[iCont]->isFloating())
|
||||||
{
|
{
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
|
|
||||||
vCont[iCont]->getWindowRect(rc);
|
vCont[iCont]->getWindowRect(rc);
|
||||||
if ((rc.top < pt.y) && (pt.y < (rc.top + 24)))
|
if ((rc.top < pt.y) && (pt.y < (rc.top + 24)))
|
||||||
|
@ -721,7 +721,7 @@ DockingCont* Gripper::contHitTest(POINT pt)
|
||||||
if (::IsWindowVisible(vCont[iCont]->getTabWnd()))
|
if (::IsWindowVisible(vCont[iCont]->getTabWnd()))
|
||||||
{
|
{
|
||||||
/* test if within tab (rect test is used, because of drag and drop behaviour) */
|
/* test if within tab (rect test is used, because of drag and drop behaviour) */
|
||||||
RECT rc = {0};
|
RECT rc = {};
|
||||||
|
|
||||||
::GetWindowRect(vCont[iCont]->getTabWnd(), &rc);
|
::GetWindowRect(vCont[iCont]->getTabWnd(), &rc);
|
||||||
if (::PtInRect(&rc, pt))
|
if (::PtInRect(&rc, pt))
|
||||||
|
@ -738,7 +738,7 @@ DockingCont* Gripper::contHitTest(POINT pt)
|
||||||
|
|
||||||
DockingCont* Gripper::workHitTest(POINT pt, RECT *rc)
|
DockingCont* Gripper::workHitTest(POINT pt, RECT *rc)
|
||||||
{
|
{
|
||||||
RECT rcCont = {0};
|
RECT rcCont = {};
|
||||||
vector<DockingCont*> vCont = _pDockMgr->getContainerInfo();
|
vector<DockingCont*> vCont = _pDockMgr->getContainerInfo();
|
||||||
|
|
||||||
/* at first test if cursor points into a visible container */
|
/* at first test if cursor points into a visible container */
|
||||||
|
|
|
@ -121,21 +121,21 @@ private:
|
||||||
DockingCont *_pCont = nullptr;
|
DockingCont *_pCont = nullptr;
|
||||||
|
|
||||||
// mouse offset in moving rectangle
|
// mouse offset in moving rectangle
|
||||||
POINT _ptOffset = { 0 };
|
POINT _ptOffset = {};
|
||||||
|
|
||||||
// remembers old mouse point
|
// remembers old mouse point
|
||||||
POINT _ptOld = { 0 };
|
POINT _ptOld = {};
|
||||||
BOOL _bPtOldValid = FALSE;
|
BOOL _bPtOldValid = FALSE;
|
||||||
|
|
||||||
// remember last drawn rectangle (jg)
|
// remember last drawn rectangle (jg)
|
||||||
RECT _rcPrev = { 0 };
|
RECT _rcPrev = {};
|
||||||
|
|
||||||
// for sorting tabs
|
// for sorting tabs
|
||||||
HWND _hTab = nullptr;
|
HWND _hTab = nullptr;
|
||||||
HWND _hTabSource = nullptr;
|
HWND _hTabSource = nullptr;
|
||||||
BOOL _startMovingFromTab = FALSE;
|
BOOL _startMovingFromTab = FALSE;
|
||||||
int _iItem = 0;
|
int _iItem = 0;
|
||||||
RECT _rcItem = { 0 };
|
RECT _rcItem = {};
|
||||||
TCITEM _tcItem;
|
TCITEM _tcItem;
|
||||||
|
|
||||||
HDC _hdc = nullptr;
|
HDC _hdc = nullptr;
|
||||||
|
|
|
@ -68,7 +68,7 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -107,7 +107,7 @@ private:
|
||||||
TreeView _treeView;
|
TreeView _treeView;
|
||||||
TreeView _treeViewSearchResult;
|
TreeView _treeViewSearchResult;
|
||||||
|
|
||||||
SCROLLINFO si = { 0 };
|
SCROLLINFO si = {};
|
||||||
long _findLine = -1;
|
long _findLine = -1;
|
||||||
long _findEndLine = -1;
|
long _findEndLine = -1;
|
||||||
HTREEITEM _findItem = nullptr;
|
HTREEITEM _findItem = nullptr;
|
||||||
|
|
|
@ -150,7 +150,7 @@ void ToolBarIcons::reInit(int size)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BITMAPINFOHEADER bi = { 0 };
|
BITMAPINFOHEADER bi = {};
|
||||||
|
|
||||||
bi.biSize = sizeof(BITMAPINFOHEADER);
|
bi.biSize = sizeof(BITMAPINFOHEADER);
|
||||||
bi.biWidth = bmp.bmWidth;
|
bi.biWidth = bmp.bmWidth;
|
||||||
|
@ -197,7 +197,7 @@ void ToolBarIcons::reInit(int size)
|
||||||
|
|
||||||
::ReleaseDC(NULL, dcScreen);
|
::ReleaseDC(NULL, dcScreen);
|
||||||
|
|
||||||
ICONINFO iconinfoDest = { 0 };
|
ICONINFO iconinfoDest = {};
|
||||||
iconinfoDest.fIcon = TRUE;
|
iconinfoDest.fIcon = TRUE;
|
||||||
iconinfoDest.hbmColor = hBmpNew;
|
iconinfoDest.hbmColor = hBmpNew;
|
||||||
iconinfoDest.hbmMask = iconinfoSrc.hbmMask;
|
iconinfoDest.hbmMask = iconinfoSrc.hbmMask;
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace // anonymous
|
||||||
|
|
||||||
void expandEnv(generic_string& s)
|
void expandEnv(generic_string& s)
|
||||||
{
|
{
|
||||||
TCHAR buffer[MAX_PATH] = { 0 };
|
TCHAR buffer[MAX_PATH] = { '\0' };
|
||||||
// This returns the resulting string length or 0 in case of error.
|
// This returns the resulting string length or 0 in case of error.
|
||||||
DWORD ret = ExpandEnvironmentStrings(s.c_str(), buffer, static_cast<DWORD>(std::size(buffer)));
|
DWORD ret = ExpandEnvironmentStrings(s.c_str(), buffer, static_cast<DWORD>(std::size(buffer)));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
@ -452,7 +452,7 @@ private:
|
||||||
{
|
{
|
||||||
if (::PathIsRelative(fileName.c_str()))
|
if (::PathIsRelative(fileName.c_str()))
|
||||||
{
|
{
|
||||||
TCHAR buffer[MAX_PATH] = { 0 };
|
TCHAR buffer[MAX_PATH] = { '\0' };
|
||||||
const generic_string folder = getDialogFolder(_dialog);
|
const generic_string folder = getDialogFolder(_dialog);
|
||||||
LPTSTR ret = ::PathCombine(buffer, folder.c_str(), fileName.c_str());
|
LPTSTR ret = ::PathCombine(buffer, folder.c_str(), fileName.c_str());
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -347,7 +347,7 @@ bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *ne
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const size_t lenMax = 256;
|
const size_t lenMax = 256;
|
||||||
TCHAR oldName[lenMax] = {0};
|
TCHAR oldName[lenMax] = { '\0' };
|
||||||
size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0);
|
size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0);
|
||||||
if (txtLen >= lenMax)
|
if (txtLen >= lenMax)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -217,9 +217,10 @@ public :
|
||||||
};
|
};
|
||||||
|
|
||||||
private :
|
private :
|
||||||
POINT _singleLineModePoint, _multiLineModePoint;
|
POINT _singleLineModePoint = {};
|
||||||
RECT _closerRect = { 0 };
|
POINT _multiLineModePoint = {};
|
||||||
RECT _closerLabelRect = { 0 };
|
RECT _closerRect = {};
|
||||||
|
RECT _closerLabelRect = {};
|
||||||
HWND _tip = nullptr;
|
HWND _tip = nullptr;
|
||||||
|
|
||||||
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
private:
|
private:
|
||||||
LPCTSTR _szFile = nullptr;
|
LPCTSTR _szFile = nullptr;
|
||||||
DWORD _dwNotifyFilter = 0;
|
DWORD _dwNotifyFilter = 0;
|
||||||
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = { 0 };
|
WIN32_FILE_ATTRIBUTE_DATA _lastFileInfo = {};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -397,7 +397,7 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
|
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
|
@ -81,8 +81,8 @@ private:
|
||||||
static bool _isHorizontalFixedRegistered;
|
static bool _isHorizontalFixedRegistered;
|
||||||
static bool _isVerticalFixedRegistered;
|
static bool _isVerticalFixedRegistered;
|
||||||
|
|
||||||
RECT _clickZone2TL = { 0 };
|
RECT _clickZone2TL = {};
|
||||||
RECT _clickZone2BR = { 0 };
|
RECT _clickZone2BR = {};
|
||||||
|
|
||||||
static LRESULT CALLBACK staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
static LRESULT CALLBACK staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
LRESULT CALLBACK spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
|
@ -280,7 +280,7 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -89,8 +89,8 @@ void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing
|
||||||
{
|
{
|
||||||
// If the user has switched from a dual monitor to a single monitor since we last
|
// If the user has switched from a dual monitor to a single monitor since we last
|
||||||
// displayed the dialog, then ensure that it's still visible on the single monitor.
|
// displayed the dialog, then ensure that it's still visible on the single monitor.
|
||||||
RECT workAreaRect = { 0 };
|
RECT workAreaRect = {};
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0);
|
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0);
|
||||||
::GetWindowRect(_hSelf, &rc);
|
::GetWindowRect(_hSelf, &rc);
|
||||||
int newLeft = rc.left;
|
int newLeft = rc.left;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public :
|
||||||
virtual void destroy() override;
|
virtual void destroy() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RECT _rc = { 0 };
|
RECT _rc = {};
|
||||||
static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0;
|
virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
int horizontal;
|
int horizontal;
|
||||||
int vertical;
|
int vertical;
|
||||||
int between;
|
int between;
|
||||||
} borders = { 0 };
|
} borders = {};
|
||||||
|
|
||||||
SendMessage(hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);
|
SendMessage(hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);
|
||||||
|
|
||||||
|
@ -133,9 +133,9 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
std::wstring str;
|
std::wstring str;
|
||||||
for (int i = 0; i < nParts; ++i)
|
for (int i = 0; i < nParts; ++i)
|
||||||
{
|
{
|
||||||
RECT rcPart = { 0 };
|
RECT rcPart = {};
|
||||||
SendMessage(hWnd, SB_GETRECT, i, (LPARAM)&rcPart);
|
SendMessage(hWnd, SB_GETRECT, i, (LPARAM)&rcPart);
|
||||||
RECT rcIntersect = { 0 };
|
RECT rcIntersect = {};
|
||||||
if (!IntersectRect(&rcIntersect, &rcPart, &ps.rcPaint))
|
if (!IntersectRect(&rcIntersect, &rcPart, &ps.rcPaint))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -200,7 +200,7 @@ LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
if (isSizeGrip)
|
if (isSizeGrip)
|
||||||
{
|
{
|
||||||
pStatusBarInfo->ensureTheme(hWnd);
|
pStatusBarInfo->ensureTheme(hWnd);
|
||||||
SIZE gripSize = { 0 };
|
SIZE gripSize = {};
|
||||||
GetThemePartSize(pStatusBarInfo->hTheme, hdc, SP_GRIPPER, 0, &rcClient, TS_DRAW, &gripSize);
|
GetThemePartSize(pStatusBarInfo->hTheme, hdc, SP_GRIPPER, 0, &rcClient, TS_DRAW, &gripSize);
|
||||||
RECT rc = rcClient;
|
RECT rc = rcClient;
|
||||||
rc.left = rc.right - gripSize.cx;
|
rc.left = rc.right - gripSize.cx;
|
||||||
|
|
|
@ -870,7 +870,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
GetClientRect(hwnd, &rc);
|
GetClientRect(hwnd, &rc);
|
||||||
FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush());
|
FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
|
||||||
|
@ -926,7 +926,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
||||||
|
|
||||||
dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already?
|
dis.itemState |= ODS_NOFOCUSRECT; // maybe, does it handle it already?
|
||||||
|
|
||||||
RECT rcIntersect = { 0 };
|
RECT rcIntersect = {};
|
||||||
if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem))
|
if (IntersectRect(&rcIntersect, &ps.rcPaint, &dis.rcItem))
|
||||||
{
|
{
|
||||||
if (dwStyle & TCS_VERTICAL)
|
if (dwStyle & TCS_VERTICAL)
|
||||||
|
|
|
@ -62,6 +62,6 @@ protected:
|
||||||
HFONT _hFontSelected = nullptr;
|
HFONT _hFontSelected = nullptr;
|
||||||
int _nbItem = 0;
|
int _nbItem = 0;
|
||||||
int _currentIndex = 0;
|
int _currentIndex = 0;
|
||||||
RECT _rc = { 0 };
|
RECT _rc = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ void ToolBar::registerDynBtn(UINT messageID, toolbarIcons* iconHandles, HICON ab
|
||||||
{
|
{
|
||||||
HBITMAP hbmMask = ::CreateCompatibleBitmap(::GetDC(NULL), bmp.bmWidth, bmp.bmHeight);
|
HBITMAP hbmMask = ::CreateCompatibleBitmap(::GetDC(NULL), bmp.bmWidth, bmp.bmHeight);
|
||||||
|
|
||||||
ICONINFO iconinfoDest = { 0 };
|
ICONINFO iconinfoDest = {};
|
||||||
iconinfoDest.fIcon = TRUE;
|
iconinfoDest.fIcon = TRUE;
|
||||||
iconinfoDest.hbmColor = iconHandles->hToolbarBmp;
|
iconinfoDest.hbmColor = iconHandles->hToolbarBmp;
|
||||||
iconinfoDest.hbmMask = hbmMask;
|
iconinfoDest.hbmMask = hbmMask;
|
||||||
|
|
|
@ -111,7 +111,7 @@ private :
|
||||||
size_t _nbTotalButtons = 0;
|
size_t _nbTotalButtons = 0;
|
||||||
size_t _nbCurrentButtons = 0;
|
size_t _nbCurrentButtons = 0;
|
||||||
ReBar * _pRebar = nullptr;
|
ReBar * _pRebar = nullptr;
|
||||||
REBARBANDINFO _rbBand = { 0 };
|
REBARBANDINFO _rbBand = {};
|
||||||
std::vector<iconLocator> _customIconVect;
|
std::vector<iconLocator> _customIconVect;
|
||||||
TiXmlNode *_toolIcons = nullptr;
|
TiXmlNode *_toolIcons = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
WNDPROC _defaultProc = nullptr;
|
WNDPROC _defaultProc = nullptr;
|
||||||
BOOL _bTrackMouse = FALSE;
|
BOOL _bTrackMouse = FALSE;
|
||||||
TOOLINFO _ti = { 0 };
|
TOOLINFO _ti = {};
|
||||||
|
|
||||||
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
|
static LRESULT CALLBACK staticWinProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
|
||||||
return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(Message, wParam, lParam));
|
return (((ToolTip *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(Message, wParam, lParam));
|
||||||
|
|
|
@ -205,7 +205,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
LPNMHEADER test = (LPNMHEADER)lParam;
|
LPNMHEADER test = (LPNMHEADER)lParam;
|
||||||
HWND hwndHD = ListView_GetHeader(_fileListView.getHSelf());
|
HWND hwndHD = ListView_GetHeader(_fileListView.getHSelf());
|
||||||
TCHAR HDtext[MAX_PATH];
|
TCHAR HDtext[MAX_PATH];
|
||||||
HDITEM hdi = { 0 };
|
HDITEM hdi = {};
|
||||||
hdi.mask = HDI_TEXT | HDI_WIDTH;
|
hdi.mask = HDI_TEXT | HDI_WIDTH;
|
||||||
hdi.pszText = HDtext;
|
hdi.pszText = HDtext;
|
||||||
hdi.cchTextMax = MAX_PATH;
|
hdi.cchTextMax = MAX_PATH;
|
||||||
|
|
|
@ -83,8 +83,8 @@ protected :
|
||||||
|
|
||||||
HWND _hList = nullptr;
|
HWND _hList = nullptr;
|
||||||
static RECT _lastKnownLocation;
|
static RECT _lastKnownLocation;
|
||||||
SIZE _szMinButton = { 0 };
|
SIZE _szMinButton = {};
|
||||||
SIZE _szMinListCtrl = { 0 };
|
SIZE _szMinListCtrl = {};
|
||||||
DocTabView *_pTab = nullptr;
|
DocTabView *_pTab = nullptr;
|
||||||
std::vector<int> _idxMap;
|
std::vector<int> _idxMap;
|
||||||
int _currentColumn = -1;
|
int _currentColumn = -1;
|
||||||
|
|
|
@ -124,7 +124,7 @@ intptr_t CALLBACK ValueDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -206,7 +206,7 @@ intptr_t CALLBACK ButtonDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
RECT rc = { 0 };
|
RECT rc = {};
|
||||||
getClientRect(rc);
|
getClientRect(rc);
|
||||||
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue