parent
2d5c241e2b
commit
2a21a042d1
|
@ -1313,7 +1313,7 @@ namespace NppDarkMode
|
||||||
|
|
||||||
DWORD textFlags = isCenter ? DT_CENTER : DT_LEFT;
|
DWORD textFlags = isCenter ? DT_CENTER : DT_LEFT;
|
||||||
|
|
||||||
if(::SendMessage(hwnd, WM_QUERYUISTATE, 0, 0) != NULL)
|
if(::SendMessage(hwnd, WM_QUERYUISTATE, 0, 0) != static_cast<LRESULT>(NULL))
|
||||||
{
|
{
|
||||||
textFlags |= DT_HIDEPREFIX;
|
textFlags |= DT_HIDEPREFIX;
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ void DocTabView::bufferUpdated(Buffer * buffer, int mask)
|
||||||
|
|
||||||
void DocTabView::setBuffer(size_t index, BufferID id)
|
void DocTabView::setBuffer(size_t index, BufferID id)
|
||||||
{
|
{
|
||||||
if (index < 0 || index >= _nbItem)
|
if (index >= _nbItem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TCITEM tie{};
|
TCITEM tie{};
|
||||||
|
|
|
@ -70,12 +70,12 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
{
|
{
|
||||||
const NppGUI & nppGUI = (NppParameters::getInstance()).getNppGUI();
|
const NppGUI & nppGUI = (NppParameters::getInstance()).getNppGUI();
|
||||||
|
|
||||||
POINT ptPage;
|
POINT ptPage{};
|
||||||
POINT ptDpi;
|
POINT ptDpi{};
|
||||||
|
|
||||||
RECT rectMargins;
|
RECT rectMargins{};
|
||||||
RECT rectPhysMargins;
|
RECT rectPhysMargins{};
|
||||||
RECT userMargins;
|
RECT userMargins{};
|
||||||
|
|
||||||
// Get printer resolution
|
// Get printer resolution
|
||||||
ptDpi.x = GetDeviceCaps(_pdlg.hDC, LOGPIXELSX); // dpi in X direction
|
ptDpi.x = GetDeviceCaps(_pdlg.hDC, LOGPIXELSX); // dpi in X direction
|
||||||
|
@ -126,7 +126,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
// Convert page size to logical units and we're done!
|
// Convert page size to logical units and we're done!
|
||||||
DPtoLP(_pdlg.hDC, &ptPage, 1);
|
DPtoLP(_pdlg.hDC, &ptPage, 1);
|
||||||
|
|
||||||
TEXTMETRIC tm;
|
TEXTMETRIC tm{};
|
||||||
|
|
||||||
int fontSize = nppGUI._printSettings._headerFontSize?nppGUI._printSettings._headerFontSize:9;
|
int fontSize = nppGUI._printSettings._headerFontSize?nppGUI._printSettings._headerFontSize:9;
|
||||||
int fontWeight = (nppGUI._printSettings._headerFontStyle & FONTSTYLE_BOLD) ? FW_BOLD : FW_NORMAL;
|
int fontWeight = (nppGUI._printSettings._headerFontStyle & FONTSTYLE_BOLD) ? FW_BOLD : FW_NORMAL;
|
||||||
|
@ -172,7 +172,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
int printMarge = tm.tmHeight + tm.tmExternalLeading;
|
int printMarge = tm.tmHeight + tm.tmExternalLeading;
|
||||||
printMarge = printMarge + printMarge / 2;
|
printMarge = printMarge + printMarge / 2;
|
||||||
|
|
||||||
DOCINFO docInfo;
|
DOCINFO docInfo{};
|
||||||
docInfo.cbSize = sizeof(DOCINFO);
|
docInfo.cbSize = sizeof(DOCINFO);
|
||||||
docInfo.fwType = 0;
|
docInfo.fwType = 0;
|
||||||
docInfo.lpszDocName = _pSEView->getCurrentBuffer()->getFullPathName();
|
docInfo.lpszDocName = _pSEView->getCurrentBuffer()->getFullPathName();
|
||||||
|
@ -205,13 +205,11 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
lengthDoc = _endPos;
|
lengthDoc = _endPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lengthPrinted < 0)
|
|
||||||
lengthPrinted = 0;
|
|
||||||
if (lengthDoc > lengthDocMax)
|
if (lengthDoc > lengthDocMax)
|
||||||
lengthDoc = lengthDocMax;
|
lengthDoc = lengthDocMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPP_RangeToFormat frPrint;
|
NPP_RangeToFormat frPrint{};
|
||||||
frPrint.hdc = _pdlg.hDC;
|
frPrint.hdc = _pdlg.hDC;
|
||||||
frPrint.hdcTarget = _pdlg.hDC;
|
frPrint.hdcTarget = _pdlg.hDC;
|
||||||
frPrint.rc.left = rectMargins.left - rectPhysMargins.left;
|
frPrint.rc.left = rectMargins.left - rectPhysMargins.left;
|
||||||
|
@ -246,7 +244,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
TCHAR longDate[bufferSize];
|
TCHAR longDate[bufferSize];
|
||||||
TCHAR time[bufferSize];
|
TCHAR time[bufferSize];
|
||||||
|
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st{};
|
||||||
::GetLocalTime(&st);
|
::GetLocalTime(&st);
|
||||||
::GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, shortDate, bufferSize);
|
::GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, shortDate, bufferSize);
|
||||||
::GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, longDate, bufferSize);
|
::GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, longDate, bufferSize);
|
||||||
|
@ -334,7 +332,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
if (!justDoIt)
|
if (!justDoIt)
|
||||||
printPage = false;
|
printPage = false;
|
||||||
|
|
||||||
TCHAR pageString[32];
|
TCHAR pageString[32]{};
|
||||||
wsprintf(pageString, TEXT("%0d"), pageNum);
|
wsprintf(pageString, TEXT("%0d"), pageNum);
|
||||||
|
|
||||||
if (printPage)
|
if (printPage)
|
||||||
|
@ -354,7 +352,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
rcw.bottom = rcw.top + headerLineHeight;
|
rcw.bottom = rcw.top + headerLineHeight;
|
||||||
|
|
||||||
|
|
||||||
SIZE size;
|
SIZE size{};
|
||||||
|
|
||||||
// Left part
|
// Left part
|
||||||
if (headerL[0] != '\0')
|
if (headerL[0] != '\0')
|
||||||
|
@ -421,7 +419,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
RECT rcw = {frPrint.rc.left, frPrint.rc.bottom + footerLineHeight / 2,
|
RECT rcw = {frPrint.rc.left, frPrint.rc.bottom + footerLineHeight / 2,
|
||||||
frPrint.rc.right, frPrint.rc.bottom + footerLineHeight + footerLineHeight / 2};
|
frPrint.rc.right, frPrint.rc.bottom + footerLineHeight + footerLineHeight / 2};
|
||||||
|
|
||||||
SIZE size;
|
SIZE size{};
|
||||||
|
|
||||||
// Left part
|
// Left part
|
||||||
if (footerL[0] != '\0')
|
if (footerL[0] != '\0')
|
||||||
|
@ -491,7 +489,7 @@ size_t Printer::doPrint(bool justDoIt)
|
||||||
if (fontFooter)
|
if (fontFooter)
|
||||||
::DeleteObject(fontFooter);
|
::DeleteObject(fontFooter);
|
||||||
|
|
||||||
return (pageNum - 1);
|
return (static_cast<size_t>(pageNum) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1866,21 +1866,14 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BGM_SETGRIDDIM:
|
case BGM_SETGRIDDIM:
|
||||||
if((wParam>=0)&&(wParam<=MAX_ROWS))
|
if (wParam<=MAX_ROWS)
|
||||||
{
|
{
|
||||||
BGHS[SelfIndex].rows = static_cast<int32_t>(wParam);
|
BGHS[SelfIndex].rows = static_cast<int32_t>(wParam);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(wParam<0)
|
BGHS[SelfIndex].rows = MAX_ROWS;
|
||||||
{
|
}
|
||||||
BGHS[SelfIndex].rows = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BGHS[SelfIndex].rows = MAX_ROWS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if((lParam>0)&&(lParam<=MAX_COLS))
|
if((lParam>0)&&(lParam<=MAX_COLS))
|
||||||
{
|
{
|
||||||
|
@ -1906,7 +1899,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
|
|
||||||
case BGM_SETCOLWIDTH:
|
case BGM_SETCOLWIDTH:
|
||||||
if((wParam <= MAX_COLS)&&(wParam >= 0) && (lParam >= 0))
|
if((wParam <= MAX_COLS) && (lParam >= 0))
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
BGHS[SelfIndex].columnwidths[wParam] = static_cast<int32_t>(lParam);
|
BGHS[SelfIndex].columnwidths[wParam] = static_cast<int32_t>(lParam);
|
||||||
|
@ -1916,15 +1909,12 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BGM_SETHEADERROWHEIGHT:
|
case BGM_SETHEADERROWHEIGHT:
|
||||||
if(wParam >= 0)
|
RECT rect;
|
||||||
{
|
BGHS[SelfIndex].headerrowheight = static_cast<int32_t>(wParam);
|
||||||
RECT rect;
|
SizeGrid(hWnd, SelfIndex);
|
||||||
BGHS[SelfIndex].headerrowheight = static_cast<int32_t>(wParam);
|
GetClientRect(hWnd, &rect);
|
||||||
SizeGrid(hWnd,SelfIndex);
|
InvalidateRect(hWnd, &rect, FALSE);
|
||||||
GetClientRect(hWnd,&rect);
|
break;
|
||||||
InvalidateRect(hWnd,&rect,FALSE);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BGM_GETHOMEROW:
|
case BGM_GETHOMEROW:
|
||||||
ReturnValue = BGHS[SelfIndex].homerow;
|
ReturnValue = BGHS[SelfIndex].homerow;
|
||||||
|
@ -2013,8 +2003,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BGM_SETTITLEHEIGHT:
|
case BGM_SETTITLEHEIGHT:
|
||||||
if(wParam<0){wParam =0;}
|
BGHS[SelfIndex].titleheight = static_cast<int32_t>(wParam);
|
||||||
BGHS[SelfIndex].titleheight = static_cast<int32_t>(wParam);
|
|
||||||
SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
|
SetHomeRow(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
|
||||||
SetHomeCol(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
|
SetHomeCol(hWnd,SelfIndex,BGHS[SelfIndex].cursorrow,BGHS[SelfIndex].cursorcol);
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue