mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge remote-tracking branch 'notepad3_orig_rizone/master'
This commit is contained in:
commit
588281bfbb
@ -400,7 +400,10 @@ BOOL SetWindowPathTitle(HWND hwnd,LPCWSTR lpszFile)
|
||||
PathRemoveFileSpec(tchPath);
|
||||
lstrcat(szTitle, L" - [");
|
||||
lstrcat(szTitle, tchPath);
|
||||
lstrcat(szTitle, L"\\]");
|
||||
if (tchPath[0] && (tchPath[lstrlen(tchPath)-1] == L'\\'))
|
||||
lstrcat(szTitle, L"]");
|
||||
else
|
||||
lstrcat(szTitle, L"\\]");
|
||||
}
|
||||
else
|
||||
lstrcpy(szTitle, lpszFile);
|
||||
|
||||
173
src/Edit.c
173
src/Edit.c
@ -178,17 +178,17 @@ HWND EditCreate(HWND hwndParent)
|
||||
SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MARK_OCCURANCE, INDIC_ROUNDBOX);
|
||||
SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MARK_OCCURANCE, RGB(0x00,0x00,0xFF));
|
||||
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MARK_OCCURANCE, 100);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, 220);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, 100);
|
||||
|
||||
SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MATCH_BRACE, INDIC_FULLBOX);
|
||||
SendMessage(hwnd, SCI_INDICSETFORE,INDIC_NP3_MATCH_BRACE, RGB(0x00, 0xFF, 0x00));
|
||||
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, 120);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MATCH_BRACE, 220);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MATCH_BRACE, 120);
|
||||
|
||||
SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_BAD_BRACE, INDIC_FULLBOX);
|
||||
SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_BAD_BRACE, RGB(0xFF, 0x00, 0x00));
|
||||
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_BAD_BRACE, 120);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, 220);
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, 120);
|
||||
|
||||
|
||||
// word delimiter handling
|
||||
@ -4537,9 +4537,11 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
iSaveMarkOcc = iMarkOccurrences;
|
||||
EnableCmd(GetMenu(hwndMain), IDM_VIEW_MARKOCCURRENCES_ONOFF, FALSE);
|
||||
iMarkOccurrences = 0;
|
||||
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_CHECKED);
|
||||
}
|
||||
else {
|
||||
iSaveMarkOcc = -1;
|
||||
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_UNCHECKED);
|
||||
}
|
||||
|
||||
SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
|
||||
@ -4684,15 +4686,11 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
}
|
||||
|
||||
HMENU hmenu = GetSystemMenu(hwnd, FALSE);
|
||||
GetString(IDS_CHECK_OCC, tch2, COUNTOF(tch2));
|
||||
InsertMenu(hmenu, 0, MF_BYPOSITION | MF_STRING | MF_ENABLED, IDS_CHECK_OCC, tch2);
|
||||
InsertMenu(hmenu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
|
||||
GetString(IDS_SAVEPOS, tch2, COUNTOF(tch2));
|
||||
InsertMenu(hmenu, 2, MF_BYPOSITION | MF_STRING | MF_ENABLED, IDS_SAVEPOS, tch2);
|
||||
InsertMenu(hmenu, 0, MF_BYPOSITION | MF_STRING | MF_ENABLED, IDS_SAVEPOS, tch2);
|
||||
GetString(IDS_RESETPOS, tch2, COUNTOF(tch2));
|
||||
InsertMenu(hmenu, 3, MF_BYPOSITION | MF_STRING | MF_ENABLED, IDS_RESETPOS, tch2);
|
||||
InsertMenu(hmenu, 4, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
|
||||
CheckCmd(hmenu, IDS_CHECK_OCC, bDoCheckAllOccurrences);
|
||||
InsertMenu(hmenu, 1, MF_BYPOSITION | MF_STRING | MF_ENABLED, IDS_RESETPOS, tch2);
|
||||
InsertMenu(hmenu, 2, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
|
||||
|
||||
hBrushRed = CreateSolidBrush(rgbRed);
|
||||
hBrushGreen = CreateSolidBrush(rgbGreen);
|
||||
@ -4779,27 +4777,55 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_MARKALL_OCC:
|
||||
{
|
||||
if (bDoCheckAllOccurrences) {
|
||||
EditSetSearchFlags(hwnd, lpefr);
|
||||
if (bFlagsChanged || (StringCchCompareXA(lastFind, lpefr->szFind) != 0)) {
|
||||
BeginWaitCursor();
|
||||
StringCchCopyA(lastFind, COUNTOF(lastFind), lpefr->szFind);
|
||||
RegExResult_t match = NO_MATCH;
|
||||
match = EditFindHasMatch(hwndEdit, lpefr, (iSaveMarkOcc > 0), FALSE);
|
||||
if (regexMatch != match) {
|
||||
regexMatch = match;
|
||||
InvalidateRect(GetDlgItem(hwnd, IDC_FINDTEXT), NULL, TRUE);
|
||||
}
|
||||
// we have to set Sci's regex instance to first find (have substitution in place)
|
||||
EditFindHasMatch(hwndEdit, lpefr, FALSE, TRUE);
|
||||
bFlagsChanged = FALSE;
|
||||
EndWaitCursor();
|
||||
|
||||
case IDC_ALL_OCCURRENCES:
|
||||
{
|
||||
if (IsDlgButtonChecked(hwnd, IDC_ALL_OCCURRENCES) == BST_CHECKED)
|
||||
{
|
||||
bDoCheckAllOccurrences = TRUE;
|
||||
iSaveMarkOcc = iMarkOccurrences;
|
||||
EnableCmd(GetMenu(hwndMain), IDM_VIEW_MARKOCCURRENCES_ONOFF, FALSE);
|
||||
iMarkOccurrences = 0;
|
||||
}
|
||||
else { // switched OFF
|
||||
bDoCheckAllOccurrences = FALSE;
|
||||
if (iSaveMarkOcc >= 0) {
|
||||
EnableCmd(GetMenu(hwndMain), IDM_VIEW_MARKOCCURRENCES_ONOFF, TRUE);
|
||||
if (iSaveMarkOcc != 0) {
|
||||
SendMessage(hwndMain, WM_COMMAND, (WPARAM)MAKELONG(IDM_VIEW_MARKOCCURRENCES_ONOFF, 1), 0);
|
||||
}
|
||||
}
|
||||
iSaveMarkOcc = -1;
|
||||
}
|
||||
bFlagsChanged = TRUE;
|
||||
SetTimer(hwnd, IDT_TIMER_MRKALL, 100, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
|
||||
case IDC_MARKALL_OCC:
|
||||
{
|
||||
if (bDoCheckAllOccurrences) {
|
||||
EditSetSearchFlags(hwnd, lpefr);
|
||||
if (bFlagsChanged || (StringCchCompareXA(lastFind, lpefr->szFind) != 0)) {
|
||||
BeginWaitCursor();
|
||||
StringCchCopyA(lastFind, COUNTOF(lastFind), lpefr->szFind);
|
||||
RegExResult_t match = NO_MATCH;
|
||||
match = EditFindHasMatch(hwndEdit, lpefr, (iSaveMarkOcc > 0), FALSE);
|
||||
if (regexMatch != match) {
|
||||
regexMatch = match;
|
||||
}
|
||||
// we have to set Sci's regex instance to first find (have substitution in place)
|
||||
EditFindHasMatch(hwndEdit, lpefr, FALSE, TRUE);
|
||||
bFlagsChanged = FALSE;
|
||||
EndWaitCursor();
|
||||
}
|
||||
}
|
||||
InvalidateRect(GetDlgItem(hwnd, IDC_FINDTEXT), NULL, TRUE);
|
||||
UpdateWindow(GetDlgItem(hwnd, IDC_FINDTEXT));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDC_FINDREGEXP:
|
||||
if (IsDlgButtonChecked(hwnd, IDC_FINDREGEXP) == BST_CHECKED)
|
||||
@ -5037,29 +5063,6 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_CHECK_OCC:
|
||||
{
|
||||
bDoCheckAllOccurrences = !bDoCheckAllOccurrences;
|
||||
CheckCmd(GetSystemMenu(hwnd, FALSE), IDS_CHECK_OCC, bDoCheckAllOccurrences);
|
||||
if (bDoCheckAllOccurrences) { // switched ON
|
||||
iSaveMarkOcc = iMarkOccurrences;
|
||||
EnableCmd(GetMenu(hwndMain), IDM_VIEW_MARKOCCURRENCES_ONOFF, FALSE);
|
||||
iMarkOccurrences = 0;
|
||||
}
|
||||
else { // switched OFF
|
||||
if (iSaveMarkOcc >= 0) {
|
||||
EnableCmd(GetMenu(hwndMain), IDM_VIEW_MARKOCCURRENCES_ONOFF, TRUE);
|
||||
if (iSaveMarkOcc != 0) {
|
||||
SendMessage(hwndMain, WM_COMMAND, (WPARAM)MAKELONG(IDM_VIEW_MARKOCCURRENCES_ONOFF, 1), 0);
|
||||
}
|
||||
}
|
||||
iSaveMarkOcc = -1;
|
||||
}
|
||||
bFlagsChanged = TRUE;
|
||||
SetTimer(hwnd, IDT_TIMER_MRKALL, 100, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDACC_FIND:
|
||||
PostMessage(GetParent(hwnd), WM_COMMAND, MAKELONG(IDM_EDIT_FIND, 1), 0);
|
||||
break;
|
||||
@ -5109,11 +5112,7 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
if (wParam == IDS_CHECK_OCC) {
|
||||
PostMessage(hwnd, WM_COMMAND, MAKELONG(IDC_CHECK_OCC, 0), 0);
|
||||
return TRUE;
|
||||
}
|
||||
else if (wParam == IDS_SAVEPOS) {
|
||||
if (wParam == IDS_SAVEPOS) {
|
||||
PostMessage(hwnd, WM_COMMAND, MAKELONG(IDACC_SAVEPOS, 0), 0);
|
||||
return TRUE;
|
||||
}
|
||||
@ -5158,40 +5157,40 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
|
||||
case WM_CTLCOLOREDIT:
|
||||
case WM_CTLCOLORLISTBOX:
|
||||
if (bDoCheckAllOccurrences)
|
||||
{
|
||||
HWND hCheck = (HWND)lParam;
|
||||
HDC hDC = (HDC)wParam;
|
||||
if (bDoCheckAllOccurrences)
|
||||
{
|
||||
HWND hCheck = (HWND)lParam;
|
||||
HDC hDC = (HDC)wParam;
|
||||
|
||||
HWND hComboBox = GetDlgItem(hwnd, IDC_FINDTEXT);
|
||||
COMBOBOXINFO ci = { sizeof(COMBOBOXINFO) };
|
||||
GetComboBoxInfo(hComboBox, &ci);
|
||||
HWND hComboBox = GetDlgItem(hwnd, IDC_FINDTEXT);
|
||||
COMBOBOXINFO ci = { sizeof(COMBOBOXINFO) };
|
||||
GetComboBoxInfo(hComboBox, &ci);
|
||||
|
||||
//if (hCheck == ci.hwndItem || hCheck == ci.hwndList)
|
||||
if (hCheck == ci.hwndItem) {
|
||||
SetBkMode(hDC, TRANSPARENT);
|
||||
INT_PTR hBrush;
|
||||
switch (regexMatch)
|
||||
{
|
||||
case MATCH:
|
||||
//SetTextColor(hDC, green);
|
||||
SetBkColor(hDC, rgbGreen);
|
||||
hBrush = (INT_PTR)hBrushGreen;
|
||||
break;
|
||||
case NO_MATCH:
|
||||
//SetTextColor(hDC, blue);
|
||||
SetBkColor(hDC, rgbBlue);
|
||||
hBrush = (INT_PTR)hBrushBlue;
|
||||
break;
|
||||
case INVALID:
|
||||
default:
|
||||
//SetTextColor(hDC, red);
|
||||
SetBkColor(hDC, rgbRed);
|
||||
hBrush = (INT_PTR)hBrushRed;
|
||||
break;
|
||||
//if (hCheck == ci.hwndItem || hCheck == ci.hwndList)
|
||||
if (hCheck == ci.hwndItem) {
|
||||
SetBkMode(hDC, TRANSPARENT);
|
||||
INT_PTR hBrush;
|
||||
switch (regexMatch) {
|
||||
case MATCH:
|
||||
//SetTextColor(hDC, green);
|
||||
SetBkColor(hDC, rgbGreen);
|
||||
hBrush = (INT_PTR)hBrushGreen;
|
||||
break;
|
||||
case NO_MATCH:
|
||||
//SetTextColor(hDC, blue);
|
||||
SetBkColor(hDC, rgbBlue);
|
||||
hBrush = (INT_PTR)hBrushBlue;
|
||||
break;
|
||||
case INVALID:
|
||||
default:
|
||||
//SetTextColor(hDC, red);
|
||||
SetBkColor(hDC, rgbRed);
|
||||
hBrush = (INT_PTR)hBrushRed;
|
||||
break;
|
||||
}
|
||||
return hBrush;
|
||||
}
|
||||
EndWaitCursor();
|
||||
return hBrush;
|
||||
}
|
||||
}
|
||||
return DefWindowProc(hwnd, umsg, wParam, lParam);
|
||||
|
||||
@ -667,10 +667,12 @@ int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpCmdLine,int n
|
||||
|
||||
while (GetMessage(&msg,NULL,0,0))
|
||||
{
|
||||
if (IsWindow(hDlgFindReplace) && (msg.hwnd == hDlgFindReplace || IsChild(hDlgFindReplace, msg.hwnd)))
|
||||
if (TranslateAccelerator(hDlgFindReplace, hAccFindReplace, &msg) || IsDialogMessage(hDlgFindReplace, &msg))
|
||||
if (IsWindow(hDlgFindReplace) && ((msg.hwnd == hDlgFindReplace) || IsChild(hDlgFindReplace, msg.hwnd)))
|
||||
{
|
||||
int iTr = TranslateAccelerator(hDlgFindReplace, hAccFindReplace, &msg);
|
||||
if (iTr || IsDialogMessage(hDlgFindReplace, &msg))
|
||||
continue;
|
||||
|
||||
}
|
||||
if (!TranslateAccelerator(hwnd,hAccMain,&msg)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
|
||||
BIN
src/Notepad3.rc
BIN
src/Notepad3.rc
Binary file not shown.
52
src/Styles.c
52
src/Styles.c
@ -85,7 +85,7 @@ EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx;
|
||||
/* 24 */ { SCI_SETEDGECOLOUR, 63122, L"2nd Long Line Marker (Colors)", L"fore:#FFC000", L"" },
|
||||
/* 25 */ { SCI_SETEXTRAASCENT+SCI_SETEXTRADESCENT, 63123, L"2nd Extra Line Spacing (Size)", L"", L"" },
|
||||
/* 26 */ { SCI_MARKERSETBACK+SCI_MARKERSETALPHA, 63125, L"2nd Book Marks (Colors)", L"back:#00FF00; alpha:20", L"" },
|
||||
/* 27 */ { SCI_MARKERSETBACK+SCI_MARKERSETALPHA, 63263, L"2nd Mark Occurrences (Colors)", L"fore:#0x00FF00; alpha:100", L"" },
|
||||
/* 27 */ { SCI_MARKERSETBACK+SCI_MARKERSETALPHA, 63263, L"2nd Mark Occurrences (Colors)", L"fore:#0x00FF00; alpha:100; alpha2:100", L"" },
|
||||
|
||||
{ -1, 00000, L"", L"", L"" } } };
|
||||
|
||||
@ -3167,8 +3167,10 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) {
|
||||
else {
|
||||
if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue))
|
||||
SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MATCH_BRACE, iValue);
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue))
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_OK + iIdx].szValue, &iValue, TRUE))
|
||||
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_MATCH_BRACE, iValue);
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_OK + iIdx].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
|
||||
@ -3176,8 +3178,10 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) {
|
||||
else {
|
||||
if (Style_StrGetColor(TRUE, lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue))
|
||||
SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_BAD_BRACE, iValue);
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue))
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue, TRUE))
|
||||
SendMessage(hwnd, SCI_INDICSETALPHA, INDIC_NP3_BAD_BRACE, iValue);
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_BRACE_BAD + iIdx].szValue, &iValue, FALSE))
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_BAD_BRACE, iValue);
|
||||
}
|
||||
|
||||
// Occurrences Marker
|
||||
@ -3203,12 +3207,18 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) {
|
||||
}
|
||||
SendMessage(hwnd, SCI_INDICSETFORE, INDIC_NP3_MARK_OCCURANCE, iValue);
|
||||
|
||||
if (!Style_StrGetAlpha(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, &iValue)) {
|
||||
if (!Style_StrGetAlpha(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, &iValue, TRUE)) {
|
||||
iValue = 100;
|
||||
StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].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)) {
|
||||
iValue = 100;
|
||||
StringCchCatW(lexDefault.Styles[STY_MARK_OCC + iIdx].szValue, COUNTOF(lexDefault.Styles[0].szValue), L"; alpha2:100");
|
||||
}
|
||||
SendMessage(hwnd, SCI_INDICSETOUTLINEALPHA, INDIC_NP3_MARK_OCCURANCE, iValue);
|
||||
|
||||
|
||||
if (pLexNew != &lexANSI)
|
||||
Style_SetStyles(hwnd, lexDefault.Styles[STY_CTRL_CHR + iIdx].iStyle, lexDefault.Styles[STY_CTRL_CHR + iIdx].szValue); // control char
|
||||
@ -3233,7 +3243,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)) { // selection alpha
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_SEL_TXT + iIdx].szValue, &iValue, TRUE)) { // selection alpha
|
||||
SendMessage(hwnd, SCI_SETSELALPHA, iValue, 0);
|
||||
SendMessage(hwnd, SCI_SETADDITIONALSELALPHA, iValue, 0);
|
||||
}
|
||||
@ -3293,7 +3303,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) {
|
||||
SendMessage(hwnd, SCI_SETCARETLINEVISIBLE, TRUE, 0);
|
||||
SendMessage(hwnd, SCI_SETCARETLINEBACK, rgb, 0);
|
||||
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue, &iValue))
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue, &iValue, TRUE))
|
||||
SendMessage(hwnd, SCI_SETCARETLINEBACKALPHA, iValue, 0);
|
||||
else
|
||||
SendMessage(hwnd, SCI_SETCARETLINEBACKALPHA, SC_ALPHA_NOALPHA, 0);
|
||||
@ -3569,7 +3579,7 @@ void Style_SetCurrentLineBackground(HWND hwnd)
|
||||
SendMessage(hwnd,SCI_SETCARETLINEBACK,rgb,0);
|
||||
|
||||
int alpha = 0;
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue,&alpha))
|
||||
if (Style_StrGetAlpha(lexDefault.Styles[STY_CUR_LN_BCK + iIdx].szValue, &alpha, TRUE))
|
||||
SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,alpha,0);
|
||||
else
|
||||
SendMessage(hwnd,SCI_SETCARETLINEBACKALPHA,SC_ALPHA_NOALPHA,0);
|
||||
@ -3591,7 +3601,7 @@ void Style_SetCurrentMargin(HWND hwnd, BOOL bShowSelMargin) {
|
||||
int iIdx = (bUse2ndDefaultStyle) ? STY_CNT_LAST : 0;
|
||||
|
||||
int alpha = 20;
|
||||
Style_StrGetAlpha(lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &alpha);
|
||||
Style_StrGetAlpha(lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &alpha, TRUE);
|
||||
|
||||
int rgbFore = RGB(0xFF, 0, 0); // red
|
||||
Style_StrGetColor(TRUE, lexDefault.Styles[STY_BOOK_MARK + iIdx].szValue, &rgbFore);
|
||||
@ -4183,11 +4193,14 @@ BOOL Style_StrGetColor(BOOL bFore,LPCWSTR lpszStyle,int *rgb)
|
||||
//
|
||||
// Style_StrGetCase()
|
||||
//
|
||||
BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int *i) {
|
||||
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, L"alpha:");
|
||||
WCHAR* p = StrStrI(lpszStyle, strAlpha);
|
||||
if (p) {
|
||||
StringCchCopy(tch, COUNTOF(tch), p + CSTRLEN(L"alpha:"));
|
||||
StringCchCopy(tch, COUNTOF(tch), p + lstrlen(strAlpha));
|
||||
p = StrChr(tch, L';');
|
||||
if (p)
|
||||
*p = L'\0';
|
||||
@ -4205,7 +4218,7 @@ BOOL Style_StrGetAlpha(LPCWSTR lpszStyle, int *i) {
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Style_StrGetAlpha()
|
||||
// Style_StrGetCase()
|
||||
//
|
||||
BOOL Style_StrGetCase(LPCWSTR lpszStyle,int *i)
|
||||
{
|
||||
@ -4331,9 +4344,8 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),(iValue == SC_CASE_UPPER) ? L"u" : L"");
|
||||
}
|
||||
|
||||
if (Style_StrGetAlpha(lpszStyle,&iValue)) {
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; alpha:");
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",iValue);
|
||||
if (Style_StrGetAlpha(lpszStyle, &iValue, TRUE)) {
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"; alpha:%i",iValue);
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
|
||||
}
|
||||
|
||||
@ -4463,12 +4475,16 @@ BOOL Style_SelectColor(HWND hwnd,BOOL bFore,LPWSTR lpszStyle,int cchStyle)
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),(iValue == SC_CASE_UPPER) ? L"u" : L"");
|
||||
}
|
||||
|
||||
if (Style_StrGetAlpha(lpszStyle,&iValue)) {
|
||||
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; alpha:");
|
||||
StringCchPrintf(tch,COUNTOF(tch),L"%i",iValue);
|
||||
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");
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ BOOL Style_StrGetSize(LPCWSTR,int*);
|
||||
BOOL Style_StrGetSizeStr(LPCWSTR,LPWSTR,int);
|
||||
BOOL Style_StrGetColor(BOOL,LPCWSTR,int*);
|
||||
BOOL Style_StrGetCase(LPCWSTR,int*);
|
||||
BOOL Style_StrGetAlpha(LPCWSTR,int*);
|
||||
BOOL Style_StrGetAlpha(LPCWSTR,int*,BOOL);
|
||||
BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL);
|
||||
BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int);
|
||||
void Style_SetStyles(HWND,int,LPCWSTR);
|
||||
|
||||
@ -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
|
||||
@ -117,7 +117,8 @@
|
||||
#define IDD_INFOBOX2 127
|
||||
#define IDD_INFOBOX3 128
|
||||
#define IDT_TIMER_MRKALL 130
|
||||
#define IDC_MARKALL_OCC 131
|
||||
#define IDC_ALL_OCCURRENCES 131
|
||||
#define IDC_MARKALL_OCC 132
|
||||
#define IDC_BACKSLASHHELP 151
|
||||
#define IDC_REGEXPHELP 152
|
||||
#define IDC_WILDCARDHELP 153
|
||||
@ -415,7 +416,6 @@
|
||||
#define IDT_FILE_LAUNCH 40724
|
||||
#define IDS_SAVEPOS 40800
|
||||
#define IDS_RESETPOS 40801
|
||||
#define IDS_CHECK_OCC 40802
|
||||
#define IDS_ERR_LOADFILE 50000
|
||||
#define IDS_ERR_SAVEFILE 50001
|
||||
#define IDS_ERR_BROWSE 50002
|
||||
|
||||
Loading…
Reference in New Issue
Block a user