From 9d6e12e92f34d066a7d0228d2a64bc3cbdee1f62 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Mon, 18 Dec 2017 13:47:19 +0100 Subject: [PATCH 01/18] + fix: "Default Font..." configuration issue --- src/Notepad3.c | 2 +- src/Notepad3.rc | Bin 184822 -> 185028 bytes src/Styles.c | 369 +++++++++++++++++++++++++++++------------------- src/Styles.h | 5 +- src/resource.h | 1 + 5 files changed, 225 insertions(+), 152 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index c9ac8a7fc..d025eb25d 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -2360,7 +2360,7 @@ void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam) EnableCmd(hmenu,IDM_VIEW_TOGGLEFOLDS,i && bShowCodeFolding); CheckCmd(hmenu,IDM_VIEW_FOLDING,bShowCodeFolding); - CheckCmd(hmenu,IDM_VIEW_USE2NDDEFAULT,Style_GetUse2ndDefault(hwndEdit)); + CheckCmd(hmenu,IDM_VIEW_USE2NDDEFAULT,Style_GetUse2ndDefault()); CheckCmd(hmenu,IDM_VIEW_WORDWRAP,bWordWrap); CheckCmd(hmenu,IDM_VIEW_LONGLINEMARKER,bMarkLongLines); diff --git a/src/Notepad3.rc b/src/Notepad3.rc index fec46b2edec395c9c50b6457132187fa1456dcf7..11acb1196bf380a0deedb74ec6802f50a6e784f7 100644 GIT binary patch delta 161 zcmeyinES|5?uHh|EldUx(<=;_gq#By0vLQ4A{pWtTo_y#+!!1gLV^4cAm5F_pTQ5v zQUF3Fpm+fg<}g$Oc_j=P45me6ku0>I|wtS#<_Y wpnNeyGFWvkP_;Tk@pMNYCgJICT$#8y6M?1`GvqVaPro>c$$fi41XEij02m`9%>V!Z delta 29 lcmX@Il>6Ia?uHh|EldUx(_eHlIZQ7|U}D+s6v@<72>`lO3t|8O diff --git a/src/Styles.c b/src/Styles.c index 5608adecc..6acb7ed28 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -593,7 +593,7 @@ KEYWORDLIST KeyWords_MAK = { EDITLEXER lexMAK = { SCLEX_MAKEFILE, 63007, L"Makefiles", L"mak; make; mk; dsp; msc; msvc", L"", &KeyWords_MAK, { - { SCE_MAKE_DEFAULT, 63126, L"Default", L"fore:#0A246A", L"" }, + { SCE_MAKE_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_MAKE_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { MULTI_STYLE(SCE_MAKE_IDENTIFIER,SCE_MAKE_IDEOL,0,0), 63129, L"Identifier", L"fore:#003CE6", L"" }, { SCE_MAKE_OPERATOR, 63132, L"Operator", L"", L"" }, @@ -3156,12 +3156,9 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { if (!Style_StrGetFont(wchDefaultStyleStrg, wchFontName, COUNTOF(wchFontName))) { - char chFontName[32] = { '\0' }; - if (IsFontAvailable(L"Consolas")) - StringCchCopyA(chFontName, COUNTOF(chFontName), "Consolas"); - else - StringCchCopyA(chFontName, COUNTOF(chFontName), "Lucida Console"); - + char chFontName[64] = { '\0' }; + Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); + WideCharToMultiByteStrg(CP_UTF8, wchFontName, chFontName); SendMessage(hwnd, SCI_STYLESETFONT, iDefaultStyle, (LPARAM)chFontName); } iBaseFontSize = 10; @@ -3249,7 +3246,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); iValue = -1; // need for retrieval - if (!Style_GetIndicatorType(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue), &iValue)) { + if (!Style_GetIndicatorType(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, 0, &iValue)) { // got default, get string StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; "); Style_GetIndicatorType(wchCaretStyle, COUNTOF(wchCaretStyle), &iValue); @@ -4036,13 +4033,40 @@ void Style_ToggleUse2ndDefault(HWND hwnd) void Style_SetDefaultFont(HWND hwnd) { const int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - if (Style_SelectFont(hwnd, lexDefault.Styles[STY_DEFAULT + iIdx].szValue, - COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), TRUE)) + + WCHAR font[BUFSIZE_STYLE_VALUE] = { L'\0' }; + WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; + + StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[STY_DEFAULT + iIdx].szValue); + + if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, TRUE)) { - fStylesModified = TRUE; - // clear lexers default - lexer inherits global default then - pLexCurrent->Styles[STY_DEFAULT].szValue[0] = L'\0'; - Style_SetLexer(hwnd,pLexCurrent); + switch (InfoBox(MBYESNO, L"MsgApplyDefaultFont", IDS_APPLY_DEFAULT_FONT, pLexCurrent->pszName)) + { + case IDYES: + // build styles string + StringCchCopyW(newStyle, COUNTOF(newStyle), font); + StringCchCat(newStyle, COUNTOF(newStyle), L"; "); + Style_AppendStyles(pLexCurrent->Styles[STY_DEFAULT].szValue, newStyle, COUNTOF(newStyle), FALSE, TRUE); + // set new styles to current lexer's default text + StringCchCopyW(pLexCurrent->Styles[STY_DEFAULT].szValue, COUNTOF(pLexCurrent->Styles[STY_DEFAULT].szValue), newStyle); + //break; fall-through + case IDNO: + // build styles string + StringCchCopyW(newStyle, COUNTOF(newStyle), font); + StringCchCat(newStyle, COUNTOF(newStyle), L"; "); + Style_AppendStyles(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle), FALSE, TRUE); + // set new styles to current lexer's default text + StringCchCopyW(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), newStyle); + // Apply new styles + fStylesModified = TRUE; + Style_SetLexer(hwnd, pLexCurrent); + break; + case IDCANCEL: + default: + // nothing to do + break; + } } } @@ -4051,9 +4075,8 @@ void Style_SetDefaultFont(HWND hwnd) // // Style_GetUse2ndDefault() // -BOOL Style_GetUse2ndDefault(HWND hwnd) +BOOL Style_GetUse2ndDefault() { - UNUSED(hwnd); return (bUse2ndDefaultStyle); } @@ -4125,7 +4148,7 @@ BOOL Style_StrGetFont(LPCWSTR lpszStyle,LPWSTR lpszFont,int cchFont) } else { - StringCchCopyN(lpszFont,cchFont,tch,cchFont); + StringCchCopyN(lpszFont,cchFont,tch, COUNTOF(tch)); } return TRUE; @@ -4390,11 +4413,147 @@ BOOL Style_GetIndicatorType(LPWSTR lpszStyle, int cchSize, int* idx) } + + + +//============================================================================= +// +// AppendStyles() +// +void Style_AppendStyles(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, int cchSizeDest, + BOOL bIncludeFont, BOOL bIncludeColor) +{ + WCHAR szTmpStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; + + int iValue; + WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; + + // --------- pure Font settings --------- + + if (bIncludeFont) + { + if (Style_StrGetFont(lpszStyleSrc, tch, COUNTOF(tch))) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; font:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + if (StrStrI(lpszStyleSrc, L"thin")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; thin"); + else if (StrStrI(lpszStyleSrc, L"extralight")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extralight"); + else if (StrStrI(lpszStyleSrc, L"light")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; light"); + else if (StrStrI(lpszStyleSrc, L"normal")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); + else if (StrStrI(lpszStyleSrc, L"medium")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; medium"); + else if (StrStrI(lpszStyleSrc, L"semibold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; semibold"); + else if (StrStrI(lpszStyleSrc, L"bold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; bold"); + else if (StrStrI(lpszStyleSrc, L"extrabold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extrabold"); + else if (StrStrI(lpszStyleSrc, L"heavy")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; heavy"); + //else + // StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); + + if (StrStrI(lpszStyleSrc, L"italic")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; italic"); + } + + if (Style_StrGetSizeStr(lpszStyleSrc, tch, COUNTOF(tch))) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; size:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + if (Style_StrGetCharSet(lpszStyleSrc, &iValue)) { + StringCchPrintf(tch, COUNTOF(tch), L"; charset:%i", iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + } // end of pure Font style + + if (Style_StrGetFontQuality(lpszStyleSrc, tch, COUNTOF(tch))) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; smoothing:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + if (StrStrI(lpszStyleSrc, L"underline")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; underline"); + } + + if (StrStrI(lpszStyleSrc, L"eolfilled")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; eolfilled"); + } + + if (Style_StrGetCase(lpszStyleSrc, &iValue)) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; case:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), (iValue == SC_CASE_UPPER) ? L"u" : L""); + } + + + // --------- pure Color settings --------- + + if (bIncludeColor) + { + // foreground + if (Style_StrGetColor(TRUE, lpszStyleSrc, &iValue)) + { + StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", + (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); + + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + // background + if (Style_StrGetColor(FALSE, lpszStyleSrc, &iValue)) + { + StringCchPrintf(tch, COUNTOF(tch), L"; back:#%02X%02X%02X", + (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); + + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + } // end of pure Color settings + + if (Style_StrGetAlpha(lpszStyleSrc, &iValue, TRUE)) { + StringCchPrintf(tch, COUNTOF(tch), L"; alpha:%i", iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + if (Style_StrGetAlpha(lpszStyleSrc, &iValue, FALSE)) { + StringCchPrintf(tch, COUNTOF(tch), L"; alpha2:%i", iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + + // -------- other style settings -------- + + if (StrStrI(lpszStyleSrc, L"block")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; block"); + + if (StrStrI(lpszStyleSrc, L"noblink")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; noblink"); + + iValue = -1; + if (Style_GetIndicatorType(lpszStyleSrc, 0, &iValue)) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; "); + Style_GetIndicatorType(tch, COUNTOF(tch), &iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + + StrTrim(szTmpStyle, L" ;"); + StringCchCat(lpszStyleDest, cchSizeDest, szTmpStyle); +} + + + //============================================================================= // // Style_SelectFont() // -BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle) +BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle, BOOL bPureFontOnly) { CHOOSEFONT cf; LOGFONT lf; @@ -4458,24 +4617,11 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle if (!ChooseFont(&cf) || !StringCchLenW(lf.lfFaceName,COUNTOF(lf.lfFaceName))) return FALSE; - // Map back to lpszStyle - StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L"font:"); + // --- map back to lpszStyle --- + + StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L"font:"); // start StringCchCat(szNewStyle,COUNTOF(szNewStyle),lf.lfFaceName); - if (Style_StrGetFontQuality(lpszStyle,tch,COUNTOF(tch))) - { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; smoothing:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (bDefaultStyle && - lf.lfCharSet != DEFAULT_CHARSET && - lf.lfCharSet != ANSI_CHARSET && - lf.lfCharSet != iDefaultCharSet) { - StringCchPrintf(tch,COUNTOF(tch),L"; charset:%i",lf.lfCharSet); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - StringCchPrintf(tch,COUNTOF(tch),L"; size:%i",cf.iPointSize/10); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - + switch (lf.lfWeight) { case FW_THIN: StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; thin"); @@ -4504,18 +4650,35 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle case FW_NORMAL: default: //~StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; normal"); - if (cf.nFontType & BOLD_FONTTYPE) + if (cf.nFontType & BOLD_FONTTYPE) { StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); + } break; } - if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; italic"); + if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); + } - if (StrStrI(lpszStyle,L"underline")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; underline"); + StringCchPrintf(tch, COUNTOF(tch), L"; size:%i", cf.iPointSize / 10); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); - // save colors + if (bDefaultStyle && + lf.lfCharSet != DEFAULT_CHARSET && + lf.lfCharSet != ANSI_CHARSET && + lf.lfCharSet != iDefaultCharSet) { + StringCchPrintf(tch,COUNTOF(tch),L"; charset:%i",lf.lfCharSet); + StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); + } + + // return, if only pure Font style is needed + if (bPureFontOnly) { + StrTrim(szNewStyle, L" ;"); + StringCchCopyN(lpszStyle, cchStyle, szNewStyle, COUNTOF(szNewStyle)); + return TRUE; + } + + // --- save colors --- if (color != 0) { StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X", @@ -4533,32 +4696,12 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); } - if (StrStrI(lpszStyle,L"eolfilled")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; eolfilled"); - - if (Style_StrGetCase(lpszStyle,&iValue)) { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; case:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),(iValue == SC_CASE_UPPER) ? L"u" : L""); - } - - if (Style_StrGetAlpha(lpszStyle, &iValue, TRUE)) { - StringCchPrintf(tch,COUNTOF(tch),L"; alpha:%i",iValue); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (Style_StrGetAlpha(lpszStyle, &iValue, FALSE)) { - StringCchPrintf(tch, COUNTOF(tch), L"; alpha2:%i", iValue); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); - } - - iValue = -1; - if (Style_GetIndicatorType(lpszStyle, cchStyle, &iValue)) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_GetIndicatorType(tch, COUNTOF(tch), &iValue); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); - } + // copy all other styles + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); + Style_AppendStyles(lpszStyle, szNewStyle, COUNTOF(szNewStyle), FALSE, FALSE); StrTrim(szNewStyle, L" ;"); - StringCchCopyN(lpszStyle,cchStyle,szNewStyle,COUNTOF(szNewStyle)); + StringCchCopyN(lpszStyle, cchStyle, szNewStyle, COUNTOF(szNewStyle)); return TRUE; } @@ -4567,7 +4710,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle // // Style_SelectColor() // -BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle) +BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle) { CHOOSECOLOR cc; WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; @@ -4577,8 +4720,8 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle) ZeroMemory(&cc,sizeof(CHOOSECOLOR)); - iRGBResult = (bFore) ? GetSysColor(COLOR_WINDOWTEXT) : GetSysColor(COLOR_WINDOW); - Style_StrGetColor(bFore,lpszStyle,&iRGBResult); + iRGBResult = (bForeGround) ? GetSysColor(COLOR_WINDOWTEXT) : GetSysColor(COLOR_WINDOW); + Style_StrGetColor(bForeGround,lpszStyle,&iRGBResult); cc.lStructSize = sizeof(CHOOSECOLOR); cc.hwndOwner = hwnd; @@ -4591,64 +4734,18 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle) iRGBResult = cc.rgbResult; + // Rebuild style string - StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L""); + StringCchCopy(szNewStyle, COUNTOF(szNewStyle), L""); // clear - if (Style_StrGetFont(lpszStyle,tch,COUNTOF(tch))) - { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"font:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (Style_StrGetFontQuality(lpszStyle,tch,COUNTOF(tch))) - { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; smoothing:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (Style_StrGetCharSet(lpszStyle,&iValue)) - { - StringCchPrintf(tch,COUNTOF(tch),L"; charset:%i",iValue); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (Style_StrGetSizeStr(lpszStyle,tch,COUNTOF(tch))) - { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; size:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - - if (StrStrI(lpszStyle, L"thin")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; thin"); - else if (StrStrI(lpszStyle, L"extralight")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; extralight"); - else if (StrStrI(lpszStyle, L"light")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; light"); - else if (StrStrI(lpszStyle, L"normal")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; normal"); - else if (StrStrI(lpszStyle, L"medium")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; medium"); - else if (StrStrI(lpszStyle, L"semibold")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; semibold"); - else if (StrStrI(lpszStyle, L"bold")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); - else if (StrStrI(lpszStyle, L"extrabold")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; extrabold"); - else if (StrStrI(lpszStyle, L"heavy")) - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; heavy"); - //else - // StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; normal"); - - if (StrStrI(lpszStyle,L"italic")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; italic"); - - if (StrStrI(lpszStyle,L"underline")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; underline"); - - if (bFore) + if (bForeGround) { StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X", (int)GetRValue(iRGBResult), (int)GetGValue(iRGBResult), (int)GetBValue(iRGBResult)); StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); + if (Style_StrGetColor(FALSE,lpszStyle,&iValue)) { StringCchPrintf(tch,COUNTOF(tch),L"; back:#%02X%02X%02X", @@ -4658,7 +4755,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle) StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); } } - else + else // set background { if (Style_StrGetColor(TRUE,lpszStyle,&iValue)) { @@ -4675,35 +4772,9 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle) StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); } - if (StrStrI(lpszStyle,L"eolfilled")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; eolfilled"); - - if (Style_StrGetCase(lpszStyle,&iValue)) { - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; case"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),(iValue == SC_CASE_UPPER) ? L"u" : L""); - } - - if (Style_StrGetAlpha(lpszStyle, &iValue, TRUE)) { - StringCchPrintf(tch,COUNTOF(tch),L"; alpha:%i",iValue); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - if (Style_StrGetAlpha(lpszStyle, &iValue, FALSE)) { - StringCchPrintf(tch, COUNTOF(tch), L"; alpha2:%i", iValue); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); - } - - if (StrStrI(lpszStyle,L"block")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; block"); - - if (StrStrI(lpszStyle,L"noblink")) - StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; noblink"); - - iValue = -1; - if (Style_GetIndicatorType(lpszStyle, cchStyle, &iValue)) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_GetIndicatorType(tch, COUNTOF(tch), &iValue); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); - } + // copy all other styles + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); + Style_AppendStyles(lpszStyle, szNewStyle, COUNTOF(szNewStyle), TRUE, FALSE); StrTrim(szNewStyle, L" ;"); StringCchCopyN(lpszStyle,cchStyle,szNewStyle,cchStyle); @@ -5256,7 +5327,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); if (Style_SelectFont(hwnd,tch,COUNTOF(tch), StringCchCompareIX(pCurrentStyle->pszName,L"Default Style") == 0 || - StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0)) { + StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, FALSE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } diff --git a/src/Styles.h b/src/Styles.h index f63027718..b6203d2a9 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -80,7 +80,7 @@ void Style_SetXMLLexer(HWND); void Style_SetLexerFromID(HWND,int); void Style_SetDefaultFont(HWND); void Style_ToggleUse2ndDefault(HWND); -BOOL Style_GetUse2ndDefault(HWND); +BOOL Style_GetUse2ndDefault(); void Style_SetIndentGuides(HWND,BOOL); BOOL Style_GetOpenDlgFilterStr(LPWSTR,int); BOOL Style_StrGetFont(LPCWSTR,LPWSTR,int); @@ -92,7 +92,8 @@ BOOL Style_StrGetColor(BOOL,LPCWSTR,int*); BOOL Style_StrGetCase(LPCWSTR,int*); BOOL Style_StrGetAlpha(LPCWSTR,int*,BOOL); BOOL Style_GetIndicatorType(LPWSTR,int,int*); -BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL); +void Style_AppendStyles(LPWSTR, LPWSTR, int, BOOL, BOOL); +BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL,BOOL); BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int); void Style_SetStyles(HWND,int,LPCWSTR); void Style_SetFontQuality(HWND,LPCWSTR); diff --git a/src/resource.h b/src/resource.h index c3b9804fe..c89c78fe1 100644 --- a/src/resource.h +++ b/src/resource.h @@ -463,6 +463,7 @@ #define IDS_WARN_UNKNOWN_EXT 50042 #define IDS_REGEX_INVALID 50043 #define IDS_DROP_NO_FILE 50044 +#define IDS_APPLY_DEFAULT_FONT 50045 #define IDS_CMDLINEHELP 60000 #define IDM_EDIT_INSERT_GUID 60001 #define IDC_STATIC -1 From 4ea8be9a0d9b5658534748348d2a81f7a124f6fc Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 11:27:26 +0100 Subject: [PATCH 02/18] + fix: "Default Font..." add check for current scheme is not default text already --- src/Styles.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Styles.c b/src/Styles.c index 6acb7ed28..20ba3ae45 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -4041,7 +4041,11 @@ void Style_SetDefaultFont(HWND hwnd) if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, TRUE)) { - switch (InfoBox(MBYESNO, L"MsgApplyDefaultFont", IDS_APPLY_DEFAULT_FONT, pLexCurrent->pszName)) + INT_PTR answer = IDNO; + if (pLexCurrent != &lexDefault) { + answer = InfoBox(MBYESNO, L"MsgApplyDefaultFont", IDS_APPLY_DEFAULT_FONT, pLexCurrent->pszName); + } + switch (answer) { case IDYES: // build styles string From 9587a0559a7ca98a2488b3bb9c5d577ce862572c Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 12:12:28 +0100 Subject: [PATCH 03/18] - revert: some changes --- src/Styles.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Styles.c b/src/Styles.c index 20ba3ae45..c52f07844 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -4571,9 +4571,11 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle // Map lpszStyle to LOGFONT if (Style_StrGetFont(lpszStyle,tch,COUNTOF(tch))) - StringCchCopyN(lf.lfFaceName,COUNTOF(lf.lfFaceName),tch,COUNTOF(lf.lfFaceName)); + StringCchCopyN(lf.lfFaceName,COUNTOF(lf.lfFaceName),tch,COUNTOF(tch)); + if (Style_StrGetCharSet(lpszStyle,&iValue)) lf.lfCharSet = (BYTE)iValue; + if (Style_StrGetSize(lpszStyle,&iValue)) { hdc = GetDC(hwnd); lf.lfHeight = -MulDiv(iValue,GetDeviceCaps(hdc,LOGPIXELSY),72); @@ -4615,6 +4617,8 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle cf.lpLogFont = &lf; cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST; + //cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; + if (HIBYTE(GetKeyState(VK_SHIFT))) cf.Flags |= CF_FIXEDPITCHONLY; From 347be7f90e8ac912c0d8b364d7f380ab9697f8b8 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 12:49:17 +0100 Subject: [PATCH 04/18] + enhanced style copy method --- src/Styles.c | 170 +++++++++++++++++++++++++-------------------------- src/Styles.h | 2 +- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index c52f07844..acbbae4f7 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -74,7 +74,7 @@ EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; /* 11 */ { SCI_SETEXTRAASCENT+SCI_SETEXTRADESCENT, 63111, L"Extra Line Spacing (Size)", L"size:2", L"" }, /* 12 */ { SCI_MARKERSETBACK+SCI_MARKERSETALPHA, 63124, L"Book Marks (Colors)", L"back:#00FF00; alpha:20", L"" }, /* 13 */ { SCI_MARKERSETBACK+SCI_MARKERSETALPHA, 63262, L"Mark Occurrences (Colors)", L"", L"" }, - /* 14 */ { SCI_SETHOTSPOTACTIVEFORE, 63264, L"Hyperlink Hotspots", L"italics; fore:#0000FF", L"" }, + /* 14 */ { SCI_SETHOTSPOTACTIVEFORE, 63264, L"Hyperlink Hotspots", L"italic; fore:#0000FF", L"" }, /* 15 */ { STYLE_DEFAULT, 63112, L"2nd Default Style", L"font:Courier New; size:10", L"" }, /* 16 */ { STYLE_LINENUMBER, 63113, L"2nd Margins and Line Numbers", L"font:Tahoma; size:-2; fore:#FF0000", L"" }, @@ -714,7 +714,7 @@ style.json.4=fore:#880AE8 # Escape sequence SCE_JSON_ESCAPESEQUENCE style.json.5=fore:#0B982E # Line comment SCE_JSON_LINECOMMENT -style.json.6=fore:#05BBAE,italics +style.json.6=fore:#05BBAE,italic # Block comment SCE_JSON_BLOCKCOMMENT style.json.7=$(style.json.6) # Operator SCE_JSON_OPERATOR @@ -2343,13 +2343,13 @@ EDITLEXER lexAHK = { SCLEX_AHK, 63305, L"AutoHotkey Script", L"ahk; ia; scriptle { SCE_AHK_LABEL, 63235, L"Label", L"fore:#000000; back:#FFFFA1", L"" }, { SCE_AHK_WORD_CF, 63310, L"Flow of control", L"fore:#480048; bold", L"" }, { SCE_AHK_WORD_CMD, 63236, L"Command", L"fore:#004080", L"" }, - { SCE_AHK_WORD_FN, 63277, L"Function", L"fore:#0F707F; italics", L"" }, - { SCE_AHK_WORD_DIR, 63203, L"Directive", L"fore:#F04020; italics", L"" }, + { SCE_AHK_WORD_FN, 63277, L"Function", L"fore:#0F707F; italic", L"" }, + { SCE_AHK_WORD_DIR, 63203, L"Directive", L"fore:#F04020; italic", L"" }, { SCE_AHK_WORD_KB, 63311, L"Keys & buttons", L"fore:#FF00FF; bold", L"" }, - { SCE_AHK_WORD_VAR, 63312, L"Built-in Variables", L"fore:#CF00CF; italics", L"" }, - { SCE_AHK_WORD_SP, 63280, L"Special", L"fore:#0000FF; italics", L"" }, + { SCE_AHK_WORD_VAR, 63312, L"Built-in Variables", L"fore:#CF00CF; italic", L"" }, + { SCE_AHK_WORD_SP, 63280, L"Special", L"fore:#0000FF; italic", L"" }, //{ SCE_AHK_WORD_UD, 63106, L"User Defined", L"fore:#800020", L"" }, - { SCE_AHK_VARREFKW, 63313, L"Variable keyword", L"fore:#CF00CF; italics; back:#F9F9FF", L"" }, + { SCE_AHK_VARREFKW, 63313, L"Variable keyword", L"fore:#CF00CF; italic; back:#F9F9FF", L"" }, { SCE_AHK_ERROR, 63261, L"Error", L"back:#FFC0C0", L"" }, { -1, 00000, L"", L"", L"" } } }; @@ -4051,7 +4051,7 @@ void Style_SetDefaultFont(HWND hwnd) // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - Style_AppendStyles(pLexCurrent->Styles[STY_DEFAULT].szValue, newStyle, COUNTOF(newStyle), FALSE, TRUE); + Style_CopyStyles_IfNotDefined(pLexCurrent->Styles[STY_DEFAULT].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text StringCchCopyW(pLexCurrent->Styles[STY_DEFAULT].szValue, COUNTOF(pLexCurrent->Styles[STY_DEFAULT].szValue), newStyle); //break; fall-through @@ -4059,7 +4059,7 @@ void Style_SetDefaultFont(HWND hwnd) // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - Style_AppendStyles(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle), FALSE, TRUE); + Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text StringCchCopyW(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), newStyle); // Apply new styles @@ -4417,15 +4417,11 @@ BOOL Style_GetIndicatorType(LPWSTR lpszStyle, int cchSize, int* idx) } - - - //============================================================================= // -// AppendStyles() +// Style_CopyStyles_IfNotDefined() // -void Style_AppendStyles(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, int cchSizeDest, - BOOL bIncludeFont, BOOL bIncludeColor) +void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, int cchSizeDest) { WCHAR szTmpStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; @@ -4434,117 +4430,121 @@ void Style_AppendStyles(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, int cchSizeDe // --------- pure Font settings --------- - if (bIncludeFont) - { + if (!StrStrI(lpszStyleDest, L"font:")) { if (Style_StrGetFont(lpszStyleSrc, tch, COUNTOF(tch))) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; font:"); StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } + } - if (StrStrI(lpszStyleSrc, L"thin")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; thin"); - else if (StrStrI(lpszStyleSrc, L"extralight")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extralight"); - else if (StrStrI(lpszStyleSrc, L"light")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; light"); - else if (StrStrI(lpszStyleSrc, L"normal")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); - else if (StrStrI(lpszStyleSrc, L"medium")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; medium"); - else if (StrStrI(lpszStyleSrc, L"semibold")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; semibold"); - else if (StrStrI(lpszStyleSrc, L"bold")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; bold"); - else if (StrStrI(lpszStyleSrc, L"extrabold")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extrabold"); - else if (StrStrI(lpszStyleSrc, L"heavy")) - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; heavy"); - //else - // StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); + if (StrStrI(lpszStyleSrc, L"thin") && !StrStrI(lpszStyleDest, L" thin")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; thin"); + else if (StrStrI(lpszStyleSrc, L"extralight") && !StrStrI(lpszStyleDest, L"extralight")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extralight"); + else if (StrStrI(lpszStyleSrc, L"light") && !StrStrI(lpszStyleDest, L"light")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; light"); + else if (StrStrI(lpszStyleSrc, L"normal") && !StrStrI(lpszStyleDest, L"normal")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); + else if (StrStrI(lpszStyleSrc, L"medium") && !StrStrI(lpszStyleDest, L"medium")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; medium"); + else if (StrStrI(lpszStyleSrc, L"semibold") && !StrStrI(lpszStyleDest, L"semibold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; semibold"); + else if (StrStrI(lpszStyleSrc, L"extrabold") && !StrStrI(lpszStyleDest, L"extrabold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extrabold"); + else if (StrStrI(lpszStyleSrc, L"bold") && !StrStrI(lpszStyleDest, L"bold")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; bold"); + else if (StrStrI(lpszStyleSrc, L"heavy") && !StrStrI(lpszStyleDest, L"heavy")) + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; heavy"); + //else + // StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); - if (StrStrI(lpszStyleSrc, L"italic")) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; italic"); - } + if (StrStrI(lpszStyleSrc, L"italic") && !StrStrI(lpszStyleDest, L"italic")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; italic"); + } + if (!StrStrI(lpszStyleDest, L"size:")) { if (Style_StrGetSizeStr(lpszStyleSrc, tch, COUNTOF(tch))) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; size:"); StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } + } + if (!StrStrI(lpszStyleDest, L"charset:")) { if (Style_StrGetCharSet(lpszStyleSrc, &iValue)) { StringCchPrintf(tch, COUNTOF(tch), L"; charset:%i", iValue); StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } - - } // end of pure Font style - - if (Style_StrGetFontQuality(lpszStyleSrc, tch, COUNTOF(tch))) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; smoothing:"); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } - if (StrStrI(lpszStyleSrc, L"underline")) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; underline"); + if (!StrStrI(lpszStyleDest, L"smoothing:")) { + if (Style_StrGetFontQuality(lpszStyleSrc, tch, COUNTOF(tch))) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; smoothing:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } } - if (StrStrI(lpszStyleSrc, L"eolfilled")) { + if (StrStrI(lpszStyleSrc, L"underline") && !StrStrI(lpszStyleDest, L"underline")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; underline"); + } + + if (StrStrI(lpszStyleSrc, L"eolfilled") && !StrStrI(lpszStyleDest, L"eolfilled")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; eolfilled"); } - if (Style_StrGetCase(lpszStyleSrc, &iValue)) { + if (Style_StrGetCase(lpszStyleSrc, &iValue) && !StrStrI(lpszStyleDest, L"case:")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; case:"); StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), (iValue == SC_CASE_UPPER) ? L"u" : L""); } - // --------- pure Color settings --------- - - if (bIncludeColor) - { - // foreground - if (Style_StrGetColor(TRUE, lpszStyleSrc, &iValue)) - { + // foreground + if (!StrStrI(lpszStyleDest, L"fore:")) { + if (Style_StrGetColor(TRUE, lpszStyleSrc, &iValue)) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } + } - // background - if (Style_StrGetColor(FALSE, lpszStyleSrc, &iValue)) - { + // background + if (!StrStrI(lpszStyleDest, L"back:")) { + if (Style_StrGetColor(FALSE, lpszStyleSrc, &iValue)) { StringCchPrintf(tch, COUNTOF(tch), L"; back:#%02X%02X%02X", (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); } - - } // end of pure Color settings + } - if (Style_StrGetAlpha(lpszStyleSrc, &iValue, TRUE)) { - StringCchPrintf(tch, COUNTOF(tch), L"; alpha:%i", iValue); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + if (!StrStrI(lpszStyleDest, L"alpha:")) { + if (Style_StrGetAlpha(lpszStyleSrc, &iValue, TRUE)) { + StringCchPrintf(tch, COUNTOF(tch), L"; alpha:%i", iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } } - - if (Style_StrGetAlpha(lpszStyleSrc, &iValue, FALSE)) { - StringCchPrintf(tch, COUNTOF(tch), L"; alpha2:%i", iValue); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + if (!StrStrI(lpszStyleDest, L"alpha2:")) { + if (Style_StrGetAlpha(lpszStyleSrc, &iValue, FALSE)) { + StringCchPrintf(tch, COUNTOF(tch), L"; alpha2:%i", iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } } - // -------- other style settings -------- - if (StrStrI(lpszStyleSrc, L"block")) + if (StrStrI(lpszStyleSrc, L"block") && !StrStrI(lpszStyleDest, L"block")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; block"); + } - if (StrStrI(lpszStyleSrc, L"noblink")) + if (StrStrI(lpszStyleSrc, L"noblink") && !StrStrI(lpszStyleDest, L"noblink")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; noblink"); + } - iValue = -1; - if (Style_GetIndicatorType(lpszStyleSrc, 0, &iValue)) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; "); - Style_GetIndicatorType(tch, COUNTOF(tch), &iValue); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + if (!StrStrI(lpszStyleDest, L"indic_")) { + iValue = -1; + if (Style_GetIndicatorType(lpszStyleSrc, 0, &iValue)) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; "); + Style_GetIndicatorType(tch, COUNTOF(tch), &iValue); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } } StrTrim(szTmpStyle, L" ;"); @@ -4594,10 +4594,10 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle lf.lfWeight = FW_MEDIUM; else if (StrStrI(lpszStyle, L"semibold")) lf.lfWeight = FW_SEMIBOLD; - else if (StrStrI(lpszStyle, L"bold")) - lf.lfWeight = FW_BOLD; else if (StrStrI(lpszStyle, L"extrabold")) lf.lfWeight = FW_EXTRABOLD; + else if (StrStrI(lpszStyle, L"bold")) + lf.lfWeight = FW_BOLD; else if (StrStrI(lpszStyle, L"heavy")) lf.lfWeight = FW_HEAVY; else @@ -4706,7 +4706,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle // copy all other styles StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_AppendStyles(lpszStyle, szNewStyle, COUNTOF(szNewStyle), FALSE, FALSE); + Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); StrTrim(szNewStyle, L" ;"); StringCchCopyN(lpszStyle, cchStyle, szNewStyle, COUNTOF(szNewStyle)); @@ -4782,7 +4782,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle) // copy all other styles StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_AppendStyles(lpszStyle, szNewStyle, COUNTOF(szNewStyle), TRUE, FALSE); + Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); StrTrim(szNewStyle, L" ;"); StringCchCopyN(lpszStyle,cchStyle,szNewStyle,cchStyle); @@ -4838,10 +4838,10 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_MEDIUM); else if (StrStrI(lpszStyle, L"semibold")) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_SEMIBOLD); - else if (StrStrI(lpszStyle, L"bold")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_BOLD); else if (StrStrI(lpszStyle, L"extrabold")) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_EXTRABOLD); + else if (StrStrI(lpszStyle, L"bold")) + SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_BOLD); else if (StrStrI(lpszStyle, L"heavy")) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_HEAVY); diff --git a/src/Styles.h b/src/Styles.h index b6203d2a9..d35f738a0 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -92,7 +92,7 @@ BOOL Style_StrGetColor(BOOL,LPCWSTR,int*); BOOL Style_StrGetCase(LPCWSTR,int*); BOOL Style_StrGetAlpha(LPCWSTR,int*,BOOL); BOOL Style_GetIndicatorType(LPWSTR,int,int*); -void Style_AppendStyles(LPWSTR, LPWSTR, int, BOOL, BOOL); +void Style_CopyStyles_IfNotDefined(LPWSTR, LPWSTR, int); BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL,BOOL); BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int); void Style_SetStyles(HWND,int,LPCWSTR); From 4e5e9461154cd7babf4b92f2e39b1dd69b65f2dd Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 16:13:59 +0100 Subject: [PATCH 05/18] + refactoring: Style Select Font dialog --- src/Styles.c | 130 ++++++++++++++++++++++++++++++--------------------- src/Styles.h | 2 +- 2 files changed, 78 insertions(+), 54 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index acbbae4f7..904f18077 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -4039,7 +4039,7 @@ void Style_SetDefaultFont(HWND hwnd) StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[STY_DEFAULT + iIdx].szValue); - if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, TRUE)) + if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) { INT_PTR answer = IDNO; if (pLexCurrent != &lexDefault) { @@ -4058,8 +4058,8 @@ void Style_SetDefaultFont(HWND hwnd) case IDNO: // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); - StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); + //StringCchCat(newStyle, COUNTOF(newStyle), L"; "); + //Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text StringCchCopyW(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), newStyle); // Apply new styles @@ -4193,7 +4193,7 @@ BOOL Style_StrGetFontQuality(LPCWSTR lpszStyle,LPWSTR lpszQuality,int cchQuality // // Style_StrGetCharSet() // -BOOL Style_StrGetCharSet(LPCWSTR lpszStyle,int* i) +BOOL Style_StrGetCharSet(LPCWSTR lpszStyle, int* i) { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR *p = StrStrI(lpszStyle, L"charset:"); @@ -4212,6 +4212,7 @@ BOOL Style_StrGetCharSet(LPCWSTR lpszStyle,int* i) return TRUE; } } + *i = DEFAULT_CHARSET; return FALSE; } @@ -4341,7 +4342,7 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int* i, BOOL bAlpha1st) // // Style_StrGetCase() // -BOOL Style_StrGetCase(LPCWSTR lpszStyle,int* i) +BOOL Style_StrGetCase(LPCWSTR lpszStyle, int* i) { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR *p = StrStrI(lpszStyle, L"case:"); @@ -4359,8 +4360,9 @@ BOOL Style_StrGetCase(LPCWSTR lpszStyle,int* i) else if (tch[0] == L'l' || tch[0] == L'L') { *i = SC_CASE_LOWER; return TRUE; + } } - } + *i = SC_CASE_MIXED; return FALSE; } @@ -4458,10 +4460,6 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in //else // StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; normal"); - if (StrStrI(lpszStyleSrc, L"italic") && !StrStrI(lpszStyleDest, L"italic")) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; italic"); - } - if (!StrStrI(lpszStyleDest, L"size:")) { if (Style_StrGetSizeStr(lpszStyleSrc, tch, COUNTOF(tch))) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; size:"); @@ -4476,21 +4474,29 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in } } - if (!StrStrI(lpszStyleDest, L"smoothing:")) { - if (Style_StrGetFontQuality(lpszStyleSrc, tch, COUNTOF(tch))) { - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; smoothing:"); - StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); - } + if (StrStrI(lpszStyleSrc, L"italic") && !StrStrI(lpszStyleDest, L"italic")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; italic"); } if (StrStrI(lpszStyleSrc, L"underline") && !StrStrI(lpszStyleDest, L"underline")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; underline"); } + if (StrStrI(lpszStyleSrc, L"strikeout") && !StrStrI(lpszStyleDest, L"strikeout")) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; strikeout"); + } + if (StrStrI(lpszStyleSrc, L"eolfilled") && !StrStrI(lpszStyleDest, L"eolfilled")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; eolfilled"); } + if (!StrStrI(lpszStyleDest, L"smoothing:")) { + if (Style_StrGetFontQuality(lpszStyleSrc, tch, COUNTOF(tch))) { + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; smoothing:"); + StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), tch); + } + } + if (Style_StrGetCase(lpszStyleSrc, &iValue) && !StrStrI(lpszStyleDest, L"case:")) { StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; case:"); StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), (iValue == SC_CASE_UPPER) ? L"u" : L""); @@ -4557,7 +4563,8 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in // // Style_SelectFont() // -BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle, BOOL bPureFontOnly) +BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, + BOOL bDefaultStyle, BOOL bPureFontOnly, BOOL bPreserveOtherStyle) { CHOOSEFONT cf; LOGFONT lf; @@ -4604,6 +4611,9 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle lf.lfWeight = FW_NORMAL; lf.lfItalic = (StrStrI(lpszStyle,L"italic")) ? TRUE : FALSE; + lf.lfUnderline = (StrStrI(lpszStyle, L"underline")) ? TRUE : FALSE; + lf.lfStrikeOut = (StrStrI(lpszStyle, L"strikeout")) ? TRUE : FALSE; + COLORREF color = 0L; if (Style_StrGetColor(TRUE, lpszStyle, &iValue)) { @@ -4616,8 +4626,10 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle cf.rgbColors = color; cf.lpLogFont = &lf; - cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST; - //cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; + if (bPureFontOnly) + cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; + else + cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; if (HIBYTE(GetKeyState(VK_SHIFT))) cf.Flags |= CF_FIXEDPITCHONLY; @@ -4668,6 +4680,14 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); } + if (lf.lfUnderline) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); + } + + if (lf.lfStrikeOut) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); + } + StringCchPrintf(tch, COUNTOF(tch), L"; size:%i", cf.iPointSize / 10); StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); @@ -4680,33 +4700,30 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle } // return, if only pure Font style is needed - if (bPureFontOnly) { - StrTrim(szNewStyle, L" ;"); - StringCchCopyN(lpszStyle, cchStyle, szNewStyle, COUNTOF(szNewStyle)); - return TRUE; + if (!bPureFontOnly) { + // --- save colors --- + if (color != cf.rgbColors) { + StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", + (int)GetRValue(cf.rgbColors), + (int)GetGValue(cf.rgbColors), + (int)GetBValue(cf.rgbColors)); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + } + if (Style_StrGetColor(FALSE, lpszStyle, &iValue)) { + StringCchPrintf(tch, COUNTOF(tch), L"; back:#%02X%02X%02X", + (int)GetRValue(iValue), + (int)GetGValue(iValue), + (int)GetBValue(iValue)); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + } + } - // --- save colors --- - if (color != 0) - { - StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X", - (int)GetRValue(cf.rgbColors), - (int)GetGValue(cf.rgbColors), - (int)GetBValue(cf.rgbColors)); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); + if (bPreserveOtherStyle) { + // copy all other styles + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); + Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); } - if (Style_StrGetColor(FALSE,lpszStyle,&iValue)) - { - StringCchPrintf(tch,COUNTOF(tch),L"; back:#%02X%02X%02X", - (int)GetRValue(iValue), - (int)GetGValue(iValue), - (int)GetBValue(iValue)); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); - } - - // copy all other styles - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); StrTrim(szNewStyle, L" ;"); StringCchCopyN(lpszStyle, cchStyle, szNewStyle, COUNTOF(szNewStyle)); @@ -4844,26 +4861,33 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_BOLD); else if (StrStrI(lpszStyle, L"heavy")) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_HEAVY); + else + SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_NORMAL); + // Italic - if (StrStrI(lpszStyle,L"italic") != NULL) - SendMessage(hwnd,SCI_STYLESETITALIC,iStyle,(LPARAM)TRUE); + SendMessage(hwnd,SCI_STYLESETITALIC,iStyle, + (LPARAM)(StrStrI(lpszStyle, L"italic") != NULL)); // Underline - if (StrStrI(lpszStyle,L"underline") != NULL) - SendMessage(hwnd,SCI_STYLESETUNDERLINE,iStyle,(LPARAM)TRUE); + SendMessage(hwnd,SCI_STYLESETUNDERLINE,iStyle, + (LPARAM)(StrStrI(lpszStyle, L"underline") != NULL)); + + // StrikeOut / Hide + SendMessage(hwnd, SCI_STYLESETVISIBLE, iStyle, + (LPARAM)(StrStrI(lpszStyle, L"strikeout") == NULL)); // EOL Filled - if (StrStrI(lpszStyle,L"eolfilled") != NULL) - SendMessage(hwnd,SCI_STYLESETEOLFILLED,iStyle,(LPARAM)TRUE); + SendMessage(hwnd,SCI_STYLESETEOLFILLED,iStyle, + (LPARAM)(StrStrI(lpszStyle, L"eolfilled") != NULL)); // Case - if (Style_StrGetCase(lpszStyle,&iValue)) - SendMessage(hwnd,SCI_STYLESETCASE,iStyle,(LPARAM)iValue); + Style_StrGetCase(lpszStyle, &iValue); + SendMessage(hwnd,SCI_STYLESETCASE,iStyle,(LPARAM)iValue); // Character Set - if (Style_StrGetCharSet(lpszStyle,&iValue)) - SendMessage(hwnd,SCI_STYLESETCHARACTERSET,iStyle,(LPARAM)iValue); + Style_StrGetCharSet(lpszStyle, &iValue); + SendMessage(hwnd,SCI_STYLESETCHARACTERSET,iStyle,(LPARAM)iValue); } @@ -5335,7 +5359,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); if (Style_SelectFont(hwnd,tch,COUNTOF(tch), StringCchCompareIX(pCurrentStyle->pszName,L"Default Style") == 0 || - StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, FALSE)) { + StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, TRUE, TRUE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } diff --git a/src/Styles.h b/src/Styles.h index d35f738a0..aeffdce31 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -93,7 +93,7 @@ BOOL Style_StrGetCase(LPCWSTR,int*); BOOL Style_StrGetAlpha(LPCWSTR,int*,BOOL); BOOL Style_GetIndicatorType(LPWSTR,int,int*); void Style_CopyStyles_IfNotDefined(LPWSTR, LPWSTR, int); -BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL,BOOL); +BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL,BOOL,BOOL); BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int); void Style_SetStyles(HWND,int,LPCWSTR); void Style_SetFontQuality(HWND,LPCWSTR); From 235a501f4d95529150ab8d2acbf029743e5f508f Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 20:05:25 +0100 Subject: [PATCH 06/18] + fix: schemes in alphabetical order (displayed names) + code robustness --- src/Styles.c | 269 +++++++++++++++++++++++++-------------------------- src/Styles.h | 2 +- 2 files changed, 134 insertions(+), 137 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 904f18077..013231a8b 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -2754,50 +2754,50 @@ EDITLEXER lexAwk = { SCLEX_PYTHON, 63024, L"Awk Script", L"awk", L"", &KeyWords // in Notepad2.c ParseCommandLine() if you change this array! PEDITLEXER pLexArray[NUMLEXERS] = { - &lexDefault, - &lexANSI, - &lexAHK, - &lexASM, - &lexAU3, - &lexAVS, - &lexAwk, - &lexBASH, - &lexBAT, - &lexCOFFEESCRIPT, - &lexCONF, //Apache Config Scripts - &lexCPP, - &lexCS, - &lexCSS, - &lexCmake, - &lexD, - &lexDIFF, - &lexGo, - &lexHTML, - &lexINNO, - &lexJAVA, - &lexJS, - &lexJSON, - &lexLATEX, - &lexLUA, - &lexMAK, - &lexMARKDOWN, - &lexMATLAB, - &lexNSIS, - &lexPAS, - &lexPL, - &lexPROPS, - &lexPS, - &lexPY, - &lexRC, - &lexRUBY, - &lexRegistry, - &lexSQL, - &lexTCL, - &lexVB, - &lexVBS, - &lexVHDL, - &lexXML, - &lexYAML + &lexDefault, // Default Text + &lexANSI, // ANSI Art + &lexCONF, // Apache Config Files + &lexASM, // Assembly Script + &lexAHK, // AutoHotkey Script + &lexAU3, // AutoIt3 Script + &lexAVS, // AviSynth Script + &lexAwk, // Awk Script + &lexBAT, // Batch Files + &lexCS, // C# Source Code + &lexCPP, // C/C++ Source Code + &lexCmake, // Cmake Script + &lexCOFFEESCRIPT, // Coffeescript + &lexPROPS, // Configuration Files + &lexCSS, // CSS Style Sheets + &lexD, // D Source Code + &lexDIFF, // Diff Files + &lexGo, // Go Source Code + &lexINNO, // Inno Setup Script + &lexJAVA, // Java Source Code + &lexJS, // JavaScript + &lexJSON, // JSON + &lexLATEX, // LaTeX Files + &lexLUA, // Lua Script + &lexMAK, // Makefiles + &lexMARKDOWN, // Markdown + &lexMATLAB, // MATLAB + &lexNSIS, // NSIS Script + &lexPAS, // Pascal Source Code + &lexPL, // Perl Script + &lexPS, // PowerShell Script + &lexPY, // Python Script + &lexRC, // Resource Script + &lexRUBY, // Ruby Script + &lexBASH, // Shell Script + &lexSQL, // SQL Query + &lexTCL, // Tcl Script + &lexVBS, // VBScript + &lexVHDL, // VHDL + &lexVB, // Visual Basic + &lexHTML, // Web Source Code + &lexRegistry, // Windows Registry Files + &lexXML, // XML Document + &lexYAML // YAML }; @@ -3087,10 +3087,6 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // Lexer SendMessage(hwnd, SCI_SETLEXER, pLexNew->iLexer, 0); - // deprecated since SCI 3.4.2 - //int iStyleBits = (int)SendMessage(hwnd,SCI_GETSTYLEBITSNEEDED,0,0); - //SendMessage(hwnd,SCI_SETSTYLEBITS,(WPARAM)iStyleBits,0); - if (pLexNew->iLexer == SCLEX_XML) SendMessage(hwnd, SCI_SETPROPERTY, (WPARAM)"lexer.xml.allow.scripts", (LPARAM)"1"); if (pLexNew->iLexer == SCLEX_CPP) { @@ -3163,22 +3159,25 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { } iBaseFontSize = 10; if (!Style_StrGetSize(wchDefaultStyleStrg, &iBaseFontSize)) { - SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size + SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size } + SendMessage(hwnd, SCI_STYLESETCHARACTERSET, iDefaultStyle, (LPARAM)DEFAULT_CHARSET); SendMessage(hwnd, SCI_STYLESETWEIGHT, iDefaultStyle, (LPARAM)FW_NORMAL); SendMessage(hwnd, SCI_STYLESETITALIC, iDefaultStyle, (LPARAM)FALSE); + SendMessage(hwnd, SCI_STYLESETUNDERLINE, iDefaultStyle, (LPARAM)FALSE); SendMessage(hwnd, SCI_STYLESETEOLFILLED, iDefaultStyle, (LPARAM)FALSE); - SendMessage(hwnd, SCI_STYLESETCHARACTERSET, iDefaultStyle, (LPARAM)DEFAULT_CHARSET); + SendMessage(hwnd, SCI_STYLESETVISIBLE, iDefaultStyle, (LPARAM)TRUE); + SendMessage(hwnd, SCI_STYLESETCASE, iDefaultStyle, (LPARAM)SC_CASE_MIXED); + + SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off + + Style_SetStyles(hwnd, iDefaultStyle, wchDefaultStyleStrg); // apply default style - // apply default style - Style_SetStyles(hwnd, iDefaultStyle, wchDefaultStyleStrg); if (StringCchLenW(pLexNew->Styles[STY_DEFAULT].szValue, COUNTOF(pLexNew->Styles[STY_DEFAULT].szValue)) > 0) { // override with Lexer's specific defaults Style_SetStyles(hwnd, iDefaultStyle, pLexNew->Styles[STY_DEFAULT].szValue); } - SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off - // Re-Set to just defined default style (STYLE_DEFAULT) SendMessage(hwnd, SCI_STYLECLEARALL, 0, 0); @@ -4039,7 +4038,7 @@ void Style_SetDefaultFont(HWND hwnd) StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[STY_DEFAULT + iIdx].szValue); - if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) + if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, TRUE, FALSE)) { INT_PTR answer = IDNO; if (pLexCurrent != &lexDefault) { @@ -4059,7 +4058,7 @@ void Style_SetDefaultFont(HWND hwnd) // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); //StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - //Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); + //~Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text StringCchCopyW(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), newStyle); // Apply new styles @@ -4284,7 +4283,7 @@ BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize) // // Style_StrGetColor() // -BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb) +BOOL Style_StrGetColor(BOOL bFore, LPCWSTR lpszStyle, int* rgb) { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR *pItem = (bFore) ? L"fore:" : L"back:"; @@ -4292,7 +4291,7 @@ BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb) WCHAR *p = StrStrI(lpszStyle, pItem); if (p) { - StringCchCopy(tch,COUNTOF(tch),p + lstrlen(pItem)); + StringCchCopy(tch, COUNTOF(tch), p + lstrlen(pItem)); if (tch[0] == L'#') tch[0] = L' '; p = StrChr(tch, L';'); @@ -4300,10 +4299,10 @@ BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb) *p = L'\0'; TrimString(tch); int iValue = 0; - int itok = swscanf_s(tch,L"%x",&iValue); + int itok = swscanf_s(tch, L"%x", &iValue); if (itok == 1) { - *rgb = RGB((iValue&0xFF0000) >> 16,(iValue&0xFF00) >> 8,iValue&0xFF); + *rgb = RGB((iValue & 0xFF0000) >> 16, (iValue & 0xFF00) >> 8, iValue & 0xFF); return TRUE; } } @@ -4319,9 +4318,9 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int* i, BOOL bAlpha1st) { const WCHAR* strAlpha = bAlpha1st ? L"alpha:" : L"alpha2:"; - WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR* p = StrStrI(lpszStyle, strAlpha); if (p) { + WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; StringCchCopy(tch, COUNTOF(tch), p + lstrlen(strAlpha)); p = StrChr(tch, L';'); if (p) @@ -4344,10 +4343,9 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int* i, BOOL bAlpha1st) // BOOL Style_StrGetCase(LPCWSTR lpszStyle, int* i) { - WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR *p = StrStrI(lpszStyle, L"case:"); - if (p) - { + if (p) { + WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; StringCchCopy(tch,COUNTOF(tch),p + CSTRLEN(L"case:")); p = StrChr(tch, L';'); if (p) @@ -4362,7 +4360,7 @@ BOOL Style_StrGetCase(LPCWSTR lpszStyle, int* i) return TRUE; } } - *i = SC_CASE_MIXED; + //*i = SC_CASE_MIXED; return FALSE; } @@ -4430,7 +4428,7 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in int iValue; WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; - // --------- pure Font settings --------- + // --------- Font settings --------- if (!StrStrI(lpszStyleDest, L"font:")) { if (Style_StrGetFont(lpszStyleSrc, tch, COUNTOF(tch))) { @@ -4502,9 +4500,9 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), (iValue == SC_CASE_UPPER) ? L"u" : L""); } - - // foreground - if (!StrStrI(lpszStyleDest, L"fore:")) { + // --------- Colors --------- + + if (!StrStrI(lpszStyleDest, L"fore:")) { // foreground if (Style_StrGetColor(TRUE, lpszStyleSrc, &iValue)) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); @@ -4512,8 +4510,7 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in } } - // background - if (!StrStrI(lpszStyleDest, L"back:")) { + if (!StrStrI(lpszStyleDest, L"back:")) { // background if (Style_StrGetColor(FALSE, lpszStyleSrc, &iValue)) { StringCchPrintf(tch, COUNTOF(tch), L"; back:#%02X%02X%02X", (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); @@ -4564,18 +4561,13 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in // Style_SelectFont() // BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, - BOOL bDefaultStyle, BOOL bPureFontOnly, BOOL bPreserveOtherStyle) + BOOL bDefaultStyle, BOOL bWithEffects, BOOL bPreserveStyles) { - CHOOSEFONT cf; - LOGFONT lf; - WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - int iValue; WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; - HDC hdc; - - ZeroMemory(&cf,sizeof(CHOOSEFONT)); - ZeroMemory(&lf,sizeof(LOGFONT)); + int iValue; + LOGFONT lf; + ZeroMemory(&lf, sizeof(LOGFONT)); // Map lpszStyle to LOGFONT if (Style_StrGetFont(lpszStyle,tch,COUNTOF(tch))) StringCchCopyN(lf.lfFaceName,COUNTOF(lf.lfFaceName),tch,COUNTOF(tch)); @@ -4584,7 +4576,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, lf.lfCharSet = (BYTE)iValue; if (Style_StrGetSize(lpszStyle,&iValue)) { - hdc = GetDC(hwnd); + HDC hdc = GetDC(hwnd); lf.lfHeight = -MulDiv(iValue,GetDeviceCaps(hdc,LOGPIXELSY),72); ReleaseDC(hwnd,hdc); } @@ -4610,6 +4602,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, else lf.lfWeight = FW_NORMAL; + lf.lfItalic = (StrStrI(lpszStyle,L"italic")) ? TRUE : FALSE; lf.lfUnderline = (StrStrI(lpszStyle, L"underline")) ? TRUE : FALSE; lf.lfStrikeOut = (StrStrI(lpszStyle, L"strikeout")) ? TRUE : FALSE; @@ -4617,29 +4610,33 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, COLORREF color = 0L; if (Style_StrGetColor(TRUE, lpszStyle, &iValue)) { - color = RGB(GetRValue(iValue),GetGValue(iValue),GetBValue(iValue)); + color = iValue; } - // Init cf + CHOOSEFONT cf; + ZeroMemory(&cf, sizeof(CHOOSEFONT)); cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = hwnd; cf.rgbColors = color; cf.lpLogFont = &lf; - if (bPureFontOnly) - cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; - else + if (bWithEffects) cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; + else + cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; if (HIBYTE(GetKeyState(VK_SHIFT))) cf.Flags |= CF_FIXEDPITCHONLY; - if (!ChooseFont(&cf) || !StringCchLenW(lf.lfFaceName,COUNTOF(lf.lfFaceName))) - return FALSE; + // --- open systems Font Selection dialog --- + + if (!ChooseFont(&cf) || (lf.lfFaceName[0] == L'\0')) { return FALSE; } // --- map back to lpszStyle --- - StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L"font:"); // start + WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; + + StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L"font:"); StringCchCat(szNewStyle,COUNTOF(szNewStyle),lf.lfFaceName); switch (lf.lfWeight) { @@ -4658,12 +4655,12 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, case FW_SEMIBOLD: StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; semibold"); break; - case FW_BOLD: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); - break; case FW_EXTRABOLD: StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; extrabold"); break; + case FW_BOLD: + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); + break; case FW_HEAVY: StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; heavy"); break; @@ -4676,31 +4673,32 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, break; } - if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); - } - - if (lf.lfUnderline) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); - } - - if (lf.lfStrikeOut) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); - } - StringCchPrintf(tch, COUNTOF(tch), L"; size:%i", cf.iPointSize / 10); StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); if (bDefaultStyle && - lf.lfCharSet != DEFAULT_CHARSET && - lf.lfCharSet != ANSI_CHARSET && - lf.lfCharSet != iDefaultCharSet) { - StringCchPrintf(tch,COUNTOF(tch),L"; charset:%i",lf.lfCharSet); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); + lf.lfCharSet != DEFAULT_CHARSET && + lf.lfCharSet != ANSI_CHARSET && + lf.lfCharSet != iDefaultCharSet) { + StringCchPrintf(tch, COUNTOF(tch), L"; charset:%i", lf.lfCharSet); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); } - + + if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); + } + // return, if only pure Font style is needed - if (!bPureFontOnly) { + if (bWithEffects) { + + if (lf.lfUnderline) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); + } + + if (lf.lfStrikeOut) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); + } + // --- save colors --- if (color != cf.rgbColors) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", @@ -4716,10 +4714,9 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, (int)GetBValue(iValue)); StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); } - } - if (bPreserveOtherStyle) { + if (bPreserveStyles) { // copy all other styles StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); @@ -4735,7 +4732,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, // // Style_SelectColor() // -BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle) +BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle, BOOL bPreserveStyles) { CHOOSECOLOR cc; WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; @@ -4797,9 +4794,11 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle) StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch); } - // copy all other styles - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); - Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); + if (bPreserveStyles) { + // copy all other styles + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; "); + Style_CopyStyles_IfNotDefined(lpszStyle, szNewStyle, COUNTOF(szNewStyle)); + } StrTrim(szNewStyle, L" ;"); StringCchCopyN(lpszStyle,cchStyle,szNewStyle,cchStyle); @@ -4861,33 +4860,31 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_BOLD); else if (StrStrI(lpszStyle, L"heavy")) SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_HEAVY); - else - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_NORMAL); - // Italic - SendMessage(hwnd,SCI_STYLESETITALIC,iStyle, - (LPARAM)(StrStrI(lpszStyle, L"italic") != NULL)); + if (StrStrI(lpszStyle, L"italic")) + SendMessage(hwnd,SCI_STYLESETITALIC,iStyle,(LPARAM)TRUE); // Underline - SendMessage(hwnd,SCI_STYLESETUNDERLINE,iStyle, - (LPARAM)(StrStrI(lpszStyle, L"underline") != NULL)); + if (StrStrI(lpszStyle, L"underline")) + SendMessage(hwnd,SCI_STYLESETUNDERLINE,iStyle,(LPARAM)TRUE); - // StrikeOut / Hide - SendMessage(hwnd, SCI_STYLESETVISIBLE, iStyle, - (LPARAM)(StrStrI(lpszStyle, L"strikeout") == NULL)); + // StrikeOut does not exist in scintilla ??? / Hide instead (no good idea) + //if (StrStrI(lpszStyle, L"strikeout")) + // SendMessage(hwnd, SCI_STYLESETVISIBLE,iStyle,(LPARAM)FALSE); // EOL Filled - SendMessage(hwnd,SCI_STYLESETEOLFILLED,iStyle, - (LPARAM)(StrStrI(lpszStyle, L"eolfilled") != NULL)); + if (StrStrI(lpszStyle, L"eolfilled")) + SendMessage(hwnd,SCI_STYLESETEOLFILLED,iStyle,(LPARAM)TRUE); // Case - Style_StrGetCase(lpszStyle, &iValue); - SendMessage(hwnd,SCI_STYLESETCASE,iStyle,(LPARAM)iValue); + if (Style_StrGetCase(lpszStyle, &iValue)) + SendMessage(hwnd,SCI_STYLESETCASE,iStyle,(LPARAM)iValue); // Character Set - Style_StrGetCharSet(lpszStyle, &iValue); - SendMessage(hwnd,SCI_STYLESETCHARACTERSET,iStyle,(LPARAM)iValue); + if (Style_StrGetCharSet(lpszStyle, &iValue)) + SendMessage(hwnd,SCI_STYLESETCHARACTERSET,iStyle,(LPARAM)iValue); + } @@ -5359,7 +5356,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); if (Style_SelectFont(hwnd,tch,COUNTOF(tch), StringCchCompareIX(pCurrentStyle->pszName,L"Default Style") == 0 || - StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, TRUE, TRUE)) { + StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, FALSE, TRUE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } @@ -5371,7 +5368,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); - if (Style_SelectColor(hwnd,TRUE,tch,COUNTOF(tch))) { + if (Style_SelectColor(hwnd,TRUE,tch,COUNTOF(tch), TRUE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } @@ -5383,7 +5380,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); - if (Style_SelectColor(hwnd,FALSE,tch,COUNTOF(tch))) { + if (Style_SelectColor(hwnd,FALSE,tch,COUNTOF(tch), TRUE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } diff --git a/src/Styles.h b/src/Styles.h index aeffdce31..e665b902d 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -94,7 +94,7 @@ BOOL Style_StrGetAlpha(LPCWSTR,int*,BOOL); BOOL Style_GetIndicatorType(LPWSTR,int,int*); void Style_CopyStyles_IfNotDefined(LPWSTR, LPWSTR, int); BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL,BOOL,BOOL); -BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int); +BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int,BOOL); void Style_SetStyles(HWND,int,LPCWSTR); void Style_SetFontQuality(HWND,LPCWSTR); void Style_GetCurrentLexerName(LPWSTR,int); From d3b8dbdc749be9488bad58cda2acf7fb748df78e Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 21:54:01 +0100 Subject: [PATCH 07/18] + feature: Dual configuration of Default Text Font or Current Scheme's Default Text Font --- src/Notepad3.c | 7 ++++- src/Notepad3.rc | Bin 185028 -> 185388 bytes src/Styles.c | 70 ++++++++++++++++++++++++++++++++++++++++++------ src/Styles.h | 2 +- src/resource.h | 9 ++++--- 5 files changed, 74 insertions(+), 14 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index d025eb25d..be7d63fad 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -4047,11 +4047,16 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) case IDM_VIEW_FONT: - Style_SetDefaultFont(hwndEdit); + Style_SetDefaultFont(hwndEdit, TRUE); UpdateStatusbar(); UpdateLineNumberWidth(); break; + case IDM_VIEW_CURRENTSCHEME: + Style_SetDefaultFont(hwndEdit, FALSE); + UpdateStatusbar(); + UpdateLineNumberWidth(); + break; case IDM_VIEW_WORDWRAP: bWordWrap = (bWordWrap) ? FALSE : TRUE; diff --git a/src/Notepad3.rc b/src/Notepad3.rc index 11acb1196bf380a0deedb74ec6802f50a6e784f7..e2ff0f7d8599cafe1da4ea23c79eea3fc7400c20 100644 GIT binary patch delta 355 zcmX@IlzYtz?hU(`d6OA37!(*Z7(y9>85}p?WL8b*b!W(7$Y)4mNCeUflmBL!PhOQJ zG+CjHWwKwk)+9Za>1BOPe1gFYAg!qkxj?MWPz+T0J4*U0Dx|0hwuua}_&tvks z1discd)u?_F?J+P-=)bUFx?@7>CbWlM<(&1L?_ delta 275 zcmZ3pg8Rr)?hU(`?*K$4p=;8JJ88%nTb;i@}Bf|jf+ey%mDfeP(c6y diff --git a/src/Styles.c b/src/Styles.c index 013231a8b..e3db8c1c5 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -2215,7 +2215,7 @@ EDITLEXER lexLATEX = { SCLEX_LATEX, 63281, L"LaTeX Files", L"tex; latex; sty", L { -1, 00000, L"", L"", L"" } } }; -EDITLEXER lexANSI = { SCLEX_NULL, 63258, L"ANSI Art", L"nfo; diz", L"", &KeyWords_NULL, { +EDITLEXER lexANSI = { SCLEX_NULL, 63266, L"ANSI Art", L"nfo; diz", L"", &KeyWords_NULL, { { STYLE_DEFAULT, 63126, L"Default", L"font:Lucida Console", L"" }, { STYLE_LINENUMBER, 63101, L"Margins and Line Numbers", L"font:Lucida Console; size:-2", L"" }, { STYLE_BRACELIGHT, 63102, L"Matching Braces", L"size:+0", L"" }, @@ -4025,10 +4025,40 @@ void Style_ToggleUse2ndDefault(HWND hwnd) } + //============================================================================= // // Style_SetDefaultFont() // +void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) +{ + WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; + + int iIdx = 0; + PEDITLEXER pLexer = pLexCurrent; + + if (pLexCurrent == &lexDefault) { + bGlobalDefault = TRUE; + iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; + pLexer = &lexDefault; + } + + StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[STY_DEFAULT + iIdx].szValue); + + if (Style_SelectFont(hwnd, newStyle, COUNTOF(newStyle), bGlobalDefault, FALSE, TRUE)) + { + // set new styles to current lexer's default text + StringCchCopyW(pLexer->Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(pLexer->Styles[STY_DEFAULT + iIdx].szValue), newStyle); + fStylesModified = TRUE; + // redraw current lexer + Style_SetLexer(hwnd, pLexCurrent); + } + +} + + + +/* void Style_SetDefaultFont(HWND hwnd) { const int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; @@ -4038,7 +4068,7 @@ void Style_SetDefaultFont(HWND hwnd) StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[STY_DEFAULT + iIdx].szValue); - if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, TRUE, FALSE)) + if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) { INT_PTR answer = IDNO; if (pLexCurrent != &lexDefault) { @@ -4072,6 +4102,7 @@ void Style_SetDefaultFont(HWND hwnd) } } } +*/ //============================================================================= @@ -4556,6 +4587,24 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in +static const WCHAR* FontSelTitle1 = L"Global Default Font"; +static const WCHAR* FontSelTitle2 = L"Current Scheme Default Font"; + +/// Callback to set the font dialog's title +static UINT CALLBACK Style_FontDialogHook( + HWND hdlg, // handle to the dialog box window + UINT uiMsg, // message identifier + WPARAM wParam, // message parameter + LPARAM lParam // message parameter +) +{ + if (uiMsg == WM_INITDIALOG) { + SetWindowText(hdlg, (WCHAR*)((CHOOSEFONT*)lParam)->lCustData); + } + UNUSED(wParam); + return 0; // Allow the default handler a chance to process +} + //============================================================================= // // Style_SelectFont() @@ -4612,6 +4661,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, if (Style_StrGetColor(TRUE, lpszStyle, &iValue)) { color = iValue; } + // Init cf CHOOSEFONT cf; ZeroMemory(&cf, sizeof(CHOOSEFONT)); @@ -4619,11 +4669,13 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, cf.hwndOwner = hwnd; cf.rgbColors = color; cf.lpLogFont = &lf; + cf.lpfnHook = (LPCFHOOKPROC)Style_FontDialogHook; // Register the callback + cf.lCustData = (LPARAM)(bDefaultStyle ? FontSelTitle1 : FontSelTitle2); + + cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; if (bWithEffects) - cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_EFFECTS | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; - else - cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST; + cf.Flags |= CF_EFFECTS; if (HIBYTE(GetKeyState(VK_SHIFT))) cf.Flags |= CF_FIXEDPITCHONLY; @@ -5354,9 +5406,11 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP { WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; GetDlgItemText(hwnd,IDC_STYLEEDIT,tch,COUNTOF(tch)); - if (Style_SelectFont(hwnd,tch,COUNTOF(tch), - StringCchCompareIX(pCurrentStyle->pszName,L"Default Style") == 0 || - StringCchCompareIX(pCurrentStyle->pszName,L"2nd Default Style") == 0, FALSE, TRUE)) { + BOOL bIsGlobalDefault = + (StringCchCompareIX(pCurrentStyle->pszName, L"Default Style") == 0) || + (StringCchCompareIX(pCurrentStyle->pszName, L"2nd Default Style") == 0); + + if (Style_SelectFont(hwnd,tch,COUNTOF(tch), bIsGlobalDefault, FALSE, TRUE)) { SetDlgItemText(hwnd,IDC_STYLEEDIT,tch); } } diff --git a/src/Styles.h b/src/Styles.h index e665b902d..2b88cb601 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -78,7 +78,7 @@ void Style_SetDefaultLexer(HWND); void Style_SetHTMLLexer(HWND); void Style_SetXMLLexer(HWND); void Style_SetLexerFromID(HWND,int); -void Style_SetDefaultFont(HWND); +void Style_SetDefaultFont(HWND,BOOL); void Style_ToggleUse2ndDefault(HWND); BOOL Style_GetUse2ndDefault(); void Style_SetIndentGuides(HWND,BOOL); diff --git a/src/resource.h b/src/resource.h index c89c78fe1..45bc0867d 100644 --- a/src/resource.h +++ b/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Notepad3.rc +// Von Microsoft Visual C++ generierte Includedatei. +// Verwendet durch Notepad3.rc // #define IDR_RT_MANIFEST 1 #define IDR_MAINWND 100 @@ -387,6 +387,7 @@ #define IDM_VIEW_ACCELWORDNAV 40451 #define IDM_VIEW_NOPRESERVECARET 40452 #define IDM_VIEW_HYPERLINKHOTSPOTS 40453 +#define IDM_VIEW_CURRENTSCHEME 40454 #define IDM_HELP_ABOUT 40500 #define IDM_HELP_CMD 40501 #define IDM_TRAY_RESTORE 40600 @@ -473,9 +474,9 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 600 +#define _APS_NEXT_RESOURCE_VALUE 601 #define _APS_NEXT_COMMAND_VALUE 701 #define _APS_NEXT_CONTROL_VALUE 801 -#define _APS_NEXT_SYMED_VALUE 900 +#define _APS_NEXT_SYMED_VALUE 901 #endif #endif From e38d93263695cec350cfd8c9e7af691e671c7faa Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 19 Dec 2017 22:51:57 +0100 Subject: [PATCH 08/18] +fix: Scheme names and corresponding resourceid references --- src/Notepad3.rc | Bin 185388 -> 186910 bytes src/Styles.c | 126 ++++++++++++++++++++++++------------------------ 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/Notepad3.rc b/src/Notepad3.rc index e2ff0f7d8599cafe1da4ea23c79eea3fc7400c20..dea8088fff507a2bbe35040d96496bd9eded2d5f 100644 GIT binary patch delta 433 zcmXv~T`PkD6h7~>cV^93F)n8$W$)I?uH5+A#ik*)#Dy|Un=y+achnZ%-6-jhl8*~6 zlxU@tLhg2<$(6hP1O9=-n@*k1^PK0L=X9>GY$pZVW>zWSD$l38sAEh*<9HDb{CR;Y zp2|aI?4yGRba?n9F4b4NQejQd3T0@SHn_Y4C*u*CWsCykrw~VVH1S|cOpiqH&?=xE~?LDjv|&B(r> Date: Wed, 20 Dec 2017 02:24:43 +0100 Subject: [PATCH 09/18] + fix: bug on font selection - global vs. current scheme + fix: relative size values (size:+/-n) should be related to predefined base --- src/Styles.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index e015a5160..410efbe04 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -3346,7 +3346,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { } else { WCHAR wch[32] = { L'\0' }; - iValue = 1; + iValue = 0; if (Style_StrGetSize(lexDefault.Styles[STY_CARET + iIdx].szValue,&iValue)) { iValue = max(min(iValue,3),1); StringCchPrintf(wch,COUNTOF(wch),L"size:%i",iValue); @@ -3357,9 +3357,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { } if (StrStr(lexDefault.Styles[STY_CARET + iIdx].szValue,L"noblink")) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)0,0); - if (StringCchLenW(wchCaretStyle,COUNTOF(wchCaretStyle))) - StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; "); - StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"noblink"); + StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; noblink"); } else SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)GetCaretBlinkTime(),0); @@ -3369,18 +3367,19 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { rgb = GetSysColor(COLOR_WINDOWTEXT); else { WCHAR wch[32] = { L'\0' }; - StringCchPrintf(wch,COUNTOF(wch),L"fore:#%02X%02X%02X", + StringCchPrintf(wch,COUNTOF(wch),L"; fore:#%02X%02X%02X", (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - if (StringCchLenW(wchCaretStyle,COUNTOF(wchCaretStyle))) - StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; "); + StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),wch); } if (!VerifyContrast(rgb,(COLORREF)SendMessage(hwnd,SCI_STYLEGETBACK,0,0))) rgb = (int)SendMessage(hwnd,SCI_STYLEGETFORE,0,0); SendMessage(hwnd,SCI_SETCARETFORE,rgb,0); SendMessage(hwnd,SCI_SETADDITIONALCARETFORE,rgb,0); + + StrTrimW(wchCaretStyle, L" ;"); StringCchCopy(lexDefault.Styles[STY_CARET + iIdx].szValue,COUNTOF(lexDefault.Styles[STY_CARET + iIdx].szValue),wchCaretStyle); if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { @@ -3397,6 +3396,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { } // Extra Line Spacing + iValue = 0; if (Style_StrGetSize(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue,&iValue) && (pLexNew != &lexANSI)) { int iAscent = 0; int iDescent = 0; @@ -4037,10 +4037,10 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) int iIdx = 0; PEDITLEXER pLexer = pLexCurrent; - if (pLexCurrent == &lexDefault) { - bGlobalDefault = TRUE; + if (bGlobalDefault || (pLexCurrent == &lexDefault)) { iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; pLexer = &lexDefault; + bGlobalDefault = TRUE; } StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[STY_DEFAULT + iIdx].szValue); @@ -4050,7 +4050,7 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) // set new styles to current lexer's default text StringCchCopyW(pLexer->Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(pLexer->Styles[STY_DEFAULT + iIdx].szValue), newStyle); fStylesModified = TRUE; - // redraw current lexer + // redraw current(!) lexer Style_SetLexer(hwnd, pLexCurrent); } @@ -4251,7 +4251,7 @@ BOOL Style_StrGetCharSet(LPCWSTR lpszStyle, int* i) // // Style_StrGetSize() // -BOOL Style_StrGetSize(LPCWSTR lpszStyle,int* i) +BOOL Style_StrGetSize(LPCWSTR lpszStyle, int* i) { WCHAR *p = StrStrI(lpszStyle, L"size:"); if (p) @@ -4279,8 +4279,10 @@ BOOL Style_StrGetSize(LPCWSTR lpszStyle,int* i) { if (iSign == 0) *i = iValue; - else - *i = max(0,iBaseFontSize + iValue * iSign); // size must be + + else { // relative size calculation + int base = *i; + *i = max(0, base + (iSign * iValue)); // size must be + + } return TRUE; } } @@ -4624,6 +4626,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, if (Style_StrGetCharSet(lpszStyle,&iValue)) lf.lfCharSet = (BYTE)iValue; + iValue = iBaseFontSize; if (Style_StrGetSize(lpszStyle,&iValue)) { HDC hdc = GetDC(hwnd); lf.lfHeight = -MulDiv(iValue,GetDeviceCaps(hdc,LOGPIXELSY),72); @@ -4864,8 +4867,9 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle, // void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) { + const int iIdx = (bUse2ndDefaultStyle && (pLexCurrent == &lexDefault)) ? STY_CNT_LAST : 0; + WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; - int iValue; // Font char chFont[64] = { '\0' }; @@ -4874,7 +4878,10 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) SendMessage(hwnd, SCI_STYLESETFONT, iStyle, (LPARAM)chFont); } - // Size + // Size (maybe relative to current lexer) + int iValue = iBaseFontSize; + Style_StrGetSize(pLexCurrent->Styles[STY_DEFAULT + iIdx].szValue, &iValue); + if (Style_StrGetSize(lpszStyle, &iValue)) { SendMessage(hwnd, SCI_STYLESETSIZE, iStyle, (LPARAM)iValue); //or Fractional From 87e455d6767caf06dc8e63689657b3f4ccb03cbd Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 20 Dec 2017 14:20:57 +0100 Subject: [PATCH 10/18] + refactor: Font Selection handling: Global Default vs. Current Scheme --- src/Styles.c | 519 ++++++++++++++++++++++++++++++--------------------- src/Styles.h | 3 +- 2 files changed, 311 insertions(+), 211 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 410efbe04..377d72655 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -51,8 +51,8 @@ extern BOOL bUseOldStyleBraceMatching; #define MULTI_STYLE(a,b,c,d) ((a)|(b<<8)|(c<<16)|(d<<24)) - -static int iBaseFontSize = 10; +#define FIXED_BASE_FONT_SIZE 10 +static int iBaseFontSize = FIXED_BASE_FONT_SIZE; KEYWORDLIST KeyWords_NULL = { @@ -114,6 +114,11 @@ enum LexDefaultStyles { STY_CNT_LAST = 15 // STY_2ND_XXX = STY_XXX + STY_CNT_LAST }; +BOOL bUse2ndDefaultStyle = FALSE; + +#define DEFAULTLEX(id) ((id) + (bUse2ndDefaultStyle ? STY_CNT_LAST : 0)) + +// ---------------------------------------------------------------------------- KEYWORDLIST KeyWords_HTML = { "!doctype ^aria- ^data- a abbr accept accept-charset accesskey acronym action address align alink " @@ -2804,7 +2809,6 @@ PEDITLEXER pLexArray[NUMLEXERS] = // Currently used lexer PEDITLEXER pLexCurrent = &lexDefault; COLORREF crCustom[16]; -BOOL bUse2ndDefaultStyle; BOOL fStylesModified = FALSE; BOOL fWarnedNoIniFile = FALSE; int iDefaultLexer; @@ -3076,7 +3080,6 @@ BOOL Style_Export(HWND hwnd) void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { int rgb; int iValue; - int iIdx; WCHAR wchFontName[64] = { '\0' }; WCHAR wchCaretStyle[64] = { L'\0' }; @@ -3125,9 +3128,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETKEYWORDS, i, (LPARAM)pLexNew->pKeyWords->pszKeyWords[i]); // Use 2nd default style - iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - int iDefaultStyle = lexDefault.Styles[STY_DEFAULT + iIdx].iStyle; - WCHAR* wchDefaultStyleStrg = lexDefault.Styles[STY_DEFAULT + iIdx].szValue; + int iDefaultStyle = lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].iStyle; + WCHAR* wchDefaultStyleStrg = lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue; // Clear SendMessage(hwnd, SCI_CLEARDOCUMENTSTYLE, 0, 0); @@ -3157,7 +3159,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WideCharToMultiByteStrg(CP_UTF8, wchFontName, chFontName); SendMessage(hwnd, SCI_STYLESETFONT, iDefaultStyle, (LPARAM)chFontName); } - iBaseFontSize = 10; + iBaseFontSize = FIXED_BASE_FONT_SIZE; if (!Style_StrGetSize(wchDefaultStyleStrg, &iBaseFontSize)) { SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size } @@ -3183,34 +3185,37 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // -------------------------------------------------------------------------- - Style_SetStyles(hwnd, lexDefault.Styles[STY_MARGIN + iIdx].iStyle, lexDefault.Styles[STY_MARGIN + iIdx].szValue); // linenumber + Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].iStyle, + lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].szValue); // linenumber if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexDefault.Styles[STY_BRACE_OK + iIdx].iStyle, lexDefault.Styles[STY_BRACE_OK + iIdx].szValue); // brace light + Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].iStyle, + lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue); // brace light } else { - if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MATCH_BRACE, iValue); } if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexDefault.Styles[STY_BRACE_BAD + iIdx].iStyle, lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue); // brace bad + Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].iStyle, + lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue); // brace bad } else { - if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, iValue); } // Occurrences Marker - if (!Style_StrGetColor(TRUE, lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, &iValue)) + if (!Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue)) { WCHAR* sty = L""; switch (iMarkOccurrences) { @@ -3228,40 +3233,39 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { iValue = RGB(0x00, 0xFF, 0x00); break; } - StringCchCopyW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), sty); + StringCchCopyW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), sty); } SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, &iValue, TRUE)) { + if (!Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue, TRUE)) { iValue = 100; - StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha:100"); + StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha:100"); } SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, &iValue, FALSE)) { + if (!Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue, FALSE)) { iValue = 100; - StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha2:100"); + StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha2:100"); } SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); iValue = -1; // need for retrieval - if (!Style_GetIndicatorType(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, 0, &iValue)) { + if (!Style_GetIndicatorType(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, 0, &iValue)) { // got default, get string - StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; "); + StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; "); Style_GetIndicatorType(wchCaretStyle, COUNTOF(wchCaretStyle), &iValue); - StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), wchCaretStyle); + StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), wchCaretStyle); } SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MARK_OCCURANCE, iValue); - // More default values... if (pLexNew != &lexANSI) - Style_SetStyles(hwnd, lexDefault.Styles[STY_CTRL_CHR + iIdx].iStyle, lexDefault.Styles[STY_CTRL_CHR + iIdx].szValue); // control char + Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_CTRL_CHR)].iStyle, lexDefault.Styles[DEFAULTLEX(STY_CTRL_CHR)].szValue); // control char - Style_SetStyles(hwnd, lexDefault.Styles[STY_INDENT_GUIDE + iIdx].iStyle, lexDefault.Styles[STY_INDENT_GUIDE + iIdx].szValue); // indent guide + Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_INDENT_GUIDE)].iStyle, lexDefault.Styles[DEFAULTLEX(STY_INDENT_GUIDE)].szValue); // indent guide - if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_SEL_TXT + iIdx].szValue, &rgb)) { // selection fore + if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &rgb)) { // selection fore SendMessage(hwnd, SCI_SETSELFORE, TRUE, rgb); SendMessage(hwnd, SCI_SETADDITIONALSELFORE, rgb, 0); } @@ -3270,7 +3274,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELFORE, 0, 0); } - if (Style_StrGetColor(FALSE, lexDefault.Styles[STY_SEL_TXT + iIdx].szValue, &iValue)) { // selection back + if (Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &iValue)) { // selection back SendMessage(hwnd, SCI_SETSELBACK, TRUE, iValue); SendMessage(hwnd, SCI_SETADDITIONALSELBACK, iValue, 0); } @@ -3279,7 +3283,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELBACK, RGB(0xC0, 0xC0, 0xC0), 0); } - if (Style_StrGetAlpha(lexDefault.Styles[STY_SEL_TXT + iIdx].szValue, &iValue, TRUE)) { // selection alpha + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &iValue, TRUE)) { // selection alpha SendMessage(hwnd, SCI_SETSELALPHA, iValue, 0); SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, iValue, 0); } @@ -3288,38 +3292,41 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, SC_ALPHA_NOALPHA, 0); } - if (StrStrI(lexDefault.Styles[STY_SEL_TXT + iIdx].szValue, L"eolfilled")) // selection eolfilled + if (StrStrI(lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, L"eolfilled")) // selection eolfilled SendMessage(hwnd, SCI_SETSELEOLFILLED, 1, 0); else SendMessage(hwnd, SCI_SETSELEOLFILLED, 0, 0); - if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, &rgb)) // whitespace fore + if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace fore SendMessage(hwnd, SCI_SETWHITESPACEFORE, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEFORE, 0, 0); - if (Style_StrGetColor(FALSE, lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, &rgb)) // whitespace back + if (Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace back SendMessage(hwnd, SCI_SETWHITESPACEBACK, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEBACK, 0, 0); // use a default value... // whitespace dot size iValue = 1; - if (Style_StrGetSize(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, &iValue)) { + if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &iValue)) { WCHAR tch[32] = { L'\0' }; WCHAR wchStyle[BUFSIZE_STYLE_VALUE]; - StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue)); + StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue)); iValue = max(min(iValue, 5), 0); - StringCchPrintf(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue), L"size:%i", iValue); + StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), L"size:%i", iValue); if (Style_StrGetColor(TRUE, wchStyle, &rgb)) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue), tch); + StringCchCat(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), tch); } if (Style_StrGetColor(FALSE, wchStyle, &rgb)) { @@ -3327,7 +3334,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_WHITESPACE + iIdx].szValue), tch); + StringCchCat(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), tch); } } SendMessage(hwnd, SCI_SETWHITESPACESIZE, iValue, 0); @@ -3340,22 +3348,23 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // caret style and width - if (StrStr(lexDefault.Styles[STY_CARET + iIdx].szValue,L"block")) { + if (StrStr(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,L"block")) { SendMessage(hwnd,SCI_SETCARETSTYLE,CARETSTYLE_BLOCK,0); StringCchCopy(wchCaretStyle,COUNTOF(wchCaretStyle),L"block"); } else { + SendMessage(hwnd, SCI_SETCARETSTYLE, CARETSTYLE_LINE, 0); + WCHAR wch[32] = { L'\0' }; - iValue = 0; - if (Style_StrGetSize(lexDefault.Styles[STY_CARET + iIdx].szValue,&iValue)) { + iValue = 1; // default caret width + if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,&iValue)) { iValue = max(min(iValue,3),1); StringCchPrintf(wch,COUNTOF(wch),L"size:%i",iValue); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),wch); } - SendMessage(hwnd,SCI_SETCARETSTYLE,CARETSTYLE_LINE,0); SendMessage(hwnd,SCI_SETCARETWIDTH,iValue,0); } - if (StrStr(lexDefault.Styles[STY_CARET + iIdx].szValue,L"noblink")) { + if (StrStr(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,L"noblink")) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)0,0); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; noblink"); } @@ -3363,7 +3372,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)GetCaretBlinkTime(),0); // caret fore - if (!Style_StrGetColor(TRUE,lexDefault.Styles[STY_CARET + iIdx].szValue,&rgb)) + if (!Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,&rgb)) rgb = GetSysColor(COLOR_WINDOWTEXT); else { WCHAR wch[32] = { L'\0' }; @@ -3380,16 +3389,17 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETADDITIONALCARETFORE,rgb,0); StrTrimW(wchCaretStyle, L" ;"); - StringCchCopy(lexDefault.Styles[STY_CARET + iIdx].szValue,COUNTOF(lexDefault.Styles[STY_CARET + iIdx].szValue),wchCaretStyle); + StringCchCopy(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue, + COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue),wchCaretStyle); if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexDefault.Styles[STY_LONG_LN_MRK + iIdx].szValue,&rgb)) // edge fore + if (Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexDefault.Styles[STY_LONG_LN_MRK + iIdx].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3397,12 +3407,12 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // Extra Line Spacing iValue = 0; - if (Style_StrGetSize(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue,&iValue) && (pLexNew != &lexANSI)) { + if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue,&iValue) && (pLexNew != &lexANSI)) { int iAscent = 0; int iDescent = 0; int iValAdj = min(max(iValue,0),64); if (iValAdj != iValue) - StringCchPrintf(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue), L"size:%i", iValAdj); + StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue), L"size:%i", iValAdj); if ((iValAdj % 2) != 0) { iAscent++; @@ -3416,7 +3426,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { else { SendMessage(hwnd,SCI_SETEXTRAASCENT,0,0); SendMessage(hwnd,SCI_SETEXTRADESCENT,0,0); - //StringCchPrintf(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_X_LN_SPACE + iIdx].szValue), L"size:%i", 0); + //StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue), L"size:%i", 0); } { // set folding style; braces are for scoping only @@ -3574,7 +3584,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // int Style_GetHotspotStyleID() { - return (bUse2ndDefaultStyle ? (STYLE_LASTPREDEFINED + STY_URL_HOTSPOT + STY_CNT_LAST) : (STYLE_LASTPREDEFINED + STY_URL_HOTSPOT)); + return (STYLE_LASTPREDEFINED + DEFAULTLEX(STY_URL_HOTSPOT)); } @@ -3584,15 +3594,12 @@ int Style_GetHotspotStyleID() // void Style_SetUrlHotSpot(HWND hwnd, BOOL bHotSpot) { - // Use 2nd default style ? - int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - // Hot Spot settings const int iStyleHotSpot = Style_GetHotspotStyleID(); if (bHotSpot) { - const WCHAR* lpszStyleHotSpot = lexDefault.Styles[STY_URL_HOTSPOT + iIdx].szValue; + const WCHAR* lpszStyleHotSpot = lexDefault.Styles[DEFAULTLEX(STY_URL_HOTSPOT)].szValue; SendMessage(hwnd, SCI_STYLESETHOTSPOT, iStyleHotSpot, (LPARAM)TRUE); SendMessage(hwnd, SCI_SETHOTSPOTSINGLELINE, TRUE, 0); @@ -3633,17 +3640,15 @@ void Style_SetLongLineColors(HWND hwnd) { int rgb; - // Use 2nd default style - int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - - if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexDefault.Styles[STY_LONG_LN_MRK + iIdx].szValue,&rgb)) // edge fore + if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) + { + if (Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexDefault.Styles[STY_LONG_LN_MRK + iIdx].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3657,19 +3662,16 @@ void Style_SetLongLineColors(HWND hwnd) // void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) { - if (bHiLitCurrLn) { - - // Use 2nd default style ? - int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - + if (bHiLitCurrLn) + { int rgb = 0; - if (Style_StrGetColor(FALSE,lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue,&rgb)) // caret line back + if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_CUR_LN_BCK)].szValue, &rgb)) // caret line back { SendMessage(hwnd,SCI_SETCARETLINEVISIBLE,TRUE,0); SendMessage(hwnd,SCI_SETCARETLINEBACK,rgb,0); int alpha = 0; - if (Style_StrGetAlpha(lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue, &alpha, TRUE)) + if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_CUR_LN_BCK)].szValue, &alpha, TRUE)) SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,alpha,0); else SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,SC_ALPHA_NOALPHA,0); @@ -3686,24 +3688,22 @@ void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) // // Style_SetCurrentMargin() // -void Style_SetCurrentMargin(HWND hwnd, BOOL bShowSelMargin) { - - int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - +void Style_SetCurrentMargin(HWND hwnd, BOOL bShowSelMargin) +{ int alpha = 20; - Style_StrGetAlpha(lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &alpha, TRUE); + Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &alpha, TRUE); int rgbFore = RGB(0xFF, 0, 0); // red - Style_StrGetColor(TRUE, lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &rgbFore); + Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &rgbFore); int rgbBack = RGB(0, 0xFF, 0); // green - Style_StrGetColor(FALSE, lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &rgbBack); + Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &rgbBack); // adjust background color by alpha in case of show margin if (bShowSelMargin) { //int bckgrnd = (int)SendMessage(hwnd, SCI_GETMARGINBACKN, MARGIN_NP3_BOOKMRK, 0); int bckgrnd = RGB(0xF0, 0xF0, 0xF0); - Style_StrGetColor(FALSE, lexDefault.Styles[STY_MARGIN + iIdx].szValue, &bckgrnd); + Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].szValue, &bckgrnd); rgbBack = Style_RgbAlpha(rgbBack, bckgrnd, min(0xFF, alpha + 50)); } SendMessage(hwnd, SCI_MARKERSETFORE, MARKER_NP3_BOOKMARK, rgbFore); @@ -4034,21 +4034,21 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) { WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - int iIdx = 0; + int iStyle = STY_DEFAULT; PEDITLEXER pLexer = pLexCurrent; if (bGlobalDefault || (pLexCurrent == &lexDefault)) { - iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; + iStyle = DEFAULTLEX(STY_DEFAULT); pLexer = &lexDefault; bGlobalDefault = TRUE; } - StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[STY_DEFAULT + iIdx].szValue); + StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[iStyle].szValue); if (Style_SelectFont(hwnd, newStyle, COUNTOF(newStyle), bGlobalDefault, FALSE, TRUE)) { // set new styles to current lexer's default text - StringCchCopyW(pLexer->Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(pLexer->Styles[STY_DEFAULT + iIdx].szValue), newStyle); + StringCchCopyW(pLexer->Styles[iStyle].szValue, COUNTOF(pLexer->Styles[iStyle].szValue), newStyle); fStylesModified = TRUE; // redraw current(!) lexer Style_SetLexer(hwnd, pLexCurrent); @@ -4057,16 +4057,13 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) } - /* void Style_SetDefaultFont(HWND hwnd) { - const int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0; - WCHAR font[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[STY_DEFAULT + iIdx].szValue); + StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue); if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) { @@ -4088,9 +4085,9 @@ void Style_SetDefaultFont(HWND hwnd) // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); //StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - //~Style_CopyStyles_IfNotDefined(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, newStyle, COUNTOF(newStyle)); + //~Style_CopyStyles_IfNotDefined(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text - StringCchCopyW(lexDefault.Styles[STY_DEFAULT + iIdx].szValue, COUNTOF(lexDefault.Styles[STY_DEFAULT + iIdx].szValue), newStyle); + StringCchCopyW(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue), newStyle); // Apply new styles fStylesModified = TRUE; Style_SetLexer(hwnd, pLexCurrent); @@ -4300,7 +4297,7 @@ BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize) WCHAR *p = StrStrI(lpszStyle, L"size:"); if (p) { - StringCchCopy(tch,COUNTOF(tch),p + CSTRLEN(L"size:")); + StringCchCopy(tch,COUNTOF(tch),(p + CSTRLEN(L"size:"))); p = StrChr(tch, L';'); if (p) *p = L'\0'; @@ -4312,6 +4309,72 @@ BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize) } +//============================================================================= +// +// Style_GetWeightValue() +// +int Style_GetWeightValue(LPCWSTR lpszWeight) +{ + int iFontWeight = FW_NORMAL; + + if (StrStrI(lpszWeight, L"thin")) + iFontWeight = FW_THIN; + else if (StrStrI(lpszWeight, L"extralight")) + iFontWeight = FW_EXTRALIGHT; + else if (StrStrI(lpszWeight, L"light")) + iFontWeight = FW_LIGHT; + else if (StrStrI(lpszWeight, L"normal")) + iFontWeight = FW_NORMAL; + else if (StrStrI(lpszWeight, L"medium")) + iFontWeight = FW_MEDIUM; + else if (StrStrI(lpszWeight, L"semibold")) + iFontWeight = FW_SEMIBOLD; + else if (StrStrI(lpszWeight, L"extrabold")) + iFontWeight = FW_EXTRABOLD; + else if (StrStrI(lpszWeight, L"bold")) // here, cause bold is in semibold and extrabold too + iFontWeight = FW_BOLD; + else if (StrStrI(lpszWeight, L"heavy")) + iFontWeight = FW_HEAVY; + + return iFontWeight; +} + +//============================================================================= +// +// Style_AppendWeightStr() +// +void Style_AppendWeightStr(LPWSTR lpszWeight, int cchSize, int fontWeight) +{ + if (fontWeight <= FW_THIN) { + StringCchCat(lpszWeight, cchSize, L"; thin"); + } + else if (fontWeight <= FW_EXTRALIGHT) { + StringCchCat(lpszWeight, cchSize, L"; extralight"); + } + else if (fontWeight <= FW_LIGHT) { + StringCchCat(lpszWeight, cchSize, L"; light"); + } + else if (fontWeight <= FW_NORMAL) { + StringCchCat(lpszWeight, cchSize, L"; normal"); + } + else if (fontWeight <= FW_MEDIUM) { + StringCchCat(lpszWeight, cchSize, L"; medium"); + } + else if (fontWeight <= FW_SEMIBOLD) { + StringCchCat(lpszWeight, cchSize, L"; semibold"); + } + else if (fontWeight <= FW_BOLD) { + StringCchCat(lpszWeight, cchSize, L"; bold"); + } + else if (fontWeight <= FW_EXTRABOLD) { + StringCchCat(lpszWeight, cchSize, L"; extrabold"); + } + else { // (fontWeight >= FW_HEAVY) + StringCchCat(lpszWeight, cchSize, L"; heavy"); + } +} + + //============================================================================= // // Style_StrGetColor() @@ -4470,7 +4533,7 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in } } - if (StrStrI(lpszStyleSrc, L"thin") && !StrStrI(lpszStyleDest, L" thin")) + if (StrStrI(lpszStyleSrc, L"thin") && !StrStrI(lpszStyleDest, L"thin")) StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; thin"); else if (StrStrI(lpszStyleSrc, L"extralight") && !StrStrI(lpszStyleDest, L"extralight")) StringCchCat(szTmpStyle, COUNTOF(szTmpStyle), L"; extralight"); @@ -4614,57 +4677,60 @@ static UINT CALLBACK Style_FontDialogHook( BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, BOOL bDefaultStyle, BOOL bWithEffects, BOOL bPreserveStyles) { - WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; - int iValue; + // Map lpszStyle to LOGFONT + WCHAR wchFontName[64] = { L'\0' }; + if (!Style_StrGetFont(lpszStyle, wchFontName, COUNTOF(wchFontName))) + { + if (!Style_StrGetFont(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, wchFontName, COUNTOF(wchFontName))) + { + Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); + } + } + + int iCharSet = DEFAULT_CHARSET; + if (!Style_StrGetCharSet(lpszStyle, &iCharSet)) { + iCharSet = iDefaultCharSet; + } + + const int iOrigBFSize = bDefaultStyle ? FIXED_BASE_FONT_SIZE : iBaseFontSize; + int iFontSize = iOrigBFSize; + BOOL bRelFontSize = (StrStrI(lpszStyle, L"size:+") || StrStrI(lpszStyle, L"size:-")); + + int iFontHeight = 0; + if (Style_StrGetSize(lpszStyle,&iFontSize)) { + HDC hdc = GetDC(hwnd); + iFontHeight = -MulDiv(iFontSize,GetDeviceCaps(hdc,LOGPIXELSY),72); + ReleaseDC(hwnd,hdc); + } + else { + HDC hdc = GetDC(hwnd); + iFontHeight = -MulDiv(iOrigBFSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); + ReleaseDC(hwnd, hdc); + } + + int iFontWeight = Style_GetWeightValue(lpszStyle); + BOOL bIsItalic = (StrStrI(lpszStyle, L"italic")) ? TRUE : FALSE; + BOOL bIsUnderline = (StrStrI(lpszStyle, L"underline")) ? TRUE : FALSE; + BOOL bIsStrikeout = (StrStrI(lpszStyle, L"strikeout")) ? TRUE : FALSE; + + // -------------------------------------------------------------------------- LOGFONT lf; ZeroMemory(&lf, sizeof(LOGFONT)); - // Map lpszStyle to LOGFONT - if (Style_StrGetFont(lpszStyle,tch,COUNTOF(tch))) - StringCchCopyN(lf.lfFaceName,COUNTOF(lf.lfFaceName),tch,COUNTOF(tch)); - - if (Style_StrGetCharSet(lpszStyle,&iValue)) - lf.lfCharSet = (BYTE)iValue; - - iValue = iBaseFontSize; - if (Style_StrGetSize(lpszStyle,&iValue)) { - HDC hdc = GetDC(hwnd); - lf.lfHeight = -MulDiv(iValue,GetDeviceCaps(hdc,LOGPIXELSY),72); - ReleaseDC(hwnd,hdc); - } - - if (StrStrI(lpszStyle, L"thin")) - lf.lfWeight = FW_THIN; - else if (StrStrI(lpszStyle, L"extralight")) - lf.lfWeight = FW_EXTRALIGHT; - else if (StrStrI(lpszStyle, L"light")) - lf.lfWeight = FW_LIGHT; - else if (StrStrI(lpszStyle, L"normal")) - lf.lfWeight = FW_NORMAL; - else if (StrStrI(lpszStyle, L"medium")) - lf.lfWeight = FW_MEDIUM; - else if (StrStrI(lpszStyle, L"semibold")) - lf.lfWeight = FW_SEMIBOLD; - else if (StrStrI(lpszStyle, L"extrabold")) - lf.lfWeight = FW_EXTRABOLD; - else if (StrStrI(lpszStyle, L"bold")) - lf.lfWeight = FW_BOLD; - else if (StrStrI(lpszStyle, L"heavy")) - lf.lfWeight = FW_HEAVY; - else - lf.lfWeight = FW_NORMAL; - - - lf.lfItalic = (StrStrI(lpszStyle,L"italic")) ? TRUE : FALSE; - lf.lfUnderline = (StrStrI(lpszStyle, L"underline")) ? TRUE : FALSE; - lf.lfStrikeOut = (StrStrI(lpszStyle, L"strikeout")) ? TRUE : FALSE; - + StringCchCopyN(lf.lfFaceName, COUNTOF(lf.lfFaceName), wchFontName, COUNTOF(wchFontName)); + lf.lfCharSet = (BYTE)iCharSet; + lf.lfHeight = iFontHeight; + lf.lfWeight = iFontWeight; + lf.lfItalic = (BYTE)bIsItalic; + lf.lfUnderline = (BYTE)bIsUnderline; + lf.lfStrikeOut = (BYTE)bIsStrikeout; + COLORREF color = 0L; + int iValue = 0; if (Style_StrGetColor(TRUE, lpszStyle, &iValue)) { - color = iValue; + color = (DWORD)iValue; } - // Init cf CHOOSEFONT cf; ZeroMemory(&cf, sizeof(CHOOSEFONT)); @@ -4675,7 +4741,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, cf.lpfnHook = (LPCFHOOKPROC)Style_FontDialogHook; // Register the callback cf.lCustData = (LPARAM)(bDefaultStyle ? FontSelTitle1 : FontSelTitle2); - cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; if (bWithEffects) cf.Flags |= CF_EFFECTS; @@ -4691,83 +4757,133 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, WCHAR szNewStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - StringCchCopy(szNewStyle,COUNTOF(szNewStyle),L"font:"); - StringCchCat(szNewStyle,COUNTOF(szNewStyle),lf.lfFaceName); - - switch (lf.lfWeight) { - case FW_THIN: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; thin"); - break; - case FW_EXTRALIGHT: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; extralight"); - break; - case FW_LIGHT: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; light"); - break; - case FW_MEDIUM: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; medium"); - break; - case FW_SEMIBOLD: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; semibold"); - break; - case FW_EXTRABOLD: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; extrabold"); - break; - case FW_BOLD: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); - break; - case FW_HEAVY: - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; heavy"); - break; - case FW_NORMAL: - default: - //~StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; normal"); - if (cf.nFontType & BOLD_FONTTYPE) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; bold"); + if (StrStrI(lpszStyle, L"font:")) { + StringCchCopy(szNewStyle, COUNTOF(szNewStyle), L"font:"); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), lf.lfFaceName); + } + else { // no font in source specified, + if (lstrcmpW(lf.lfFaceName, wchFontName) != 0) { + StringCchCopy(szNewStyle, COUNTOF(szNewStyle), L"font:"); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), lf.lfFaceName); } - break; } - StringCchPrintf(tch, COUNTOF(tch), L"; size:%i", cf.iPointSize / 10); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + if (lf.lfWeight == iFontWeight) { + WCHAR check[64] = { L'\0' }; + Style_AppendWeightStr(check, COUNTOF(check), lf.lfWeight); + StrTrimW(check, L" ;"); + if (StrStrI(lpszStyle, check)) { + Style_AppendWeightStr(szNewStyle, COUNTOF(szNewStyle), lf.lfWeight); + } + } + else { + Style_AppendWeightStr(szNewStyle, COUNTOF(szNewStyle), lf.lfWeight); + } + + int iNewFontSize = (int)((cf.iPointSize + 5) / 10); + WCHAR newSize[64] = { L'\0' }; + + if (bRelFontSize) + { + int iNewRelSize = iNewFontSize - iOrigBFSize; + + if (iNewRelSize >= 0) + StringCchPrintfW(newSize, COUNTOF(newSize), L"; size:+%i", iNewRelSize); + else + StringCchPrintfW(newSize, COUNTOF(newSize), L"; size:-%i", (0 - iNewRelSize)); + } + else { + if (iNewFontSize == iFontSize) { + if (StrStrI(lpszStyle, L"size:")) { + StringCchPrintfW(newSize, COUNTOF(newSize), L"; size:%i", iNewFontSize); + } + } + else { + StringCchPrintfW(newSize, COUNTOF(newSize), L"; size:%i", iNewFontSize); + } + } + StringCchCat(szNewStyle, COUNTOF(szNewStyle), newSize); + + + WCHAR chset[32] = { L'\0' }; if (bDefaultStyle && - lf.lfCharSet != DEFAULT_CHARSET && - lf.lfCharSet != ANSI_CHARSET && - lf.lfCharSet != iDefaultCharSet) { - StringCchPrintf(tch, COUNTOF(tch), L"; charset:%i", lf.lfCharSet); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + (lf.lfCharSet != DEFAULT_CHARSET) && + (lf.lfCharSet != ANSI_CHARSET) && + (lf.lfCharSet != iDefaultCharSet)) { + if (lf.lfCharSet == iCharSet) { + if (StrStrI(lpszStyle, L"charset:")) + { + StringCchPrintf(chset, COUNTOF(chset), L"; charset:%i", lf.lfCharSet); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), chset); + } + } + else { + StringCchPrintf(chset, COUNTOF(chset), L"; charset:%i", lf.lfCharSet); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), chset); + } } - if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); + if (lf.lfItalic) { + if (bIsItalic) { + if (StrStrI(lpszStyle, L"italic")) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); + } + } + else { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; italic"); + } } - // return, if only pure Font style is needed if (bWithEffects) { if (lf.lfUnderline) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); + if (bIsUnderline) { + if (StrStrI(lpszStyle, L"underline")) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); + } + } + else { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; underline"); + } } if (lf.lfStrikeOut) { - StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); + if (bIsStrikeout) { + if (StrStrI(lpszStyle, L"strikeout")) { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); + } + } + else { + StringCchCat(szNewStyle, COUNTOF(szNewStyle), L"; strikeout"); + } } // --- save colors --- - if (color != cf.rgbColors) { - StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", + WCHAR newColor[64] = { L'\0' }; + if (cf.rgbColors == color) { + if (StrStrI(lpszStyle, L"fore:")) { + StringCchPrintf(newColor, COUNTOF(newColor), L"; fore:#%02X%02X%02X", + (int)GetRValue(cf.rgbColors), + (int)GetGValue(cf.rgbColors), + (int)GetBValue(cf.rgbColors)); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), newColor); + } + } + else { // color changed + StringCchPrintf(newColor, COUNTOF(newColor), L"; fore:#%02X%02X%02X", (int)GetRValue(cf.rgbColors), (int)GetGValue(cf.rgbColors), (int)GetBValue(cf.rgbColors)); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), newColor); } + // copy background if (Style_StrGetColor(FALSE, lpszStyle, &iValue)) { - StringCchPrintf(tch, COUNTOF(tch), L"; back:#%02X%02X%02X", - (int)GetRValue(iValue), + StringCchPrintf(newColor, COUNTOF(newColor), L"; back:#%02X%02X%02X", + (int)GetRValue(iValue), (int)GetGValue(iValue), (int)GetBValue(iValue)); - StringCchCat(szNewStyle, COUNTOF(szNewStyle), tch); + StringCchCat(szNewStyle, COUNTOF(szNewStyle), newColor); } } @@ -4867,7 +4983,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle, // void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) { - const int iIdx = (bUse2ndDefaultStyle && (pLexCurrent == &lexDefault)) ? STY_CNT_LAST : 0; + const int iDefaultStyle = ((pLexCurrent == &lexDefault) ? DEFAULTLEX(STY_DEFAULT) : STY_DEFAULT); WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; @@ -4878,10 +4994,10 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) SendMessage(hwnd, SCI_STYLESETFONT, iStyle, (LPARAM)chFont); } - // Size (maybe relative to current lexer) - int iValue = iBaseFontSize; - Style_StrGetSize(pLexCurrent->Styles[STY_DEFAULT + iIdx].szValue, &iValue); - + // Size values maybe relative to current value + int iValue = (pLexCurrent == &lexDefault) ? FIXED_BASE_FONT_SIZE : iBaseFontSize; + Style_StrGetSize(pLexCurrent->Styles[iDefaultStyle].szValue, &iValue); + // feed current base size if (Style_StrGetSize(lpszStyle, &iValue)) { SendMessage(hwnd, SCI_STYLESETSIZE, iStyle, (LPARAM)iValue); //or Fractional @@ -4901,24 +5017,7 @@ void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) // SendMessage(hwnd,SCI_STYLESETBOLD,iStyle,(LPARAM)TRUE); // Weight - if (StrStrI(lpszStyle, L"thin")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_THIN); - else if (StrStrI(lpszStyle, L"extralight")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_EXTRALIGHT); - else if (StrStrI(lpszStyle, L"light")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_LIGHT); - else if (StrStrI(lpszStyle, L"normal")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_NORMAL); - else if (StrStrI(lpszStyle, L"medium")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_MEDIUM); - else if (StrStrI(lpszStyle, L"semibold")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_SEMIBOLD); - else if (StrStrI(lpszStyle, L"extrabold")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_EXTRABOLD); - else if (StrStrI(lpszStyle, L"bold")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_BOLD); - else if (StrStrI(lpszStyle, L"heavy")) - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)FW_HEAVY); + SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)Style_GetWeightValue(lpszStyle)); // Italic if (StrStrI(lpszStyle, L"italic")) diff --git a/src/Styles.h b/src/Styles.h index 2b88cb601..ef040e52b 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -106,7 +106,8 @@ void Style_ConfigDlg(HWND); INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND,UINT,WPARAM,LPARAM); void Style_SelectLexerDlg(HWND); int Style_GetHotspotStyleID(); - +int Style_GetWeightValue(LPCWSTR); +void Style_AppendWeightStr(LPWSTR, int, int); #endif //_NP3_STYLES_H_ From 6d9e70675184ff4f1c106d29db749b65be1a2936 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 20 Dec 2017 17:03:08 +0100 Subject: [PATCH 11/18] + analysis version (staged) --- src/Styles.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 377d72655..3edb749e7 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -3159,6 +3159,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WideCharToMultiByteStrg(CP_UTF8, wchFontName, chFontName); SendMessage(hwnd, SCI_STYLESETFONT, iDefaultStyle, (LPARAM)chFontName); } + iBaseFontSize = FIXED_BASE_FONT_SIZE; if (!Style_StrGetSize(wchDefaultStyleStrg, &iBaseFontSize)) { SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size @@ -3170,14 +3171,16 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_STYLESETEOLFILLED, iDefaultStyle, (LPARAM)FALSE); SendMessage(hwnd, SCI_STYLESETVISIBLE, iDefaultStyle, (LPARAM)TRUE); SendMessage(hwnd, SCI_STYLESETCASE, iDefaultStyle, (LPARAM)SC_CASE_MIXED); - SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off - + Style_SetStyles(hwnd, iDefaultStyle, wchDefaultStyleStrg); // apply default style - if (StringCchLenW(pLexNew->Styles[STY_DEFAULT].szValue, COUNTOF(pLexNew->Styles[STY_DEFAULT].szValue)) > 0) { - // override with Lexer's specific defaults - Style_SetStyles(hwnd, iDefaultStyle, pLexNew->Styles[STY_DEFAULT].szValue); + // apply default and specific styles to lexer + if (pLexNew != &lexDefault) { + if (StringCchLenW(pLexNew->Styles[STY_DEFAULT].szValue, COUNTOF(pLexNew->Styles[STY_DEFAULT].szValue)) > 0) { + // override with Lexer's specific defaults + Style_SetStyles(hwnd, pLexNew->Styles[STY_DEFAULT].iStyle, pLexNew->Styles[STY_DEFAULT].szValue); + } } // Re-Set to just defined default style (STYLE_DEFAULT) @@ -3426,7 +3429,6 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { else { SendMessage(hwnd,SCI_SETEXTRAASCENT,0,0); SendMessage(hwnd,SCI_SETEXTRADESCENT,0,0); - //StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue), L"size:%i", 0); } { // set folding style; braces are for scoping only @@ -4160,7 +4162,7 @@ BOOL Style_GetOpenDlgFilterStr(LPWSTR lpszFilter,int cchFilter) // BOOL Style_StrGetFont(LPCWSTR lpszStyle,LPWSTR lpszFont,int cchFont) { - WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; + WCHAR tch[64] = { L'\0' }; WCHAR *p = StrStrI(lpszStyle, L"font:"); if (p) { @@ -4181,7 +4183,6 @@ BOOL Style_StrGetFont(LPCWSTR lpszStyle,LPWSTR lpszFont,int cchFont) { StringCchCopyN(lpszFont,cchFont,tch, COUNTOF(tch)); } - return TRUE; } return FALSE; @@ -4276,8 +4277,9 @@ BOOL Style_StrGetSize(LPCWSTR lpszStyle, int* i) { if (iSign == 0) *i = iValue; - else { // relative size calculation - int base = *i; + else { + // relative size calculation + int base = *i; // base is input *i = max(0, base + (iSign * iValue)); // size must be + } return TRUE; @@ -4693,10 +4695,10 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, } const int iOrigBFSize = bDefaultStyle ? FIXED_BASE_FONT_SIZE : iBaseFontSize; - int iFontSize = iOrigBFSize; BOOL bRelFontSize = (StrStrI(lpszStyle, L"size:+") || StrStrI(lpszStyle, L"size:-")); int iFontHeight = 0; + int iFontSize = iOrigBFSize; if (Style_StrGetSize(lpszStyle,&iFontSize)) { HDC hdc = GetDC(hwnd); iFontHeight = -MulDiv(iFontSize,GetDeviceCaps(hdc,LOGPIXELSY),72); @@ -4741,7 +4743,9 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, cf.lpfnHook = (LPCFHOOKPROC)Style_FontDialogHook; // Register the callback cf.lCustData = (LPARAM)(bDefaultStyle ? FontSelTitle1 : FontSelTitle2); - cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + //cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + if (bWithEffects) cf.Flags |= CF_EFFECTS; @@ -4981,23 +4985,22 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle, // // Style_SetStyles() // -void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle) +void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle) { - const int iDefaultStyle = ((pLexCurrent == &lexDefault) ? DEFAULTLEX(STY_DEFAULT) : STY_DEFAULT); - - WCHAR tch[BUFSIZE_STYLE_VALUE] = { L'\0' }; + WCHAR tch[64] = { L'\0' }; // Font - char chFont[64] = { '\0' }; if (Style_StrGetFont(lpszStyle, tch, COUNTOF(tch))) { - WideCharToMultiByteStrg(CP_UTF8, tch, chFont); - SendMessage(hwnd, SCI_STYLESETFONT, iStyle, (LPARAM)chFont); + if (lstrlen(tch) > 0) { + char chFont[64] = { '\0' }; + WideCharToMultiByteStrg(CP_UTF8, tch, chFont); + SendMessage(hwnd, SCI_STYLESETFONT, iStyle, (LPARAM)chFont); + } } - // Size values maybe relative to current value + // Size values are relative to iBaseFontSize int iValue = (pLexCurrent == &lexDefault) ? FIXED_BASE_FONT_SIZE : iBaseFontSize; - Style_StrGetSize(pLexCurrent->Styles[iDefaultStyle].szValue, &iValue); - // feed current base size + if (Style_StrGetSize(lpszStyle, &iValue)) { SendMessage(hwnd, SCI_STYLESETSIZE, iStyle, (LPARAM)iValue); //or Fractional From 148830576185ad6c59e9a9d8b8e84e4c8345d354 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 20 Dec 2017 18:35:19 +0100 Subject: [PATCH 12/18] + cleanup and minor bugfixes --- src/Styles.c | 247 ++++++++++++++++++++++++++++----------------------- src/Styles.h | 2 +- 2 files changed, 137 insertions(+), 112 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 3edb749e7..1c864b5fd 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -59,7 +59,7 @@ KEYWORDLIST KeyWords_NULL = { "", "", "", "", "", "", "", "", "" }; -EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; log; asc; doc", L"", &KeyWords_NULL, { +EDITLEXER lexStandard = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; log; asc; doc", L"", &KeyWords_NULL, { /* 0 */ { STYLE_DEFAULT, 63100, L"Default Style", L"font:Default; size:10", L"" }, /* 1 */ { STYLE_LINENUMBER, 63101, L"Margins and Line Numbers", L"size:-2; fore:#FF0000", L"" }, /* 2 */ { STYLE_BRACELIGHT, 63102, L"Matching Braces", L"size:+1; bold; fore:#FF0000", L"" }, @@ -116,7 +116,7 @@ enum LexDefaultStyles { BOOL bUse2ndDefaultStyle = FALSE; -#define DEFAULTLEX(id) ((id) + (bUse2ndDefaultStyle ? STY_CNT_LAST : 0)) +#define STDLEX(id) ((id) + (bUse2ndDefaultStyle ? STY_CNT_LAST : 0)) // ---------------------------------------------------------------------------- @@ -2759,7 +2759,7 @@ EDITLEXER lexAwk = { SCLEX_PYTHON, 63024, L"Awk Script", L"awk", L"", &KeyWords // in Notepad2.c ParseCommandLine() if you change this array! PEDITLEXER pLexArray[NUMLEXERS] = { - &lexDefault, // Default Text + &lexStandard, // Default Text &lexANSI, // ANSI Files &lexCONF, // Apache Config Files &lexASM, // Assembly Script @@ -2807,11 +2807,12 @@ PEDITLEXER pLexArray[NUMLEXERS] = // Currently used lexer -PEDITLEXER pLexCurrent = &lexDefault; +int iDefaultLexer = 0; +PEDITLEXER pLexCurrent = &lexStandard; + COLORREF crCustom[16]; BOOL fStylesModified = FALSE; BOOL fWarnedNoIniFile = FALSE; -int iDefaultLexer; BOOL bAutoSelect; int cxStyleSelectDlg; int cyStyleSelectDlg; @@ -3128,8 +3129,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETKEYWORDS, i, (LPARAM)pLexNew->pKeyWords->pszKeyWords[i]); // Use 2nd default style - int iDefaultStyle = lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].iStyle; - WCHAR* wchDefaultStyleStrg = lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue; + int iDefaultStyle = lexStandard.Styles[STDLEX(STY_DEFAULT)].iStyle; + WCHAR* wchStandardStyleStrg = lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue; // Clear SendMessage(hwnd, SCI_CLEARDOCUMENTSTYLE, 0, 0); @@ -3141,18 +3142,28 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_STYLERESETDEFAULT, 0, 0); - if (!Style_StrGetColor(TRUE, wchDefaultStyleStrg, &iValue)) + if (!Style_StrGetColor(TRUE, wchStandardStyleStrg, &iValue)) SendMessage(hwnd, SCI_STYLESETFORE, STYLE_DEFAULT, (LPARAM)GetSysColor(COLOR_WINDOWTEXT)); // default text color - if (!Style_StrGetColor(FALSE, wchDefaultStyleStrg, &iValue)) + if (!Style_StrGetColor(FALSE, wchStandardStyleStrg, &iValue)) SendMessage(hwnd, SCI_STYLESETBACK, STYLE_DEFAULT, (LPARAM)GetSysColor(COLOR_WINDOW)); // default window color // Auto-select codepage according to charset //~Style_SetACPfromCharSet(hwnd); // ---- Font & More --- - Style_SetFontQuality(hwnd, wchDefaultStyleStrg); - if (!Style_StrGetFont(wchDefaultStyleStrg, wchFontName, COUNTOF(wchFontName))) + // constants + + Style_SetFontQuality(hwnd, wchStandardStyleStrg); + + SendMessage(hwnd, SCI_STYLESETVISIBLE, iDefaultStyle, (LPARAM)TRUE); + + SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off + + + // customizable + + if (!Style_StrGetFont(wchStandardStyleStrg, wchFontName, COUNTOF(wchFontName))) { char chFontName[64] = { '\0' }; Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); @@ -3161,64 +3172,75 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { } iBaseFontSize = FIXED_BASE_FONT_SIZE; - if (!Style_StrGetSize(wchDefaultStyleStrg, &iBaseFontSize)) { + if (!Style_StrGetSize(wchStandardStyleStrg, &iBaseFontSize)) { SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size } - SendMessage(hwnd, SCI_STYLESETCHARACTERSET, iDefaultStyle, (LPARAM)DEFAULT_CHARSET); - SendMessage(hwnd, SCI_STYLESETWEIGHT, iDefaultStyle, (LPARAM)FW_NORMAL); - SendMessage(hwnd, SCI_STYLESETITALIC, iDefaultStyle, (LPARAM)FALSE); - SendMessage(hwnd, SCI_STYLESETUNDERLINE, iDefaultStyle, (LPARAM)FALSE); - SendMessage(hwnd, SCI_STYLESETEOLFILLED, iDefaultStyle, (LPARAM)FALSE); - SendMessage(hwnd, SCI_STYLESETVISIBLE, iDefaultStyle, (LPARAM)TRUE); - SendMessage(hwnd, SCI_STYLESETCASE, iDefaultStyle, (LPARAM)SC_CASE_MIXED); - SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off - Style_SetStyles(hwnd, iDefaultStyle, wchDefaultStyleStrg); // apply default style - - // apply default and specific styles to lexer - if (pLexNew != &lexDefault) { - if (StringCchLenW(pLexNew->Styles[STY_DEFAULT].szValue, COUNTOF(pLexNew->Styles[STY_DEFAULT].szValue)) > 0) { - // override with Lexer's specific defaults - Style_SetStyles(hwnd, pLexNew->Styles[STY_DEFAULT].iStyle, pLexNew->Styles[STY_DEFAULT].szValue); - } + if (!Style_StrGetCharSet(wchStandardStyleStrg, &iValue)) { + SendMessage(hwnd, SCI_STYLESETCHARACTERSET, iDefaultStyle, (LPARAM)DEFAULT_CHARSET); + } + + if (!Style_StrGetWeightValue(wchStandardStyleStrg, &iValue)) { + SendMessage(hwnd, SCI_STYLESETWEIGHT, iDefaultStyle, (LPARAM)FW_NORMAL); + } + + if (!Style_StrGetCase(wchStandardStyleStrg, &iValue)) { + SendMessage(hwnd, SCI_STYLESETCASE, iDefaultStyle, (LPARAM)SC_CASE_MIXED); } - // Re-Set to just defined default style (STYLE_DEFAULT) + if (!StrStrI(wchStandardStyleStrg, L"italic")) + SendMessage(hwnd, SCI_STYLESETITALIC, iDefaultStyle, (LPARAM)FALSE); + + if (!StrStrI(wchStandardStyleStrg, L"underline")) + SendMessage(hwnd, SCI_STYLESETUNDERLINE, iDefaultStyle, (LPARAM)FALSE); + + if (!StrStrI(wchStandardStyleStrg, L"eolfilled")) + SendMessage(hwnd, SCI_STYLESETEOLFILLED, iDefaultStyle, (LPARAM)FALSE); + + + Style_SetStyles(hwnd, iDefaultStyle, wchStandardStyleStrg); // apply default style + + // --- apply current scheme specific settings to default style --- + if (pLexNew != &lexStandard) { + Style_SetStyles(hwnd, iDefaultStyle, pLexNew->Styles[STY_DEFAULT].szValue); + } + + // Broadcast STYLE_DEFAULT to all styles SendMessage(hwnd, SCI_STYLECLEARALL, 0, 0); // -------------------------------------------------------------------------- - Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].iStyle, - lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].szValue); // linenumber + Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_MARGIN)].iStyle, + lexStandard.Styles[STDLEX(STY_MARGIN)].szValue); // linenumber if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].iStyle, - lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue); // brace light + Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_BRACE_OK)].iStyle, + lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue); // brace light } else { - if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_OK)].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MATCH_BRACE, iValue); } if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].iStyle, - lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue); // brace bad + Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_BRACE_BAD)].iStyle, + lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue); // brace bad } else { - if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BRACE_BAD)].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, iValue); } // Occurrences Marker - if (!Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue)) + if (!Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue)) { WCHAR* sty = L""; switch (iMarkOccurrences) { @@ -3236,39 +3258,39 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { iValue = RGB(0x00, 0xFF, 0x00); break; } - StringCchCopyW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), sty); + StringCchCopyW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), sty); } SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue, TRUE)) { + if (!Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue, TRUE)) { iValue = 100; - StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha:100"); + StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha:100"); } SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, &iValue, FALSE)) { + if (!Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue, FALSE)) { iValue = 100; - StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha2:100"); + StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha2:100"); } SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); iValue = -1; // need for retrieval - if (!Style_GetIndicatorType(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, 0, &iValue)) { + if (!Style_GetIndicatorType(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, 0, &iValue)) { // got default, get string - StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; "); + StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; "); Style_GetIndicatorType(wchCaretStyle, COUNTOF(wchCaretStyle), &iValue); - StringCchCatW(lexDefault.Styles[DEFAULTLEX(STY_MARK_OCC)].szValue, COUNTOF(lexDefault.Styles[0].szValue), wchCaretStyle); + StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), wchCaretStyle); } SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MARK_OCCURANCE, iValue); // More default values... if (pLexNew != &lexANSI) - Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_CTRL_CHR)].iStyle, lexDefault.Styles[DEFAULTLEX(STY_CTRL_CHR)].szValue); // control char + Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_CTRL_CHR)].iStyle, lexStandard.Styles[STDLEX(STY_CTRL_CHR)].szValue); // control char - Style_SetStyles(hwnd, lexDefault.Styles[DEFAULTLEX(STY_INDENT_GUIDE)].iStyle, lexDefault.Styles[DEFAULTLEX(STY_INDENT_GUIDE)].szValue); // indent guide + Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_INDENT_GUIDE)].iStyle, lexStandard.Styles[STDLEX(STY_INDENT_GUIDE)].szValue); // indent guide - if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &rgb)) { // selection fore + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &rgb)) { // selection fore SendMessage(hwnd, SCI_SETSELFORE, TRUE, rgb); SendMessage(hwnd, SCI_SETADDITIONALSELFORE, rgb, 0); } @@ -3277,7 +3299,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELFORE, 0, 0); } - if (Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &iValue)) { // selection back + if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &iValue)) { // selection back SendMessage(hwnd, SCI_SETSELBACK, TRUE, iValue); SendMessage(hwnd, SCI_SETADDITIONALSELBACK, iValue, 0); } @@ -3286,7 +3308,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELBACK, RGB(0xC0, 0xC0, 0xC0), 0); } - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, &iValue, TRUE)) { // selection alpha + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &iValue, TRUE)) { // selection alpha SendMessage(hwnd, SCI_SETSELALPHA, iValue, 0); SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, iValue, 0); } @@ -3295,41 +3317,41 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, SC_ALPHA_NOALPHA, 0); } - if (StrStrI(lexDefault.Styles[DEFAULTLEX(STY_SEL_TXT)].szValue, L"eolfilled")) // selection eolfilled + if (StrStrI(lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, L"eolfilled")) // selection eolfilled SendMessage(hwnd, SCI_SETSELEOLFILLED, 1, 0); else SendMessage(hwnd, SCI_SETSELEOLFILLED, 0, 0); - if (Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace fore + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace fore SendMessage(hwnd, SCI_SETWHITESPACEFORE, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEFORE, 0, 0); - if (Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace back + if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace back SendMessage(hwnd, SCI_SETWHITESPACEBACK, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEBACK, 0, 0); // use a default value... // whitespace dot size iValue = 1; - if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, &iValue)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &iValue)) { WCHAR tch[32] = { L'\0' }; WCHAR wchStyle[BUFSIZE_STYLE_VALUE]; - StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue)); + StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue)); iValue = max(min(iValue, 5), 0); - StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), L"size:%i", iValue); + StringCchPrintf(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), L"size:%i", iValue); if (Style_StrGetColor(TRUE, wchStyle, &rgb)) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), tch); + StringCchCat(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), tch); } if (Style_StrGetColor(FALSE, wchStyle, &rgb)) { @@ -3337,8 +3359,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_WHITESPACE)].szValue), tch); + StringCchCat(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), tch); } } SendMessage(hwnd, SCI_SETWHITESPACESIZE, iValue, 0); @@ -3351,7 +3373,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // caret style and width - if (StrStr(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,L"block")) { + if (StrStr(lexStandard.Styles[STDLEX(STY_CARET)].szValue,L"block")) { SendMessage(hwnd,SCI_SETCARETSTYLE,CARETSTYLE_BLOCK,0); StringCchCopy(wchCaretStyle,COUNTOF(wchCaretStyle),L"block"); } @@ -3360,14 +3382,14 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WCHAR wch[32] = { L'\0' }; iValue = 1; // default caret width - if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,&iValue)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_CARET)].szValue,&iValue)) { iValue = max(min(iValue,3),1); StringCchPrintf(wch,COUNTOF(wch),L"size:%i",iValue); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),wch); } SendMessage(hwnd,SCI_SETCARETWIDTH,iValue,0); } - if (StrStr(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,L"noblink")) { + if (StrStr(lexStandard.Styles[STDLEX(STY_CARET)].szValue,L"noblink")) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)0,0); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; noblink"); } @@ -3375,7 +3397,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)GetCaretBlinkTime(),0); // caret fore - if (!Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue,&rgb)) + if (!Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_CARET)].szValue,&rgb)) rgb = GetSysColor(COLOR_WINDOWTEXT); else { WCHAR wch[32] = { L'\0' }; @@ -3392,17 +3414,17 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETADDITIONALCARETFORE,rgb,0); StrTrimW(wchCaretStyle, L" ;"); - StringCchCopy(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue, - COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_CARET)].szValue),wchCaretStyle); + StringCchCopy(lexStandard.Styles[STDLEX(STY_CARET)].szValue, + COUNTOF(lexStandard.Styles[STDLEX(STY_CARET)].szValue),wchCaretStyle); if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore + if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3410,12 +3432,12 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // Extra Line Spacing iValue = 0; - if (Style_StrGetSize(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue,&iValue) && (pLexNew != &lexANSI)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue,&iValue) && (pLexNew != &lexANSI)) { int iAscent = 0; int iDescent = 0; int iValAdj = min(max(iValue,0),64); if (iValAdj != iValue) - StringCchPrintf(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_X_LN_SPACE)].szValue), L"size:%i", iValAdj); + StringCchPrintf(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue), L"size:%i", iValAdj); if ((iValAdj % 2) != 0) { iAscent++; @@ -3586,7 +3608,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // int Style_GetHotspotStyleID() { - return (STYLE_LASTPREDEFINED + DEFAULTLEX(STY_URL_HOTSPOT)); + return (STYLE_LASTPREDEFINED + STDLEX(STY_URL_HOTSPOT)); } @@ -3601,7 +3623,7 @@ void Style_SetUrlHotSpot(HWND hwnd, BOOL bHotSpot) if (bHotSpot) { - const WCHAR* lpszStyleHotSpot = lexDefault.Styles[DEFAULTLEX(STY_URL_HOTSPOT)].szValue; + const WCHAR* lpszStyleHotSpot = lexStandard.Styles[STDLEX(STY_URL_HOTSPOT)].szValue; SendMessage(hwnd, SCI_STYLESETHOTSPOT, iStyleHotSpot, (LPARAM)TRUE); SendMessage(hwnd, SCI_SETHOTSPOTSINGLELINE, TRUE, 0); @@ -3644,13 +3666,13 @@ void Style_SetLongLineColors(HWND hwnd) if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore + if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3667,13 +3689,13 @@ void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) if (bHiLitCurrLn) { int rgb = 0; - if (Style_StrGetColor(FALSE,lexDefault.Styles[DEFAULTLEX(STY_CUR_LN_BCK)].szValue, &rgb)) // caret line back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_CUR_LN_BCK)].szValue, &rgb)) // caret line back { SendMessage(hwnd,SCI_SETCARETLINEVISIBLE,TRUE,0); SendMessage(hwnd,SCI_SETCARETLINEBACK,rgb,0); int alpha = 0; - if (Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_CUR_LN_BCK)].szValue, &alpha, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_CUR_LN_BCK)].szValue, &alpha, TRUE)) SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,alpha,0); else SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,SC_ALPHA_NOALPHA,0); @@ -3693,19 +3715,19 @@ void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) void Style_SetCurrentMargin(HWND hwnd, BOOL bShowSelMargin) { int alpha = 20; - Style_StrGetAlpha(lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &alpha, TRUE); + Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &alpha, TRUE); int rgbFore = RGB(0xFF, 0, 0); // red - Style_StrGetColor(TRUE, lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &rgbFore); + Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &rgbFore); int rgbBack = RGB(0, 0xFF, 0); // green - Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_BOOK_MARK)].szValue, &rgbBack); + Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &rgbBack); // adjust background color by alpha in case of show margin if (bShowSelMargin) { //int bckgrnd = (int)SendMessage(hwnd, SCI_GETMARGINBACKN, MARGIN_NP3_BOOKMRK, 0); int bckgrnd = RGB(0xF0, 0xF0, 0xF0); - Style_StrGetColor(FALSE, lexDefault.Styles[DEFAULTLEX(STY_MARGIN)].szValue, &bckgrnd); + Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_MARGIN)].szValue, &bckgrnd); rgbBack = Style_RgbAlpha(rgbBack, bckgrnd, min(0xFF, alpha + 50)); } SendMessage(hwnd, SCI_MARKERSETFORE, MARKER_NP3_BOOKMARK, rgbFore); @@ -3850,7 +3872,7 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile) StrTrimA(tchText," \t\n\r"); pLexSniffed = Style_SniffShebang(tchText); if (pLexSniffed) { - if (Encoding_Current(CPI_GET) != g_DOSEncoding || pLexSniffed != &lexDefault || ( + if (Encoding_Current(CPI_GET) != g_DOSEncoding || pLexSniffed != &lexStandard || ( StringCchCompareIX(lpszExt,L"nfo") && StringCchCompareIX(lpszExt,L"diz"))) { // Although .nfo and .diz were removed from the default lexer's // default extensions list, they may still presist in the user's INI @@ -3980,7 +4002,7 @@ void Style_SetLexerFromName(HWND hwnd,LPCWSTR lpszFile,LPCWSTR lpszName) // void Style_SetDefaultLexer(HWND hwnd) { - Style_SetLexer(hwnd,pLexArray[0]); + Style_SetLexer(hwnd, pLexArray[iDefaultLexer]); } @@ -4039,9 +4061,9 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) int iStyle = STY_DEFAULT; PEDITLEXER pLexer = pLexCurrent; - if (bGlobalDefault || (pLexCurrent == &lexDefault)) { - iStyle = DEFAULTLEX(STY_DEFAULT); - pLexer = &lexDefault; + if (bGlobalDefault || (pLexCurrent == &lexStandard)) { + iStyle = STDLEX(STY_DEFAULT); + pLexer = &lexStandard; bGlobalDefault = TRUE; } @@ -4065,12 +4087,12 @@ void Style_SetDefaultFont(HWND hwnd) WCHAR font[BUFSIZE_STYLE_VALUE] = { L'\0' }; WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - StringCchCopyW(font, COUNTOF(font), lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue); + StringCchCopyW(font, COUNTOF(font), lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue); if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) { INT_PTR answer = IDNO; - if (pLexCurrent != &lexDefault) { + if (pLexCurrent != &lexStandard) { answer = InfoBox(MBYESNO, L"MsgApplyDefaultFont", IDS_APPLY_DEFAULT_FONT, pLexCurrent->pszName); } switch (answer) @@ -4087,9 +4109,9 @@ void Style_SetDefaultFont(HWND hwnd) // build styles string StringCchCopyW(newStyle, COUNTOF(newStyle), font); //StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - //~Style_CopyStyles_IfNotDefined(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, newStyle, COUNTOF(newStyle)); + //~Style_CopyStyles_IfNotDefined(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, newStyle, COUNTOF(newStyle)); // set new styles to current lexer's default text - StringCchCopyW(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, COUNTOF(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue), newStyle); + StringCchCopyW(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, COUNTOF(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue), newStyle); // Apply new styles fStylesModified = TRUE; Style_SetLexer(hwnd, pLexCurrent); @@ -4240,7 +4262,6 @@ BOOL Style_StrGetCharSet(LPCWSTR lpszStyle, int* i) return TRUE; } } - *i = DEFAULT_CHARSET; return FALSE; } @@ -4313,11 +4334,11 @@ BOOL Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize) //============================================================================= // -// Style_GetWeightValue() +// Style_StrGetWeightValue() // -int Style_GetWeightValue(LPCWSTR lpszWeight) +BOOL Style_StrGetWeightValue(LPCWSTR lpszWeight, int* i) { - int iFontWeight = FW_NORMAL; + int iFontWeight = -1; if (StrStrI(lpszWeight, L"thin")) iFontWeight = FW_THIN; @@ -4338,7 +4359,10 @@ int Style_GetWeightValue(LPCWSTR lpszWeight) else if (StrStrI(lpszWeight, L"heavy")) iFontWeight = FW_HEAVY; - return iFontWeight; + if (iFontWeight >= 0) { + *i = iFontWeight; + } + return ((iFontWeight < 0) ? FALSE : TRUE); } //============================================================================= @@ -4458,7 +4482,6 @@ BOOL Style_StrGetCase(LPCWSTR lpszStyle, int* i) return TRUE; } } - //*i = SC_CASE_MIXED; return FALSE; } @@ -4683,13 +4706,13 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, WCHAR wchFontName[64] = { L'\0' }; if (!Style_StrGetFont(lpszStyle, wchFontName, COUNTOF(wchFontName))) { - if (!Style_StrGetFont(lexDefault.Styles[DEFAULTLEX(STY_DEFAULT)].szValue, wchFontName, COUNTOF(wchFontName))) + if (!Style_StrGetFont(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, wchFontName, COUNTOF(wchFontName))) { Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); } } - int iCharSet = DEFAULT_CHARSET; + int iCharSet = iDefaultCharSet; if (!Style_StrGetCharSet(lpszStyle, &iCharSet)) { iCharSet = iDefaultCharSet; } @@ -4710,7 +4733,10 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, ReleaseDC(hwnd, hdc); } - int iFontWeight = Style_GetWeightValue(lpszStyle); + int iFontWeight = FW_NORMAL; + if (!Style_StrGetWeightValue(lpszStyle, &iFontWeight)) { + iFontWeight = FW_NORMAL; + } BOOL bIsItalic = (StrStrI(lpszStyle, L"italic")) ? TRUE : FALSE; BOOL bIsUnderline = (StrStrI(lpszStyle, L"underline")) ? TRUE : FALSE; BOOL bIsStrikeout = (StrStrI(lpszStyle, L"strikeout")) ? TRUE : FALSE; @@ -4989,6 +5015,8 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle) { WCHAR tch[64] = { L'\0' }; + if (lstrlen(lpszStyle) == 0) { return; } + // Font if (Style_StrGetFont(lpszStyle, tch, COUNTOF(tch))) { if (lstrlen(tch) > 0) { @@ -4999,7 +5027,7 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle) } // Size values are relative to iBaseFontSize - int iValue = (pLexCurrent == &lexDefault) ? FIXED_BASE_FONT_SIZE : iBaseFontSize; + int iValue = (pLexCurrent == &lexStandard) ? FIXED_BASE_FONT_SIZE : iBaseFontSize; if (Style_StrGetSize(lpszStyle, &iValue)) { SendMessage(hwnd, SCI_STYLESETSIZE, iStyle, (LPARAM)iValue); @@ -5015,12 +5043,9 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle) if (Style_StrGetColor(FALSE,lpszStyle,&iValue)) SendMessage(hwnd,SCI_STYLESETBACK,iStyle,(LPARAM)iValue); - //// Bold - //if (StrStrI(lpszStyle,L"bold") != NULL) - // SendMessage(hwnd,SCI_STYLESETBOLD,iStyle,(LPARAM)TRUE); - // Weight - SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)Style_GetWeightValue(lpszStyle)); + if (Style_StrGetWeightValue(lpszStyle,&iValue)) + SendMessage(hwnd, SCI_STYLESETWEIGHT, iStyle, (LPARAM)iValue); // Italic if (StrStrI(lpszStyle, L"italic")) diff --git a/src/Styles.h b/src/Styles.h index ef040e52b..8c0b4a26b 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -106,7 +106,7 @@ void Style_ConfigDlg(HWND); INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND,UINT,WPARAM,LPARAM); void Style_SelectLexerDlg(HWND); int Style_GetHotspotStyleID(); -int Style_GetWeightValue(LPCWSTR); +int Style_StrGetWeightValue(LPCWSTR,int*); void Style_AppendWeightStr(LPWSTR, int, int); #endif //_NP3_STYLES_H_ From 76475761ffdfa8f60dee783fc880282b20038d47 Mon Sep 17 00:00:00 2001 From: Derick Payne Date: Thu, 21 Dec 2017 00:10:00 +0200 Subject: [PATCH 13/18] Licensing update - Included Scintilla license. - Included Onigmo license. --- Build/License.txt | 33 +++++++++++++++++++++++++----- License.txt | 52 +++++++++++++++++++++++++---------------------- 2 files changed, 56 insertions(+), 29 deletions(-) diff --git a/Build/License.txt b/Build/License.txt index 58055c1cf..f7f6b1038 100644 --- a/Build/License.txt +++ b/Build/License.txt @@ -1,12 +1,35 @@ -Notepad3 and MiniPath Copyright © 2008-2016 Rizonesoft, All rights reserved. -https://rizonesoft.com +Notepad3 and MiniPath Copyright © 2008-2016 Rizonesoft, All rights reserved. +https://www.rizonesoft.com Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of Florian Balmer nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================== +License for Scintilla and SciTE +================================================== +Copyright 1998-2002 by Neil Hodgson + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +================================================== +License for Onigmo (Oniguruma-mod) RegEx Engine +================================================== +Copyright (c) 2002-2009 K.Kosako +Copyright (c) 2011-2014 K.Takata +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/License.txt b/License.txt index 86452245d..f7f6b1038 100644 --- a/License.txt +++ b/License.txt @@ -1,31 +1,35 @@ -Notepad3 and MiniPath Copyright © 2008-2016 Rizonesoft, All rights reserved. +Notepad3 and MiniPath Copyright © 2008-2016 Rizonesoft, All rights reserved. https://www.rizonesoft.com -Notepad2 and metapath Copyright © 2004-2011 Florian Balmer -Notepad2-mod Copyright © 2010-2014 All contributors, see Readme.txt +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of Florian Balmer nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. +================================================== +License for Scintilla and SciTE +================================================== +Copyright 1998-2002 by Neil Hodgson -3. Neither the name of Florian Balmer nor the names of its contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. +All Rights Reserved -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +================================================== +License for Onigmo (Oniguruma-mod) RegEx Engine +================================================== +Copyright (c) 2002-2009 K.Kosako +Copyright (c) 2011-2014 K.Takata +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 3251101e6141b8a70191fa67d066fe9b5a4f6986 Mon Sep 17 00:00:00 2001 From: Derick Payne Date: Thu, 21 Dec 2017 00:37:08 +0200 Subject: [PATCH 14/18] Contributors update --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Notepad3.rc | Bin 184822 -> 184864 bytes src/VersionEx.h | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index cec645708..72c2a20c9 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -749 +761 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 03ccbd509..ca71571ce 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 diff --git a/src/Notepad3.rc b/src/Notepad3.rc index fec46b2edec395c9c50b6457132187fa1456dcf7..f548e960111dfc274c85aebd66db11a4ac1f7ca2 100644 GIT binary patch delta 243 zcmeyin0vtz?hOZ6rcXP`G;jI>E+)R_0@m#Xtc+hcJ#`oq7=joQ88R927*ZLEfIM%8 ze1;MrOa+Q$0NH6k2vX$?lm)3v2a19CJ`5fV@eIB|UMWK{L+bQeen#Wz_xKr2BK5## z6a!Uf17#H$G#LDWW`T5;0?jC8$OX!1g3a(|&|?Szt4jphn24e_7pNDa$`9z4Ooki= rh3T958MUVi2rwq_gIwSO)a}Ah33B)JjRK64?Vkh~w|^2~VmSx^1)nt% delta 223 zcmZ3mg!|iK?hOZ6CST*((451%J%^R?3#X(4g9bwoLncENLq0snYE?8$OLkLh;2tyG=B10vECW8)x z0)q>K9uQXoO)LWPG#HYBbR|Op$Yij52v}Z^!2_r#4{U25SY0VlMFvo;7)U}?1_61Q k4BkK+JV0(^Vo00LxQ$VI`UP%Awsspq#_cwOOivB~0A{N(EdT%j diff --git a/src/VersionEx.h b/src/VersionEx.h index ad7f75d87..a8e0f3f00 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -5,7 +5,7 @@ // ////////////////////////////////////////////////////////// #define VERSION_MAJOR 3 #define VERSION_MINOR 17 -#define VERSION_REV 1216 -#define VERSION_BUILD 749 +#define VERSION_REV 1221 +#define VERSION_BUILD 761 #define SCINTILLA_VER 402 #define ONIGMO_REGEX_VER 6.1.3 From 4f40d004a763ec4f2d46af9b5d64b18ff2221b5d Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 21 Dec 2017 13:46:30 +0100 Subject: [PATCH 15/18] + fix: some more bugs regarding standard lexer handling --- src/Notepad3.c | 3 +- src/Styles.c | 639 ++++++++++++++++++++++++++----------------------- src/Styles.h | 3 + 3 files changed, 345 insertions(+), 300 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index be7d63fad..f21e98e5c 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1160,8 +1160,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam) // update Scintilla colors case WM_SYSCOLORCHANGE: { - extern PEDITLEXER pLexCurrent; - Style_SetLexer(hwndEdit,pLexCurrent); + Style_SetLexer(hwndEdit,NULL); // uses current lexer UpdateLineNumberWidth(); return DefWindowProc(hwnd,umsg,wParam,lParam); } diff --git a/src/Styles.c b/src/Styles.c index 1c864b5fd..7bce2af92 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -51,8 +51,7 @@ extern BOOL bUseOldStyleBraceMatching; #define MULTI_STYLE(a,b,c,d) ((a)|(b<<8)|(c<<16)|(d<<24)) -#define FIXED_BASE_FONT_SIZE 10 -static int iBaseFontSize = FIXED_BASE_FONT_SIZE; +#define INITIAL_BASE_FONT_SIZE (10) KEYWORDLIST KeyWords_NULL = { @@ -114,9 +113,10 @@ enum LexDefaultStyles { STY_CNT_LAST = 15 // STY_2ND_XXX = STY_XXX + STY_CNT_LAST }; -BOOL bUse2ndDefaultStyle = FALSE; -#define STDLEX(id) ((id) + (bUse2ndDefaultStyle ? STY_CNT_LAST : 0)) +#define STDLEXID(id) ((id) + (Style_GetUse2ndDefault() ? STY_CNT_LAST : 0)) +//~ => Style[STDLEXID(STY_DEFAULT)].iStyle := STYLE_DEFAULT + // ---------------------------------------------------------------------------- @@ -344,7 +344,8 @@ KEYWORDLIST KeyWords_CSS = { EDITLEXER lexCSS = { SCLEX_CSS, 63003, L"CSS Style Sheets", L"css; less; sass; scss", L"", &KeyWords_CSS, { - { SCE_CSS_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_CSS_DEFAULT, 63126, L"CSS Default", L"", L"" }, { SCE_CSS_COMMENT, 63127, L"Comment", L"fore:#646464", L"" }, { SCE_CSS_TAG, 63136, L"HTML Tag", L"bold; fore:#0A246A", L"" }, { SCE_CSS_CLASS, 63194, L"Tag-Class", L"fore:#648000", L"" }, @@ -398,7 +399,8 @@ KEYWORDLIST KeyWords_CPP = { }; EDITLEXER lexCPP = { SCLEX_CPP, 63004, L"C/C++ Source Code", L"c; cpp; cxx; cc; h; hpp; hxx; hh; m; mm; idl; inl; odl", L"", &KeyWords_CPP, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#0A246A", L"" }, @@ -549,7 +551,8 @@ KEYWORDLIST KeyWords_CS = { EDITLEXER lexCS = { SCLEX_CPP, 63005, L"C# Source Code", L"cs", L"", &KeyWords_CS, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"C Default", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#804000", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -578,7 +581,8 @@ KEYWORDLIST KeyWords_RC = { EDITLEXER lexRC = { SCLEX_CPP, 63006, L"Resource Script", L"rc; rc2; rct; rh; r; dlg", L"", &KeyWords_RC, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#0A246A", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -598,7 +602,8 @@ KEYWORDLIST KeyWords_MAK = { EDITLEXER lexMAK = { SCLEX_MAKEFILE, 63007, L"Makefiles", L"mak; make; mk; dsp; msc; msvc", L"", &KeyWords_MAK, { - { SCE_MAKE_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_MAKE_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_MAKE_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { MULTI_STYLE(SCE_MAKE_IDENTIFIER,SCE_MAKE_IDEOL,0,0), 63129, L"Identifier", L"fore:#003CE6", L"" }, { SCE_MAKE_OPERATOR, 63132, L"Operator", L"", L"" }, @@ -618,7 +623,8 @@ KEYWORDLIST KeyWords_VBS = { EDITLEXER lexVBS = { SCLEX_VBSCRIPT, 63008, L"VBScript", L"vbs; dsm", L"", &KeyWords_VBS, { - { SCE_B_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_B_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_B_COMMENT, 63127, L"Comment", L"fore:#808080", L"" }, { SCE_B_KEYWORD, 63128, L"Keyword", L"bold; fore:#B000B0", L"" }, { SCE_B_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -651,7 +657,8 @@ KEYWORDLIST KeyWords_VB = { EDITLEXER lexVB = { SCLEX_VB, 63009, L"Visual Basic", L"vb; bas; frm; cls; ctl; pag; dsr; dob", L"", &KeyWords_VB, { - { SCE_B_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_B_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_B_COMMENT, 63127, L"Comment", L"fore:#808080", L"" }, { SCE_B_KEYWORD, 63128, L"Keyword", L"bold; fore:#B000B0", L"" }, { SCE_B_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -677,7 +684,8 @@ KEYWORDLIST KeyWords_JS = { EDITLEXER lexJS = { SCLEX_CPP, 63010, L"JavaScript", L"js; jse; jsm; as", L"", &KeyWords_JS, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#646464", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#A46000", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -699,7 +707,8 @@ KEYWORDLIST KeyWords_JSON = { EDITLEXER lexJSON = { SCLEX_JSON, 63029, L"JSON", L"json; eslintrc; jshintrc; jsonld", L"", &KeyWords_JSON, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#646464", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#A46000", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -751,7 +760,8 @@ KEYWORDLIST KeyWords_JAVA = { EDITLEXER lexJAVA = { SCLEX_CPP, 63011, L"Java Source Code", L"java", L"", &KeyWords_JAVA, { - { SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_C_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_C_COMMENT, 63127, L"Comment", L"fore:#646464", L"" }, { SCE_C_WORD, 63128, L"Keyword", L"bold; fore:#A46000", L"" }, { SCE_C_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -777,7 +787,8 @@ KEYWORDLIST KeyWords_PAS = { EDITLEXER lexPAS = { SCLEX_PASCAL, 63012, L"Pascal Source Code", L"pas; dpr; dpk; dfm; inc; pp", L"", &KeyWords_PAS, { - { SCE_PAS_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_PAS_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_PAS_COMMENT,SCE_PAS_COMMENT2,SCE_PAS_COMMENTLINE,0), 63127, L"Comment", L"fore:#646464", L"" }, { SCE_PAS_WORD, 63128, L"Keyword", L"bold; fore:#800080", L"" }, { SCE_PAS_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -880,7 +891,8 @@ KEYWORDLIST KeyWords_ASM = { EDITLEXER lexASM = { SCLEX_ASM, 63013, L"Assembly Script", L"asm", L"", &KeyWords_ASM, { - { SCE_ASM_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_ASM_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_ASM_COMMENT,SCE_ASM_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_ASM_IDENTIFIER, 63129, L"Identifier", L"", L"" }, { MULTI_STYLE(SCE_ASM_STRING,SCE_ASM_CHARACTER,SCE_ASM_STRINGEOL,0), 63131, L"String", L"fore:#008000", L"" }, @@ -920,7 +932,8 @@ KEYWORDLIST KeyWords_PL = { EDITLEXER lexPL = { SCLEX_PERL, 63014, L"Perl Script", L"pl; pm; cgi; pod", L"", &KeyWords_PL, { - { SCE_PL_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_PL_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_PL_COMMENTLINE, 63127, L"Comment", L"fore:#646464", L"" }, { SCE_PL_WORD, 63128, L"Keyword", L"bold; fore:#804000", L"" }, { SCE_PL_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -962,7 +975,8 @@ KEYWORDLIST KeyWords_PROPS = { EDITLEXER lexPROPS = { SCLEX_PROPERTIES, 63015, L"Configuration Files", L"ini; inf; cfg; properties; oem; sif; url; sed; theme", L"", &KeyWords_PROPS, { - { SCE_PROPS_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_PROPS_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_PROPS_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_PROPS_SECTION, 63232, L"Section", L"fore:#000000; back:#FF8040; bold; eolfilled", L"" }, { SCE_PROPS_ASSIGNMENT, 63233, L"Assignment", L"fore:#FF0000", L"" }, @@ -985,7 +999,8 @@ KEYWORDLIST KeyWords_BAT = { EDITLEXER lexBAT = { SCLEX_BATCH, 63016, L"Batch Files", L"bat; cmd", L"", &KeyWords_BAT, { - { SCE_BAT_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_BAT_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_BAT_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_BAT_WORD, 63128, L"Keyword", L"bold; fore:#0A246A", L"" }, { SCE_BAT_IDENTIFIER, 63129, L"Identifier", L"fore:#003CE6; back:#FFF1A8", L"" }, @@ -1000,7 +1015,8 @@ KEYWORDLIST KeyWords_DIFF = { EDITLEXER lexDIFF = { SCLEX_DIFF, 63017, L"Diff Files", L"diff; patch", L"", &KeyWords_DIFF, { - { SCE_DIFF_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_DIFF_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_DIFF_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_DIFF_COMMAND, 63236, L"Command", L"bold; fore:#0A246A", L"" }, { SCE_DIFF_HEADER, 63238, L"Source and Destination", L"fore:#C80000; back:#FFF1A8; eolfilled", L"" }, @@ -1038,7 +1054,8 @@ KEYWORDLIST KeyWords_SQL = { EDITLEXER lexSQL = { SCLEX_SQL, 63018, L"SQL Query", L"sql", L"", &KeyWords_SQL, { - { SCE_SQL_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_SQL_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_SQL_COMMENT, 63127, L"Comment", L"fore:#505050", L"" }, { SCE_SQL_WORD, 63128, L"Keyword", L"bold; fore:#800080", L"" }, { MULTI_STYLE(SCE_SQL_STRING,SCE_SQL_CHARACTER,0,0), 63131, L"String", L"fore:#008000; back:#FFF1A8", L"" }, @@ -1057,7 +1074,8 @@ KEYWORDLIST KeyWords_PY = { EDITLEXER lexPY = { SCLEX_PYTHON, 63019, L"Python Script", L"py; pyw", L"", &KeyWords_PY, { - { SCE_P_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_P_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_P_COMMENTLINE,SCE_P_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#880000", L"" }, { SCE_P_WORD, 63128, L"Keyword", L"fore:#000088", L"" }, { SCE_P_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -1186,7 +1204,8 @@ KEYWORDLIST KeyWords_CONF = { EDITLEXER lexCONF = { SCLEX_CONF, 63020, L"Apache Config Files", L"conf; htaccess", L"", &KeyWords_CONF, { - { SCE_CONF_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_CONF_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_CONF_COMMENT, 63127, L"Comment", L"fore:#648000", L"" }, { SCE_CONF_STRING, 63131, L"String", L"fore:#B000B0", L"" }, { SCE_CONF_NUMBER, 63130, L"Number", L"fore:#FF4000", L"" }, @@ -1256,7 +1275,8 @@ KEYWORDLIST KeyWords_PS = { EDITLEXER lexPS = { SCLEX_POWERSHELL, 63021, L"PowerShell Script", L"ps1; psd1; psm1", L"", &KeyWords_PS, { - { SCE_POWERSHELL_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_POWERSHELL_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_POWERSHELL_COMMENT,SCE_POWERSHELL_COMMENTSTREAM,0,0), 63127, L"Comment", L"fore:#646464", L"" }, { SCE_POWERSHELL_KEYWORD, 63128, L"Keyword", L"bold; fore:#804000", L"" }, { SCE_POWERSHELL_IDENTIFIER, 63129, L"Identifier", L"", L"" }, @@ -1324,7 +1344,8 @@ KEYWORDLIST KeyWords_NSIS = { EDITLEXER lexNSIS = { SCLEX_NSIS, 63030, L"NSIS Script", L"nsi; nsh", L"", &KeyWords_NSIS, { - { SCE_NSIS_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //,{ SCE_NSIS_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_NSIS_COMMENT,SCE_NSIS_COMMENTBOX,0,0), 63127, L"Comment", L"fore:#008000", L"" }, { MULTI_STYLE(SCE_NSIS_STRINGDQ,SCE_NSIS_STRINGLQ,SCE_NSIS_STRINGRQ,0), 63131, L"String", L"fore:#666666; back:#EEEEEE", L"" }, { SCE_NSIS_FUNCTION, 63277, L"Function", L"fore:#0033CC", L"" }, @@ -1381,7 +1402,8 @@ KEYWORDLIST KeyWords_INNO = { EDITLEXER lexINNO = { SCLEX_INNOSETUP, 63031, L"Inno Setup Script", L"iss; isl; islu", L"", &KeyWords_INNO, { - { SCE_INNO_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_INNO_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_INNO_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_INNO_KEYWORD, 63128, L"Keyword", L"fore:#0000FF", L"" }, { SCE_INNO_PARAMETER, 63294, L"Parameter", L"fore:#0000FF", L"" }, @@ -1403,23 +1425,24 @@ KEYWORDLIST KeyWords_RUBY = { "", "", "", "", "", "", "", "" }; EDITLEXER lexRUBY = { SCLEX_RUBY, 63032, L"Ruby Script", L"rb; ruby; rbw; rake; rjs; Rakefile; gemspec", L"", &KeyWords_RUBY, { - { SCE_RB_DEFAULT, 63126, L"Default", L"", L"" }, - { MULTI_STYLE(SCE_RB_COMMENTLINE,SCE_P_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#008000", L"" }, - { SCE_RB_WORD, 63128, L"Keyword", L"fore:#00007F", L"" }, - { SCE_RB_IDENTIFIER, 63129, L"Identifier", L"", L"" }, - { SCE_RB_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, - { SCE_RB_OPERATOR, 63132, L"Operator", L"", L"" }, - { MULTI_STYLE(SCE_RB_STRING,SCE_RB_CHARACTER,SCE_P_STRINGEOL,0), 63131, L"String", L"fore:#FF8000", L"" }, - { SCE_RB_CLASSNAME, 63246, L"Class name", L"fore:#0000FF", L"" }, - { SCE_RB_DEFNAME, 63247, L"Function name", L"fore:#007F7F", L"" }, - { SCE_RB_POD, 63314, L"POD", L"fore:#004000; back:#C0FFC0; eolfilled", L"" }, - { SCE_RB_REGEX, 63315, L"Regex", L"fore:#000000; back:#A0FFA0", L"" }, - { SCE_RB_SYMBOL, 63316, L"Symbol", L"fore:#C0A030", L"" }, - { SCE_RB_MODULE_NAME, 63317, L"Module name", L"fore:#A000A0", L"" }, - { SCE_RB_INSTANCE_VAR, 63318, L"Instance Var", L"fore:#B00080", L"" }, - { SCE_RB_CLASS_VAR, 63319, L"Class Var", L"fore:#8000B0", L"" }, - { SCE_RB_DATASECTION, 63320, L"Data Section", L"fore:#600000; back:#FFF0D8; eolfilled", L"" }, - { -1, 00000, L"", L"", L"" } } }; + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_RB_DEFAULT, 63126, L"Default", L"", L"" }, + { MULTI_STYLE(SCE_RB_COMMENTLINE,SCE_P_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#008000", L"" }, + { SCE_RB_WORD, 63128, L"Keyword", L"fore:#00007F", L"" }, + { SCE_RB_IDENTIFIER, 63129, L"Identifier", L"", L"" }, + { SCE_RB_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, + { SCE_RB_OPERATOR, 63132, L"Operator", L"", L"" }, + { MULTI_STYLE(SCE_RB_STRING,SCE_RB_CHARACTER,SCE_P_STRINGEOL,0), 63131, L"String", L"fore:#FF8000", L"" }, + { SCE_RB_CLASSNAME, 63246, L"Class name", L"fore:#0000FF", L"" }, + { SCE_RB_DEFNAME, 63247, L"Function name", L"fore:#007F7F", L"" }, + { SCE_RB_POD, 63314, L"POD", L"fore:#004000; back:#C0FFC0; eolfilled", L"" }, + { SCE_RB_REGEX, 63315, L"Regex", L"fore:#000000; back:#A0FFA0", L"" }, + { SCE_RB_SYMBOL, 63316, L"Symbol", L"fore:#C0A030", L"" }, + { SCE_RB_MODULE_NAME, 63317, L"Module name", L"fore:#A000A0", L"" }, + { SCE_RB_INSTANCE_VAR, 63318, L"Instance Var", L"fore:#B00080", L"" }, + { SCE_RB_CLASS_VAR, 63319, L"Class Var", L"fore:#8000B0", L"" }, + { SCE_RB_DATASECTION, 63320, L"Data Section", L"fore:#600000; back:#FFF0D8; eolfilled", L"" }, + { -1, 00000, L"", L"", L"" } } }; KEYWORDLIST KeyWords_LUA = { @@ -1452,7 +1475,8 @@ KEYWORDLIST KeyWords_LUA = { EDITLEXER lexLUA = { SCLEX_LUA, 63033, L"Lua Script", L"lua", L"", &KeyWords_LUA, { - { SCE_LUA_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_LUA_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_LUA_COMMENT,SCE_LUA_COMMENTLINE,SCE_LUA_COMMENTDOC,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_LUA_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, { SCE_LUA_WORD, 63128, L"Keyword", L"fore:#00007F", L"" }, @@ -1486,7 +1510,8 @@ KEYWORDLIST KeyWords_BASH = { EDITLEXER lexBASH = { SCLEX_BASH, 63026, L"Shell Script", L"sh", L"", &KeyWords_BASH, { - { SCE_SH_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_SH_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_SH_ERROR, 63261, L"Error", L"", L"" }, { SCE_SH_COMMENTLINE, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_SH_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, @@ -1534,7 +1559,8 @@ KEYWORDLIST KeyWords_TCL = { EDITLEXER lexTCL = { SCLEX_TCL, 63034, L"Tcl Script", L"tcl; itcl", L"", &KeyWords_TCL, { - { SCE_TCL_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_TCL_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_TCL__MULTI_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_TCL__MULTI_KEYWORD, 63128, L"Keyword", L"fore:#0000FF", L"" }, { SCE_TCL_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, @@ -2193,7 +2219,8 @@ KEYWORDLIST KeyWords_AU3 = { EDITLEXER lexAU3 = { SCLEX_AU3, 63035, L"AutoIt3 Script", L"au3", L"", &KeyWords_AU3, { - { SCE_AU3_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_AU3_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_AU3_COMMENT,SCE_AU3_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_AU3_NUMBER, 63130, L"Number", L"fore:#008080", L"" }, { SCE_AU3_FUNCTION, 63277, L"Function", L"fore:#0000FF", L"" }, @@ -2210,7 +2237,8 @@ EDITLEXER lexAU3 = { SCLEX_AU3, 63035, L"AutoIt3 Script", L"au3", L"", &KeyWords EDITLEXER lexLATEX = { SCLEX_LATEX, 63036, L"LaTeX Files", L"tex; latex; sty", L"", &KeyWords_NULL, { - { SCE_L_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_L_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_L_COMMAND,SCE_L_SHORTCMD,SCE_L_CMDOPT,0), 63236, L"Command", L"fore:#0000FF", L"" }, { MULTI_STYLE(SCE_L_COMMENT,SCE_L_COMMENT2,0,0), 63127, L"Comment", L"fore:#008000", L"" }, { MULTI_STYLE(SCE_L_MATH,SCE_L_MATH2,0,0), 63283, L"Math", L"fore:#FF0000", L"" }, @@ -2336,7 +2364,8 @@ KEYWORDLIST KeyWords_AHK = { EDITLEXER lexAHK = { SCLEX_AHK, 63037, L"AutoHotkey Script", L"ahk; ia; scriptlet", L"", &KeyWords_AHK, { - { SCE_AHK_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_AHK_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_AHK_COMMENTLINE,SCE_AHK_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_AHK_ESCAPE, 63306, L"Escape", L"fore:#FF8000", L"" }, { SCE_AHK_SYNOPERATOR, 63307, L"Syntax Operator", L"fore:#7F200F", L"" }, @@ -2389,7 +2418,8 @@ KEYWORDLIST KeyWords_CMAKE = { EDITLEXER lexCmake = { SCLEX_CMAKE, 63038, L"Cmake Script", L"cmake; ctest", L"", &KeyWords_CMAKE, { - { SCE_CMAKE_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_CMAKE_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_CMAKE_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { MULTI_STYLE(SCE_CMAKE_STRINGDQ,SCE_CMAKE_STRINGLQ,SCE_CMAKE_STRINGRQ,0), 63131, L"String", L"back:#EEEEEE; fore:#7F007F", L"" }, { SCE_CMAKE_COMMANDS, 63277, L"Function", L"fore:#00007F", L"" }, @@ -2481,7 +2511,8 @@ KEYWORDLIST KeyWords_AVS = { EDITLEXER lexAVS = { SCLEX_AVS, 63039, L"AviSynth Script", L"avs; avsi", L"", &KeyWords_AVS, { - { SCE_AVS_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_AVS_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_AVS_COMMENTLINE,SCE_AVS_COMMENTBLOCK,SCE_AVS_COMMENTBLOCKN,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_AVS_OPERATOR, 63132, L"Operator", L"", L"" }, { MULTI_STYLE(SCE_AVS_STRING,SCE_AVS_TRIPLESTRING,0,0), 63131, L"String", L"fore:#7F007F", L"" }, @@ -2500,7 +2531,8 @@ KEYWORDLIST KeyWords_MARKDOWN = { EDITLEXER lexMARKDOWN = { SCLEX_MARKDOWN, 63040, L"Markdown", L"md; markdown; mdown; mkdn; mkd", L"", &KeyWords_MARKDOWN, { - { SCE_MARKDOWN_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_MARKDOWN_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_MARKDOWN_LINE_BEGIN, 63338, L"Line Begin", L"", L"" }, { MULTI_STYLE(SCE_MARKDOWN_STRONG1,SCE_MARKDOWN_STRONG2,0,0), 63339, L"Strong", L"bold", L"" }, { MULTI_STYLE(SCE_MARKDOWN_EM1,SCE_MARKDOWN_EM2,0,0), 63340, L"Emphasis", L"italic", L"" }, @@ -2525,7 +2557,8 @@ KEYWORDLIST KeyWords_YAML = { "y n yes no on off true false", "", "", "", "", "", "", "", "" }; EDITLEXER lexYAML = { SCLEX_YAML, 63041, L"YAML", L"yaml; yml", L"", &KeyWords_YAML, { - { SCE_YAML_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_YAML_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_YAML_COMMENT, 63127, L"Comment", L"fore:#008800", L"" }, { SCE_YAML_IDENTIFIER, 63129, L"Identifier", L"bold; fore:#0A246A", L"" }, { SCE_YAML_KEYWORD, 63128, L"Keyword", L"fore:#880088", L"" }, @@ -2556,7 +2589,8 @@ KEYWORDLIST KeyWords_VHDL = { "", "", "" }; EDITLEXER lexVHDL = { SCLEX_VHDL, 63028, L"VHDL", L"vhdl; vhd", L"", &KeyWords_VHDL, { - { SCE_VHDL_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_VHDL_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_VHDL_COMMENTLINEBANG, SCE_VHDL_COMMENT, SCE_VHDL_BLOCK_COMMENT, 0), 63127, L"Comment", L"fore:#008800", L"" }, { SCE_VHDL_NUMBER, 63130, L"Number", L"fore:#FF0000", L"" }, { MULTI_STYLE(SCE_VHDL_STRING, SCE_VHDL_STRINGEOL, 0, 0), 63131, L"String", L"fore:#008000", L"" }, @@ -2575,7 +2609,8 @@ KEYWORDLIST KeyWords_Registry = { "", "", "", "", "", "", "", "", "" }; EDITLEXER lexRegistry = { SCLEX_REGISTRY, 63027, L"Registry Files", L"reg", L"", &KeyWords_Registry, { - { SCE_REG_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_REG_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_REG_COMMENT, 63127, L"Comment", L"fore:#008800", L"" }, { SCE_REG_VALUENAME, 63376, L"Value Name", L"", L"" }, { MULTI_STYLE(SCE_REG_STRING,SCE_REG_STRING_GUID,0,0), 63131, L"String", L"fore:#008000", L"" }, @@ -2595,7 +2630,8 @@ KEYWORDLIST KeyWords_COFFEESCRIPT = { EDITLEXER lexCOFFEESCRIPT = { SCLEX_COFFEESCRIPT, 63042, L"Coffeescript", L"coffee; Cakefile", L"", &KeyWords_COFFEESCRIPT, { - { SCE_COFFEESCRIPT_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_COFFEESCRIPT_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_COFFEESCRIPT_COMMENT,SCE_COFFEESCRIPT_COMMENTLINE,SCE_COFFEESCRIPT_COMMENTDOC,SCE_COFFEESCRIPT_COMMENTBLOCK), 63127, L"Comment", L"fore:#646464", L"" }, { MULTI_STYLE(SCE_COFFEESCRIPT_STRING,SCE_COFFEESCRIPT_STRINGEOL,SCE_COFFEESCRIPT_STRINGRAW,0), 63131, L"String", L"fore:#008000", L"" }, { SCE_COFFEESCRIPT_PREPROCESSOR, 63133, L"Preprocessor", L"fore:#FF8000", L"" }, @@ -2618,7 +2654,8 @@ KEYWORDLIST KeyWords_MATLAB = { EDITLEXER lexMATLAB = { SCLEX_MATLAB, 63043, L"MATLAB", L"matlab", L"", &KeyWords_MATLAB, { - { SCE_MATLAB_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_MATLAB_DEFAULT, 63126, L"Default", L"", L"" }, { SCE_MATLAB_COMMENT, 63127, L"Comment", L"fore:#008000", L"" }, { SCE_MATLAB_COMMAND, 63236, L"Command", L"bold", L"" }, { SCE_MATLAB_NUMBER, 63130, L"Number", L"fore:#FF8000", L"" }, @@ -2659,7 +2696,8 @@ KEYWORDLIST KeyWords_D = { EDITLEXER lexD = { SCLEX_D, 63022, L"D Source Code", L"d; dd; di", L"", &KeyWords_D, { - { SCE_D_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_D_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_D_COMMENT,SCE_D_COMMENTLINE,SCE_D_COMMENTNESTED,0), 63127, L"Comment", L"fore:#008000", L"" }, { SCE_D_COMMENTDOC, 63259, L"Comment Doc", L"fore:#040A0", L"" }, { SCE_D_NUMBER, 63130, L"Number", L"fore:#FF0000", L"" }, @@ -2702,7 +2740,8 @@ KEYWORDLIST KeyWords_Go = { EDITLEXER lexGo = { SCLEX_D, 63023, L"Go Source Code", L"go", L"", &KeyWords_Go,{ - { SCE_D_DEFAULT, 63126, L"Default", L"", L"" }, + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_D_DEFAULT, 63126, L"Default", L"", L"" }, { MULTI_STYLE(SCE_D_COMMENT,SCE_D_COMMENTLINE,SCE_D_COMMENTNESTED,0), 63127, L"Comment", L"fore:#008000", L"" }, //{ SCE_D_COMMENTDOC, 63259, L"Comment Doc", L"fore:#040A0", L"" }, { SCE_D_NUMBER, 63130, L"Number", L"fore:#FF0000", L"" }, @@ -2743,21 +2782,22 @@ KEYWORDLIST KeyWords_Awk = { EDITLEXER lexAwk = { SCLEX_PYTHON, 63024, L"Awk Script", L"awk", L"", &KeyWords_Awk,{ - { SCE_P_DEFAULT, 63126, L"Default", L"", L"" }, - { SCE_P_WORD, 63128, L"Keyword", L"bold; fore:#0000A0", L"" }, - { SCE_P_WORD2, 63260, L"Keyword 2nd", L"bold; italic; fore:#6666FF", L"" }, - { SCE_P_IDENTIFIER, 63129, L"Identifier", L"", L"" }, - { MULTI_STYLE(SCE_P_COMMENTLINE,SCE_P_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#808080", L"" }, - { MULTI_STYLE(SCE_P_STRING,SCE_P_STRINGEOL,SCE_P_CHARACTER,0), 63131, L"String", L"fore:#008000", L"" }, - { SCE_P_NUMBER, 63130, L"Number", L"fore:#C04000", L"" }, - { SCE_P_OPERATOR, 63132, L"Operator", L"fore:#B000B0", L"" }, - { -1, 00000, L"", L"", L"" } } }; + { STYLE_DEFAULT, 63126, L"Default", L"", L"" }, + //{ SCE_P_DEFAULT, 63126, L"Default", L"", L"" }, + { SCE_P_WORD, 63128, L"Keyword", L"bold; fore:#0000A0", L"" }, + { SCE_P_WORD2, 63260, L"Keyword 2nd", L"bold; italic; fore:#6666FF", L"" }, + { SCE_P_IDENTIFIER, 63129, L"Identifier", L"", L"" }, + { MULTI_STYLE(SCE_P_COMMENTLINE,SCE_P_COMMENTBLOCK,0,0), 63127, L"Comment", L"fore:#808080", L"" }, + { MULTI_STYLE(SCE_P_STRING,SCE_P_STRINGEOL,SCE_P_CHARACTER,0), 63131, L"String", L"fore:#008000", L"" }, + { SCE_P_NUMBER, 63130, L"Number", L"fore:#C04000", L"" }, + { SCE_P_OPERATOR, 63132, L"Operator", L"fore:#B000B0", L"" }, + { -1, 00000, L"", L"", L"" } } }; // This array holds all the lexers... // Don't forget to change the number of the lexer for HTML and XML // in Notepad2.c ParseCommandLine() if you change this array! -PEDITLEXER pLexArray[NUMLEXERS] = +static PEDITLEXER pLexArray[NUMLEXERS] = { &lexStandard, // Default Text &lexANSI, // ANSI Files @@ -2807,15 +2847,17 @@ PEDITLEXER pLexArray[NUMLEXERS] = // Currently used lexer -int iDefaultLexer = 0; -PEDITLEXER pLexCurrent = &lexStandard; +static int g_iDefaultLexer = 0; +static PEDITLEXER g_pLexCurrent = &lexStandard; // pLexArray[g_iDefaultLexer]; + +static BOOL g_fStylesModified = FALSE; +static BOOL g_fWarnedNoIniFile = FALSE; + +static COLORREF g_colorCustom[16]; +static BOOL g_bAutoSelect; +static int g_cxStyleSelectDlg; +static int g_cyStyleSelectDlg; -COLORREF crCustom[16]; -BOOL fStylesModified = FALSE; -BOOL fWarnedNoIniFile = FALSE; -BOOL bAutoSelect; -int cxStyleSelectDlg; -int cyStyleSelectDlg; extern int iDefaultCharSet; extern BOOL bHiliteCurrentLine; @@ -2850,22 +2892,22 @@ void Style_Load() int cchIniSection = (int)LocalSize(pIniSection)/sizeof(WCHAR); // Custom colors - crCustom [0] = RGB(0x00,0x00,0x00); - crCustom [1] = RGB(0x0A,0x24,0x6A); - crCustom [2] = RGB(0x3A,0x6E,0xA5); - crCustom [3] = RGB(0x00,0x3C,0xE6); - crCustom [4] = RGB(0x00,0x66,0x33); - crCustom [5] = RGB(0x60,0x80,0x20); - crCustom [6] = RGB(0x64,0x80,0x00); - crCustom [7] = RGB(0xA4,0x60,0x00); - crCustom [8] = RGB(0xFF,0xFF,0xFF); - crCustom [9] = RGB(0xFF,0xFF,0xE2); - crCustom[10] = RGB(0xFF,0xF1,0xA8); - crCustom[11] = RGB(0xFF,0xC0,0x00); - crCustom[12] = RGB(0xFF,0x40,0x00); - crCustom[13] = RGB(0xC8,0x00,0x00); - crCustom[14] = RGB(0xB0,0x00,0xB0); - crCustom[15] = RGB(0xB2,0x8B,0x40); + g_colorCustom [0] = RGB(0x00,0x00,0x00); + g_colorCustom [1] = RGB(0x0A,0x24,0x6A); + g_colorCustom [2] = RGB(0x3A,0x6E,0xA5); + g_colorCustom [3] = RGB(0x00,0x3C,0xE6); + g_colorCustom [4] = RGB(0x00,0x66,0x33); + g_colorCustom [5] = RGB(0x60,0x80,0x20); + g_colorCustom [6] = RGB(0x64,0x80,0x00); + g_colorCustom [7] = RGB(0xA4,0x60,0x00); + g_colorCustom [8] = RGB(0xFF,0xFF,0xFF); + g_colorCustom [9] = RGB(0xFF,0xFF,0xE2); + g_colorCustom[10] = RGB(0xFF,0xF1,0xA8); + g_colorCustom[11] = RGB(0xFF,0xC0,0x00); + g_colorCustom[12] = RGB(0xFF,0x40,0x00); + g_colorCustom[13] = RGB(0xC8,0x00,0x00); + g_colorCustom[14] = RGB(0xB0,0x00,0xB0); + g_colorCustom[15] = RGB(0xB2,0x8B,0x40); LoadIniSection(L"Custom Colors",pIniSection,cchIniSection); for (i = 0; i < 16; i++) { @@ -2876,28 +2918,29 @@ void Style_Load() int irgb; int itok = swscanf_s(CharNext(wch),L"%x",&irgb); if (itok == 1) - crCustom[i] = RGB((irgb&0xFF0000) >> 16,(irgb&0xFF00) >> 8,irgb&0xFF); + g_colorCustom[i] = RGB((irgb&0xFF0000) >> 16,(irgb&0xFF00) >> 8,irgb&0xFF); } } } LoadIniSection(L"Styles",pIniSection,cchIniSection); + // 2nd default - bUse2ndDefaultStyle = (IniSectionGetInt(pIniSection,L"Use2ndDefaultStyle",0)) ? TRUE : FALSE; + Style_SetUse2ndDefault(IniSectionGetBool(pIniSection, L"Use2ndDefaultStyle", 0)); // default scheme - iDefaultLexer = IniSectionGetInt(pIniSection,L"DefaultScheme",0); - iDefaultLexer = min(max(iDefaultLexer,0),COUNTOF(pLexArray)-1); + g_iDefaultLexer = IniSectionGetInt(pIniSection,L"DefaultScheme",0); + g_iDefaultLexer = min(max(g_iDefaultLexer,0),COUNTOF(pLexArray)-1); // auto select - bAutoSelect = (IniSectionGetInt(pIniSection,L"AutoSelect",1)) ? 1 : 0; + g_bAutoSelect = (IniSectionGetInt(pIniSection,L"AutoSelect",1)) ? 1 : 0; // scheme select dlg dimensions - cxStyleSelectDlg = IniSectionGetInt(pIniSection,L"SelectDlgSizeX",304); - cxStyleSelectDlg = max(cxStyleSelectDlg,0); + g_cxStyleSelectDlg = IniSectionGetInt(pIniSection,L"SelectDlgSizeX",304); + g_cxStyleSelectDlg = max(g_cxStyleSelectDlg,0); - cyStyleSelectDlg = IniSectionGetInt(pIniSection,L"SelectDlgSizeY",0); - cyStyleSelectDlg = max(cyStyleSelectDlg,324); + g_cyStyleSelectDlg = IniSectionGetInt(pIniSection,L"SelectDlgSizeY",0); + g_cyStyleSelectDlg = max(g_cyStyleSelectDlg,324); for (iLexer = 0; iLexer < COUNTOF(pLexArray); iLexer++) { LoadIniSection(pLexArray[iLexer]->pszName,pIniSection,cchIniSection); @@ -2932,29 +2975,29 @@ void Style_Save() WCHAR wch[32] = { L'\0' }; StringCchPrintf(tch,COUNTOF(tch),L"%02i",i+1); StringCchPrintf(wch,COUNTOF(wch),L"#%02X%02X%02X", - (int)GetRValue(crCustom[i]),(int)GetGValue(crCustom[i]),(int)GetBValue(crCustom[i])); + (int)GetRValue(g_colorCustom[i]),(int)GetGValue(g_colorCustom[i]),(int)GetBValue(g_colorCustom[i])); IniSectionSetString(pIniSection,tch,wch); } SaveIniSection(L"Custom Colors",pIniSection); ZeroMemory(pIniSection,LocalSize(pIniSection)); // auto select - IniSectionSetInt(pIniSection,L"Use2ndDefaultStyle",bUse2ndDefaultStyle); + IniSectionSetBool(pIniSection,L"Use2ndDefaultStyle",Style_GetUse2ndDefault()); // default scheme - IniSectionSetInt(pIniSection,L"DefaultScheme",iDefaultLexer); + IniSectionSetInt(pIniSection,L"DefaultScheme",g_iDefaultLexer); // auto select - IniSectionSetInt(pIniSection,L"AutoSelect",bAutoSelect); + IniSectionSetInt(pIniSection,L"AutoSelect",g_bAutoSelect); // scheme select dlg dimensions - IniSectionSetInt(pIniSection,L"SelectDlgSizeX",cxStyleSelectDlg); - IniSectionSetInt(pIniSection,L"SelectDlgSizeY",cyStyleSelectDlg); + IniSectionSetInt(pIniSection,L"SelectDlgSizeX",g_cxStyleSelectDlg); + IniSectionSetInt(pIniSection,L"SelectDlgSizeY",g_cyStyleSelectDlg); SaveIniSection(L"Styles",pIniSection); ZeroMemory(pIniSection,LocalSize(pIniSection)); - if (!fStylesModified) { + if (!g_fStylesModified) { LocalFree(pIniSection); return; } @@ -3084,13 +3127,15 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WCHAR wchFontName[64] = { '\0' }; WCHAR wchCaretStyle[64] = { L'\0' }; - // Select default if NULL is specified - if (!pLexNew) - pLexNew = pLexArray[iDefaultLexer]; + // Select current if NULL is specified + if (!pLexNew) { + pLexNew = g_pLexCurrent; // initially current lexer is default lexer + } - // Lexer + // Lexer SendMessage(hwnd, SCI_SETLEXER, pLexNew->iLexer, 0); + // Lexer very specific styles if (pLexNew->iLexer == SCLEX_XML) SendMessage(hwnd, SCI_SETPROPERTY, (WPARAM)"lexer.xml.allow.scripts", (LPARAM)"1"); if (pLexNew->iLexer == SCLEX_CPP) { @@ -3125,12 +3170,15 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SciCall_SetProperty("fold.cpp.comment.explicit", "0"); // Add KeyWord Lists - for (int i = 0; i < (KEYWORDSET_MAX + 1); i++) + for (int i = 0; i < (KEYWORDSET_MAX + 1); i++) { SendMessage(hwnd, SCI_SETKEYWORDS, i, (LPARAM)pLexNew->pKeyWords->pszKeyWords[i]); + } - // Use 2nd default style - int iDefaultStyle = lexStandard.Styles[STDLEX(STY_DEFAULT)].iStyle; - WCHAR* wchStandardStyleStrg = lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue; + + // first set standard lexer's default values + g_pLexCurrent = &lexStandard; + + WCHAR* wchStandardStyleStrg = lexStandard.Styles[STDLEXID(STY_DEFAULT)].szValue; // Clear SendMessage(hwnd, SCI_CLEARDOCUMENTSTYLE, 0, 0); @@ -3156,7 +3204,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { Style_SetFontQuality(hwnd, wchStandardStyleStrg); - SendMessage(hwnd, SCI_STYLESETVISIBLE, iDefaultStyle, (LPARAM)TRUE); + SendMessage(hwnd, SCI_STYLESETVISIBLE, STYLE_DEFAULT, (LPARAM)TRUE); SendMessage(hwnd, SCI_STYLESETHOTSPOT, STYLE_DEFAULT, (LPARAM)FALSE); // default hotspot off @@ -3168,79 +3216,85 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { char chFontName[64] = { '\0' }; Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); WideCharToMultiByteStrg(CP_UTF8, wchFontName, chFontName); - SendMessage(hwnd, SCI_STYLESETFONT, iDefaultStyle, (LPARAM)chFontName); + SendMessage(hwnd, SCI_STYLESETFONT, STYLE_DEFAULT, (LPARAM)chFontName); } - iBaseFontSize = FIXED_BASE_FONT_SIZE; - if (!Style_StrGetSize(wchStandardStyleStrg, &iBaseFontSize)) { - SendMessage(hwnd, SCI_STYLESETSIZE, iDefaultStyle, (LPARAM)iBaseFontSize); // base size - } - + int iBaseFontSize = INITIAL_BASE_FONT_SIZE; // init + Style_StrGetSize(wchStandardStyleStrg, &iBaseFontSize); + Style_SetBaseFontSize(hwnd, iBaseFontSize); // apply + + if (!Style_StrGetCharSet(wchStandardStyleStrg, &iValue)) { - SendMessage(hwnd, SCI_STYLESETCHARACTERSET, iDefaultStyle, (LPARAM)DEFAULT_CHARSET); + SendMessage(hwnd, SCI_STYLESETCHARACTERSET, STYLE_DEFAULT, (LPARAM)DEFAULT_CHARSET); } if (!Style_StrGetWeightValue(wchStandardStyleStrg, &iValue)) { - SendMessage(hwnd, SCI_STYLESETWEIGHT, iDefaultStyle, (LPARAM)FW_NORMAL); + SendMessage(hwnd, SCI_STYLESETWEIGHT, STYLE_DEFAULT, (LPARAM)FW_NORMAL); } if (!Style_StrGetCase(wchStandardStyleStrg, &iValue)) { - SendMessage(hwnd, SCI_STYLESETCASE, iDefaultStyle, (LPARAM)SC_CASE_MIXED); + SendMessage(hwnd, SCI_STYLESETCASE, STYLE_DEFAULT, (LPARAM)SC_CASE_MIXED); } if (!StrStrI(wchStandardStyleStrg, L"italic")) - SendMessage(hwnd, SCI_STYLESETITALIC, iDefaultStyle, (LPARAM)FALSE); + SendMessage(hwnd, SCI_STYLESETITALIC, STYLE_DEFAULT, (LPARAM)FALSE); if (!StrStrI(wchStandardStyleStrg, L"underline")) - SendMessage(hwnd, SCI_STYLESETUNDERLINE, iDefaultStyle, (LPARAM)FALSE); + SendMessage(hwnd, SCI_STYLESETUNDERLINE, STYLE_DEFAULT, (LPARAM)FALSE); if (!StrStrI(wchStandardStyleStrg, L"eolfilled")) - SendMessage(hwnd, SCI_STYLESETEOLFILLED, iDefaultStyle, (LPARAM)FALSE); + SendMessage(hwnd, SCI_STYLESETEOLFILLED, STYLE_DEFAULT, (LPARAM)FALSE); - Style_SetStyles(hwnd, iDefaultStyle, wchStandardStyleStrg); // apply default style + // --- apply default style --- + Style_SetStyles(hwnd, STYLE_DEFAULT, wchStandardStyleStrg); // --- apply current scheme specific settings to default style --- - if (pLexNew != &lexStandard) { - Style_SetStyles(hwnd, iDefaultStyle, pLexNew->Styles[STY_DEFAULT].szValue); + + // global define current lexer + g_pLexCurrent = pLexNew; + + if (g_pLexCurrent != &lexStandard) { + Style_SetStyles(hwnd, STYLE_DEFAULT, g_pLexCurrent->Styles[STY_DEFAULT].szValue); } - // Broadcast STYLE_DEFAULT to all styles + // Broadcast STYLE_DEFAULT as base style to all other style SendMessage(hwnd, SCI_STYLECLEARALL, 0, 0); + // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- - Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_MARGIN)].iStyle, - lexStandard.Styles[STDLEX(STY_MARGIN)].szValue); // linenumber + Style_SetStyles(hwnd, lexStandard.Styles[STDLEXID(STY_MARGIN)].iStyle, + lexStandard.Styles[STDLEXID(STY_MARGIN)].szValue); // linenumber if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_BRACE_OK)].iStyle, - lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue); // brace light + Style_SetStyles(hwnd, lexStandard.Styles[STDLEXID(STY_BRACE_OK)].iStyle, + lexStandard.Styles[STDLEXID(STY_BRACE_OK)].szValue); // brace light } else { - if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_BRACE_OK)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_BRACE_OK)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, iValue); - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_OK)].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_BRACE_OK)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MATCH_BRACE, iValue); } if (bUseOldStyleBraceMatching) { - Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_BRACE_BAD)].iStyle, - lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue); // brace bad + Style_SetStyles(hwnd, lexStandard.Styles[STDLEXID(STY_BRACE_BAD)].iStyle, + lexStandard.Styles[STDLEXID(STY_BRACE_BAD)].szValue); // brace bad } else { - if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue)) + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_BRACE_BAD)].szValue, &iValue)) SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_BRACE_BAD)].szValue, &iValue, TRUE)) SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_BAD_BRACE, iValue); - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BRACE_BAD)].szValue, &iValue, FALSE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_BRACE_BAD)].szValue, &iValue, FALSE)) SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, iValue); } // Occurrences Marker - if (!Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue)) + if (!Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, &iValue)) { WCHAR* sty = L""; switch (iMarkOccurrences) { @@ -3258,39 +3312,39 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { iValue = RGB(0x00, 0xFF, 0x00); break; } - StringCchCopyW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), sty); + StringCchCopyW(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), sty); } SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue, TRUE)) { + if (!Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, &iValue, TRUE)) { iValue = 100; - StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha:100"); + StringCchCatW(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha:100"); } SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); - if (!Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, &iValue, FALSE)) { + if (!Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, &iValue, FALSE)) { iValue = 100; - StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha2:100"); + StringCchCatW(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; alpha2:100"); } SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, iValue); iValue = -1; // need for retrieval - if (!Style_GetIndicatorType(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, 0, &iValue)) { + if (!Style_GetIndicatorType(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, 0, &iValue)) { // got default, get string - StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; "); + StringCchCatW(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), L"; "); Style_GetIndicatorType(wchCaretStyle, COUNTOF(wchCaretStyle), &iValue); - StringCchCatW(lexStandard.Styles[STDLEX(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), wchCaretStyle); + StringCchCatW(lexStandard.Styles[STDLEXID(STY_MARK_OCC)].szValue, COUNTOF(lexStandard.Styles[0].szValue), wchCaretStyle); } SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MARK_OCCURANCE, iValue); // More default values... if (pLexNew != &lexANSI) - Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_CTRL_CHR)].iStyle, lexStandard.Styles[STDLEX(STY_CTRL_CHR)].szValue); // control char + Style_SetStyles(hwnd, lexStandard.Styles[STDLEXID(STY_CTRL_CHR)].iStyle, lexStandard.Styles[STDLEXID(STY_CTRL_CHR)].szValue); // control char - Style_SetStyles(hwnd, lexStandard.Styles[STDLEX(STY_INDENT_GUIDE)].iStyle, lexStandard.Styles[STDLEX(STY_INDENT_GUIDE)].szValue); // indent guide + Style_SetStyles(hwnd, lexStandard.Styles[STDLEXID(STY_INDENT_GUIDE)].iStyle, lexStandard.Styles[STDLEXID(STY_INDENT_GUIDE)].szValue); // indent guide - if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &rgb)) { // selection fore + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_SEL_TXT)].szValue, &rgb)) { // selection fore SendMessage(hwnd, SCI_SETSELFORE, TRUE, rgb); SendMessage(hwnd, SCI_SETADDITIONALSELFORE, rgb, 0); } @@ -3299,7 +3353,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELFORE, 0, 0); } - if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &iValue)) { // selection back + if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEXID(STY_SEL_TXT)].szValue, &iValue)) { // selection back SendMessage(hwnd, SCI_SETSELBACK, TRUE, iValue); SendMessage(hwnd, SCI_SETADDITIONALSELBACK, iValue, 0); } @@ -3308,7 +3362,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELBACK, RGB(0xC0, 0xC0, 0xC0), 0); } - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, &iValue, TRUE)) { // selection alpha + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_SEL_TXT)].szValue, &iValue, TRUE)) { // selection alpha SendMessage(hwnd, SCI_SETSELALPHA, iValue, 0); SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, iValue, 0); } @@ -3317,41 +3371,41 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, SC_ALPHA_NOALPHA, 0); } - if (StrStrI(lexStandard.Styles[STDLEX(STY_SEL_TXT)].szValue, L"eolfilled")) // selection eolfilled + if (StrStrI(lexStandard.Styles[STDLEXID(STY_SEL_TXT)].szValue, L"eolfilled")) // selection eolfilled SendMessage(hwnd, SCI_SETSELEOLFILLED, 1, 0); else SendMessage(hwnd, SCI_SETSELEOLFILLED, 0, 0); - if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace fore + if (Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, &rgb)) // whitespace fore SendMessage(hwnd, SCI_SETWHITESPACEFORE, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEFORE, 0, 0); - if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &rgb)) // whitespace back + if (Style_StrGetColor(FALSE, lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, &rgb)) // whitespace back SendMessage(hwnd, SCI_SETWHITESPACEBACK, TRUE, rgb); else SendMessage(hwnd, SCI_SETWHITESPACEBACK, 0, 0); // use a default value... // whitespace dot size iValue = 1; - if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, &iValue)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, &iValue)) { WCHAR tch[32] = { L'\0' }; WCHAR wchStyle[BUFSIZE_STYLE_VALUE]; - StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue)); + StringCchCopyN(wchStyle, COUNTOF(wchStyle), lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue)); iValue = max(min(iValue, 5), 0); - StringCchPrintf(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), L"size:%i", iValue); + StringCchPrintf(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue), L"size:%i", iValue); if (Style_StrGetColor(TRUE, wchStyle, &rgb)) { StringCchPrintf(tch, COUNTOF(tch), L"; fore:#%02X%02X%02X", (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), tch); + StringCchCat(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue), tch); } if (Style_StrGetColor(FALSE, wchStyle, &rgb)) { @@ -3359,8 +3413,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); - StringCchCat(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue, - COUNTOF(lexStandard.Styles[STDLEX(STY_WHITESPACE)].szValue), tch); + StringCchCat(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue, + COUNTOF(lexStandard.Styles[STDLEXID(STY_WHITESPACE)].szValue), tch); } } SendMessage(hwnd, SCI_SETWHITESPACESIZE, iValue, 0); @@ -3373,7 +3427,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // caret style and width - if (StrStr(lexStandard.Styles[STDLEX(STY_CARET)].szValue,L"block")) { + if (StrStr(lexStandard.Styles[STDLEXID(STY_CARET)].szValue,L"block")) { SendMessage(hwnd,SCI_SETCARETSTYLE,CARETSTYLE_BLOCK,0); StringCchCopy(wchCaretStyle,COUNTOF(wchCaretStyle),L"block"); } @@ -3382,14 +3436,14 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { WCHAR wch[32] = { L'\0' }; iValue = 1; // default caret width - if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_CARET)].szValue,&iValue)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEXID(STY_CARET)].szValue,&iValue)) { iValue = max(min(iValue,3),1); StringCchPrintf(wch,COUNTOF(wch),L"size:%i",iValue); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),wch); } SendMessage(hwnd,SCI_SETCARETWIDTH,iValue,0); } - if (StrStr(lexStandard.Styles[STDLEX(STY_CARET)].szValue,L"noblink")) { + if (StrStr(lexStandard.Styles[STDLEXID(STY_CARET)].szValue,L"noblink")) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)0,0); StringCchCat(wchCaretStyle,COUNTOF(wchCaretStyle),L"; noblink"); } @@ -3397,7 +3451,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETCARETPERIOD,(WPARAM)GetCaretBlinkTime(),0); // caret fore - if (!Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_CARET)].szValue,&rgb)) + if (!Style_StrGetColor(TRUE,lexStandard.Styles[STDLEXID(STY_CARET)].szValue,&rgb)) rgb = GetSysColor(COLOR_WINDOWTEXT); else { WCHAR wch[32] = { L'\0' }; @@ -3414,17 +3468,17 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { SendMessage(hwnd,SCI_SETADDITIONALCARETFORE,rgb,0); StrTrimW(wchCaretStyle, L" ;"); - StringCchCopy(lexStandard.Styles[STDLEX(STY_CARET)].szValue, - COUNTOF(lexStandard.Styles[STDLEX(STY_CARET)].szValue),wchCaretStyle); + StringCchCopy(lexStandard.Styles[STDLEXID(STY_CARET)].szValue, + COUNTOF(lexStandard.Styles[STDLEXID(STY_CARET)].szValue),wchCaretStyle); if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore + if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEXID(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEXID(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3432,12 +3486,12 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // Extra Line Spacing iValue = 0; - if (Style_StrGetSize(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue,&iValue) && (pLexNew != &lexANSI)) { + if (Style_StrGetSize(lexStandard.Styles[STDLEXID(STY_X_LN_SPACE)].szValue,&iValue) && (pLexNew != &lexANSI)) { int iAscent = 0; int iDescent = 0; int iValAdj = min(max(iValue,0),64); if (iValAdj != iValue) - StringCchPrintf(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue, COUNTOF(lexStandard.Styles[STDLEX(STY_X_LN_SPACE)].szValue), L"size:%i", iValAdj); + StringCchPrintf(lexStandard.Styles[STDLEXID(STY_X_LN_SPACE)].szValue, COUNTOF(lexStandard.Styles[STDLEXID(STY_X_LN_SPACE)].szValue), L"size:%i", iValAdj); if ((iValAdj % 2) != 0) { iAscent++; @@ -3595,10 +3649,6 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // update UI for hotspots Style_SetUrlHotSpot(hwnd, bHyperlinkHotspot); EditUpdateUrlHotspots(hwnd, 0, SciCall_GetTextLength(), bHyperlinkHotspot); - - // Save current lexer - pLexCurrent = pLexNew; - } @@ -3608,7 +3658,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) { // int Style_GetHotspotStyleID() { - return (STYLE_LASTPREDEFINED + STDLEX(STY_URL_HOTSPOT)); + return (STYLE_LASTPREDEFINED + STDLEXID(STY_URL_HOTSPOT)); } @@ -3623,7 +3673,7 @@ void Style_SetUrlHotSpot(HWND hwnd, BOOL bHotSpot) if (bHotSpot) { - const WCHAR* lpszStyleHotSpot = lexStandard.Styles[STDLEX(STY_URL_HOTSPOT)].szValue; + const WCHAR* lpszStyleHotSpot = lexStandard.Styles[STDLEXID(STY_URL_HOTSPOT)].szValue; SendMessage(hwnd, SCI_STYLESETHOTSPOT, iStyleHotSpot, (LPARAM)TRUE); SendMessage(hwnd, SCI_SETHOTSPOTSINGLELINE, TRUE, 0); @@ -3666,13 +3716,13 @@ void Style_SetLongLineColors(HWND hwnd) if (SendMessage(hwnd,SCI_GETEDGEMODE,0,0) == EDGE_LINE) { - if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore + if (Style_StrGetColor(TRUE,lexStandard.Styles[STDLEXID(STY_LONG_LN_MRK)].szValue,&rgb)) // edge fore SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); } else { - if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEXID(STY_LONG_LN_MRK)].szValue,&rgb)) // edge back SendMessage(hwnd,SCI_SETEDGECOLOUR,rgb,0); else SendMessage(hwnd,SCI_SETEDGECOLOUR,GetSysColor(COLOR_3DLIGHT),0); @@ -3689,13 +3739,13 @@ void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) if (bHiLitCurrLn) { int rgb = 0; - if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEX(STY_CUR_LN_BCK)].szValue, &rgb)) // caret line back + if (Style_StrGetColor(FALSE,lexStandard.Styles[STDLEXID(STY_CUR_LN_BCK)].szValue, &rgb)) // caret line back { SendMessage(hwnd,SCI_SETCARETLINEVISIBLE,TRUE,0); SendMessage(hwnd,SCI_SETCARETLINEBACK,rgb,0); int alpha = 0; - if (Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_CUR_LN_BCK)].szValue, &alpha, TRUE)) + if (Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_CUR_LN_BCK)].szValue, &alpha, TRUE)) SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,alpha,0); else SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,SC_ALPHA_NOALPHA,0); @@ -3715,19 +3765,19 @@ void Style_SetCurrentLineBackground(HWND hwnd, BOOL bHiLitCurrLn) void Style_SetCurrentMargin(HWND hwnd, BOOL bShowSelMargin) { int alpha = 20; - Style_StrGetAlpha(lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &alpha, TRUE); + Style_StrGetAlpha(lexStandard.Styles[STDLEXID(STY_BOOK_MARK)].szValue, &alpha, TRUE); int rgbFore = RGB(0xFF, 0, 0); // red - Style_StrGetColor(TRUE, lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &rgbFore); + Style_StrGetColor(TRUE, lexStandard.Styles[STDLEXID(STY_BOOK_MARK)].szValue, &rgbFore); int rgbBack = RGB(0, 0xFF, 0); // green - Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_BOOK_MARK)].szValue, &rgbBack); + Style_StrGetColor(FALSE, lexStandard.Styles[STDLEXID(STY_BOOK_MARK)].szValue, &rgbBack); // adjust background color by alpha in case of show margin if (bShowSelMargin) { //int bckgrnd = (int)SendMessage(hwnd, SCI_GETMARGINBACKN, MARGIN_NP3_BOOKMRK, 0); int bckgrnd = RGB(0xF0, 0xF0, 0xF0); - Style_StrGetColor(FALSE, lexStandard.Styles[STDLEX(STY_MARGIN)].szValue, &bckgrnd); + Style_StrGetColor(FALSE, lexStandard.Styles[STDLEXID(STY_MARGIN)].szValue, &bckgrnd); rgbBack = Style_RgbAlpha(rgbBack, bckgrnd, min(0xFF, alpha + 50)); } SendMessage(hwnd, SCI_MARKERSETFORE, MARKER_NP3_BOOKMARK, rgbFore); @@ -3855,7 +3905,7 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile) { LPWSTR lpszExt = PathFindExtension(lpszFile); BOOL bFound = FALSE; - PEDITLEXER pLexNew = pLexArray[iDefaultLexer]; + PEDITLEXER pLexNew = pLexArray[g_iDefaultLexer]; PEDITLEXER pLexSniffed; if ((fvCurFile.mask & FV_MODE) && fvCurFile.tchMode[0]) { @@ -3898,7 +3948,7 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile) } } - if (!bFound && bAutoSelect && /* bAutoSelect == FALSE skips lexer search */ + if (!bFound && g_bAutoSelect && /* g_bAutoSelect == FALSE skips lexer search */ (lpszFile && StringCchLen(lpszFile,MAX_PATH) > 0 && *lpszExt)) { if (*lpszExt == L'.') ++lpszExt; @@ -3929,25 +3979,25 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile) } } - if (!bFound && bAutoSelect && + if (!bFound && g_bAutoSelect && StringCchCompareIX(PathFindFileName(lpszFile),L"makefile") == 0) { pLexNew = &lexMAK; bFound = TRUE; } - if (!bFound && bAutoSelect && + if (!bFound && g_bAutoSelect && StringCchCompareIX(PathFindFileName(lpszFile),L"rakefile") == 0) { pLexNew = &lexRUBY; bFound = TRUE; } - if (!bFound && bAutoSelect && + if (!bFound && g_bAutoSelect && StringCchCompareIX(PathFindFileName(lpszFile),L"mozconfig") == 0) { pLexNew = &lexBASH; bFound = TRUE; } - if (!bFound && bAutoSelect && (!fNoHTMLGuess || !fNoCGIGuess)) { + if (!bFound && g_bAutoSelect && (!fNoHTMLGuess || !fNoCGIGuess)) { char tchText[512]; SendMessage(hwnd,SCI_GETTEXT,(WPARAM)COUNTOF(tchText)-1,(LPARAM)tchText); StrTrimA(tchText," \t\n\r"); @@ -4002,7 +4052,7 @@ void Style_SetLexerFromName(HWND hwnd,LPCWSTR lpszFile,LPCWSTR lpszName) // void Style_SetDefaultLexer(HWND hwnd) { - Style_SetLexer(hwnd, pLexArray[iDefaultLexer]); + Style_SetLexer(hwnd, pLexArray[g_iDefaultLexer]); } @@ -4044,8 +4094,9 @@ void Style_SetLexerFromID(HWND hwnd,int id) // void Style_ToggleUse2ndDefault(HWND hwnd) { - bUse2ndDefaultStyle = (bUse2ndDefaultStyle) ? FALSE : TRUE; - Style_SetLexer(hwnd,pLexCurrent); + BOOL use2ndDefStyle = Style_GetUse2ndDefault(); + Style_SetUse2ndDefault(use2ndDefStyle ? FALSE : TRUE); // swap + Style_SetLexer(hwnd,g_pLexCurrent); } @@ -4058,84 +4109,66 @@ void Style_SetDefaultFont(HWND hwnd, BOOL bGlobalDefault) { WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - int iStyle = STY_DEFAULT; - PEDITLEXER pLexer = pLexCurrent; - - if (bGlobalDefault || (pLexCurrent == &lexStandard)) { - iStyle = STDLEX(STY_DEFAULT); - pLexer = &lexStandard; - bGlobalDefault = TRUE; - } + PEDITLEXER pLexer = bGlobalDefault ? &lexStandard : g_pLexCurrent; - StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[iStyle].szValue); + StringCchCopyW(newStyle, COUNTOF(newStyle), pLexer->Styles[STY_DEFAULT].szValue); if (Style_SelectFont(hwnd, newStyle, COUNTOF(newStyle), bGlobalDefault, FALSE, TRUE)) { // set new styles to current lexer's default text - StringCchCopyW(pLexer->Styles[iStyle].szValue, COUNTOF(pLexer->Styles[iStyle].szValue), newStyle); - fStylesModified = TRUE; + StringCchCopyW(pLexer->Styles[STY_DEFAULT].szValue, COUNTOF(pLexer->Styles[STY_DEFAULT].szValue), newStyle); + g_fStylesModified = TRUE; // redraw current(!) lexer - Style_SetLexer(hwnd, pLexCurrent); + Style_SetLexer(hwnd, g_pLexCurrent); } } -/* -void Style_SetDefaultFont(HWND hwnd) -{ - WCHAR font[BUFSIZE_STYLE_VALUE] = { L'\0' }; - WCHAR newStyle[BUFSIZE_STYLE_VALUE] = { L'\0' }; - - StringCchCopyW(font, COUNTOF(font), lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue); - - if (Style_SelectFont(hwnd, font, COUNTOF(font), TRUE, FALSE, FALSE)) - { - INT_PTR answer = IDNO; - if (pLexCurrent != &lexStandard) { - answer = InfoBox(MBYESNO, L"MsgApplyDefaultFont", IDS_APPLY_DEFAULT_FONT, pLexCurrent->pszName); - } - switch (answer) - { - case IDYES: - // build styles string - StringCchCopyW(newStyle, COUNTOF(newStyle), font); - StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - Style_CopyStyles_IfNotDefined(pLexCurrent->Styles[STY_DEFAULT].szValue, newStyle, COUNTOF(newStyle)); - // set new styles to current lexer's default text - StringCchCopyW(pLexCurrent->Styles[STY_DEFAULT].szValue, COUNTOF(pLexCurrent->Styles[STY_DEFAULT].szValue), newStyle); - //break; fall-through - case IDNO: - // build styles string - StringCchCopyW(newStyle, COUNTOF(newStyle), font); - //StringCchCat(newStyle, COUNTOF(newStyle), L"; "); - //~Style_CopyStyles_IfNotDefined(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, newStyle, COUNTOF(newStyle)); - // set new styles to current lexer's default text - StringCchCopyW(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, COUNTOF(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue), newStyle); - // Apply new styles - fStylesModified = TRUE; - Style_SetLexer(hwnd, pLexCurrent); - break; - case IDCANCEL: - default: - // nothing to do - break; - } - } -} -*/ - //============================================================================= // -// Style_GetUse2ndDefault() +// Style_SetUse2ndDefault(), Style_GetUse2ndDefault() // +BOOL Style_SetUse2ndDefault(int value) +{ + static BOOL bUse2ndDefaultStyle = FALSE; + + if ((value == TRUE) || (value == FALSE)) { + bUse2ndDefaultStyle = (BOOL)value; + } + return bUse2ndDefaultStyle; +} + BOOL Style_GetUse2ndDefault() { - return (bUse2ndDefaultStyle); + return Style_SetUse2ndDefault(FALSE - TRUE); } + +//============================================================================= +// +// Style_SetBaseFontSize(), Style_GetBaseFontSize() +// +int Style_SetBaseFontSize(HWND hwnd, int bfSize) +{ + static int iBaseFontSize = INITIAL_BASE_FONT_SIZE; + + if (bfSize >= 0) { + iBaseFontSize = bfSize; + SendMessage(hwnd, SCI_STYLESETSIZE, STYLE_DEFAULT, (LPARAM)iBaseFontSize); + } + return iBaseFontSize; +} + +int Style_GetBaseFontSize(HWND hwnd) +{ + return Style_SetBaseFontSize(hwnd, -1); +} + + + //============================================================================= // // Style_SetIndentGuides() @@ -4678,7 +4711,9 @@ void Style_CopyStyles_IfNotDefined(LPWSTR lpszStyleSrc, LPWSTR lpszStyleDest, in static const WCHAR* FontSelTitle1 = L"Global Default Font"; -static const WCHAR* FontSelTitle2 = L"Current Scheme Default Font"; +static const WCHAR* FontSelTitle2 = L"Current Scheme's Default Font"; +static const WCHAR* FontSelTitle3 = L"++ Global Default Font ++"; +static const WCHAR* FontSelTitle4 = L"++ Current Scheme's Default Font ++"; /// Callback to set the font dialog's title static UINT CALLBACK Style_FontDialogHook( @@ -4706,7 +4741,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, WCHAR wchFontName[64] = { L'\0' }; if (!Style_StrGetFont(lpszStyle, wchFontName, COUNTOF(wchFontName))) { - if (!Style_StrGetFont(lexStandard.Styles[STDLEX(STY_DEFAULT)].szValue, wchFontName, COUNTOF(wchFontName))) + if (!Style_StrGetFont(lexStandard.Styles[STDLEXID(STY_DEFAULT)].szValue, wchFontName, COUNTOF(wchFontName))) { Style_StrGetFont(L"font:Default", wchFontName, COUNTOF(wchFontName)); } @@ -4717,11 +4752,17 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, iCharSet = iDefaultCharSet; } - const int iOrigBFSize = bDefaultStyle ? FIXED_BASE_FONT_SIZE : iBaseFontSize; + int iBaseFontSize = Style_GetBaseFontSize(hwnd); + // except + if (bDefaultStyle) { iBaseFontSize = INITIAL_BASE_FONT_SIZE; } + + int iFontSize = iBaseFontSize; + + // is "size:" definition relative ? BOOL bRelFontSize = (StrStrI(lpszStyle, L"size:+") || StrStrI(lpszStyle, L"size:-")); + // Font Height int iFontHeight = 0; - int iFontSize = iOrigBFSize; if (Style_StrGetSize(lpszStyle,&iFontSize)) { HDC hdc = GetDC(hwnd); iFontHeight = -MulDiv(iFontSize,GetDeviceCaps(hdc,LOGPIXELSY),72); @@ -4729,10 +4770,11 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, } else { HDC hdc = GetDC(hwnd); - iFontHeight = -MulDiv(iOrigBFSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); + iFontHeight = -MulDiv(iBaseFontSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); ReleaseDC(hwnd, hdc); } + // Font Weight int iFontWeight = FW_NORMAL; if (!Style_StrGetWeightValue(lpszStyle, &iFontWeight)) { iFontWeight = FW_NORMAL; @@ -4767,18 +4809,17 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, cf.rgbColors = color; cf.lpLogFont = &lf; cf.lpfnHook = (LPCFHOOKPROC)Style_FontDialogHook; // Register the callback - cf.lCustData = (LPARAM)(bDefaultStyle ? FontSelTitle1 : FontSelTitle2); - + cf.lCustData = (LPARAM)(bDefaultStyle ? (bRelFontSize ? FontSelTitle1 : FontSelTitle1) : (bRelFontSize ? FontSelTitle4 : FontSelTitle2)); //cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_ENABLEHOOK; - if (bWithEffects) cf.Flags |= CF_EFFECTS; - + if (HIBYTE(GetKeyState(VK_SHIFT))) cf.Flags |= CF_FIXEDPITCHONLY; + // --- open systems Font Selection dialog --- if (!ChooseFont(&cf) || (lf.lfFaceName[0] == L'\0')) { return FALSE; } @@ -4816,7 +4857,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, if (bRelFontSize) { - int iNewRelSize = iNewFontSize - iOrigBFSize; + int iNewRelSize = iNewFontSize - iBaseFontSize; if (iNewRelSize >= 0) StringCchPrintfW(newSize, COUNTOF(newSize), L"; size:+%i", iNewRelSize); @@ -4949,7 +4990,7 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bForeGround,LPWSTR lpszStyle,int cchStyle, cc.lStructSize = sizeof(CHOOSECOLOR); cc.hwndOwner = hwnd; cc.rgbResult = iRGBResult; - cc.lpCustColors = crCustom; + cc.lpCustColors = g_colorCustom; cc.Flags = CC_FULLOPEN | CC_RGBINIT | CC_SOLIDCOLOR; if (!ChooseColor(&cc)) @@ -5027,7 +5068,9 @@ void Style_SetStyles(HWND hwnd, int iStyle, LPCWSTR lpszStyle) } // Size values are relative to iBaseFontSize - int iValue = (pLexCurrent == &lexStandard) ? FIXED_BASE_FONT_SIZE : iBaseFontSize; + int iValue = Style_GetBaseFontSize(hwnd); + // except + if (g_pLexCurrent == &lexStandard) { iValue = INITIAL_BASE_FONT_SIZE; } if (Style_StrGetSize(lpszStyle, &iValue)) { SendMessage(hwnd, SCI_STYLESETSIZE, iStyle, (LPARAM)iValue); @@ -5117,8 +5160,8 @@ void Style_SetFontQuality(HWND hwnd,LPCWSTR lpszStyle) { // void Style_GetCurrentLexerName(LPWSTR lpszName,int cchName) { - if (!GetString(pLexCurrent->rid,lpszName,cchName)) - StringCchCopyN(lpszName,cchName,pLexCurrent->pszName,cchName); + if (!GetString(g_pLexCurrent->rid,lpszName,cchName)) + StringCchCopyN(lpszName,cchName,g_pLexCurrent->pszName,cchName); } @@ -5263,7 +5306,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP // Add lexers for (i = 0; i < COUNTOF(pLexArray); i++) { - if (!found && (StringCchCompareX(pLexArray[i]->pszName,pLexCurrent->pszName) == 0)) + if (!found && (StringCchCompareX(pLexArray[i]->pszName,g_pLexCurrent->pszName) == 0)) { found = 1; currentLex = Style_AddLexerToTreeView(hwndTV,pLexArray[i]); @@ -5654,7 +5697,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP if (!GetDlgItemText(hwnd,IDC_STYLEEDIT,pCurrentLexer->szExtensions,COUNTOF(pCurrentLexer->szExtensions))) StringCchCopy(pCurrentLexer->szExtensions,COUNTOF(pCurrentLexer->szExtensions),pCurrentLexer->pszDefExt); } - Style_SetLexer(hwndEdit,pLexCurrent); + Style_SetLexer(hwndEdit,g_pLexCurrent); UpdateLineNumberWidth(); } break; @@ -5726,10 +5769,10 @@ void Style_ConfigDlg(HWND hwnd) } } else { - fStylesModified = TRUE; - if (!fWarnedNoIniFile && (StringCchLenW(szIniFile,COUNTOF(szIniFile)) == 0)) { + g_fStylesModified = TRUE; + if (!g_fWarnedNoIniFile && (StringCchLenW(szIniFile,COUNTOF(szIniFile)) == 0)) { MsgBox(MBWARN,IDS_SETTINGSNOTSAVED); - fWarnedNoIniFile = TRUE; + g_fWarnedNoIniFile = TRUE; } } @@ -5737,7 +5780,7 @@ void Style_ConfigDlg(HWND hwnd) LocalFree(StyleBackup[c]); } // Apply new (or previous) Styles - Style_SetLexer(hwnd,pLexCurrent); + Style_SetLexer(hwnd,g_pLexCurrent); } @@ -5779,11 +5822,11 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR mmiPtMinX = rc.right-rc.left; mmiPtMaxY = rc.bottom-rc.top; - if (cxStyleSelectDlg < (rc.right-rc.left)) - cxStyleSelectDlg = rc.right-rc.left; - if (cyStyleSelectDlg < (rc.bottom-rc.top)) - cyStyleSelectDlg = rc.bottom-rc.top; - SetWindowPos(hwnd,NULL,rc.left,rc.top,cxStyleSelectDlg,cyStyleSelectDlg,SWP_NOZORDER); + if (g_cxStyleSelectDlg < (rc.right-rc.left)) + g_cxStyleSelectDlg = rc.right-rc.left; + if (g_cyStyleSelectDlg < (rc.bottom-rc.top)) + g_cyStyleSelectDlg = rc.bottom-rc.top; + SetWindowPos(hwnd,NULL,rc.left,rc.top,g_cxStyleSelectDlg,g_cyStyleSelectDlg,SWP_NOZORDER); SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|WS_THICKFRAME); SetWindowPos(hwnd,NULL,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED); @@ -5825,18 +5868,18 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR for (i = 0; i < lvItems; i++) { lvi.iItem = i; ListView_GetItem(hwndLV,&lvi);; - if (StringCchCompareX(((PEDITLEXER)lvi.lParam)->pszName,pLexCurrent->pszName) == 0) { + if (StringCchCompareX(((PEDITLEXER)lvi.lParam)->pszName,g_pLexCurrent->pszName) == 0) { ListView_SetItemState(hwndLV,i,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED); ListView_EnsureVisible(hwndLV,i,FALSE); - if (iDefaultLexer == i) { + if (g_iDefaultLexer == i) { CheckDlgButton(hwnd,IDC_DEFAULTSCHEME,BST_CHECKED); } } } - iInternalDefault = iDefaultLexer; + iInternalDefault = g_iDefaultLexer; - if (bAutoSelect) + if (g_bAutoSelect) CheckDlgButton(hwnd,IDC_AUTOSELECT,BST_CHECKED); CenterDlgInParent(hwnd); @@ -5849,8 +5892,8 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR RECT rc; GetWindowRect(hwnd,&rc); - cxStyleSelectDlg = rc.right-rc.left; - cyStyleSelectDlg = rc.bottom-rc.top; + g_cxStyleSelectDlg = rc.right-rc.left; + g_cyStyleSelectDlg = rc.bottom-rc.top; } return FALSE; @@ -5955,9 +5998,9 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR lvi.mask = LVIF_PARAM; lvi.iItem = ListView_GetNextItem(hwndLV,-1,LVNI_ALL | LVNI_SELECTED); if (ListView_GetItem(hwndLV,&lvi)) { - pLexCurrent = (PEDITLEXER)lvi.lParam; - iDefaultLexer = iInternalDefault; - bAutoSelect = (IsDlgButtonChecked(hwnd,IDC_AUTOSELECT) == BST_CHECKED) ? 1 : 0; + g_pLexCurrent = (PEDITLEXER)lvi.lParam; + g_iDefaultLexer = iInternalDefault; + g_bAutoSelect = (IsDlgButtonChecked(hwnd,IDC_AUTOSELECT) == BST_CHECKED) ? 1 : 0; EndDialog(hwnd,IDOK); } } @@ -5989,7 +6032,7 @@ void Style_SelectLexerDlg(HWND hwnd) MAKEINTRESOURCE(IDD_STYLESELECT), GetParent(hwnd),Style_SelectLexerDlgProc,0)) - Style_SetLexer(hwnd,pLexCurrent); + Style_SetLexer(hwnd,g_pLexCurrent); } // End of Styles.c diff --git a/src/Styles.h b/src/Styles.h index 8c0b4a26b..73ec75e08 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -81,6 +81,9 @@ void Style_SetLexerFromID(HWND,int); void Style_SetDefaultFont(HWND,BOOL); void Style_ToggleUse2ndDefault(HWND); BOOL Style_GetUse2ndDefault(); +BOOL Style_SetUse2ndDefault(int); // in:BOOL +int Style_GetBaseFontSize(HWND); +int Style_SetBaseFontSize(HWND,int); void Style_SetIndentGuides(HWND,BOOL); BOOL Style_GetOpenDlgFilterStr(LPWSTR,int); BOOL Style_StrGetFont(LPCWSTR,LPWSTR,int); From 7aee4dca92ef15b78a51152d0d4191b6d781d930 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 21 Dec 2017 14:11:25 +0100 Subject: [PATCH 16/18] +fix: using WYSIWYG fonts (screen vs. printer) --- src/Styles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 7bce2af92..28d55ce0e 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -4810,8 +4810,8 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, cf.lpLogFont = &lf; cf.lpfnHook = (LPCFHOOKPROC)Style_FontDialogHook; // Register the callback cf.lCustData = (LPARAM)(bDefaultStyle ? (bRelFontSize ? FontSelTitle1 : FontSelTitle1) : (bRelFontSize ? FontSelTitle4 : FontSelTitle2)); - //cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; - cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + //cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_ENABLEHOOK; + cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_BOTH | CF_WYSIWYG | CF_FORCEFONTEXIST | CF_ENABLEHOOK; if (bWithEffects) cf.Flags |= CF_EFFECTS; From e8322a3d421f9cf8259c8adabce144bef13f69cd Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Thu, 21 Dec 2017 14:26:10 +0100 Subject: [PATCH 17/18] + fix: resource file (.rc) broken by GitHub merge :-/ --- src/Notepad3.rc | 1950 +++++++++++++++++++++++++++++++++++++++++++++++ src/VersionEx.h | 4 +- 2 files changed, 1952 insertions(+), 2 deletions(-) diff --git a/src/Notepad3.rc b/src/Notepad3.rc index e69de29bb..abcdb2cd8 100644 --- a/src/Notepad3.rc +++ b/src/Notepad3.rc @@ -0,0 +1,1950 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Englisch (USA) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINWND ICON "..\\res\\Notepad3.ico" + +IDI_RUN ICON "..\\res\\Run.ico" + +IDI_STYLES ICON "..\\res\\Styles.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_MAINWND BITMAP "..\\res\\Toolbar.bmp" + +IDB_OPEN BITMAP "..\\res\\Open.bmp" + +IDB_NEXT BITMAP "..\\res\\Next.bmp" + +IDB_PREV BITMAP "..\\res\\Prev.bmp" + +IDB_PICK BITMAP "..\\res\\Pick.bmp" + +IDB_ENCODING BITMAP "..\\res\\Encoding.bmp" + +IDR_MAINWND2 BITMAP "..\\res\\Toolbar2.bmp" + + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_COPY CURSOR "..\\res\\Copy.cur" + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MAINWND MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New\tCtrl+N", IDM_FILE_NEW + MENUITEM "&Open...\tCtrl+O", IDM_FILE_OPEN + MENUITEM "Re&vert\tF5", IDM_FILE_REVERT + MENUITEM "&Save\tCtrl+S", IDM_FILE_SAVE + MENUITEM "Save &As...\tF6", IDM_FILE_SAVEAS + MENUITEM "Save &Copy...\tCtrl+F6", IDM_FILE_SAVECOPY + MENUITEM "&Read Only", IDM_FILE_READONLY + MENUITEM SEPARATOR + MENUITEM "Set Encryption Passphrase", IDM_SETPASS + MENUITEM SEPARATOR + POPUP "&Launch" + BEGIN + MENUITEM "&New Window\tAlt+N", IDM_FILE_NEWWINDOW + MENUITEM "&Empty Window\tAlt+0", IDM_FILE_NEWWINDOW2 + MENUITEM SEPARATOR + MENUITEM "Execute &Document\tCtrl+L", IDM_FILE_LAUNCH + MENUITEM "&Open with...\tAlt+L", IDM_FILE_OPENWITH + MENUITEM "&Command...\tCtrl+R", IDM_FILE_RUN + MENUITEM SEPARATOR + MENUITEM "Web Template &1\tCtrl+Shift+1", CMD_WEBACTION1 + MENUITEM "Web Template &2\tCtrl+Shift+2", CMD_WEBACTION2 + END + MENUITEM SEPARATOR + POPUP "&Encoding" + BEGIN + MENUITEM "&ANSI", IDM_ENCODING_ANSI + MENUITEM "&Unicode", IDM_ENCODING_UNICODE + MENUITEM "Unicode &Big Endian", IDM_ENCODING_UNICODEREV + MENUITEM "UTF-&8\tShift+F8", IDM_ENCODING_UTF8 + MENUITEM "UTF-8 with &Signature", IDM_ENCODING_UTF8SIGN + MENUITEM "&More...\tF9", IDM_ENCODING_SELECT + MENUITEM SEPARATOR + MENUITEM "Recode to &Default\tCtrl-Alt-F", CMD_RECODEDEFAULT + MENUITEM "Recode to &ANSI\tCtrl-Shift+A", CMD_RECODEANSI + MENUITEM "Recode to &OEM\tCtrl+Shift+O", CMD_RECODEOEM + MENUITEM "ASCII as UTF-&8\tCtrl+Shift+F8", CMD_RELOADASCIIASUTF8 + MENUITEM "Ignore Encoding &Tags\tAlt+F8", CMD_RELOADNOFILEVARS + MENUITEM "&Recode...\tF8", IDM_ENCODING_RECODE + MENUITEM SEPARATOR + MENUITEM "Set &Default...", IDM_ENCODING_SETDEFAULT + END + POPUP "Line Endin&gs" + BEGIN + MENUITEM "&Windows (CR+LF)", IDM_LINEENDINGS_CRLF + MENUITEM "&Unix (LF)", IDM_LINEENDINGS_LF + MENUITEM "&Mac (CR)", IDM_LINEENDINGS_CR + MENUITEM SEPARATOR + MENUITEM "&Default...", IDM_LINEENDINGS_SETDEFAULT + END + MENUITEM SEPARATOR + MENUITEM "Page Se&tup...", IDM_FILE_PAGESETUP + MENUITEM "&Print...\tCtrl+P", IDM_FILE_PRINT + MENUITEM SEPARATOR + MENUITEM "Propert&ies...", IDM_FILE_PROPERTIES + MENUITEM "Create &Desktop Link", IDM_FILE_CREATELINK + MENUITEM SEPARATOR + MENUITEM "Browse...\tCtrl+M", IDM_FILE_BROWSE + POPUP "&Favorites" + BEGIN + MENUITEM "&Open Favorites...\tAlt+I", IDM_FILE_OPENFAV + MENUITEM "&Add Current File...\tAlt+K", IDM_FILE_ADDTOFAV + MENUITEM "&Manage...\tAlt+F9", IDM_FILE_MANAGEFAV + END + MENUITEM "Recent (&History)...\tAlt+H", IDM_FILE_RECENT + MENUITEM SEPARATOR + MENUITEM "E&xit\tAlt+F4", IDM_FILE_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Undo\tCtrl+Z", IDM_EDIT_UNDO + MENUITEM "&Redo\tCtrl+Y", IDM_EDIT_REDO + MENUITEM SEPARATOR + MENUITEM "Cu&t\tCtrl+X", IDM_EDIT_CUT + MENUITEM "&Copy\tCtrl+C", IDM_EDIT_COPY + MENUITEM "Copy A&ll\tAlt+C", IDM_EDIT_COPYALL + MENUITEM "Copy &Add\tCtrl+E", IDM_EDIT_COPYADD + MENUITEM "&Paste\tCtrl+V", IDM_EDIT_PASTE + MENUITEM "S&wap\tCtrl+K", IDM_EDIT_SWAP + MENUITEM "Clear\tDel", IDM_EDIT_CLEAR + MENUITEM "Clear Clipboar&d", IDM_EDIT_CLEARCLIPBOARD + MENUITEM "&Select All\tCtrl+A", IDM_EDIT_SELECTALL + MENUITEM SEPARATOR + POPUP "&Words" + BEGIN + MENUITEM "Complete Word\tCtrl+Alt+Enter", IDM_EDIT_COMPLETEWORD + MENUITEM SEPARATOR + MENUITEM "Cursor Word Left\tCtrl+Left", CMD_CTRLLEFT + MENUITEM "Cursor Word Right\tCtrl+Right", CMD_CTRLRIGHT + MENUITEM "Delete Word Left\tCtrl+Back", CMD_CTRLBACK + MENUITEM "Delete Word Right\tCtrl+Del", CMD_CTRLDEL + END + POPUP "L&ines" + BEGIN + MENUITEM "Move &Up\tCtrl+Shift+Up", IDM_EDIT_MOVELINEUP + MENUITEM "&Move Down\tCtrl+Shift+Down", IDM_EDIT_MOVELINEDOWN + MENUITEM SEPARATOR + MENUITEM "&Cut Line\tCtrl+X,Ctrl+Shift+X", IDM_EDIT_CUTLINE + MENUITEM "C&opy Line\tCtrl+C,Ctrl+Shift+C", IDM_EDIT_COPYLINE + MENUITEM "D&elete Line\tCtrl+Shift+D", IDM_EDIT_DELETELINE + MENUITEM "&Duplicate Line\tCtrl+D", IDM_EDIT_DUPLICATELINE + MENUITEM SEPARATOR + MENUITEM "Delete Line Left\tCtrl+Shift+Back", IDM_EDIT_DELETELINELEFT + MENUITEM "Delete Line Right\tCtrl+Shift+Del", IDM_EDIT_DELETELINERIGHT + MENUITEM SEPARATOR + MENUITEM "Column &Wrap...\tCtrl+Shift+W", IDM_EDIT_COLUMNWRAP + MENUITEM "&Split Lines\tCtrl+I", IDM_EDIT_SPLITLINES + MENUITEM "&Join Lines\tCtrl+J", IDM_EDIT_JOINLINES + MENUITEM "Join &Paragraphs\tCtrl+Shift+J", IDM_EDIT_JOINLINESEX + END + POPUP "&Block" + BEGIN + MENUITEM "&Indent\tTab", IDM_EDIT_INDENT + MENUITEM "&Unindent\tShift+Tab", IDM_EDIT_UNINDENT + MENUITEM SEPARATOR + POPUP "&Enclose Selection" + BEGIN + MENUITEM "&Single Quotes\tCtrl+1", CMD_STRINGIFY + MENUITEM "&Double Quotes\tCtrl+2", CMD_STRINGIFY2 + MENUITEM SEPARATOR + MENUITEM "( )\tCtrl+3", CMD_EMBRACE + MENUITEM "[ ]\tCtrl+4", CMD_EMBRACE2 + MENUITEM "{ }\tCtrl+5", CMD_EMBRACE3 + MENUITEM SEPARATOR + MENUITEM "&Backticks\tCtrl+6", CMD_EMBRACE4 + MENUITEM SEPARATOR + MENUITEM "&With...\tAlt+Q", IDM_EDIT_ENCLOSESELECTION + END + MENUITEM "&Duplicate Selection\tAlt+D", IDM_EDIT_SELECTIONDUPLICATE + MENUITEM SEPARATOR + MENUITEM "&Pad With Spaces\tAlt+B", IDM_EDIT_PADWITHSPACES + MENUITEM "Strip &First Character\tAlt+Z", IDM_EDIT_STRIP1STCHAR + MENUITEM "Strip &Last Character\tAlt+U", IDM_EDIT_STRIPLASTCHAR + MENUITEM "Strip &Trailing Blanks\tAlt+W", IDM_EDIT_TRIMLINES + MENUITEM "Compress &Whitespace\tAlt+P", IDM_EDIT_COMPRESSWS + MENUITEM "Merge &Blank Lines\tAlt+Y", IDM_EDIT_MERGEBLANKLINES + MENUITEM "&Remove Blank Lines\tAlt+R", IDM_EDIT_REMOVEBLANKLINES + MENUITEM SEPARATOR + MENUITEM "&Modify Lines...\tAlt+M", IDM_EDIT_MODIFYLINES + MENUITEM "Alig&n Lines...\tAlt+J", IDM_EDIT_ALIGN + MENUITEM "S&ort Lines...\tAlt+O", IDM_EDIT_SORTLINES + END + POPUP "C&onvert" + BEGIN + MENUITEM "&Uppercase\tCtrl+Shift+U", IDM_EDIT_CONVERTUPPERCASE + MENUITEM "&Lowercase\tCtrl+U", IDM_EDIT_CONVERTLOWERCASE + MENUITEM SEPARATOR + MENUITEM "&Invert Case\tCtrl+Alt+U", IDM_EDIT_INVERTCASE + MENUITEM "Title &Case\tCtrl+Alt+I", IDM_EDIT_TITLECASE + MENUITEM "&Sentence Case\tCtrl+Alt+O", IDM_EDIT_SENTENCECASE + MENUITEM SEPARATOR + MENUITEM "&Tabify Selection\tCtrl+Shift+T", IDM_EDIT_CONVERTSPACES + MENUITEM "U&ntabify Selection\tCtrl+Shift+S", IDM_EDIT_CONVERTTABS + MENUITEM SEPARATOR + MENUITEM "Ta&bify Indent\tCtrl+Alt+T", IDM_EDIT_CONVERTSPACES2 + MENUITEM "Untabi&fy Indent\tCtrl+Alt+S", IDM_EDIT_CONVERTTABS2 + END + POPUP "I&nsert" + BEGIN + MENUITEM "&New Line Above\tCtrl+Enter", CMD_CTRLENTER + MENUITEM SEPARATOR + MENUITEM "&HTML/XML Tag...\tAlt+X", IDM_EDIT_INSERT_TAG + MENUITEM SEPARATOR + MENUITEM "&Encoding Identifier\tCtrl+F8", IDM_EDIT_INSERT_ENCODING + MENUITEM SEPARATOR + MENUITEM "Time/Date (&Short Form)\tCtrl+F5", IDM_EDIT_INSERT_SHORTDATE + MENUITEM "Time/Date (&Long Form)\tCtrl+Shift+F5", IDM_EDIT_INSERT_LONGDATE + MENUITEM "Update &Timestamps\tShift+F5", CMD_TIMESTAMPS + MENUITEM SEPARATOR + MENUITEM "&Filename\tCtrl+F9", IDM_EDIT_INSERT_FILENAME + MENUITEM "&Path and Filename\tCtrl+Shift+F9", IDM_EDIT_INSERT_PATHNAME + MENUITEM SEPARATOR + MENUITEM "&GUID\tCtrl+Shift+.", IDM_EDIT_INSERT_GUID + END + POPUP "Spec&ial" + BEGIN + MENUITEM "Line Comment (&Toggle)\tCtrl+Q", IDM_EDIT_LINECOMMENT + MENUITEM "Stream &Comment\tCtrl+Shift+Q", IDM_EDIT_STREAMCOMMENT + MENUITEM SEPARATOR + MENUITEM "URL &Encode\tCtrl+Shift+E", IDM_EDIT_URLENCODE + MENUITEM "URL &Decode\tCtrl+Shift+R", IDM_EDIT_URLDECODE + MENUITEM SEPARATOR + MENUITEM "Esca&pe C Chars\tCtrl+Alt+E", IDM_EDIT_ESCAPECCHARS + MENUITEM "&Unescape C Chars\tCtrl+Alt+R", IDM_EDIT_UNESCAPECCHARS + MENUITEM SEPARATOR + MENUITEM "C&har To Hex\tCtrl+Alt+X", IDM_EDIT_CHAR2HEX + MENUITEM "Hex To Cha&r\tCtrl+Alt+C", IDM_EDIT_HEX2CHAR + MENUITEM SEPARATOR + MENUITEM "&Find Matching Brace\tCtrl+B", IDM_EDIT_FINDMATCHINGBRACE + MENUITEM "&Select To Matching Brace\tCtrl+Shift+B", IDM_EDIT_SELTOMATCHINGBRACE + MENUITEM SEPARATOR + MENUITEM "Select To Ne&xt\tCtrl+Alt+F2", IDM_EDIT_SELTONEXT + MENUITEM "Select To Pre&vious\tCtrl+Alt+Shift+F2", IDM_EDIT_SELTOPREV + END + MENUITEM SEPARATOR + POPUP "Bookmarks" + BEGIN + MENUITEM "Toggle\tCtrl+F2", BME_EDIT_BOOKMARKTOGGLE + MENUITEM SEPARATOR + MENUITEM "Goto Next\tF2", BME_EDIT_BOOKMARKNEXT + MENUITEM "Goto Previous\tShift+F2", BME_EDIT_BOOKMARKPREV + MENUITEM SEPARATOR + MENUITEM "Clear All\tAlt+F2", BME_EDIT_BOOKMARKCLEAR + END + MENUITEM SEPARATOR + MENUITEM "&Find...\tCtrl+F", IDM_EDIT_FIND + MENUITEM "Sa&ve Find Text\tAlt+F3", IDM_EDIT_SAVEFIND + MENUITEM "Find Ne&xt\tF3", IDM_EDIT_FINDNEXT + MENUITEM "Find Pre&vious\tShift+F3", IDM_EDIT_FINDPREV + MENUITEM "R&eplace...\tCtrl+H", IDM_EDIT_REPLACE + MENUITEM "Replace Ne&xt\tF4", IDM_EDIT_REPLACENEXT + MENUITEM "&Goto...\tCtrl+G", IDM_EDIT_GOTOLINE + END + POPUP "&View" + BEGIN + MENUITEM "&Syntax Scheme...\tF12", IDM_VIEW_SCHEME + MENUITEM "&2nd Default Scheme\tShift+F12", IDM_VIEW_USE2NDDEFAULT + MENUITEM "&Customize Schemes...\tCtrl+F12", IDM_VIEW_SCHEMECONFIG + MENUITEM "&Global Default Font...\tAlt+F12", IDM_VIEW_FONT + MENUITEM "Current Scheme's &Default Font...\tCtrl+Alt+F12", IDM_VIEW_CURRENTSCHEME + MENUITEM SEPARATOR + MENUITEM "Word W&rap\tCtrl+W", IDM_VIEW_WORDWRAP + MENUITEM "&Long Line Marker\tCtrl+Shift+L", IDM_VIEW_LONGLINEMARKER + MENUITEM "Indentation &Guides\tCtrl+Shift+G", IDM_VIEW_SHOWINDENTGUIDES + MENUITEM SEPARATOR + MENUITEM "Show &Whitespace\tCtrl+Shift+8", IDM_VIEW_SHOWWHITESPACE + MENUITEM "Show Line &Endings\tCtrl+Shift+9", IDM_VIEW_SHOWEOLS + MENUITEM "Show Wrap S&ymbols\tCtrl+Shift+0", IDM_VIEW_WORDWRAPSYMBOLS + MENUITEM SEPARATOR + MENUITEM "Hyperlink Hotspots\tCtrl+Alt+H", IDM_VIEW_HYPERLINKHOTSPOTS + MENUITEM "Visual &Brace Matching\tCtrl+Shift+V", IDM_VIEW_MATCHBRACES + MENUITEM "Highlight C&urrent Line\tCtrl+Shift+I", IDM_VIEW_HILITECURRENTLINE + POPUP "Mar&k Occurrences" + BEGIN + MENUITEM "&Active", IDM_VIEW_MARKOCCURRENCES_ONOFF + MENUITEM SEPARATOR + MENUITEM "Match &Case", IDM_VIEW_MARKOCCURRENCES_CASE + MENUITEM "Match &Whole Words Only", IDM_VIEW_MARKOCCURRENCES_WORD + END + MENUITEM SEPARATOR + MENUITEM "Line &Numbers\tCtrl+Shift+N", IDM_VIEW_LINENUMBERS + MENUITEM "Selection &Margin\tCtrl+Shift+M", IDM_VIEW_MARGIN + MENUITEM SEPARATOR + MENUITEM "Code &Folding\tCtrl+Shift+Alt+F", IDM_VIEW_FOLDING + MENUITEM "&Toggle All Folds\tCtrl+Shift+F", IDM_VIEW_TOGGLEFOLDS + MENUITEM SEPARATOR + MENUITEM "Zoom &In\tCtrl++", IDM_VIEW_ZOOMIN + MENUITEM "Zoom &Out\tCtrl+-", IDM_VIEW_ZOOMOUT + MENUITEM "Reset &Zoom\tCtrl+0", IDM_VIEW_RESETZOOM + END + POPUP "&Settings" + BEGIN + MENUITEM "Insert Tabs as &Spaces", IDM_VIEW_TABSASSPACES + MENUITEM "&Tab Settings...\tCtrl+T", IDM_VIEW_TABSETTINGS + MENUITEM "&Word Wrap Settings...", IDM_VIEW_WORDWRAPSETTINGS + MENUITEM "&Long Line Settings...", IDM_VIEW_LONGLINESETTINGS + MENUITEM "Auto In&dent Text", IDM_VIEW_AUTOINDENTTEXT + MENUITEM "Auto Close &HTML/XML\tCtrl+Shift+H", IDM_VIEW_AUTOCLOSETAGS + MENUITEM "Auto Complete Wo&rds", IDM_VIEW_AUTOCOMPLETEWORDS + MENUITEM "&Accelerated Word Navigation", IDM_VIEW_ACCELWORDNAV + MENUITEM SEPARATOR + MENUITEM "&Reuse Window", IDM_VIEW_REUSEWINDOW + MENUITEM "Sticky Window &Position", IDM_VIEW_STICKYWINPOS + MENUITEM "&Always On Top\tAlt+T", IDM_VIEW_ALWAYSONTOP + MENUITEM "Minimi&ze To Tray", IDM_VIEW_MINTOTRAY + MENUITEM "Transparent &Mode\tCtrl+Numpad_*", IDM_VIEW_TRANSPARENT + MENUITEM SEPARATOR + MENUITEM "Single &File Instance", IDM_VIEW_SINGLEFILEINSTANCE + MENUITEM "File &Change Notification...\tAlt+F5", IDM_VIEW_CHANGENOTIFY + POPUP "Window Title Displa&y" + BEGIN + MENUITEM "Filename &Only", IDM_VIEW_SHOWFILENAMEONLY + MENUITEM "Filename and &Directory", IDM_VIEW_SHOWFILENAMEFIRST + MENUITEM "Full &Pathname", IDM_VIEW_SHOWFULLPATH + MENUITEM "&Text Excerpt\tCtrl+9", IDM_VIEW_SHOWEXCERPT + END + POPUP "Esc &Key Function" + BEGIN + MENUITEM "&None", IDM_VIEW_NOESCFUNC + MENUITEM "&Minimize Notepad3", IDM_VIEW_ESCMINIMIZE + MENUITEM "E&xit Notepad3", IDM_VIEW_ESCEXIT + END + MENUITEM "Sa&ve Before Running Tools", IDM_VIEW_SAVEBEFORERUNNINGTOOLS + MENUITEM "Remember Recent F&iles", IDM_VIEW_NOSAVERECENT + MENUITEM "Preserve Caret &Position", IDM_VIEW_NOPRESERVECARET + MENUITEM "Remember S&earch Strings", IDM_VIEW_NOSAVEFINDREPL + MENUITEM SEPARATOR + MENUITEM "Sh&ow Toolbar", IDM_VIEW_TOOLBAR + MENUITEM "C&ustomize Toolbar...", IDM_VIEW_CUSTOMIZETB + MENUITEM "Sh&ow Statusbar", IDM_VIEW_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "Save Settings On E&xit", IDM_VIEW_SAVESETTINGS + MENUITEM "Save Settings &Now\tF7", IDM_VIEW_SAVESETTINGSNOW + MENUITEM "&Open Settings File\tCtrl+F7", CMD_OPENINIFILE + END + POPUP "&Help" + BEGIN + MENUITEM "&About...\tF1", IDM_HELP_ABOUT + MENUITEM "Command Line Help", IDM_HELP_CMD + END +END + +IDR_POPUPMENU MENU +BEGIN + POPUP "+" + BEGIN + MENUITEM "&Undo", IDM_EDIT_UNDO + MENUITEM "&Redo", IDM_EDIT_REDO + MENUITEM SEPARATOR + MENUITEM "Cu&t", IDM_EDIT_CUT + MENUITEM "&Copy", IDM_EDIT_COPY + MENUITEM "&Paste", IDM_EDIT_PASTE + MENUITEM "Cl&ear", IDM_EDIT_CLEAR + MENUITEM SEPARATOR + MENUITEM "&Select All", IDM_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Open &Hyperlink", CMD_OPEN_HYPERLINK + END + POPUP "+" + BEGIN + MENUITEM "Show &Toolbar", IDM_VIEW_TOOLBAR + MENUITEM "&Customize Toolbar...", IDM_VIEW_CUSTOMIZETB + MENUITEM "Show &Statusbar", IDM_VIEW_STATUSBAR + END + POPUP "+" + BEGIN + MENUITEM "Open Notepad3", IDM_TRAY_RESTORE + MENUITEM "Exit Notepad3", IDM_TRAY_EXIT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDR_MAINWND ACCELERATORS +BEGIN + "0", IDM_VIEW_RESETZOOM, VIRTKEY, CONTROL, NOINVERT + "0", IDM_FILE_NEWWINDOW2, VIRTKEY, ALT, NOINVERT + "0", IDM_VIEW_WORDWRAPSYMBOLS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "1", CMD_STRINGIFY, VIRTKEY, CONTROL, NOINVERT + "1", CMD_WEBACTION1, VIRTKEY, SHIFT, CONTROL, NOINVERT + "2", CMD_STRINGIFY2, VIRTKEY, CONTROL, NOINVERT + "2", CMD_WEBACTION2, VIRTKEY, SHIFT, CONTROL, NOINVERT + "3", CMD_EMBRACE, VIRTKEY, CONTROL, NOINVERT + "4", CMD_EMBRACE2, VIRTKEY, CONTROL, NOINVERT + "5", CMD_EMBRACE3, VIRTKEY, CONTROL, NOINVERT + "6", CMD_EMBRACE4, VIRTKEY, CONTROL, NOINVERT + "8", IDM_VIEW_SHOWWHITESPACE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "9", CMD_TOGGLETITLE, VIRTKEY, CONTROL, NOINVERT + "9", IDM_VIEW_SHOWEOLS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "A", IDM_EDIT_SELECTALL, VIRTKEY, CONTROL, NOINVERT + "A", CMD_RECODEANSI, VIRTKEY, SHIFT, CONTROL, NOINVERT + "B", IDM_EDIT_FINDMATCHINGBRACE, VIRTKEY, CONTROL, NOINVERT + "B", IDM_EDIT_PADWITHSPACES, VIRTKEY, ALT, NOINVERT + "B", IDM_EDIT_SELTOMATCHINGBRACE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "C", IDM_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT + "C", IDM_EDIT_COPYALL, VIRTKEY, ALT, NOINVERT + "C", IDM_EDIT_HEX2CHAR, VIRTKEY, CONTROL, ALT, NOINVERT + "C", IDM_EDIT_COPYLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "D", IDM_EDIT_DUPLICATELINE, VIRTKEY, CONTROL, NOINVERT + "D", IDM_EDIT_SELECTIONDUPLICATE, VIRTKEY, ALT, NOINVERT + "D", IDM_EDIT_DELETELINE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "E", IDM_EDIT_COPYADD, VIRTKEY, CONTROL, NOINVERT + "E", IDM_EDIT_ESCAPECCHARS, VIRTKEY, CONTROL, ALT, NOINVERT + "E", IDM_EDIT_URLENCODE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "F", IDM_EDIT_FIND, VIRTKEY, CONTROL, NOINVERT + "F", CMD_RECODEDEFAULT, VIRTKEY, CONTROL, ALT, NOINVERT + "F", IDM_VIEW_FOLDING, VIRTKEY, SHIFT, CONTROL, ALT, NOINVERT + "F", IDM_VIEW_TOGGLEFOLDS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "G", IDM_EDIT_GOTOLINE, VIRTKEY, CONTROL, NOINVERT + "G", IDM_VIEW_SHOWINDENTGUIDES, VIRTKEY, SHIFT, CONTROL, NOINVERT + "H", IDM_EDIT_REPLACE, VIRTKEY, CONTROL, NOINVERT + "H", IDM_FILE_RECENT, VIRTKEY, ALT, NOINVERT + "H", IDM_VIEW_AUTOCLOSETAGS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "H", IDM_VIEW_HYPERLINKHOTSPOTS, VIRTKEY, CONTROL, ALT, NOINVERT + "I", IDM_EDIT_SPLITLINES, VIRTKEY, CONTROL, NOINVERT + "I", IDM_FILE_OPENFAV, VIRTKEY, ALT, NOINVERT + "I", IDM_EDIT_TITLECASE, VIRTKEY, CONTROL, ALT, NOINVERT + "I", IDM_VIEW_HILITECURRENTLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "J", IDM_EDIT_JOINLINES, VIRTKEY, CONTROL, NOINVERT + "J", IDM_EDIT_ALIGN, VIRTKEY, ALT, NOINVERT + "J", IDM_EDIT_JOINLINESEX, VIRTKEY, SHIFT, CONTROL, NOINVERT + "K", IDM_EDIT_SWAP, VIRTKEY, CONTROL, NOINVERT + "K", IDM_FILE_ADDTOFAV, VIRTKEY, ALT, NOINVERT + "K", CMD_COPYWINPOS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "L", IDM_FILE_LAUNCH, VIRTKEY, CONTROL, NOINVERT + "L", IDM_FILE_OPENWITH, VIRTKEY, ALT, NOINVERT + "L", IDM_VIEW_LONGLINEMARKER, VIRTKEY, SHIFT, CONTROL, NOINVERT + "M", IDM_FILE_BROWSE, VIRTKEY, CONTROL, NOINVERT + "M", IDM_EDIT_MODIFYLINES, VIRTKEY, ALT, NOINVERT + "M", IDM_VIEW_MARGIN, VIRTKEY, SHIFT, CONTROL, NOINVERT + "N", IDM_FILE_NEW, VIRTKEY, CONTROL, NOINVERT + "N", IDM_FILE_NEWWINDOW, VIRTKEY, ALT, NOINVERT + "N", IDM_VIEW_LINENUMBERS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "O", IDM_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT + "O", IDM_EDIT_SORTLINES, VIRTKEY, ALT, NOINVERT + "O", IDM_EDIT_SENTENCECASE, VIRTKEY, CONTROL, ALT, NOINVERT + "O", CMD_RECODEOEM, VIRTKEY, SHIFT, CONTROL, NOINVERT + "P", IDM_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT + "P", IDM_EDIT_COMPRESSWS, VIRTKEY, ALT, NOINVERT + "P", CMD_DEFAULTWINPOS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "Q", IDM_EDIT_LINECOMMENT, VIRTKEY, CONTROL, NOINVERT + "Q", IDM_EDIT_ENCLOSESELECTION, VIRTKEY, ALT, NOINVERT + "Q", IDM_EDIT_STREAMCOMMENT, VIRTKEY, SHIFT, CONTROL, NOINVERT + "R", IDM_FILE_RUN, VIRTKEY, CONTROL, NOINVERT + "R", IDM_EDIT_REMOVEBLANKLINES, VIRTKEY, ALT, NOINVERT + "R", IDM_EDIT_UNESCAPECCHARS, VIRTKEY, CONTROL, ALT, NOINVERT + "R", IDM_EDIT_URLDECODE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "S", IDM_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT + "S", IDM_EDIT_CONVERTTABS2, VIRTKEY, CONTROL, ALT, NOINVERT + "S", IDM_EDIT_CONVERTTABS, VIRTKEY, SHIFT, CONTROL, NOINVERT + "T", IDM_VIEW_TABSETTINGS, VIRTKEY, CONTROL, NOINVERT + "T", IDM_VIEW_ALWAYSONTOP, VIRTKEY, ALT, NOINVERT + "T", IDM_EDIT_CONVERTSPACES2, VIRTKEY, CONTROL, ALT, NOINVERT + "T", IDM_EDIT_CONVERTSPACES, VIRTKEY, SHIFT, CONTROL, NOINVERT + "U", IDM_EDIT_CONVERTLOWERCASE, VIRTKEY, CONTROL, NOINVERT + "U", IDM_EDIT_STRIPLASTCHAR, VIRTKEY, ALT, NOINVERT + "U", IDM_EDIT_INVERTCASE, VIRTKEY, CONTROL, ALT, NOINVERT + "U", IDM_EDIT_CONVERTUPPERCASE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "V", IDM_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT + "V", IDM_VIEW_MATCHBRACES, VIRTKEY, SHIFT, CONTROL, NOINVERT + "W", IDM_VIEW_WORDWRAP, VIRTKEY, CONTROL, NOINVERT + "W", IDM_EDIT_TRIMLINES, VIRTKEY, ALT, NOINVERT + "W", IDM_EDIT_COLUMNWRAP, VIRTKEY, SHIFT, CONTROL, NOINVERT + "X", IDM_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT + "X", IDM_EDIT_INSERT_TAG, VIRTKEY, ALT, NOINVERT + "X", IDM_EDIT_CHAR2HEX, VIRTKEY, CONTROL, ALT, NOINVERT + "X", IDM_EDIT_CUTLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT + "Y", IDM_EDIT_REDO, VIRTKEY, CONTROL, NOINVERT + "Y", IDM_EDIT_MERGEBLANKLINES, VIRTKEY, ALT, NOINVERT + "Y", IDM_EDIT_UNDO, VIRTKEY, SHIFT, CONTROL, NOINVERT + "Z", IDM_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT + "Z", IDM_EDIT_STRIP1STCHAR, VIRTKEY, ALT, NOINVERT + "Z", IDM_EDIT_REDO, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_LEFT, CMD_CTRLLEFT, VIRTKEY, CONTROL, NOINVERT + VK_RIGHT, CMD_CTRLRIGHT, VIRTKEY, CONTROL, NOINVERT + VK_ADD, IDM_VIEW_ZOOMIN, VIRTKEY, CONTROL, NOINVERT + VK_ADD, CMD_INCLINELIMIT, VIRTKEY, ALT, NOINVERT + VK_ADD, CMD_INCREASENUM, VIRTKEY, CONTROL, ALT, NOINVERT + VK_BACK, CMD_BACK, VIRTKEY, NOINVERT + VK_BACK, CMD_CTRLBACK, VIRTKEY, CONTROL, NOINVERT + VK_BACK, IDM_EDIT_UNDO, VIRTKEY, ALT, NOINVERT + VK_BACK, IDM_EDIT_DELETELINELEFT, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_DELETE, CMD_DEL, VIRTKEY, NOINVERT + VK_DELETE, CMD_CTRLDEL, VIRTKEY, CONTROL, NOINVERT + VK_DELETE, IDM_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT + VK_DELETE, IDM_EDIT_DELETELINERIGHT, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_DOWN, IDM_EDIT_MOVELINEDOWN, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_ESCAPE, CMD_ESCAPE, VIRTKEY, NOINVERT + VK_ESCAPE, CMD_SHIFTESC, VIRTKEY, SHIFT, NOINVERT + VK_F1, IDM_HELP_ABOUT, VIRTKEY, NOINVERT + VK_F11, CMD_LEXDEFAULT, VIRTKEY, NOINVERT + VK_F11, CMD_LEXHTML, VIRTKEY, CONTROL, NOINVERT + VK_F11, CMD_LEXXML, VIRTKEY, SHIFT, NOINVERT + VK_F12, IDM_VIEW_SCHEME, VIRTKEY, NOINVERT + VK_F12, IDM_VIEW_SCHEMECONFIG, VIRTKEY, CONTROL, NOINVERT + VK_F12, IDM_VIEW_FONT, VIRTKEY, ALT, NOINVERT + VK_F12, IDM_VIEW_USE2NDDEFAULT, VIRTKEY, SHIFT, NOINVERT + VK_F12, IDM_VIEW_CURRENTSCHEME, VIRTKEY, CONTROL, ALT + VK_F2, IDM_EDIT_SELTONEXT, VIRTKEY, CONTROL, ALT, NOINVERT + VK_F2, IDM_EDIT_SELTOPREV, VIRTKEY, SHIFT, CONTROL, ALT, NOINVERT + VK_F2, BME_EDIT_BOOKMARKNEXT, VIRTKEY, NOINVERT + VK_F2, BME_EDIT_BOOKMARKTOGGLE, VIRTKEY, CONTROL, NOINVERT + VK_F2, BME_EDIT_BOOKMARKCLEAR, VIRTKEY, ALT, NOINVERT + VK_F2, BME_EDIT_BOOKMARKPREV, VIRTKEY, SHIFT, NOINVERT + VK_F3, IDM_EDIT_FINDNEXT, VIRTKEY, NOINVERT + VK_F3, CMD_FINDNEXTSEL, VIRTKEY, CONTROL, NOINVERT + VK_F3, IDM_EDIT_SAVEFIND, VIRTKEY, ALT, NOINVERT + VK_F3, IDM_EDIT_FINDPREV, VIRTKEY, SHIFT, NOINVERT + VK_F3, CMD_FINDPREVSEL, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_F4, IDM_EDIT_REPLACENEXT, VIRTKEY, NOINVERT + VK_F4, IDM_FILE_NEW, VIRTKEY, CONTROL, NOINVERT + VK_F4, IDM_FILE_NEW, VIRTKEY, CONTROL, NOINVERT + VK_F5, IDM_FILE_REVERT, VIRTKEY, NOINVERT + VK_F5, IDM_EDIT_INSERT_SHORTDATE, VIRTKEY, CONTROL, NOINVERT + VK_F5, IDM_VIEW_CHANGENOTIFY, VIRTKEY, ALT, NOINVERT + VK_F5, CMD_TIMESTAMPS, VIRTKEY, SHIFT, NOINVERT + VK_F5, IDM_EDIT_INSERT_LONGDATE, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_F6, IDM_FILE_SAVEAS, VIRTKEY, NOINVERT + VK_F6, IDM_FILE_SAVECOPY, VIRTKEY, CONTROL, NOINVERT + VK_F7, IDM_VIEW_SAVESETTINGSNOW, VIRTKEY, NOINVERT + VK_F7, CMD_OPENINIFILE, VIRTKEY, CONTROL, NOINVERT + VK_F8, IDM_ENCODING_RECODE, VIRTKEY, NOINVERT + VK_F8, IDM_EDIT_INSERT_ENCODING, VIRTKEY, CONTROL, NOINVERT + VK_F8, CMD_RELOADNOFILEVARS, VIRTKEY, ALT, NOINVERT + VK_F8, IDM_ENCODING_UTF8, VIRTKEY, SHIFT, NOINVERT + VK_F8, CMD_RELOADASCIIASUTF8, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_F9, IDM_ENCODING_SELECT, VIRTKEY, NOINVERT + VK_F9, IDM_EDIT_INSERT_FILENAME, VIRTKEY, CONTROL, NOINVERT + VK_F9, IDM_FILE_MANAGEFAV, VIRTKEY, ALT, NOINVERT + VK_F9, CMD_COPYPATHNAME, VIRTKEY, SHIFT, NOINVERT + VK_F9, IDM_EDIT_INSERT_PATHNAME, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_OEM_2, IDM_EDIT_LINECOMMENT, VIRTKEY, CONTROL, NOINVERT + VK_OEM_2, IDM_EDIT_STREAMCOMMENT, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_DIVIDE, IDM_EDIT_LINECOMMENT, VIRTKEY, CONTROL, NOINVERT + VK_DIVIDE, IDM_EDIT_STREAMCOMMENT, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_NUMPAD0, IDM_VIEW_RESETZOOM, VIRTKEY, CONTROL, NOINVERT + VK_MULTIPLY, IDM_VIEW_TRANSPARENT, VIRTKEY, CONTROL, NOINVERT + VK_OEM_COMMA, CMD_JUMP2SELSTART, VIRTKEY, CONTROL, NOINVERT + VK_OEM_MINUS, IDM_VIEW_ZOOMOUT, VIRTKEY, CONTROL, NOINVERT + VK_OEM_MINUS, CMD_DECREASENUM, VIRTKEY, CONTROL, ALT, NOINVERT + VK_OEM_PERIOD, CMD_JUMP2SELEND, VIRTKEY, CONTROL, NOINVERT + VK_OEM_PLUS, IDM_VIEW_ZOOMIN, VIRTKEY, CONTROL, NOINVERT + VK_OEM_PLUS, CMD_INCREASENUM, VIRTKEY, CONTROL, ALT, NOINVERT + VK_RETURN, CMD_CTRLENTER, VIRTKEY, CONTROL, NOINVERT + VK_RETURN, CMD_SHIFTCTRLENTER, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_RETURN, IDM_EDIT_COMPLETEWORD, VIRTKEY, CONTROL, ALT, NOINVERT + VK_SPACE, IDM_EDIT_SELECTWORD, VIRTKEY, CONTROL, NOINVERT + VK_SPACE, IDM_EDIT_SELECTLINE, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_SUBTRACT, IDM_VIEW_ZOOMOUT, VIRTKEY, CONTROL, NOINVERT + VK_SUBTRACT, CMD_DECLINELIMIT, VIRTKEY, ALT, NOINVERT + VK_SUBTRACT, CMD_DECREASENUM, VIRTKEY, CONTROL, ALT, NOINVERT + VK_TAB, IDM_EDIT_INDENT, VIRTKEY, NOINVERT + VK_TAB, IDM_EDIT_UNINDENT, VIRTKEY, SHIFT, NOINVERT + VK_TAB, CMD_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_UP, IDM_EDIT_MOVELINEUP, VIRTKEY, SHIFT, CONTROL, NOINVERT + VK_OEM_PERIOD, IDM_EDIT_INSERT_GUID, VIRTKEY, SHIFT, CONTROL, NOINVERT +END + +IDR_ACCFINDREPLACE ACCELERATORS +BEGIN + "F", IDACC_FIND, VIRTKEY, CONTROL, NOINVERT + "H", IDACC_REPLACE, VIRTKEY, CONTROL, NOINVERT + "O", IDACC_SAVEPOS, VIRTKEY, CONTROL, NOINVERT + "P", IDACC_RESETPOS, VIRTKEY, CONTROL, NOINVERT + VK_F2, IDACC_SELTONEXT, VIRTKEY, CONTROL, ALT, NOINVERT + VK_F2, IDACC_SELTOPREV, VIRTKEY, SHIFT, CONTROL, ALT, NOINVERT + VK_F3, IDACC_FINDNEXT, VIRTKEY, NOINVERT + VK_F3, IDACC_SAVEFIND, VIRTKEY, ALT, NOINVERT + VK_F3, IDACC_FINDPREV, VIRTKEY, SHIFT, NOINVERT + VK_F4, IDACC_REPLACENEXT, VIRTKEY, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUT DIALOGEX 0, 0, 255, 227 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_NOFAILCREATE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Notepad3" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,195,204,50,14 + ICON IDR_MAINWND,IDC_STATIC,7,7,21,20 + LTEXT "",IDC_VERSION,45,10,200,17 + LTEXT "Scintilla Library Version:",IDC_SCI_VERSION,45,24,200,8 + LTEXT "Compiled with:",IDC_COMPILER2,45,35,200,8 + LTEXT "",IDC_COMPILER,96,35,200,8 + LTEXT "",IDC_COPYRIGHT,45,55,200,8 + LTEXT "",IDC_WEBPAGE2,45,64,200,8,NOT WS_VISIBLE | WS_DISABLED + CONTROL "",IDC_WEBPAGE,"SysLink",WS_TABSTOP,45,64,200,10 + LTEXT "XhmikosR ( Notepad2-mod )",IDC_STATIC,45,85,200,8 + LTEXT "",IDC_MODWEBPAGE2,45,94,200,8,NOT WS_VISIBLE | WS_DISABLED + CONTROL "",IDC_MODWEBPAGE,"SysLink",WS_TABSTOP,45,94,200,10 + LTEXT "Florian Balmer et al. ( Notepad2 )",IDC_STATIC,45,110,200,8 + LTEXT "",IDC_NOTE2WEBPAGE2,45,119,200,8,NOT WS_VISIBLE | WS_DISABLED + CONTROL "",IDC_NOTE2WEBPAGE,"SysLink",WS_TABSTOP,45,119,200,10 + LTEXT "Contributors: Derick Payne (Rizonesoft), Flo Balmer (Notepad2), N.Hodgson (Scintilla), XhmikosR (Notepad2-mod), Kai Liu, RL Vision, A.Lekov, B.Barbieri, M.Ellis (MinimizeToTray), D.Dyer (crypt), T.D.Hanson (uthash), RaiKoHoff",IDC_STATIC,45,150,200,44 +END + +IDD_FIND DIALOGEX 0, 0, 273, 101 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_NOFAILCREATE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Find Text" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Search Strin&g:",IDC_STATIC,7,7,46,8 + COMBOBOX IDC_FINDTEXT,7,17,192,116,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + CONTROL "Match &case",IDC_FINDCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,37,53,10 + CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,89,10 + CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10 + CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,85,10 + CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10 + CONTROL "C&lose after find",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,49,65,10 + DEFPUSHBUTTON "&Find Next",IDOK,216,7,50,14 + PUSHBUTTON "Find &Previous",IDC_FINDPREV,216,24,50,14 + PUSHBUTTON "Close",IDCANCEL,216,41,50,14 + CONTROL "Goto Replace (Ctrl+H)",IDC_TOGGLEFINDREPLACE, + "SysLink",0x0,125,85,74,10 + CONTROL "(?)",IDC_REGEXPHELP,"SysLink",0x0,106,74,14,10 + CONTROL "(?)",IDC_BACKSLASHHELP,"SysLink",0x0,106,85,14,10 + CONTROL "W&ildcard Search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,73,63,10 + CONTROL "(?)",IDC_WILDCARDHELP,"SysLink",0x0,191,73,14,10 + CONTROL "Mark &Occurrences",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,61,73,10 + CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,96,10 +END + +IDD_REPLACE DIALOGEX 0, 0, 273, 130 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_NOFAILCREATE | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Replace Text" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Search Strin&g:",IDC_STATIC,7,7,46,8 + COMBOBOX IDC_FINDTEXT,7,17,192,116,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + LTEXT "Replace wit&h:",IDC_STATIC,7,35,44,8 + COMBOBOX IDC_REPLACETEXT,7,46,192,116,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + CONTROL "Match &case",IDC_FINDCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,66,53,10 + CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,78,89,10 + CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10 + CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,97,10 + CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,89,10 + CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10 + CONTROL "C&lose after replace",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,78,77,10 + DEFPUSHBUTTON "&Find Next",IDOK,216,7,50,14 + PUSHBUTTON "Find &Previous",IDC_FINDPREV,216,24,50,14 + PUSHBUTTON "&Replace",IDC_REPLACE,216,41,50,14 + PUSHBUTTON "Replace &All",IDC_REPLACEALL,216,58,50,14 + PUSHBUTTON "In &Selection",IDC_REPLACEINSEL,216,75,50,14 + PUSHBUTTON "Swap Strings",IDC_SWAPSTRG,216,92,50,14 + PUSHBUTTON "Close",IDCANCEL,216,110,50,14 + CONTROL "Goto Find (Ctrl+F)",IDC_TOGGLEFINDREPLACE, + "SysLink",0x0,125,114,74,10 + CONTROL "(?)",IDC_REGEXPHELP,"SysLink",0x0,107,102,14,10 + CONTROL "(?)",IDC_BACKSLASHHELP,"SysLink",0x0,107,114,14,10 + CONTROL "W&ildcard Search",IDC_WILDCARDSEARCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,102,63,10 + CONTROL "(?)",IDC_WILDCARDHELP,"SysLink",0x0,191,102,14,10 + CONTROL "Mark &Occurrences",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,90,73,10 +END + +IDD_RUN DIALOGEX 0, 0, 229, 96 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Run" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + ICON IDI_RUN,IDC_STATIC,10,7,21,20 + LTEXT "Type the name of a program, folder, document, or internet resource, and Windows will open it for you.",IDC_STATIC,39,7,179,17 + EDITTEXT IDC_COMMANDLINE,10,35,208,13,ES_AUTOHSCROLL + PUSHBUTTON "Browse...",IDC_SEARCHEXE,163,69,55,16 + DEFPUSHBUTTON "OK",IDOK,47,69,55,16 + PUSHBUTTON "Cancel",IDCANCEL,105,69,55,16 +END + +IDD_OPENWITH DIALOGEX 0, 0, 165, 129 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Open with..." +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_OPENWITHDIR,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,7,151,69 + PUSHBUTTON "",IDC_GETOPENWITHDIR,7,83,13,13 + LTEXT "Click here to specify the directory with links to your favorite applications.",IDC_OPENWITHDESCR,26,83,132,18 + DEFPUSHBUTTON "OK",IDOK,52,108,50,14 + PUSHBUTTON "Cancel",IDCANCEL,108,108,50,14 + SCROLLBAR IDC_RESIZEGRIP3,7,112,10,10 +END + +IDD_DEFENCODING DIALOGEX 0, 0, 180, 118 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Encoding" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "&Default encoding:",IDC_STATIC,7,7,58,8 + CONTROL "",IDC_ENCODINGLIST,"ComboBoxEx32",CBS_DROPDOWNLIST | WS_CLIPSIBLINGS | WS_VSCROLL | WS_TABSTOP,7,20,166,128 + CONTROL "Skip automatic &Unicode detection.",IDC_NOUNICODEDETECTION, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,43,124,10 + CONTROL "Open 7-bit &ASCII files in UTF-8 mode.",IDC_ASCIIASUTF8, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,53,136,10 + CONTROL "Open 8-bit *.&nfo/diz files in DOS-437 mode.",IDC_NFOASOEM, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,63,166,10 + CONTROL "Don't parse encoding &tags.",IDC_ENCODINGFROMFILEVARS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,102,10 + DEFPUSHBUTTON "OK",IDOK,68,97,50,14 + PUSHBUTTON "Cancel",IDCANCEL,123,97,50,14 +END + +IDD_DEFEOLMODE DIALOGEX 0, 0, 180, 78 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Line Endings" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "&Default line ending mode:",IDC_STATIC,7,7,82,8 + COMBOBOX 100,7,20,98,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "&Ensure consistent line endings when saving.",IDC_CONSISTENTEOLS, + "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,7,48,157,10 + CONTROL "&Strip trailing blanks when saving.",IDC_AUTOSTRIPBLANKS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,60,121,10 + DEFPUSHBUTTON "OK",IDOK,123,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,123,24,50,14 +END + +IDD_LINENUM DIALOGEX 0, 0, 186, 47 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Goto" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Line:",IDC_STATIC,7,7,16,8 + EDITTEXT IDC_LINENUM,7,24,46,14,ES_AUTOHSCROLL + LTEXT "&Column:",IDC_STATIC,63,7,27,8 + EDITTEXT IDC_COLNUM,63,24,46,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,129,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 +END + +IDD_FILEMRU DIALOGEX 0, 0, 269, 154 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Open Recent File" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_FILEMRU,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,7,255,97 + CONTROL "&Save recent file list on exit.",IDC_SAVEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,121,96,10 + CONTROL "&Preserve caret position.",IDC_PRESERVECARET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,106,96,10 + DEFPUSHBUTTON "OK",IDOK,154,133,50,14,WS_DISABLED + PUSHBUTTON "Discard",IDC_REMOVE,212,106,50,14,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,212,133,50,14 + SCROLLBAR IDC_RESIZEGRIP,7,137,10,10 +END + +IDD_CHANGENOTIFY DIALOGEX 0, 0, 184, 65 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "File Change Notification" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "&None.",100,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,7,35,10 + CONTROL "&Display message.",101,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,19,71,10 + CONTROL "&Auto-reload (unmodified).",102,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,31,99,10 + CONTROL "&Reset if a new file is opened.",103,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,48,109,10 + DEFPUSHBUTTON "OK",IDOK,127,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,24,50,14 +END + +IDD_STYLESELECT DIALOGEX 0, 0, 165, 134 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Select Scheme" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_STYLELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,7,151,70 + CONTROL "Set selected scheme as &default.",IDC_DEFAULTSCHEME, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,118,10 + CONTROL "&Auto-select by filename extension.",IDC_AUTOSELECT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,95,127,10 + DEFPUSHBUTTON "OK",IDOK,53,113,50,14,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,108,113,50,14 + SCROLLBAR IDC_RESIZEGRIP3,7,117,10,10 +END + +IDD_STYLECONFIG DIALOGEX 0, 0, 468, 238 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Customize Schemes" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_STYLELIST,"SysTreeView32",TVS_SHOWSELALWAYS | TVS_SINGLEEXPAND | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,164,224 + LTEXT "",IDC_STYLELABEL,182,144,279,8 + EDITTEXT IDC_STYLEEDIT,182,156,279,12,ES_AUTOHSCROLL + PUSHBUTTON "For&e...",IDC_STYLEFORE,181,174,46,14 + PUSHBUTTON "&Back...",IDC_STYLEBACK,232,174,46,14 + PUSHBUTTON "&Font...",IDC_STYLEFONT,283,174,42,14 + PUSHBUTTON "&Preview",IDC_PREVIEW,330,174,42,14 + PUSHBUTTON "&Reset",IDC_STYLEDEFAULT,377,174,42,14 + PUSHBUTTON "",IDC_PREVSTYLE,426,174,15,14 + PUSHBUTTON "",IDC_NEXTSTYLE,446,174,15,14 + PUSHBUTTON "&Import...",IDC_IMPORT,181,217,50,14 + PUSHBUTTON "E&xport...",IDC_EXPORT,237,217,50,14 + DEFPUSHBUTTON "OK",IDOK,355,217,50,14 + PUSHBUTTON "Cancel",IDCANCEL,411,217,50,14 + GROUPBOX "Info",IDC_STATIC,181,7,280,127 + ICON IDI_STYLES,IDC_STATIC,189,19,20,20 + LTEXT "Customize Schemes",IDC_TITLE,220,25,200,12 + LTEXT "Filename extensions must be separated by ;\n\nStyle format:\nfont:Name;size:nn;bold;italic;underline;fore:#ffffff;back:#bbbbbb;eolfilled\n\nStyle properties can be copied using copy and paste or drag and drop.\n\nThe ""Preview"" button will not apply any changes.",IDC_STATIC,197,50,252,70 + LTEXT "Associated file&name extensions:|Style &settings:",IDC_STYLELABELS,315,230,152,8,NOT WS_VISIBLE +END + +IDD_TABSETTINGS DIALOGEX 0, 0, 174, 90 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Tab Settings" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Tabulator width:",IDC_STATIC,7,10,54,8 + EDITTEXT 100,67,7,30,14,ES_AUTOHSCROLL + LTEXT "&Indentation size:",IDC_STATIC,7,30,55,8 + EDITTEXT 101,67,27,30,14,ES_AUTOHSCROLL + CONTROL "Insert tabs as &spaces.",102,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,47,87,10 + CONTROL "Tab &key reformats indentation.",103,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,115,10 + CONTROL "&Backspace key reformats indentation.",104,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,71,137,10 + DEFPUSHBUTTON "OK",IDOK,117,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,117,24,50,14 +END + +IDD_LONGLINES DIALOGEX 0, 0, 184, 55 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Long Lines" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Limit for long lines:",IDC_STATIC,7,10,60,8 + EDITTEXT 100,77,7,30,14,ES_AUTOHSCROLL + CONTROL "Show &edge line.",101,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,27,67,10 + CONTROL "Change &background color.",102,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,38,100,10 + DEFPUSHBUTTON "OK",IDOK,127,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,24,50,14 +END + +IDD_WORDWRAP DIALOGEX 0, 0, 196, 100 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Word Wrap Settings" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + COMBOBOX 100,7,7,182,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX 101,7,24,182,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX 102,7,41,182,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX 103,7,58,182,196,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,83,79,50,14 + PUSHBUTTON "Cancel",IDCANCEL,139,79,50,14 + LTEXT "No wrap indent|Wrap indent by 1 character|Wrap indent by 2 characters|Wrap indent by 1 level|Wrap indent by 2 levels|Wrap indent as first subline|Wrap indent 1 level more than first subline",200,0,0,615,8,NOT WS_VISIBLE + LTEXT "No visual indicators before wrap|Show visual indicators before wrap (near text)|Show visual indicators before wrap (near borders)",201,0,0,418,8,NOT WS_VISIBLE + LTEXT "No visual indicators after wrap|Show visual indicators after wrap (near text)|Show visual indicators after wrap (near borders)",202,0,0,402,8,NOT WS_VISIBLE + LTEXT "Wrap text between words|Wrap text between any glyphs",203,0,0,187,8,NOT WS_VISIBLE +END + +IDD_PAGESETUP DIALOGEX 5, 5, 356, 260 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Page Setup" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + GROUPBOX "Paper",1073,8,8,224,56,WS_GROUP + LTEXT "Si&ze:",1089,16,24,36,8 + COMBOBOX 1137,64,23,160,160,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "&Source:",1090,16,45,36,8 + COMBOBOX 1138,64,42,160,160,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP + GROUPBOX "Orientation",1072,8,69,64,56,WS_GROUP + CONTROL "P&ortrait",1056,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,16,82,52,12 + CONTROL "L&andscape",1057,"Button",BS_AUTORADIOBUTTON,16,103,52,12 + GROUPBOX "Margins",1075,80,69,152,56,WS_GROUP + LTEXT "&Left:",1102,88,85,32,8 + EDITTEXT 1155,120,82,28,12,WS_GROUP + LTEXT "&Top:",1104,88,104,32,8 + EDITTEXT 1156,120,103,28,12,WS_GROUP + LTEXT "&Right:",1103,164,85,32,8 + EDITTEXT 1157,196,82,28,12,WS_GROUP + LTEXT "&Bottom:",1105,164,104,32,8 + EDITTEXT 1158,196,103,28,12,WS_GROUP + GROUPBOX "Headers and Footers",1074,8,130,224,56,WS_GROUP + LTEXT "&Header:",IDC_STATIC,16,146,36,8 + COMBOBOX 32,64,145,160,160,CBS_DROPDOWNLIST | WS_VSCROLL | WS_GROUP | WS_TABSTOP + LTEXT "&Footer:",IDC_STATIC,16,167,36,8 + COMBOBOX 33,64,164,160,160,CBS_DROPDOWNLIST | WS_VSCROLL | WS_GROUP | WS_TABSTOP + GROUPBOX "Print Colors",1076,8,191,224,37,WS_GROUP + LTEXT "Mo&de:",IDC_STATIC,16,207,36,8 + COMBOBOX 34,64,206,160,160,CBS_DROPDOWNLIST | WS_VSCROLL | WS_GROUP | WS_TABSTOP + GROUPBOX "Zoom",IDC_STATIC,240,170,108,58,WS_GROUP + LTEXT "Print zoo&m (-10 to +20):",IDC_STATIC,248,188,92,8 + EDITTEXT 30,298,206,42,12,ES_AUTOHSCROLL + CONTROL "",31,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,282,205,11,14 + DEFPUSHBUTTON "OK",1,190,237,50,14,WS_GROUP + PUSHBUTTON "Cancel",2,244,237,50,14 + PUSHBUTTON "&Printer...",1026,298,237,50,14 + GROUPBOX "Preview",IDC_STATIC,240,8,108,157 + CONTROL "",1080,"Static",SS_WHITERECT,254,47,80,80 + CONTROL "",1081,"Static",SS_GRAYRECT,334,51,4,80 + CONTROL "",1082,"Static",SS_GRAYRECT,262,123,80,4 +END + +IDD_FAVORITES DIALOGEX 0, 0, 165, 129 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Favorites" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_FAVORITESDIR,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,7,151,69 + PUSHBUTTON "",IDC_GETFAVORITESDIR,7,83,13,13 + LTEXT "Click here to specify the directory with links to your favorite files.",IDC_FAVORITESDESCR,26,83,132,18 + DEFPUSHBUTTON "OK",IDOK,52,108,50,14 + PUSHBUTTON "Cancel",IDCANCEL,108,108,50,14 + SCROLLBAR IDC_RESIZEGRIP3,7,112,10,10 +END + +IDD_ADDTOFAV DIALOGEX 0, 0, 172, 66 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Add to Favorites" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Enter the name for the new favorites item:",IDC_STATIC,7,7,158,8 + EDITTEXT 100,7,22,158,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,59,45,50,14,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,115,45,50,14 +END + +IDD_PASSWORDS DIALOG 0, 0, 311, 122 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Encryption" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,245,94,50,14 + PUSHBUTTON "Cancel",IDCANCEL,184,94,50,14 + CONTROL "Set New Master Key",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,60,84,10 + EDITTEXT IDC_EDIT1,17,35,276,14,ES_AUTOHSCROLL | WS_GROUP + EDITTEXT IDC_EDIT2,17,74,277,14 + LTEXT "Optional Master Key",IDC_STATIC,18,61,66,10,SS_SUNKEN | NOT WS_GROUP + CONTROL "Encrypt using Passphrase",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,21,98,10 + CONTROL "Reuse Master Key",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,218,60,76,10 + GROUPBOX "Passphrase",IDC_STATIC,7,7,297,108 +END + +IDD_READPW DIALOG 0, 0, 299, 84 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Decrypt File" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,233,54,50,14 + PUSHBUTTON "Cancel",IDCANCEL,175,54,50,14 + EDITTEXT IDC_EDIT3,16,24,267,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_GROUP + CONTROL "decrypt using the master key",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,60,148,10 + LTEXT "This file has a master key",IDC_STATICPW,16,47,89,11,NOT WS_GROUP + GROUPBOX "Passphrase",IDC_STATIC,7,7,285,70 +END + +IDD_COLUMNWRAP DIALOGEX 0, 0, 130, 47 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Column Wrap" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Boundary:",IDC_STATIC,7,7,34,8 + EDITTEXT IDC_COLUMNWRAP,7,24,46,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,73,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,73,24,50,14 +END + +IDD_MODIFYLINES DIALOGEX 0, 0, 182, 110 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Modify Lines" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Prefix text to lines:",IDC_STATIC,7,7,62,8 + EDITTEXT 100,7,18,98,14,ES_AUTOHSCROLL + LTEXT "&Append text to lines:",IDC_STATIC,7,37,68,8 + EDITTEXT 101,7,48,98,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,125,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,125,24,50,14 + LTEXT "$(L)",200,7,72,14,8 + LTEXT "$(0L)",201,30,72,18,8 + LTEXT "Document line number.",IDC_STATIC,57,72,74,8 + LTEXT "$(N)",202,7,82,15,8 + LTEXT "$(0N)",203,30,82,19,8 + LTEXT "Continuous number.",IDC_STATIC,57,82,66,8 + LTEXT "$(I)",204,7,92,13,8 + LTEXT "$(0I)",205,30,92,17,8 + LTEXT "Continuous number (zero-based).",IDC_STATIC,57,92,109,8 +END + +IDD_INSERTTAG DIALOGEX 0, 0, 182, 70 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Insert HTML/XML Tag" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "&Opening tag (with attributes):",IDC_STATIC,7,7,97,8 + EDITTEXT 100,7,18,98,14,ES_AUTOHSCROLL + LTEXT "&Closing tag (can be edited):",IDC_STATIC,7,37,90,8 + EDITTEXT 101,7,48,98,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,125,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,125,24,50,14 +END + +IDD_ENCLOSESELECTION DIALOGEX 0, 0, 182, 70 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Enclose Selection" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Insert &before selection:",IDC_STATIC,7,7,76,8 + EDITTEXT 100,7,18,98,14,ES_AUTOHSCROLL + LTEXT "Insert &after selection:",IDC_STATIC,7,37,71,8 + EDITTEXT 101,7,48,98,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,125,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,125,24,50,14 +END + +IDD_INFOBOX DIALOGEX 0, 0, 244, 71 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Notepad3" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,21,20 + LTEXT "",IDC_INFOBOXTEXT,35,7,202,34 + DEFPUSHBUTTON "OK",IDOK,187,50,50,14 + CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10 +END + +IDD_INFOBOX2 DIALOGEX 0, 0, 244, 71 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Notepad3" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,21,20 + LTEXT "",IDC_INFOBOXTEXT,35,7,202,34 + PUSHBUTTON "&Yes",IDYES,131,50,50,14 + PUSHBUTTON "&No",IDNO,187,50,50,14 + CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10 +END + +IDD_INFOBOX3 DIALOGEX 0, 0, 244, 71 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Notepad3" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,21,20 + LTEXT "",IDC_INFOBOXTEXT,35,7,202,34 + DEFPUSHBUTTON "OK",IDOK,131,50,50,14 + PUSHBUTTON "Cancel",IDCANCEL,187,50,50,14 + CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10 +END + +IDD_SORT DIALOGEX 0, 0, 184, 140 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sort Lines" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "Sort &ascending.",100,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,7,66,10 + CONTROL "Sort &descending.",101,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,19,70,10 + CONTROL "Shu&ffle lines.",102,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,31,57,10 + CONTROL "&Merge duplicate lines.",103,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,50,85,10 + CONTROL "&Remove duplicate lines.",104,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,62,91,10 + CONTROL "Remove &unique lines.",105,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,74,84,10 + CONTROL "&Case insensitive.",106,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,92,70,10 + CONTROL "Logical &number comparison.",107,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,104,104,10 + CONTROL "Column &sort (rectangular selection).",108,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,122,131,10 + DEFPUSHBUTTON "OK",IDOK,127,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,24,50,14 +END + +IDD_RECODE DIALOGEX 0, 0, 165, 135 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Recode" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Select source &encoding to reload file:",IDC_STATIC,7,7,119,8 + CONTROL "",IDC_ENCODINGLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,19,151,87 + DEFPUSHBUTTON "OK",IDOK,53,114,50,14,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,108,114,50,14 + SCROLLBAR IDC_RESIZEGRIP4,7,118,10,10 +END + +IDD_ENCODING DIALOGEX 0, 0, 165, 135 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Encoding" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "Select current file &encoding:",IDC_STATIC,7,7,90,8 + CONTROL "",IDC_ENCODINGLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,19,151,87 + DEFPUSHBUTTON "OK",IDOK,53,114,50,14,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,108,114,50,14 + SCROLLBAR IDC_RESIZEGRIP4,7,118,10,10 +END + +IDD_ALIGN DIALOGEX 0, 0, 184, 74 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Align Lines" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "&Left.",100,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,7,31,10 + CONTROL "&Right.",101,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,19,35,10 + CONTROL "&Center.",102,"Button",BS_AUTORADIOBUTTON,7,31,41,10 + CONTROL "&Justify.",103,"Button",BS_AUTORADIOBUTTON,7,43,40,10 + CONTROL "Justify (&Paragraph mode).",104,"Button",BS_AUTORADIOBUTTON,7,55,100,10 + DEFPUSHBUTTON "OK",IDOK,127,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,24,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 245 + VERTGUIDE, 45 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_FIND, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 266 + VERTGUIDE, 7 + TOPMARGIN, 7 + BOTTOMMARGIN, 95 + END + + IDD_REPLACE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 266 + VERTGUIDE, 7 + TOPMARGIN, 7 + BOTTOMMARGIN, 124 + END + + IDD_RUN, DIALOG + BEGIN + LEFTMARGIN, 10 + RIGHTMARGIN, 218 + BOTTOMMARGIN, 85 + END + + IDD_OPENWITH, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_DEFENCODING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 173 + TOPMARGIN, 7 + BOTTOMMARGIN, 101 + END + + IDD_DEFEOLMODE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 173 + TOPMARGIN, 7 + BOTTOMMARGIN, 71 + END + + IDD_LINENUM, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 40 + END + + IDD_FILEMRU, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 262 + TOPMARGIN, 7 + BOTTOMMARGIN, 147 + END + + IDD_CHANGENOTIFY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 177 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_STYLESELECT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 127 + END + + IDD_STYLECONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 461 + TOPMARGIN, 7 + BOTTOMMARGIN, 231 + END + + IDD_TABSETTINGS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 167 + TOPMARGIN, 7 + BOTTOMMARGIN, 83 + END + + IDD_LONGLINES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 177 + TOPMARGIN, 7 + BOTTOMMARGIN, 48 + END + + IDD_WORDWRAP, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 189 + TOPMARGIN, 7 + BOTTOMMARGIN, 93 + END + + IDD_PAGESETUP, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 349 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + END + + IDD_FAVORITES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_ADDTOFAV, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 165 + TOPMARGIN, 7 + BOTTOMMARGIN, 59 + END + + IDD_PASSWORDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 304 + TOPMARGIN, 7 + BOTTOMMARGIN, 115 + END + + IDD_COLUMNWRAP, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 123 + TOPMARGIN, 7 + BOTTOMMARGIN, 40 + END + + IDD_MODIFYLINES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 175 + TOPMARGIN, 7 + BOTTOMMARGIN, 103 + END + + IDD_INSERTTAG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 175 + TOPMARGIN, 7 + BOTTOMMARGIN, 63 + END + + IDD_ENCLOSESELECTION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 175 + TOPMARGIN, 7 + BOTTOMMARGIN, 63 + END + + IDD_INFOBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_INFOBOX2, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_INFOBOX3, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SORT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 177 + TOPMARGIN, 7 + BOTTOMMARGIN, 133 + END + + IDD_RECODE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_ENCODING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_ALIGN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 177 + TOPMARGIN, 7 + BOTTOMMARGIN, 67 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_PASS_FAILURE "The passphrase is incorrect." + IDS_NOPASS "Cancelled - no passphrase." +END + +STRINGTABLE +BEGIN + IDS_APPTITLE "Notepad3" + IDS_APPTITLE_ELEVATED "%s (Administrator)" + IDS_APPTITLE_PASTEBOARD "Notepad3 : Paste Board" + IDS_UNTITLED "Untitled" + IDS_TITLEEXCERPT """%s""" + IDS_READONLY "(Read Only)" + IDS_DOCPOS " Ln %s / %s Col %s Sel %s SelLn %s Occ %s " + IDS_DOCPOS2 " Ln %s / %s Col %s / %s Sel %s SelLn %s Occ %s " + IDS_DOCSIZE " %s [UTF-8]" + IDS_LOADFILE "Loading ""%s""..." + IDS_SAVEFILE "Saving ""%s""..." + IDS_PRINTFILE "Printing page %i..." + IDS_SAVINGSETTINGS "Saving settings..." + IDS_LINKDESCRIPTION "Edit with Notepad3" + IDS_FILTER_ALL "All files (*.*)|*.*|" + IDS_FILTER_EXE "Executable files (*.exe;*.com;*.bat;*.cmd;*.lnk;*.pif)|*.exe;*.com;*.bat;*.cmd;*.lnk;*.pif|All files (*.*)|*.*|" +END + +STRINGTABLE +BEGIN + IDS_FILTER_INI "Configuration files (*.ini)|*.ini|All files (*.*)|*.*|" + IDS_OPENWITH "Select the directory with links to your favorite applications." + IDS_FAVORITES "Select the directory with links to your favorite files." + IDS_BACKSLASHHELP "Backslash Transformations\n\n\\a\tAlert (BEL, Ascii 7)\n\\b\tBackspace (BS, Ascii 8)\n\\f\tFormfeed (FF, Ascii 12)\n\\n\tNewline (LF, Ascii 10)\n\\r\tCarriage return (CR, Ascii 13)\n\\t\tHorizontal Tab (HT, Ascii 9)\n\\v\tVertical Tab (VT, Ascii 11)\n\\0oo\tOctal Value\n\\u####\tHexadecimal Value\n\\xhh\tHexadecimal Value\n\\\\\tBackslash" + IDS_REGEXPHELP "RegExp Matching Syntax (Multi Lines)\n\n.\tAny character, except Newline (LF,\\n,Ascii 10)\n^\tEmpty string immediately after Newline\n$\tEmpty string immediately before End of Line\n\\<\tStart of a word\n\\>\tEnd of a word\n\\b\tWord boundary\n[...]\tA set of chars ([abc]) or a range ([a-z])\n[^...]\tChars NOT in the set or range\n\\d\tAny decimal digit\n\\D\tAny non-digit char\n\\s\tAny whitespace char\n\\S\tNot a whitespace char\n\\w\tAny ""word"" char\n\\W\tAny ""non-word"" char\n\\x\tEscape character with otherwise special meaning\n\\xHH\tChar with hex code HH\n?\tMatches preceding 0 or 1 times\n*\tMatches preceding 0 or more times\n+\tMatches preceding 1 or more times\n*? or +?\tNon greedy matching of quantifiers ""?"" and ""+""\n(\tStart of a region\n)\tEnd of a region\n\\n\tRefers to a region when replacing (n is 1-9)\n" + IDS_WILDCARDHELP "Wildcard Search\n\n*\tMatches zero or more characters.\n?\tMatches exactly one character. " +END + +STRINGTABLE +BEGIN + IDT_FILE_NEW "New" + IDT_FILE_OPEN "Open" + IDT_FILE_BROWSE "Browse" + IDT_FILE_SAVE "Save" +END + +STRINGTABLE +BEGIN + IDT_EDIT_UNDO "Undo" + IDT_EDIT_REDO "Redo" + IDT_EDIT_CUT "Cut" + IDT_EDIT_COPY "Copy" + IDT_EDIT_PASTE "Paste" + IDT_EDIT_FIND "Find" + IDT_EDIT_REPLACE "Replace" + IDT_VIEW_WORDWRAP "Word Wrap" + IDT_VIEW_ZOOMIN "Zoom In" + IDT_VIEW_ZOOMOUT "Zoom Out" + IDT_VIEW_SCHEME "Select Scheme" + IDT_VIEW_SCHEMECONFIG "Customize Schemes" + IDT_FILE_EXIT "Exit" + IDT_FILE_SAVEAS "Save As" + IDT_FILE_SAVECOPY "Save Copy" + IDT_EDIT_CLEAR "Clear" +END + +STRINGTABLE +BEGIN + IDT_FILE_PRINT "Print" + IDT_FILE_OPENFAV "Favorites" + IDT_FILE_ADDTOFAV "Add to Favorites" + IDT_VIEW_TOGGLEFOLDS "Toggle All Folds" + IDT_FILE_LAUNCH "Execute Document" +END + +STRINGTABLE +BEGIN + IDS_ERR_LOADFILE "Error loading ""%s""." + IDS_ERR_SAVEFILE "Error saving ""%s""." + IDS_ERR_BROWSE "No file browser plugin was found.\nThe MiniPath file browser plugin can be downloaded from https://rizonesoft.com." + IDS_ERR_MRUDLG "No access to the selected file!\nWould you like to remove it from the list?" + IDS_ERR_CREATELINK "Error creating the Desktop link." + IDS_ERR_PREVWINDISABLED "Existing Notepad3 window is busy or has an active dialog box.\nWould you like to open another Notepad3 window?" + IDS_SELRECT "This operation can't be perfomed within a rectangular selection." + IDS_BUFFERTOOSMALL "This operation can't be performed (lines too long)." + IDS_FIND_WRAPFW "Reached the end of the document, restarting search at the beginning." + IDS_FIND_WRAPRE "Reached the beginning of the document, restarting search at the end." + IDS_NOTFOUND "The specified text was not found." + IDS_REPLCOUNT "%i occurrences of the specified text have been replaced." + IDS_ASK_ENCODING "Switching the file encoding from one encoding to another may replace unsupported text with default characters, and the undo history will be cleared. Continue?" + IDS_ASK_ENCODING2 "You are about to change the encoding of an empty file. Note that this will clear the undo history, as it can't be synchronized with the new encoding. Continue?" + IDS_ERR_ENCODINGNA "Code page conversion tables for the selected encoding are not available on your system." + IDS_ERR_UNICODE "Error converting this Unicode file.\nData will be lost if the file is saved!" +END + +STRINGTABLE +BEGIN + IDS_READONLY_SAVE """%s"" is read only. Save to a different file?" + IDS_FILECHANGENOTIFY "The current file has been modified by an external program. Reload?" + IDS_FILECHANGENOTIFY2 "The current file has been deleted. Save now?" + IDS_STICKYWINPOS "Sticky Window Position is enabled. Any new Notepad3 windows will use the current window placement settings." + IDS_SAVEDSETTINGS "The current program settings have been saved." + IDS_CREATEINI_FAIL "Error creating configuration file." + IDS_WRITEINI_FAIL "Error writing settings to configuration file." + IDS_SETTINGSNOTSAVED "No existing configuration file was found.\nTo keep your style modifications, save settings now (F7) or go back to scheme configuration (Ctrl+F12) and export your styles." + IDS_EXPORT_FAIL "Error exporting style settings to ""%s""." + IDS_ERR_ACCESSDENIED "The file ""%s"" cannot be saved and may be protected.\n\nDo you want to launch Notepad3 as Administrator?" + IDS_WARN_UNKNOWN_EXT "Unknown file name extension (%s) !\nLoading data anyway ?" + IDS_REGEX_INVALID "Error evaluating regular expression. Expression is invalid!" + IDS_DROP_NO_FILE "No valid filename retrieved.\nIf dropping from 32-bit application,\nplease drag and drop to Notepad3's tool bar." + IDS_APPLY_DEFAULT_FONT "Apply these font settings to current ('%s') scheme's default text also?" +END + +STRINGTABLE +BEGIN + IDS_CMDLINEHELP "Command Line Help\n\nfile\tMust be the last argument, no quoted spaces by default.\n+\tAccept multiple file arguments (with quoted spaces).\n-\tAccept single file argument (without quoted spaces).\n…\tEncoding (/ansi, /unicode, /unicodebe, /utf8, /utf8sig).\n…\tLine ending mode (/crlf, /lf, /cr).\n/e\tFile source encoding.\n/g\tJump to specified position (/g -1 end of file).\n/m\tMatch specified text (/m- last, /mr regex, /mb backslash).\n/l\tAuto-reload modified files.\n/q\tForce creation of new files without prompt.\n/s\tSelect specified syntax scheme.\n/d\tSelect default text scheme.\n/h\tSelect Web Source Code scheme.\n/x\tSelect XML Document scheme.\n/c\tOpen new window and paste clipboard contents.\n/b\tOpen new paste board to collect clipboard entries.\n/n\tAlways open a new window (/ns single file instance).\n/r\tReuse window (/rs single file instance).\n/p\tSet window position and size (/p0, /ps, /pf,l,t,r,b,m).\n/t\tSet window title.\n/i\tStart as tray icon.\n/o\tKeep window on top.\n/f\tSpecify ini-file (/f0 no ini-file).\n/u\tLaunch with elevated privileges.\n/v\tPrint file immediately and quit.\n/vd\tPrint file (open printer dialog).\n/z\tSkip next (usable for registry-based Notepad replacement)." +END + +STRINGTABLE +BEGIN + IDS_ERR_UNICODE2 "Certain characters in the current text are not supported by the selected encoding, and may be replaced by default placeholders when saving. It's recommended to choose another file encoding. Continue?" + IDS_WARN_LOAD_BIG_FILE "Are you sure you want to open this large file?" + IDS_ERR_DROP "Only one file can be dropped at the same time!" + IDS_ASK_SAVE "Save changes to ""%s""?" + IDS_ASK_REVERT "Revert file to last saved state? Your changes will be lost!" + IDS_ASK_RECODE "Recoding requires reloading file from disk, unsaved changes will be lost!" + IDS_ASK_CREATE """%s"" not found.\nWould you like to create this file?" + IDS_PRINT_HEADER "Filename, Current Date and Time|Filename, Current Date|Filename|Leave blank" + IDS_PRINT_FOOTER "Page Number|Leave blank" + IDS_PRINT_COLOR "Normal|Invert light (dark background)|Black on white|Color on white|Color on white (except line numbers)" + IDS_PRINT_PAGENUM "Page %i" + IDS_PRINT_EMPTY "This document doesn't contain any text to be printed." + IDS_PRINT_ERROR "Error printing ""%s""!" + IDS_FAV_SUCCESS "A shortcut to the current file has been created in the favorites directory." + IDS_FAV_FAILURE "The shortcut to the current file could not be created.\nMake sure there's no other file with the same name." + IDS_READONLY_MODIFY "The attributes of ""%s"" could not be modified." +END + +STRINGTABLE +BEGIN + IDS_SAVEPOS "&Save Position\tCtrl+O" + IDS_RESETPOS "&Reset Position\tCtrl+P" +END + +STRINGTABLE +BEGIN + 61000 "A0;ANSI;ANSI" + 61001 "A1;OEM;OEM" + 61002 "A2;Unicode (UTF-16 LE BOM);Unicode (UTF-16) LE BOM" + 61003 "A3;Unicode (UTF-16 BE BOM);Unicode (UTF-16) BE BOM" + 61004 "A4;Unicode (UTF-16 LE);Unicode (UTF-16) LE" + 61005 "A5;Unicode (UTF-16 BE);Unicode (UTF-16) BE" + 61006 "A6;UTF-8;Unicode (UTF-8)" + 61007 "A7;UTF-8 Signature;Unicode (UTF-8) Signature" +END + +STRINGTABLE +BEGIN + 61008 "A8;UTF-7;Unicode (UTF-7)" + 61009 "C;Arabic (DOS-720);DOS-720" + 61010 "C;Arabic (ISO-8859-6);ISO-8859-6" + 61011 "C;Arabic (Mac);Mac (Arabic)" + 61012 "C;Arabic (Windows-1256);Windows-1256" + 61013 "C;Baltic (DOS-775);DOS-775" + 61014 "C;Baltic (ISO-8859-4);ISO-8859-4" + 61015 "C;Baltic (Windows-1257);Windows-1257" + 61016 "C;Central European (DOS-852);DOS-852" + 61017 "C;Central European (ISO-8859-2);ISO-8859-2" + 61018 "C;Central European (Mac);Mac (Central)" + 61019 "C;Central European (Windows-1250);Windows-1250" + 61020 "C;Chinese Simplified (GBK-2312);GBK-2312" + 61021 "C;Chinese Simplified (Mac);Mac (zh-cn)" + 61022 "C;Chinese Traditional (Big5);Big5" + 61023 "C;Chinese Traditional (Mac);Mac (zh-tw)" +END + +STRINGTABLE +BEGIN + 61024 "C;Croatian (Mac);Mac (Croatian)" + 61025 "C;Cyrillic (DOS-866);DOS-866" + 61026 "C;Cyrillic (ISO-8859-5);ISO-8859-5" + 61027 "C;Cyrillic (KOI8-R);KOI8-R" + 61028 "C;Cyrillic (KOI8-U);KOI8-U" + 61029 "C;Cyrillic (Mac);Mac (Cyrillic)" + 61030 "C;Cyrillic (Windows-1251);Windows-1251" + 61031 "C;Estonian (ISO-8859-13);ISO-8859-13" + 61032 "C;French Canadian (DOS-863);DOS-863" + 61033 "C;Greek (DOS-737);DOS-737" + 61034 "C;Greek (ISO-8859-7);ISO-8859-7" + 61035 "C;Greek (Mac);Mac (Greek)" + 61036 "C;Greek (Windows-1253);Windows-1253" + 61037 "C;Greek, Modern (DOS-869);DOS-869" + 61038 "C;Hebrew (DOS-862);DOS-862" + 61039 "C;Hebrew (ISO-8859-8-I);ISO-8859-8-I" +END + +STRINGTABLE +BEGIN + 61040 "C;Hebrew (ISO-8859-8);ISO-8859-8" + 61041 "C;Hebrew (Mac);Mac (Hebrew)" + 61042 "C;Hebrew (Windows-1255);Windows-1255" + 61043 "C;Icelandic (DOS-861);DOS-861" + 61044 "C;Icelandic (Mac);Mac (Icelandic)" + 61045 "C;Japanese (Mac);Mac (Japanese)" + 61046 "C;Japanese (Shift-JIS);Shift-JIS" + 61047 "C;Korean (Mac);Mac (Korean)" + 61048 "C;Korean (Windows-949);Windows-949" + 61049 "C;Latin 3 (ISO-8859-3);ISO-8859-3" + 61050 "C;Latin 9 (ISO-8859-15);ISO-8859-15" + 61051 "C;Nordic (DOS-865);DOS-865" + 61052 "C;OEM United States (DOS-437);DOS-437" + 61053 "C;OEM Multilingual Latin 1 (DOS-858);DOS-858" + 61054 "C;Portuguese (DOS-860);DOS-860" + 61055 "C;Romanian (Mac);Mac (Romanian)" +END + +STRINGTABLE +BEGIN + 61056 "C;Thai (Mac);Mac (Thai)" + 61057 "C;Thai (Windows-874);Windows-874" + 61058 "C;Turkish (DOS-857);DOS-857" + 61059 "C;Turkish (ISO-8859-9);ISO-8859-9" + 61060 "C;Turkish (Mac);Mac (Turkish)" + 61061 "C;Turkish (Windows-1254);Windows-1254" + 61062 "C;Ukrainian (Mac);Mac (Ukrainian)" + 61063 "C;Vietnamese (Windows-1258);Windows-1258" + 61064 "B;Western European (DOS-850);DOS-850" + 61065 "B;Western European (ISO-8859-1);ISO-8859-1" + 61066 "B;Western European (Mac);Mac (Western)" + 61067 "B;Western European (Windows-1252);Windows-1252" + 61068 "D0;IBM EBCDIC (US-Canada);EBCDIC (US)" + 61069 "D1;IBM EBCDIC (International);EBCDIC (Int.)" + 61070 "D2;IBM EBCDIC (Greek Modern);EBCDIC (GR)" + 61071 "D3;IBM EBCDIC (Turkish Latin-5);EBCDIC (Latin-5)" +END + +STRINGTABLE +BEGIN + 61072 "C;Chinese Simplified (GB18030);GB18030" +END + +STRINGTABLE +BEGIN + 62000 "Windows (CR+LF)" + 62001 "Unix (LF)" + 62002 "Mac (CR)" +END + +STRINGTABLE +BEGIN + 63000 "Default Text" + 63001 "Web Source Code" + 63002 "XML Document" + 63003 "CSS Style Sheets" + 63004 "C/C++ Source Code" + 63005 "C# Source Code" + 63006 "Resource Script" + 63007 "Makefiles" +END + +STRINGTABLE +BEGIN + 63008 "VBScript" + 63009 "Visual Basic" + 63010 "JavaScript" + 63011 "Java Source Code" + 63012 "Pascal Source Code" + 63013 "Assembly Script" + 63014 "Perl Script" + 63015 "Configuration Files" + 63016 "Batch Files" + 63017 "Diff Files" + 63018 "SQL Query" + 63019 "Python Script" + 63020 "Apache Config Files" + 63021 "PowerShell Script" + 63022 "D Source Code" + 63023 "Go Source Code" +END + +STRINGTABLE +BEGIN + 63024 "Awk Script" + 63025 "ANSI Art" + 63026 "Shell Script" + 63027 "Registry Files" + 63028 "VHDL" + 63029 "JSON" + 63030 "NSIS" + 63031 "Inno Setup Script" + 63032 "Ruby Script" + 63033 "Lua Script" + 63034 "Tcl Script" + 63035 "AutoIt3 Script" + 63036 "LaTeX Files" + 63037 "AutoHotkey Script" + 63038 "Cmake Script" + 63039 "AviSynth Script" + 63040 "Markdown" + 63041 "YAML" + 63042 "Coffeescript" + 63043 "MATLAB" +END + +STRINGTABLE +BEGIN + 63100 "Default Style" + 63101 "Margins and Line Numbers" + 63102 "Matching Braces" + 63103 "Matching Braces Error" +END + +STRINGTABLE +BEGIN + 63104 "Control Characters (Font)" + 63105 "Indentation Guide (Color)" + 63106 "Selected Text (Colors)" + 63107 "Whitespace (Colors, Size 0-5)" + 63108 "Current Line Background (Color)" + 63109 "Caret (Color, Size 1-3)" + 63110 "Long Line Marker (Colors)" + 63111 "Extra Line Spacing (Size)" + 63112 "2nd Default Style" + 63113 "2nd Margins and Line Numbers" + 63114 "2nd Matching Braces" + 63115 "2nd Matching Braces Error" + 63116 "2nd Control Characters (Font)" + 63117 "2nd Indentation Guide (Color)" + 63118 "2nd Selected Text (Colors)" + 63119 "2nd Whitespace (Colors, Size 0-5)" +END + +STRINGTABLE +BEGIN + 63120 "2nd Current Line Background (Color)" + 63121 "2nd Caret (Color, Size 1-3)" + 63122 "2nd Long Line Marker (Colors)" + 63123 "2nd Extra Line Spacing (Size)" + 63124 "Book Marks (Colors)" + 63125 "2nd Book Marks (Colors)" + 63126 "Default" + 63127 "Comment" + 63128 "Keyword" + 63129 "Identifier" + 63130 "Number" + 63131 "String" + 63132 "Operator" + 63133 "Preprocessor" + 63134 "Verbatim String" + 63135 "Regex" +END + +STRINGTABLE +BEGIN + 63136 "HTML Tag" + 63137 "HTML Unknown Tag" + 63138 "HTML Attribute" + 63139 "HTML Unknown Attribute" + 63140 "HTML Value" + 63141 "HTML String" + 63142 "HTML Other Inside Tag" + 63143 "HTML Comment" + 63144 "HTML Entity" + 63145 "XML Identifier" + 63146 "ASP Start Tag" + 63147 "CDATA" + 63148 "PHP Start Tag" + 63149 "PHP Default" + 63150 "PHP String" + 63151 "PHP Simple String" +END + +STRINGTABLE +BEGIN + 63152 "PHP Keyword" + 63153 "PHP Number" + 63154 "PHP Variable" + 63155 "PHP String Variable" + 63156 "PHP Complex Variable" + 63157 "PHP Comment" + 63158 "PHP Operator" + 63159 "JS Default" + 63160 "JS Comment" + 63161 "JS Number" + 63162 "JS Identifier" + 63163 "JS Keyword" + 63164 "JS String" + 63165 "JS Symbols" + 63166 "JS Regex" + 63167 "ASP JS Default" +END + +STRINGTABLE +BEGIN + 63168 "ASP JS Comment" + 63169 "ASP JS Number" + 63170 "ASP JS Identifier" + 63171 "ASP JS Keyword" + 63172 "ASP JS String" + 63173 "ASP JS Symbols" + 63174 "ASP JS Regex" + 63175 "VBS Default" + 63176 "VBS Comment" + 63177 "VBS Number" + 63178 "VBS Keyword" + 63179 "VBS String" + 63180 "VBS Identifier" + 63181 "ASP VBS Default" + 63182 "ASP VBS Comment" + 63183 "ASP VBS Number" +END + +STRINGTABLE +BEGIN + 63184 "ASP VBS Keyword" + 63185 "ASP VBS String" + 63186 "ASP VBS Identifier" + 63187 "XML Tag" + 63188 "XML Attribute" + 63189 "XML Value" + 63190 "XML String" + 63191 "XML Other Inside Tag" + 63192 "XML Comment" + 63193 "XML Entity" + 63194 "Tag-Class" + 63195 "Tag-Id" + 63196 "Tag-Attribute" + 63197 "Pseudo-class" + 63198 "Unknown Pseudo-class" + 63199 "CSS Property" +END + +STRINGTABLE +BEGIN + 63200 "Unknown Property" + 63201 "Value" + 63202 "Important" + 63203 "Directive" + 63204 "Target" + 63205 "Inline Asm" + 63206 "CPU Instruction" + 63207 "FPU Instruction" + 63208 "Register" + 63209 "Directive Operand" + 63210 "Extended Instruction" + 63211 "String double quoted" + 63212 "String single quoted" + 63213 "POD (common)" + 63214 "POD (verbatim)" + 63215 "Scalar $var" +END + +STRINGTABLE +BEGIN + 63216 "Array @var" + 63217 "Hash %var" + 63218 "Symbol table *var" + 63219 "Regex /re/ or m{re}" + 63220 "Substitution s/re/ore/" + 63221 "Back ticks" + 63222 "Data section" + 63223 "Here-doc (delimiter)" + 63224 "Here-doc (single quoted, q)" + 63225 "Here-doc (double quoted, qq)" + 63226 "Here-doc (back ticks, qx)" + 63227 "Single quoted string (generic, q)" + 63228 "Double quoted string (qq)" + 63229 "Back ticks (qx)" + 63230 "Regex (qr)" + 63231 "Array (qw)" +END + +STRINGTABLE +BEGIN + 63232 "Section" + 63233 "Assignment" + 63234 "Default Value" + 63235 "Label" + 63236 "Command" + 63237 "SGML" + 63238 "Source and Destination" + 63239 "Position Setting" + 63240 "Line Addition" + 63241 "Line Removal" + 63242 "Line Change" + 63243 "Quoted Identifier" + 63244 "String triple double quotes" + 63245 "String triple single quotes" + 63246 "Class name" + 63247 "Function name" +END + +STRINGTABLE +BEGIN + 63248 "IP Address" + 63249 "Variable" + 63250 "Cmdlet" + 63251 "Alias" + 63252 "Parsing error" + 63253 "Prototype" + 63254 "Format identifier" + 63255 "Format body" + 63256 "HTML Element Text" + 63257 "XML Element Text" + 63258 "Typedefs/Classes" + 63259 "Comment Doc" + 63260 "Keyword 2nd" + 63261 "Error" + 63262 "Mark Occurrences (Colors)" + 63263 "2nd Mark Occurrences (Colors)" +END + +STRINGTABLE +BEGIN + 63264 "Hyperlink Hotspots" + 63265 "2nd Hyperlink Hotspots" +END + +#endif // Englisch (USA) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Deutsch (Schweiz) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DES) +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_SWISS + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include \0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""Notepad3.ver""\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Deutsch (Schweiz) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "Notepad3.ver" +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/VersionEx.h b/src/VersionEx.h index a8e0f3f00..c3f49c1fc 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -5,7 +5,7 @@ // ////////////////////////////////////////////////////////// #define VERSION_MAJOR 3 #define VERSION_MINOR 17 -#define VERSION_REV 1221 -#define VERSION_BUILD 761 +#define VERSION_REV 1220 +#define VERSION_BUILD 758 #define SCINTILLA_VER 402 #define ONIGMO_REGEX_VER 6.1.3 From 67f86648544f2091950aea7982e624f9ce4298c1 Mon Sep 17 00:00:00 2001 From: Derick Payne Date: Thu, 21 Dec 2017 22:23:13 +0200 Subject: [PATCH 18/18] Added Online Documentation menu item --- src/Notepad3.c | 5 ++++- src/Notepad3.rc | 16 ++++++++++++---- src/resource.h | 7 ++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index f21e98e5c..ef59343ec 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -4554,7 +4554,10 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam) break; - case IDM_HELP_ABOUT: + case IDM_HELP_ONLINEDOCUMENTATION: + ShellExecute(0, 0, L"https://www.rizonesoft.com/documents/notepad3/", 0, 0, SW_SHOW); + break; + case IDM_HELP_ABOUT: ThemedDialogBox(g_hInstance,MAKEINTRESOURCE(IDD_ABOUT), hwnd,AboutDlgProc); break; diff --git a/src/Notepad3.rc b/src/Notepad3.rc index abcdb2cd8..52d5d272d 100644 --- a/src/Notepad3.rc +++ b/src/Notepad3.rc @@ -12,10 +12,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// Englisch (USA) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) ///////////////////////////////////////////////////////////////////////////// // @@ -364,6 +365,8 @@ BEGIN END POPUP "&Help" BEGIN + MENUITEM "&Online Documentation", IDM_HELP_ONLINEDOCUMENTATION + MENUITEM SEPARATOR MENUITEM "&About...\tF1", IDM_HELP_ABOUT MENUITEM "Command Line Help", IDM_HELP_CMD END @@ -1681,6 +1684,10 @@ BEGIN 63037 "AutoHotkey Script" 63038 "Cmake Script" 63039 "AviSynth Script" +END + +STRINGTABLE +BEGIN 63040 "Markdown" 63041 "YAML" 63042 "Coffeescript" @@ -1901,15 +1908,16 @@ BEGIN 63265 "2nd Hyperlink Hotspots" END -#endif // Englisch (USA) resources +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Deutsch (Schweiz) resources +// German (Switzerland) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DES) LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_SWISS +#pragma code_page(1252) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -1934,7 +1942,7 @@ END #endif // APSTUDIO_INVOKED -#endif // Deutsch (Schweiz) resources +#endif // German (Switzerland) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/resource.h b/src/resource.h index 45bc0867d..403c0901c 100644 --- a/src/resource.h +++ b/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Von Microsoft Visual C++ generierte Includedatei. -// Verwendet durch Notepad3.rc +// Microsoft Visual C++ generated include file. +// Used by Notepad3.rc // #define IDR_RT_MANIFEST 1 #define IDR_MAINWND 100 @@ -390,6 +390,7 @@ #define IDM_VIEW_CURRENTSCHEME 40454 #define IDM_HELP_ABOUT 40500 #define IDM_HELP_CMD 40501 +#define IDM_HELP_ONLINEDOCUMENTATION 40502 #define IDM_TRAY_RESTORE 40600 #define IDM_TRAY_EXIT 40601 #define IDT_FILE_NEW 40700 @@ -475,7 +476,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 601 -#define _APS_NEXT_COMMAND_VALUE 701 +#define _APS_NEXT_COMMAND_VALUE 703 #define _APS_NEXT_CONTROL_VALUE 801 #define _APS_NEXT_SYMED_VALUE 901 #endif