mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ enh: "Toggle View" coop main window vs. F/R dialog
This commit is contained in:
parent
3a6c978781
commit
0350cfe098
32
src/Edit.c
32
src/Edit.c
@ -280,6 +280,7 @@ void EditSetNewText(HWND hwnd,char* lpstrText,DWORD cbText)
|
||||
if (SendMessage(hwnd, SCI_GETREADONLY, 0, 0)) {
|
||||
SendMessage(hwnd, SCI_SETREADONLY, false, 0);
|
||||
}
|
||||
|
||||
SendMessage(hwnd,SCI_CANCEL,0,0);
|
||||
SendMessage(hwnd,SCI_SETUNDOCOLLECTION,0,0);
|
||||
UndoRedoActionMap(-1,NULL);
|
||||
@ -288,6 +289,9 @@ void EditSetNewText(HWND hwnd,char* lpstrText,DWORD cbText)
|
||||
SendMessage(hwnd,SCI_MARKERDELETEALL,(WPARAM)MARKER_NP3_OCCUR_LINE,0);
|
||||
SendMessage(hwnd,SCI_SETSCROLLWIDTH,GetSystemMetrics(SM_CXSCREEN),0);
|
||||
SendMessage(hwnd,SCI_SETXOFFSET,0,0);
|
||||
if (EditToggleView(g_hwndEdit, false)) {
|
||||
EditToggleView(g_hwndEdit, true);
|
||||
}
|
||||
|
||||
FileVars_Apply(hwnd,&fvCurFile);
|
||||
|
||||
@ -5088,10 +5092,8 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
if (!bSwitchedFindReplace)
|
||||
{
|
||||
sg_pefrData->szFind[0] = '\0';
|
||||
KillTimer(hwnd, IDT_TIMER_MRKALL);
|
||||
|
||||
if (sg_pefrData->bMarkOccurences) {
|
||||
EditClearAllOccurrenceMarkers(g_hwndEdit, 0, -1);
|
||||
}
|
||||
g_iMarkOccurrences = iSaveMarkOcc;
|
||||
g_bMarkOccurrencesMatchVisible = bSaveOccVisible;
|
||||
|
||||
@ -5106,7 +5108,6 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
|
||||
EditEnsureSelectionVisible(g_hwndEdit);
|
||||
}
|
||||
KillTimer(hwnd, IDT_TIMER_MRKALL);
|
||||
DeleteObject(hBrushRed);
|
||||
DeleteObject(hBrushGreen);
|
||||
DeleteObject(hBrushBlue);
|
||||
@ -5157,7 +5158,6 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
DialogEnableWindow(hwnd, IDC_REPLACEINSEL, !SciCall_IsSelectionEmpty());
|
||||
|
||||
if (sg_pefrData->bMarkOccurences) {
|
||||
sg_pefrData->bStateChanged = true; // main window has been edited maybe
|
||||
_SetTimerMarkAll(hwnd,50);
|
||||
}
|
||||
|
||||
@ -5172,10 +5172,9 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_FR_RESET_STATE:
|
||||
if (EditToggleView(g_hwndEdit, false)) {
|
||||
EditToggleView(g_hwndEdit, true);
|
||||
}
|
||||
|
||||
case IDC_DOC_MODIFIED:
|
||||
sg_pefrData->bStateChanged = true;
|
||||
break;
|
||||
|
||||
case IDC_FINDTEXT:
|
||||
@ -6259,11 +6258,11 @@ bool EditToggleView(HWND hwnd, bool bToggleView)
|
||||
|
||||
if (bHideNonMatchedLines) {
|
||||
EditScrollTo(hwnd, 0, false);
|
||||
SendMessage(hwnd, SCI_SETREADONLY, true, 0);
|
||||
SciCall_SetReadOnly(true);
|
||||
}
|
||||
else {
|
||||
EditScrollTo(hwnd, Sci_GetCurrentLine(), true);
|
||||
SendMessage(hwnd, SCI_SETREADONLY, false, 0);
|
||||
SciCall_SetReadOnly(false);
|
||||
}
|
||||
|
||||
EndWaitCursor();
|
||||
@ -6589,9 +6588,6 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo
|
||||
|
||||
IgnoreNotifyChangeEvent();
|
||||
|
||||
// 1st apply current lexer style
|
||||
EditFinalizeStyling(hwnd, iStartPos);
|
||||
|
||||
if (!bHideLines) {
|
||||
SciCall_FoldAll(SC_FOLDACTION_EXPAND);
|
||||
SciCall_MarkerDeleteAll(MARKER_NP3_OCCUR_LINE);
|
||||
@ -6601,6 +6597,7 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo
|
||||
ObserveNotifyChangeEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
EditApplyLexerStyle(hwnd, 0, -1); // reset
|
||||
|
||||
// prepare hidde (folding) settings
|
||||
@ -6664,8 +6661,11 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo
|
||||
}
|
||||
|
||||
if (iEndPos < SciCall_GetTextLength()) {
|
||||
SciCall_StartStyling(SciCall_GetLineEndPosition(iEndPos));
|
||||
EditFinalizeStyling(hwnd, SciCall_GetTextLength());
|
||||
const DocPos iStartStyling = SciCall_PositionFromLine(iEndLine + 1);
|
||||
if ((iStartStyling >= 0) && (iStartStyling < SciCall_GetTextLength())) {
|
||||
SciCall_StartStyling(iStartStyling);
|
||||
EditFinalizeStyling(hwnd, -1);
|
||||
}
|
||||
}
|
||||
|
||||
ObserveNotifyChangeEvent();
|
||||
|
||||
232
src/Notepad3.c
232
src/Notepad3.c
@ -430,6 +430,11 @@ static void __fastcall _SetDocumentModified(bool bModified)
|
||||
IsDocumentModified = bModified;
|
||||
UpdateToolbar();
|
||||
}
|
||||
if (bModified) {
|
||||
if (IsWindow(g_hwndDlgFindReplace)) {
|
||||
SendMessage(g_hwndDlgFindReplace, WM_COMMAND, MAKELONG(IDC_DOC_MODIFIED, 1), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2234,13 +2239,14 @@ LRESULT MsgTrayMessage(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
//
|
||||
void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
int i;
|
||||
DocPos p;
|
||||
bool b;
|
||||
//DocPos p;
|
||||
bool b,e,s;
|
||||
|
||||
HMENU hmenu = (HMENU)wParam;
|
||||
|
||||
i = (int)StringCchLenW(g_wchCurFile,COUNTOF(g_wchCurFile));
|
||||
bool ro = SciCall_GetReadOnly();
|
||||
|
||||
int i = (int)StringCchLenW(g_wchCurFile,COUNTOF(g_wchCurFile));
|
||||
EnableCmd(hmenu,IDM_FILE_REVERT,i);
|
||||
EnableCmd(hmenu, CMD_RELOADASCIIASUTF8, i);
|
||||
EnableCmd(hmenu, CMD_RECODEANSI, i);
|
||||
@ -2249,7 +2255,6 @@ void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
EnableCmd(hmenu, CMD_RECODEDEFAULT, i);
|
||||
EnableCmd(hmenu, IDM_FILE_LAUNCH, i);
|
||||
|
||||
|
||||
EnableCmd(hmenu,IDM_FILE_LAUNCH,i);
|
||||
EnableCmd(hmenu,IDM_FILE_PROPERTIES,i);
|
||||
EnableCmd(hmenu,IDM_FILE_CREATELINK,i);
|
||||
@ -2258,14 +2263,14 @@ void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
EnableCmd(hmenu,IDM_FILE_READONLY,i);
|
||||
CheckCmd(hmenu,IDM_FILE_READONLY,bReadOnly);
|
||||
|
||||
//EnableCmd(hmenu,IDM_ENCODING_UNICODEREV,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_ENCODING_UNICODE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_ENCODING_UTF8SIGN,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_ENCODING_UTF8,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_ENCODING_ANSI,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_LINEENDINGS_CRLF,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_LINEENDINGS_LF,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_LINEENDINGS_CR,!bReadOnly);
|
||||
EnableCmd(hmenu,IDM_ENCODING_UNICODEREV,!ro);
|
||||
EnableCmd(hmenu,IDM_ENCODING_UNICODE,!ro);
|
||||
EnableCmd(hmenu,IDM_ENCODING_UTF8SIGN,!ro);
|
||||
EnableCmd(hmenu,IDM_ENCODING_UTF8,!ro);
|
||||
EnableCmd(hmenu,IDM_ENCODING_ANSI,!ro);
|
||||
EnableCmd(hmenu,IDM_LINEENDINGS_CRLF,!ro);
|
||||
EnableCmd(hmenu,IDM_LINEENDINGS_LF,!ro);
|
||||
EnableCmd(hmenu,IDM_LINEENDINGS_CR,!ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_ENCODING_RECODE,i);
|
||||
|
||||
@ -2293,129 +2298,139 @@ void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
|
||||
EnableCmd(hmenu,IDM_FILE_RECENT,(MRU_Enum(g_pFileMRU,0,NULL,0) > 0));
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_UNDO,SendMessage(g_hwndEdit,SCI_CANUNDO,0,0) /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_REDO,SendMessage(g_hwndEdit,SCI_CANREDO,0,0) /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_UNDO,SciCall_CanUndo() && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_REDO,SciCall_CanRedo() && !ro);
|
||||
|
||||
|
||||
i = !SciCall_IsSelectionEmpty();
|
||||
p = SciCall_GetTextLength();
|
||||
b = (bool)SendMessage(g_hwndEdit, SCI_CANPASTE, 0, 0);
|
||||
s = SciCall_IsSelectionEmpty();
|
||||
e = (SciCall_GetTextLength() == 0);
|
||||
b = SciCall_CanPaste();
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_CUT,p /*&& !bReadOnly*/); // allow Ctrl-X w/o selection
|
||||
EnableCmd(hmenu,IDM_EDIT_COPY,p /*&& !bReadOnly*/); // allow Ctrl-C w/o selection
|
||||
EnableCmd(hmenu,IDM_EDIT_CUT, !e && !ro); // allow Ctrl-X w/o selection
|
||||
EnableCmd(hmenu,IDM_EDIT_COPY, !e); // allow Ctrl-C w/o selection
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_COPYALL,p /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_COPYADD,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_COPYALL, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_COPYADD, !s);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_PASTE,b /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_SWAP,i || b /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CLEAR,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_PASTE, b && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_SWAP, (!s || b) && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CLEAR, !s && !ro);
|
||||
|
||||
EnableCmd(hmenu, IDM_EDIT_SELECTALL, p /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu, IDM_EDIT_SELECTALL, !e);
|
||||
|
||||
|
||||
OpenClipboard(hwnd);
|
||||
EnableCmd(hmenu,IDM_EDIT_CLEARCLIPBOARD,CountClipboardFormats());
|
||||
CloseClipboard();
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_MOVELINEUP,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_MOVELINEDOWN,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_DUPLICATELINE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_CUTLINE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_COPYLINE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_DELETELINE,!bReadOnly);
|
||||
EnableCmd(hmenu,IDM_EDIT_MOVELINEUP,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_MOVELINEDOWN,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_DUPLICATELINE,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CUTLINE,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_COPYLINE,true);
|
||||
EnableCmd(hmenu,IDM_EDIT_DELETELINE,!ro);
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_INDENT,i /*&& !bReadOnly*/);
|
||||
//EnableCmd(hmenu,IDM_EDIT_UNINDENT,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu, IDM_EDIT_MERGEBLANKLINES, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_MERGEEMPTYLINES, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_REMOVEBLANKLINES, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_REMOVEEMPTYLINES, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_REMOVEDUPLICATELINES, !ro);
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_PADWITHSPACES,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_STRIP1STCHAR,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_STRIPLASTCHAR,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_TRIMLINES,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_MERGEBLANKLINES,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_REMOVEBLANKLINES,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_REMOVEEMPTYLINES,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_REMOVEDUPLICATELINES,!bReadOnly);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_INDENT, !s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_UNINDENT, !s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_PADWITHSPACES,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_STRIP1STCHAR,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_STRIPLASTCHAR,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_TRIMLINES,!ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_SELECTIONDUPLICATE, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_COMPRESSWS, !ro);
|
||||
|
||||
EnableCmd(hmenu, IDM_EDIT_MODIFYLINES, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_ALIGN, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_SORTLINES,
|
||||
(SciCall_LineFromPosition(SciCall_GetSelectionEnd()) -
|
||||
(SciCall_LineFromPosition(SciCall_GetSelectionEnd()) -
|
||||
SciCall_LineFromPosition(SciCall_GetSelectionStart())) >= 1);
|
||||
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_COLUMNWRAP,i /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_SPLITLINES,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_JOINLINES,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu, IDM_EDIT_JOINLN_NOSP,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_JOINLINES_PARA,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_SPLITLINES,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_JOINLINES,!s && !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_JOINLN_NOSP,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_JOINLINES_PARA,!s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTUPPERCASE,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTLOWERCASE,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_INVERTCASE,i /*&& !bReadOnly*/ /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_TITLECASE,i /*&& !bReadOnly*/ /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_SENTENCECASE,i /*&& !bReadOnly*/ /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTUPPERCASE,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTLOWERCASE,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_INVERTCASE,!s && !ro /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_TITLECASE,!s && !ro /*&& IsWindowsNT()*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_SENTENCECASE,!s && !ro /*&& IsWindowsNT()*/);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTTABS,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTSPACES,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTTABS2,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTSPACES2,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTTABS,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTSPACES,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTTABS2,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_CONVERTSPACES2,!s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_URLENCODE,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_URLDECODE,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_URLENCODE,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_URLDECODE,!s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_ESCAPECCHARS,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_UNESCAPECCHARS,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_ESCAPECCHARS,!s && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_UNESCAPECCHARS,!s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_CHAR2HEX,true /*&& !bReadOnly*/); // Char2Hex allowed for char after curr pos
|
||||
EnableCmd(hmenu,IDM_EDIT_HEX2CHAR,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_CHAR2HEX, !ro); // Char2Hex allowed for char after curr pos
|
||||
EnableCmd(hmenu,IDM_EDIT_HEX2CHAR, !s && !ro);
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_INCREASENUM,i /*&& !bReadOnly*/);
|
||||
//EnableCmd(hmenu,IDM_EDIT_DECREASENUM,i /*&& !bReadOnly*/);
|
||||
//EnableCmd(hmenu,IDM_EDIT_INCREASENUM,!s && !ro);
|
||||
//EnableCmd(hmenu,IDM_EDIT_DECREASENUM,!s && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_VIEW_SHOWEXCERPT,i);
|
||||
EnableCmd(hmenu,IDM_VIEW_SHOWEXCERPT, !s);
|
||||
|
||||
i = (int)SendMessage(g_hwndEdit,SCI_GETLEXER,0,0);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_LINECOMMENT,
|
||||
!(i == SCLEX_NULL || i == SCLEX_CSS || i == SCLEX_DIFF || i == SCLEX_MARKDOWN || i == SCLEX_JSON));
|
||||
!(i == SCLEX_NULL || i == SCLEX_CSS || i == SCLEX_DIFF || i == SCLEX_MARKDOWN || i == SCLEX_JSON) && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_STREAMCOMMENT,
|
||||
!(i == SCLEX_NULL || i == SCLEX_VBSCRIPT || i == SCLEX_MAKEFILE || i == SCLEX_VB || i == SCLEX_ASM ||
|
||||
i == SCLEX_SQL || i == SCLEX_PERL || i == SCLEX_PYTHON || i == SCLEX_PROPERTIES ||i == SCLEX_CONF ||
|
||||
i == SCLEX_POWERSHELL || i == SCLEX_BATCH || i == SCLEX_DIFF || i == SCLEX_BASH || i == SCLEX_TCL ||
|
||||
i == SCLEX_AU3 || i == SCLEX_LATEX || i == SCLEX_AHK || i == SCLEX_RUBY || i == SCLEX_CMAKE || i == SCLEX_MARKDOWN ||
|
||||
i == SCLEX_YAML || i == SCLEX_REGISTRY || i == SCLEX_NIMROD));
|
||||
i == SCLEX_YAML || i == SCLEX_REGISTRY || i == SCLEX_NIMROD) && !ro);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_ENCODING, *Encoding_GetParseNames(Encoding_Current(CPI_GET)));
|
||||
EnableCmd(hmenu, CMD_CTRLENTER, !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_INSERT_TAG, !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_ENCODING, *Encoding_GetParseNames(Encoding_Current(CPI_GET) && !ro));
|
||||
|
||||
//EnableCmd(hmenu,IDM_EDIT_INSERT_SHORTDATE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_INSERT_LONGDATE,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_INSERT_FILENAME,!bReadOnly);
|
||||
//EnableCmd(hmenu,IDM_EDIT_INSERT_PATHNAME,!bReadOnly);
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_SHORTDATE,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_LONGDATE,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_FILENAME,!ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_INSERT_PATHNAME,!ro);
|
||||
|
||||
i = (int)(SciCall_GetTextLength() != 0);
|
||||
EnableCmd(hmenu,IDM_EDIT_FIND,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_SAVEFIND,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDNEXT,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDPREV,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_REPLACE,i /*&& !bReadOnly*/);
|
||||
EnableCmd(hmenu,IDM_EDIT_REPLACENEXT,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTONEXT,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTOPREV,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDMATCHINGBRACE,i);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTOMATCHINGBRACE,i);
|
||||
EnableCmd(hmenu, IDM_EDIT_INSERT_GUID, !ro);
|
||||
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKPREV,i);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKNEXT,i);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKTOGGLE,i);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKCLEAR,i);
|
||||
e = (SciCall_GetTextLength() == 0);
|
||||
|
||||
EnableCmd(hmenu, IDM_EDIT_DELETELINELEFT, i);
|
||||
EnableCmd(hmenu, IDM_EDIT_DELETELINERIGHT, i);
|
||||
EnableCmd(hmenu, CMD_CTRLBACK, i);
|
||||
EnableCmd(hmenu, CMD_CTRLDEL, i);
|
||||
EnableCmd(hmenu, CMD_TIMESTAMPS, i);
|
||||
EnableCmd(hmenu,IDM_EDIT_FIND, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_SAVEFIND, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDNEXT, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDPREV, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_REPLACE, !e && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_REPLACENEXT, !e && !ro);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTONEXT, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTOPREV, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_FINDMATCHINGBRACE, !e);
|
||||
EnableCmd(hmenu,IDM_EDIT_SELTOMATCHINGBRACE, !e);
|
||||
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKPREV, !e);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKNEXT, !e);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKTOGGLE, !e);
|
||||
EnableCmd(hmenu,BME_EDIT_BOOKMARKCLEAR, !e);
|
||||
|
||||
EnableCmd(hmenu, IDM_EDIT_DELETELINELEFT, !e && !ro);
|
||||
EnableCmd(hmenu, IDM_EDIT_DELETELINERIGHT, !e && !ro);
|
||||
EnableCmd(hmenu, CMD_CTRLBACK, !e && !ro);
|
||||
EnableCmd(hmenu, CMD_CTRLDEL, !e && !ro);
|
||||
EnableCmd(hmenu, CMD_TIMESTAMPS, !e && !ro);
|
||||
|
||||
EnableCmd(hmenu, IDM_VIEW_FONT, !IsWindow(g_hwndDlgCustomizeSchemes));
|
||||
EnableCmd(hmenu, IDM_VIEW_CURRENTSCHEME, !IsWindow(g_hwndDlgCustomizeSchemes));
|
||||
|
||||
EnableCmd(hmenu,IDM_VIEW_TOGGLEFOLDS,i && (g_bCodeFoldingAvailable && g_bShowCodeFolding));
|
||||
EnableCmd(hmenu,IDM_VIEW_TOGGLEFOLDS,!e && (g_bCodeFoldingAvailable && g_bShowCodeFolding));
|
||||
CheckCmd(hmenu,IDM_VIEW_FOLDING, (g_bCodeFoldingAvailable && g_bShowCodeFolding));
|
||||
EnableCmd(hmenu, IDM_VIEW_FOLDING, g_bCodeFoldingAvailable);
|
||||
|
||||
@ -2429,8 +2444,8 @@ void MsgInitMenu(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
CheckCmd(hmenu,IDM_VIEW_LINENUMBERS,bShowLineNumbers);
|
||||
CheckCmd(hmenu,IDM_VIEW_MARGIN,g_bShowSelectionMargin);
|
||||
|
||||
EnableCmd(hmenu,IDM_EDIT_COMPLETEWORD,i);
|
||||
CheckCmd(hmenu,IDM_VIEW_AUTOCOMPLETEWORDS,bAutoCompleteWords);
|
||||
EnableCmd(hmenu,IDM_EDIT_COMPLETEWORD,!e && !ro);
|
||||
CheckCmd(hmenu,IDM_VIEW_AUTOCOMPLETEWORDS,bAutoCompleteWords && !ro);
|
||||
CheckCmd(hmenu,IDM_VIEW_ACCELWORDNAV,bAccelWordNavigation);
|
||||
|
||||
CheckCmd(hmenu, IDM_VIEW_MARKOCCUR_ONOFF, (g_iMarkOccurrences > 0));
|
||||
@ -5425,6 +5440,12 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
_SetDocumentModified(true);
|
||||
return true;
|
||||
}
|
||||
else if (pnmh->code == SCN_MODIFYATTEMPTRO) {
|
||||
if (EditToggleView(g_hwndEdit, false)) {
|
||||
EditToggleView(g_hwndEdit, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -7638,6 +7659,12 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
bool fSuccess;
|
||||
int fileEncoding = CPI_ANSI_DEFAULT;
|
||||
|
||||
if (bNew || bReload) {
|
||||
if (EditToggleView(g_hwndEdit, false)) {
|
||||
EditToggleView(g_hwndEdit, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!bDontSave)
|
||||
{
|
||||
if (!FileSave(false,true,false,false))
|
||||
@ -7646,7 +7673,6 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
|
||||
if (!bReload) { ResetEncryption(); }
|
||||
|
||||
|
||||
if (bNew) {
|
||||
StringCchCopy(g_wchCurFile,COUNTOF(g_wchCurFile),L"");
|
||||
SetDlgItemText(g_hwndMain,IDC_FILENAME,g_wchCurFile);
|
||||
@ -7670,14 +7696,12 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
UpdateLineNumberWidth();
|
||||
|
||||
// Terminate file watching
|
||||
if (bResetFileWatching)
|
||||
if (bResetFileWatching) {
|
||||
iFileWatchingMode = 0;
|
||||
}
|
||||
InstallFileWatching(NULL);
|
||||
bEnableSaveSettings = true;
|
||||
UpdateSettingsCmds();
|
||||
if (IsWindow(g_hwndDlgFindReplace)) {
|
||||
SendMessage(g_hwndDlgFindReplace, WM_COMMAND, (WPARAM)MAKELONG(IDC_FR_RESET_STATE, 1), 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ BEGIN
|
||||
MENUITEM "Save &Copy...\tCtrl+F6", IDM_FILE_SAVECOPY
|
||||
MENUITEM "&Read Only", IDM_FILE_READONLY
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Set Encr&yption Passphrase", IDM_SETPASS
|
||||
MENUITEM "Set Encr&yption Passphrase...", IDM_SETPASS
|
||||
MENUITEM SEPARATOR
|
||||
POPUP "&Launch"
|
||||
BEGIN
|
||||
@ -326,7 +326,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Toggle View\tCtrl+Alt+V", IDM_VIEW_TOGGLE_VIEW
|
||||
MENUITEM "Toggle View\tCtrl+Alt+V", IDM_VIEW_TOGGLE_VIEW
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Line &Numbers\tCtrl+Shift+N", IDM_VIEW_LINENUMBERS
|
||||
MENUITEM "Selection &Margin\tCtrl+Shift+M", IDM_VIEW_MARGIN
|
||||
@ -391,7 +391,7 @@ BEGIN
|
||||
BEGIN
|
||||
MENUITEM "&Online Documentation\tF1", IDM_HELP_ONLINEDOCUMENTATION
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Launch &Update Installer", IDM_HELP_UPDATEINSTALLER
|
||||
MENUITEM "Launch &Update Installer...", IDM_HELP_UPDATEINSTALLER
|
||||
MENUITEM "Check &Website for Update", IDM_HELP_UPDATEWEBSITE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Command Line Help...", IDM_HELP_CMD
|
||||
@ -1009,27 +1009,27 @@ BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,245,98,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,184,98,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_PASSWORD | ES_AUTOHSCROLL | WS_GROUP
|
||||
EDITTEXT IDC_EDIT2,17,74,277,14,ES_PASSWORD
|
||||
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
|
||||
EDITTEXT IDC_EDIT1,17,35,276,12,ES_PASSWORD | ES_AUTOHSCROLL | WS_GROUP
|
||||
EDITTEXT IDC_EDIT2,17,74,277,12,ES_PASSWORD | ES_AUTOHSCROLL
|
||||
LTEXT "Optional Master Key:",IDC_STATIC,17,61,72,10,NOT WS_GROUP
|
||||
CONTROL "Encrypt using Passphrase",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,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
|
||||
CONTROL "show passphrases",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,97,75,10
|
||||
END
|
||||
|
||||
IDD_READPW DIALOGEX 0, 0, 299, 84
|
||||
IDD_READPW DIALOGEX 0, 0, 299, 81
|
||||
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", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,233,61,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,175,61,50,14
|
||||
EDITTEXT IDC_EDIT3,16,23,267,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_GROUP
|
||||
CONTROL "decrypt using the master key",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,45,117,10
|
||||
LTEXT "This file has a master key",IDC_STATICPW,16,46,89,11,NOT WS_GROUP
|
||||
GROUPBOX "Passphrase",IDC_STATIC,6,6,285,73
|
||||
CONTROL "show passphrase",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,63,75,10
|
||||
DEFPUSHBUTTON "OK",IDOK,233,58,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,175,58,50,14
|
||||
EDITTEXT IDC_EDIT3,16,23,267,12,ES_PASSWORD | ES_AUTOHSCROLL | WS_GROUP
|
||||
CONTROL "decrypt using the master key",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,40,117,10
|
||||
LTEXT "This file has a master key",IDC_STATICPW,16,41,89,11,NOT WS_GROUP
|
||||
GROUPBOX "Passphrase",IDC_STATIC,8,6,283,69
|
||||
CONTROL "show passphrase",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,60,75,10
|
||||
END
|
||||
|
||||
IDD_COLUMNWRAP DIALOGEX 0, 0, 130, 47
|
||||
|
||||
742
src/SciCall.h
742
src/SciCall.h
@ -1,368 +1,374 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* Notepad3 *
|
||||
* *
|
||||
* SciCall.h *
|
||||
* Inline wrappers for Scintilla API calls, arranged in the order and *
|
||||
* grouping in which they appear in the Scintilla documentation. *
|
||||
* Based on code from Notepad2, (c) Florian Balmer 1996-2011 *
|
||||
* *
|
||||
* The use of these inline wrapper functions with declared types will *
|
||||
* ensure that we get the benefit of the compiler's type checking. *
|
||||
* *
|
||||
* (c) Rizonesoft 2008-2018 *
|
||||
* https://rizonesoft.com *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* On Windows, the message - passing scheme used to communicate between the
|
||||
* container and Scintilla is mediated by the operating system SendMessage
|
||||
* function and can lead to bad performance when calling intensively.
|
||||
* To avoid this overhead, Scintilla provides messages that allow you to call
|
||||
* the Scintilla message function directly.
|
||||
* The code to do this in C / C++ is of the form :
|
||||
*
|
||||
* #include "Scintilla.h"
|
||||
* SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
|
||||
* sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);
|
||||
*
|
||||
* // now a wrapper to call Scintilla directly
|
||||
* sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
* return pSciMsg(pSciWndData, iMessage, wParam, lParam);
|
||||
* }
|
||||
*
|
||||
* SciFnDirect, sptr_t and uptr_t are declared in Scintilla.h.hSciWnd
|
||||
* is the window handle returned when you created the Scintilla window.
|
||||
*
|
||||
* While faster, this direct calling will cause problems if performed from a
|
||||
* different thread to the native thread of the Scintilla window in which case
|
||||
* SendMessage(hSciWnd, SCI_*, wParam, lParam) should be used
|
||||
* to synchronize with the window's thread.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
#define SCI_DIRECTFUNCTION_INTERFACE 1 // disable for asynchronous operation
|
||||
|
||||
|
||||
#pragma once
|
||||
#ifndef _NP3_SCICALL_H_
|
||||
#define _NP3_SCICALL_H_
|
||||
|
||||
#include "TypeDefs.h"
|
||||
|
||||
extern HANDLE g_hScintilla;
|
||||
extern HANDLE g_hwndEdit;
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Sci_SendMessage() short version
|
||||
//
|
||||
#define Sci_SendMsgV0(CMD) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)0, (LPARAM)0)
|
||||
#define Sci_SendMsgV1(CMD,WP) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)0)
|
||||
#define Sci_SendMsgV2(CMD,WP,LP) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)(LP))
|
||||
|
||||
#define Sci_PostMsgV0(CMD) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)0, (LPARAM)0)
|
||||
#define Sci_PostMsgV1(CMD,WP) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)0)
|
||||
#define Sci_PostMsgV2(CMD,WP,LP) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)(LP))
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SciCall()
|
||||
//
|
||||
#ifdef SCI_DIRECTFUNCTION_INTERFACE
|
||||
|
||||
LRESULT WINAPI Scintilla_DirectFunction(HANDLE, UINT, WPARAM, LPARAM);
|
||||
#define SciCall(m, w, l) Scintilla_DirectFunction(g_hScintilla, m, w, l)
|
||||
|
||||
#else
|
||||
|
||||
#define SciCall(m, w, l) SendMessage(g_hwndEdit, m, w, l)
|
||||
|
||||
#endif // SCI_DIRECTFUNCTION_INTERFACE
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// DeclareSciCall[RV][0-2] Macros
|
||||
//
|
||||
// R: With an explicit return type
|
||||
// V: No return type defined ("void"); defaults to SendMessage's LRESULT
|
||||
// 0-2: Number of parameters to define
|
||||
//
|
||||
#define DeclareSciCallR0(fn, msg, ret) \
|
||||
__forceinline ret SciCall_##fn() { \
|
||||
return((ret)SciCall(SCI_##msg, 0, 0)); \
|
||||
}
|
||||
#define DeclareSciCallR1(fn, msg, ret, type1, var1) \
|
||||
__forceinline ret SciCall_##fn(type1 var1) { \
|
||||
return((ret)SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
|
||||
}
|
||||
#define DeclareSciCallR01(fn, msg, ret, type2, var2) \
|
||||
__forceinline ret SciCall_##fn(type2 var2) { \
|
||||
return((ret)SciCall(SCI_##msg, 0, (LPARAM)(var2))); \
|
||||
}
|
||||
#define DeclareSciCallR2(fn, msg, ret, type1, var1, type2, var2) \
|
||||
__forceinline ret SciCall_##fn(type1 var1, type2 var2) { \
|
||||
return((ret)SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
|
||||
}
|
||||
|
||||
#define DeclareSciCallV0(fn, msg) \
|
||||
__forceinline LRESULT SciCall_##fn() { \
|
||||
return(SciCall(SCI_##msg, 0, 0)); \
|
||||
}
|
||||
#define DeclareSciCallV1(fn, msg, type1, var1) \
|
||||
__forceinline LRESULT SciCall_##fn(type1 var1) { \
|
||||
return(SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
|
||||
}
|
||||
#define DeclareSciCallV01(fn, msg, type2, var2) \
|
||||
__forceinline LRESULT SciCall_##fn(type2 var2) { \
|
||||
return(SciCall(SCI_##msg, 0, (LPARAM)(var2))); \
|
||||
}
|
||||
#define DeclareSciCallV2(fn, msg, type1, var1, type2, var2) \
|
||||
__forceinline LRESULT SciCall_##fn(type1 var1, type2 var2) { \
|
||||
return(SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Selection, positions and information
|
||||
//
|
||||
DeclareSciCallR0(IsDocModified, GETMODIFY, bool)
|
||||
DeclareSciCallR0(IsSelectionEmpty, GETSELECTIONEMPTY, bool)
|
||||
DeclareSciCallR0(IsSelectionRectangle, SELECTIONISRECTANGLE, bool)
|
||||
|
||||
DeclareSciCallR0(CanPaste, CANPASTE, bool)
|
||||
|
||||
DeclareSciCallR0(GetCurrentPos, GETCURRENTPOS, DocPos)
|
||||
DeclareSciCallR0(GetAnchor, GETANCHOR, DocPos)
|
||||
DeclareSciCallR0(GetSelectionMode, GETSELECTIONMODE, int)
|
||||
DeclareSciCallR0(GetSelectionStart, GETSELECTIONSTART, DocPos)
|
||||
DeclareSciCallR0(GetSelectionEnd, GETSELECTIONEND, DocPos)
|
||||
DeclareSciCallR1(GetLineSelStartPosition, GETLINESELSTARTPOSITION, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetLineSelEndPosition, GETLINESELENDPOSITION, DocPos, DocLn, line)
|
||||
|
||||
// Rectangular selection with virtual space
|
||||
DeclareSciCallR0(GetRectangularSelectionCaret, GETRECTANGULARSELECTIONCARET, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionCaret, SETRECTANGULARSELECTIONCARET, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionAnchor, GETRECTANGULARSELECTIONANCHOR, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionAnchor, SETRECTANGULARSELECTIONANCHOR, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionCaretVirtualSpace, GETRECTANGULARSELECTIONCARETVIRTUALSPACE, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionCaretVirtualSpace, SETRECTANGULARSELECTIONCARETVIRTUALSPACE, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionAnchorVirtualSpace, GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionAnchorVirtualSpace, SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, DocPos, position)
|
||||
|
||||
// Multiselections (Lines of Rectangular selection)
|
||||
DeclareSciCallV0(ClearSelections, CLEARSELECTIONS)
|
||||
DeclareSciCallV0(SwapMainAnchorCaret, SWAPMAINANCHORCARET)
|
||||
DeclareSciCallR0(GetSelections, GETSELECTIONS, DocPosU)
|
||||
DeclareSciCallR1(GetSelectionNCaret, GETSELECTIONNCARET, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNAnchor, GETSELECTIONNANCHOR, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNCaretVirtualSpace, GETSELECTIONNCARETVIRTUALSPACE, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNAnchorVirtualSpace, GETSELECTIONNANCHORVIRTUALSPACE, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallV2(SetSelectionNCaret, SETSELECTIONNCARET, DocPosU, selnum, DocPos, caretPos)
|
||||
DeclareSciCallV2(SetSelectionNAnchor, SETSELECTIONNANCHOR, DocPosU, selnum, DocPos, anchorPos)
|
||||
DeclareSciCallV2(SetSelectionNCaretVirtualSpace, SETSELECTIONNCARETVIRTUALSPACE, DocPosU, selnum, DocPos, position)
|
||||
DeclareSciCallV2(SetSelectionNAnchorVirtualSpace, SETSELECTIONNANCHORVIRTUALSPACE, DocPosU, selnum, DocPos, position)
|
||||
|
||||
|
||||
// Operations
|
||||
DeclareSciCallV0(Cut, CUT)
|
||||
DeclareSciCallV0(Copy, COPY)
|
||||
DeclareSciCallV0(Paste, PASTE)
|
||||
DeclareSciCallV0(Clear, CLEAR)
|
||||
DeclareSciCallV0(Cancel, CANCEL)
|
||||
DeclareSciCallV0(CopyAllowLine, COPYALLOWLINE)
|
||||
DeclareSciCallV0(LineDelete, LINEDELETE)
|
||||
DeclareSciCallV2(CopyText, COPYTEXT, DocPos, length, const char*, text)
|
||||
DeclareSciCallV2(GetText, GETTEXT, DocPos, length, const char*, text)
|
||||
|
||||
DeclareSciCallV2(SetSel, SETSEL, DocPos, anchorPos, DocPos, currentPos)
|
||||
DeclareSciCallV0(SelectAll, SELECTALL)
|
||||
DeclareSciCallR01(GetSelText, GETSELTEXT, DocPos, const char*, text)
|
||||
DeclareSciCallV01(ReplaceSel, REPLACESEL, const char*, text)
|
||||
DeclareSciCallR2(GetLine, GETLINE, DocPos, DocLn, line, const char*, text)
|
||||
DeclareSciCallV2(InsertText, INSERTTEXT, DocPos, position, const char*, text)
|
||||
|
||||
|
||||
DeclareSciCallR0(GetTargetStart, GETTARGETSTART, DocPos)
|
||||
DeclareSciCallR0(GetTargetEnd, GETTARGETEND, DocPos)
|
||||
DeclareSciCallV0(TargetFromSelection, TARGETFROMSELECTION)
|
||||
DeclareSciCallV2(SetTargetRange, SETTARGETRANGE, DocPos, start, DocPos, end)
|
||||
DeclareSciCallR2(ReplaceTarget, REPLACETARGET, DocPos, DocPos, length, const char*, text)
|
||||
DeclareSciCallV2(AddText, ADDTEXT, DocPos, length, const char*, text)
|
||||
|
||||
|
||||
DeclareSciCallV1(SetAnchor, SETANCHOR, DocPos, position)
|
||||
DeclareSciCallV1(SetCurrentPos, SETCURRENTPOS, DocPos, position)
|
||||
DeclareSciCallV1(SetMultiPaste, SETMULTIPASTE, int, option)
|
||||
|
||||
DeclareSciCallV1(GotoPos, GOTOPOS, DocPos, position)
|
||||
DeclareSciCallV1(GotoLine, GOTOLINE, DocLn, line)
|
||||
DeclareSciCallR1(PositionBefore, POSITIONBEFORE, DocPos, DocPos, position)
|
||||
DeclareSciCallR1(PositionAfter, POSITIONAFTER, DocPos, DocPos, position)
|
||||
DeclareSciCallR1(GetCharAt, GETCHARAT, char, DocPos, position)
|
||||
DeclareSciCallR0(GetEOLMode, GETEOLMODE, int)
|
||||
|
||||
DeclareSciCallR0(GetLineCount, GETLINECOUNT, DocLn)
|
||||
DeclareSciCallR0(GetTextLength, GETTEXTLENGTH, DocPos)
|
||||
DeclareSciCallR1(LineLength, LINELENGTH, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(LineFromPosition, LINEFROMPOSITION, DocLn, DocPos, position)
|
||||
DeclareSciCallR1(PositionFromLine, POSITIONFROMLINE, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetLineEndPosition, GETLINEENDPOSITION, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetColumn, GETCOLUMN, DocPos, DocPos, position)
|
||||
DeclareSciCallR2(FindColumn, FINDCOLUMN, DocPos, DocLn, line, DocPos, column)
|
||||
DeclareSciCallR1(GetLineIndentPosition, GETLINEINDENTPOSITION, DocPos, DocLn, line)
|
||||
|
||||
DeclareSciCallR2(GetRangePointer, GETRANGEPOINTER, char* const, DocPos, start, DocPos, length)
|
||||
DeclareSciCallR0(GetCharacterPointer, GETCHARACTERPOINTER, const char*)
|
||||
|
||||
DeclareSciCallV1(SetVirtualSpaceOptions, SETVIRTUALSPACEOPTIONS, int, options)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Commands
|
||||
//
|
||||
DeclareSciCallV0(NewLine, NEWLINE)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Scrolling and automatic scrolling
|
||||
//
|
||||
DeclareSciCallV2(SetVisiblePolicy, SETVISIBLEPOLICY, int, flags, DocLn, lines)
|
||||
DeclareSciCallV0(ChooseCaretX, CHOOSECARETX)
|
||||
DeclareSciCallV0(ScrollCaret, SCROLLCARET)
|
||||
DeclareSciCallV2(LineScroll, LINESCROLL, DocPos, columns, DocLn, lines)
|
||||
DeclareSciCallV2(ScrollRange, SCROLLRANGE, DocPos, secondaryPos, DocPos, primaryPos)
|
||||
DeclareSciCallV1(SetScrollWidth, SETSCROLLWIDTH, int, width)
|
||||
DeclareSciCallV1(SetEndAtLastLine, SETENDATLASTLINE, bool, flag)
|
||||
DeclareSciCallR0(GetXoffset, GETXOFFSET, int)
|
||||
DeclareSciCallV1(SetXoffset, SETXOFFSET, int, offset)
|
||||
|
||||
DeclareSciCallR0(LinesOnScreen, LINESONSCREEN, DocLn)
|
||||
DeclareSciCallR0(GetFirstVisibleLine, GETFIRSTVISIBLELINE, DocLn)
|
||||
DeclareSciCallV1(SetFirstVisibleLine, SETFIRSTVISIBLELINE, DocLn, line)
|
||||
DeclareSciCallR1(DocLineFromVisible, DOCLINEFROMVISIBLE, DocLn, DocLn, line)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Style definition
|
||||
//
|
||||
DeclareSciCallR1(StyleGetFore, STYLEGETFORE, COLORREF, int, styleNumber)
|
||||
DeclareSciCallR1(StyleGetBack, STYLEGETBACK, COLORREF, int, styleNumber)
|
||||
DeclareSciCallV2(SetStyling, SETSTYLING, DocPosCR, length, int, style)
|
||||
DeclareSciCallV1(StartStyling, STARTSTYLING, DocPos, position)
|
||||
DeclareSciCallR0(GetEndStyled, GETENDSTYLED, DocPos)
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Margins
|
||||
//
|
||||
DeclareSciCallV2(SetMarginType, SETMARGINTYPEN, int, margin, int, type)
|
||||
DeclareSciCallV2(SetMarginWidth, SETMARGINWIDTHN, int, margin, int, pixelWidth)
|
||||
DeclareSciCallV2(SetMarginMask, SETMARGINMASKN, int, margin, int, mask)
|
||||
DeclareSciCallV2(SetMarginSensitive, SETMARGINSENSITIVEN, int, margin, bool, sensitive)
|
||||
DeclareSciCallV2(SetMarginBackN, SETMARGINBACKN, int, margin, COLORREF, colour)
|
||||
DeclareSciCallV2(SetFoldMarginColour, SETFOLDMARGINCOLOUR, bool, useSetting, COLORREF, colour)
|
||||
DeclareSciCallV2(SetFoldMarginHiColour, SETFOLDMARGINHICOLOUR, bool, useSetting, COLORREF, colour)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Markers
|
||||
//
|
||||
DeclareSciCallR1(MarkerGet, MARKERGET, int, DocLn, line)
|
||||
DeclareSciCallV2(MarkerDefine, MARKERDEFINE, int, markerNumber, int, markerSymbols)
|
||||
DeclareSciCallV2(MarkerSetFore, MARKERSETFORE, int, markerNumber, COLORREF, colour)
|
||||
DeclareSciCallV2(MarkerSetBack, MARKERSETBACK, int, markerNumber, COLORREF, colour)
|
||||
DeclareSciCallV2(MarkerSetAlpha, MARKERSETALPHA, int, markerNumber, int, alpha)
|
||||
DeclareSciCallR2(MarkerAdd, MARKERADD, int, DocLn, line, int, markerNumber)
|
||||
DeclareSciCallV2(MarkerDelete, MARKERDELETE, DocLn, line, int, markerNumber)
|
||||
DeclareSciCallV1(MarkerDeleteAll, MARKERDELETEALL, int, markerNumber)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Indicators
|
||||
//
|
||||
DeclareSciCallR2(IndicatorValueAt, INDICATORVALUEAT, int, int, indicatorID, DocPos, position)
|
||||
DeclareSciCallV2(IndicatorFillRange, INDICATORFILLRANGE, DocPos, position, DocPos, length)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Folding
|
||||
//
|
||||
//
|
||||
DeclareSciCallR1(GetLineVisible, GETLINEVISIBLE, bool, DocLn, line)
|
||||
DeclareSciCallV2(SetFoldLevel, SETFOLDLEVEL, DocLn, line, int, flags)
|
||||
DeclareSciCallR1(GetFoldLevel, GETFOLDLEVEL, int, DocLn, line)
|
||||
DeclareSciCallV1(SetFoldFlags, SETFOLDFLAGS, int, flags)
|
||||
DeclareSciCallV1(FoldDisplayTextSetStyle, FOLDDISPLAYTEXTSETSTYLE, int, flags)
|
||||
DeclareSciCallR1(GetFoldParent, GETFOLDPARENT, int, DocLn, line)
|
||||
DeclareSciCallR1(GetFoldExpanded, GETFOLDEXPANDED, int, DocLn, line)
|
||||
DeclareSciCallV1(ToggleFold, TOGGLEFOLD, DocLn, line)
|
||||
DeclareSciCallV1(FoldAll, FOLDALL, int, flags)
|
||||
DeclareSciCallV1(EnsureVisible, ENSUREVISIBLE, DocLn, line)
|
||||
DeclareSciCallV1(EnsureVisibleEnforcePolicy, ENSUREVISIBLEENFORCEPOLICY, DocLn, line)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Lexer
|
||||
//
|
||||
DeclareSciCallV2(SetProperty, SETPROPERTY, const char *, key, const char *, value)
|
||||
DeclareSciCallV2(Colourise, COLOURISE, DocPos, startPos, DocPos, endPos)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
DeclareSciCallV1(SetCursor, SETCURSOR, int, flags)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Undo/Redo Stack
|
||||
//
|
||||
DeclareSciCallR0(GetUndoCollection, GETUNDOCOLLECTION, bool)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SetTechnology
|
||||
//
|
||||
DeclareSciCallV1(SetBufferedDraw, SETBUFFEREDDRAW, bool, value)
|
||||
DeclareSciCallV1(SetTechnology, SETTECHNOLOGY, int, technology)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Utilities
|
||||
//
|
||||
#define Sci_IsStreamSelected() (SciCall_GetSelectionMode() == SC_SEL_STREAM)
|
||||
#define Sci_IsFullLineSelected() (SciCall_GetSelectionMode() == SC_SEL_LINES)
|
||||
#define Sci_IsThinRectangleSelected() (SciCall_GetSelectionMode() == SC_SEL_THIN)
|
||||
#define Sci_IsSingleLineSelection() \
|
||||
(SciCall_LineFromPosition(SciCall_GetCurrentPos()) == SciCall_LineFromPosition(SciCall_GetAnchor()))
|
||||
|
||||
#define Sci_GetEOLLen() ((SciCall_GetEOLMode() == SC_EOL_CRLF) ? 2 : 1)
|
||||
|
||||
#define Sci_GetCurrentLine() SciCall_LineFromPosition(SciCall_GetCurrentPos())
|
||||
|
||||
// length of line w/o line-end chars (full use SciCall_LineLength()
|
||||
#define Sci_GetNetLineLength(line) (SciCall_GetLineEndPosition(line) - SciCall_PositionFromLine(line))
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#endif //_NP3_SCICALL_H_
|
||||
/******************************************************************************
|
||||
* *
|
||||
* *
|
||||
* Notepad3 *
|
||||
* *
|
||||
* SciCall.h *
|
||||
* Inline wrappers for Scintilla API calls, arranged in the order and *
|
||||
* grouping in which they appear in the Scintilla documentation. *
|
||||
* Based on code from Notepad2, (c) Florian Balmer 1996-2011 *
|
||||
* *
|
||||
* The use of these inline wrapper functions with declared types will *
|
||||
* ensure that we get the benefit of the compiler's type checking. *
|
||||
* *
|
||||
* (c) Rizonesoft 2008-2018 *
|
||||
* https://rizonesoft.com *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* On Windows, the message - passing scheme used to communicate between the
|
||||
* container and Scintilla is mediated by the operating system SendMessage
|
||||
* function and can lead to bad performance when calling intensively.
|
||||
* To avoid this overhead, Scintilla provides messages that allow you to call
|
||||
* the Scintilla message function directly.
|
||||
* The code to do this in C / C++ is of the form :
|
||||
*
|
||||
* #include "Scintilla.h"
|
||||
* SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
|
||||
* sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);
|
||||
*
|
||||
* // now a wrapper to call Scintilla directly
|
||||
* sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
* return pSciMsg(pSciWndData, iMessage, wParam, lParam);
|
||||
* }
|
||||
*
|
||||
* SciFnDirect, sptr_t and uptr_t are declared in Scintilla.h.hSciWnd
|
||||
* is the window handle returned when you created the Scintilla window.
|
||||
*
|
||||
* While faster, this direct calling will cause problems if performed from a
|
||||
* different thread to the native thread of the Scintilla window in which case
|
||||
* SendMessage(hSciWnd, SCI_*, wParam, lParam) should be used
|
||||
* to synchronize with the window's thread.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
#define SCI_DIRECTFUNCTION_INTERFACE 1 // disable for asynchronous operation
|
||||
|
||||
|
||||
#pragma once
|
||||
#ifndef _NP3_SCICALL_H_
|
||||
#define _NP3_SCICALL_H_
|
||||
|
||||
#include "TypeDefs.h"
|
||||
|
||||
extern HANDLE g_hScintilla;
|
||||
extern HANDLE g_hwndEdit;
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Sci_SendMessage() short version
|
||||
//
|
||||
#define Sci_SendMsgV0(CMD) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)0, (LPARAM)0)
|
||||
#define Sci_SendMsgV1(CMD,WP) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)0)
|
||||
#define Sci_SendMsgV2(CMD,WP,LP) SendMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)(LP))
|
||||
|
||||
#define Sci_PostMsgV0(CMD) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)0, (LPARAM)0)
|
||||
#define Sci_PostMsgV1(CMD,WP) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)0)
|
||||
#define Sci_PostMsgV2(CMD,WP,LP) PostMessage(g_hwndEdit, SCI_##CMD, (WPARAM)(WP), (LPARAM)(LP))
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SciCall()
|
||||
//
|
||||
#ifdef SCI_DIRECTFUNCTION_INTERFACE
|
||||
|
||||
LRESULT WINAPI Scintilla_DirectFunction(HANDLE, UINT, WPARAM, LPARAM);
|
||||
#define SciCall(m, w, l) Scintilla_DirectFunction(g_hScintilla, m, w, l)
|
||||
|
||||
#else
|
||||
|
||||
#define SciCall(m, w, l) SendMessage(g_hwndEdit, m, w, l)
|
||||
|
||||
#endif // SCI_DIRECTFUNCTION_INTERFACE
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// DeclareSciCall[RV][0-2] Macros
|
||||
//
|
||||
// R: With an explicit return type
|
||||
// V: No return type defined ("void"); defaults to SendMessage's LRESULT
|
||||
// 0-2: Number of parameters to define
|
||||
//
|
||||
#define DeclareSciCallR0(fn, msg, ret) \
|
||||
__forceinline ret SciCall_##fn() { \
|
||||
return((ret)SciCall(SCI_##msg, 0, 0)); \
|
||||
}
|
||||
#define DeclareSciCallR1(fn, msg, ret, type1, var1) \
|
||||
__forceinline ret SciCall_##fn(type1 var1) { \
|
||||
return((ret)SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
|
||||
}
|
||||
#define DeclareSciCallR01(fn, msg, ret, type2, var2) \
|
||||
__forceinline ret SciCall_##fn(type2 var2) { \
|
||||
return((ret)SciCall(SCI_##msg, 0, (LPARAM)(var2))); \
|
||||
}
|
||||
#define DeclareSciCallR2(fn, msg, ret, type1, var1, type2, var2) \
|
||||
__forceinline ret SciCall_##fn(type1 var1, type2 var2) { \
|
||||
return((ret)SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
|
||||
}
|
||||
|
||||
#define DeclareSciCallV0(fn, msg) \
|
||||
__forceinline LRESULT SciCall_##fn() { \
|
||||
return(SciCall(SCI_##msg, 0, 0)); \
|
||||
}
|
||||
#define DeclareSciCallV1(fn, msg, type1, var1) \
|
||||
__forceinline LRESULT SciCall_##fn(type1 var1) { \
|
||||
return(SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
|
||||
}
|
||||
#define DeclareSciCallV01(fn, msg, type2, var2) \
|
||||
__forceinline LRESULT SciCall_##fn(type2 var2) { \
|
||||
return(SciCall(SCI_##msg, 0, (LPARAM)(var2))); \
|
||||
}
|
||||
#define DeclareSciCallV2(fn, msg, type1, var1, type2, var2) \
|
||||
__forceinline LRESULT SciCall_##fn(type1 var1, type2 var2) { \
|
||||
return(SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Selection, positions and information
|
||||
//
|
||||
|
||||
DeclareSciCallR0(GetReadOnly, GETREADONLY, bool)
|
||||
DeclareSciCallV1(SetReadOnly, SETREADONLY, bool, flag)
|
||||
DeclareSciCallR0(CanUndo, CANUNDO, bool)
|
||||
DeclareSciCallR0(CanRedo, CANREDO, bool)
|
||||
|
||||
DeclareSciCallR0(IsDocModified, GETMODIFY, bool)
|
||||
DeclareSciCallR0(IsSelectionEmpty, GETSELECTIONEMPTY, bool)
|
||||
DeclareSciCallR0(IsSelectionRectangle, SELECTIONISRECTANGLE, bool)
|
||||
|
||||
DeclareSciCallR0(CanPaste, CANPASTE, bool)
|
||||
|
||||
DeclareSciCallR0(GetCurrentPos, GETCURRENTPOS, DocPos)
|
||||
DeclareSciCallR0(GetAnchor, GETANCHOR, DocPos)
|
||||
DeclareSciCallR0(GetSelectionMode, GETSELECTIONMODE, int)
|
||||
DeclareSciCallR0(GetSelectionStart, GETSELECTIONSTART, DocPos)
|
||||
DeclareSciCallR0(GetSelectionEnd, GETSELECTIONEND, DocPos)
|
||||
DeclareSciCallR1(GetLineSelStartPosition, GETLINESELSTARTPOSITION, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetLineSelEndPosition, GETLINESELENDPOSITION, DocPos, DocLn, line)
|
||||
|
||||
// Rectangular selection with virtual space
|
||||
DeclareSciCallR0(GetRectangularSelectionCaret, GETRECTANGULARSELECTIONCARET, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionCaret, SETRECTANGULARSELECTIONCARET, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionAnchor, GETRECTANGULARSELECTIONANCHOR, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionAnchor, SETRECTANGULARSELECTIONANCHOR, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionCaretVirtualSpace, GETRECTANGULARSELECTIONCARETVIRTUALSPACE, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionCaretVirtualSpace, SETRECTANGULARSELECTIONCARETVIRTUALSPACE, DocPos, position)
|
||||
DeclareSciCallR0(GetRectangularSelectionAnchorVirtualSpace, GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, DocPos)
|
||||
DeclareSciCallV1(SetRectangularSelectionAnchorVirtualSpace, SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, DocPos, position)
|
||||
|
||||
// Multiselections (Lines of Rectangular selection)
|
||||
DeclareSciCallV0(ClearSelections, CLEARSELECTIONS)
|
||||
DeclareSciCallV0(SwapMainAnchorCaret, SWAPMAINANCHORCARET)
|
||||
DeclareSciCallR0(GetSelections, GETSELECTIONS, DocPosU)
|
||||
DeclareSciCallR1(GetSelectionNCaret, GETSELECTIONNCARET, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNAnchor, GETSELECTIONNANCHOR, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNCaretVirtualSpace, GETSELECTIONNCARETVIRTUALSPACE, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallR1(GetSelectionNAnchorVirtualSpace, GETSELECTIONNANCHORVIRTUALSPACE, DocPos, DocPosU, selnum)
|
||||
DeclareSciCallV2(SetSelectionNCaret, SETSELECTIONNCARET, DocPosU, selnum, DocPos, caretPos)
|
||||
DeclareSciCallV2(SetSelectionNAnchor, SETSELECTIONNANCHOR, DocPosU, selnum, DocPos, anchorPos)
|
||||
DeclareSciCallV2(SetSelectionNCaretVirtualSpace, SETSELECTIONNCARETVIRTUALSPACE, DocPosU, selnum, DocPos, position)
|
||||
DeclareSciCallV2(SetSelectionNAnchorVirtualSpace, SETSELECTIONNANCHORVIRTUALSPACE, DocPosU, selnum, DocPos, position)
|
||||
|
||||
|
||||
// Operations
|
||||
DeclareSciCallV0(Cut, CUT)
|
||||
DeclareSciCallV0(Copy, COPY)
|
||||
DeclareSciCallV0(Paste, PASTE)
|
||||
DeclareSciCallV0(Clear, CLEAR)
|
||||
DeclareSciCallV0(Cancel, CANCEL)
|
||||
DeclareSciCallV0(CopyAllowLine, COPYALLOWLINE)
|
||||
DeclareSciCallV0(LineDelete, LINEDELETE)
|
||||
DeclareSciCallV2(CopyText, COPYTEXT, DocPos, length, const char*, text)
|
||||
DeclareSciCallV2(GetText, GETTEXT, DocPos, length, const char*, text)
|
||||
|
||||
DeclareSciCallV2(SetSel, SETSEL, DocPos, anchorPos, DocPos, currentPos)
|
||||
DeclareSciCallV0(SelectAll, SELECTALL)
|
||||
DeclareSciCallR01(GetSelText, GETSELTEXT, DocPos, const char*, text)
|
||||
DeclareSciCallV01(ReplaceSel, REPLACESEL, const char*, text)
|
||||
DeclareSciCallR2(GetLine, GETLINE, DocPos, DocLn, line, const char*, text)
|
||||
DeclareSciCallV2(InsertText, INSERTTEXT, DocPos, position, const char*, text)
|
||||
|
||||
|
||||
DeclareSciCallR0(GetTargetStart, GETTARGETSTART, DocPos)
|
||||
DeclareSciCallR0(GetTargetEnd, GETTARGETEND, DocPos)
|
||||
DeclareSciCallV0(TargetFromSelection, TARGETFROMSELECTION)
|
||||
DeclareSciCallV2(SetTargetRange, SETTARGETRANGE, DocPos, start, DocPos, end)
|
||||
DeclareSciCallR2(ReplaceTarget, REPLACETARGET, DocPos, DocPos, length, const char*, text)
|
||||
DeclareSciCallV2(AddText, ADDTEXT, DocPos, length, const char*, text)
|
||||
|
||||
|
||||
DeclareSciCallV1(SetAnchor, SETANCHOR, DocPos, position)
|
||||
DeclareSciCallV1(SetCurrentPos, SETCURRENTPOS, DocPos, position)
|
||||
DeclareSciCallV1(SetMultiPaste, SETMULTIPASTE, int, option)
|
||||
|
||||
DeclareSciCallV1(GotoPos, GOTOPOS, DocPos, position)
|
||||
DeclareSciCallV1(GotoLine, GOTOLINE, DocLn, line)
|
||||
DeclareSciCallR1(PositionBefore, POSITIONBEFORE, DocPos, DocPos, position)
|
||||
DeclareSciCallR1(PositionAfter, POSITIONAFTER, DocPos, DocPos, position)
|
||||
DeclareSciCallR1(GetCharAt, GETCHARAT, char, DocPos, position)
|
||||
DeclareSciCallR0(GetEOLMode, GETEOLMODE, int)
|
||||
|
||||
DeclareSciCallR0(GetLineCount, GETLINECOUNT, DocLn)
|
||||
DeclareSciCallR0(GetTextLength, GETTEXTLENGTH, DocPos)
|
||||
DeclareSciCallR1(LineLength, LINELENGTH, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(LineFromPosition, LINEFROMPOSITION, DocLn, DocPos, position)
|
||||
DeclareSciCallR1(PositionFromLine, POSITIONFROMLINE, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetLineEndPosition, GETLINEENDPOSITION, DocPos, DocLn, line)
|
||||
DeclareSciCallR1(GetColumn, GETCOLUMN, DocPos, DocPos, position)
|
||||
DeclareSciCallR2(FindColumn, FINDCOLUMN, DocPos, DocLn, line, DocPos, column)
|
||||
DeclareSciCallR1(GetLineIndentPosition, GETLINEINDENTPOSITION, DocPos, DocLn, line)
|
||||
|
||||
DeclareSciCallR2(GetRangePointer, GETRANGEPOINTER, char* const, DocPos, start, DocPos, length)
|
||||
DeclareSciCallR0(GetCharacterPointer, GETCHARACTERPOINTER, const char*)
|
||||
|
||||
DeclareSciCallV1(SetVirtualSpaceOptions, SETVIRTUALSPACEOPTIONS, int, options)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Commands
|
||||
//
|
||||
DeclareSciCallV0(NewLine, NEWLINE)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Scrolling and automatic scrolling
|
||||
//
|
||||
DeclareSciCallV2(SetVisiblePolicy, SETVISIBLEPOLICY, int, flags, DocLn, lines)
|
||||
DeclareSciCallV0(ChooseCaretX, CHOOSECARETX)
|
||||
DeclareSciCallV0(ScrollCaret, SCROLLCARET)
|
||||
DeclareSciCallV2(LineScroll, LINESCROLL, DocPos, columns, DocLn, lines)
|
||||
DeclareSciCallV2(ScrollRange, SCROLLRANGE, DocPos, secondaryPos, DocPos, primaryPos)
|
||||
DeclareSciCallV1(SetScrollWidth, SETSCROLLWIDTH, int, width)
|
||||
DeclareSciCallV1(SetEndAtLastLine, SETENDATLASTLINE, bool, flag)
|
||||
DeclareSciCallR0(GetXoffset, GETXOFFSET, int)
|
||||
DeclareSciCallV1(SetXoffset, SETXOFFSET, int, offset)
|
||||
|
||||
DeclareSciCallR0(LinesOnScreen, LINESONSCREEN, DocLn)
|
||||
DeclareSciCallR0(GetFirstVisibleLine, GETFIRSTVISIBLELINE, DocLn)
|
||||
DeclareSciCallV1(SetFirstVisibleLine, SETFIRSTVISIBLELINE, DocLn, line)
|
||||
DeclareSciCallR1(DocLineFromVisible, DOCLINEFROMVISIBLE, DocLn, DocLn, line)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Style definition
|
||||
//
|
||||
DeclareSciCallR1(StyleGetFore, STYLEGETFORE, COLORREF, int, styleNumber)
|
||||
DeclareSciCallR1(StyleGetBack, STYLEGETBACK, COLORREF, int, styleNumber)
|
||||
DeclareSciCallV2(SetStyling, SETSTYLING, DocPosCR, length, int, style)
|
||||
DeclareSciCallV1(StartStyling, STARTSTYLING, DocPos, position)
|
||||
DeclareSciCallR0(GetEndStyled, GETENDSTYLED, DocPos)
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Margins
|
||||
//
|
||||
DeclareSciCallV2(SetMarginType, SETMARGINTYPEN, int, margin, int, type)
|
||||
DeclareSciCallV2(SetMarginWidth, SETMARGINWIDTHN, int, margin, int, pixelWidth)
|
||||
DeclareSciCallV2(SetMarginMask, SETMARGINMASKN, int, margin, int, mask)
|
||||
DeclareSciCallV2(SetMarginSensitive, SETMARGINSENSITIVEN, int, margin, bool, sensitive)
|
||||
DeclareSciCallV2(SetMarginBackN, SETMARGINBACKN, int, margin, COLORREF, colour)
|
||||
DeclareSciCallV2(SetFoldMarginColour, SETFOLDMARGINCOLOUR, bool, useSetting, COLORREF, colour)
|
||||
DeclareSciCallV2(SetFoldMarginHiColour, SETFOLDMARGINHICOLOUR, bool, useSetting, COLORREF, colour)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Markers
|
||||
//
|
||||
DeclareSciCallR1(MarkerGet, MARKERGET, int, DocLn, line)
|
||||
DeclareSciCallV2(MarkerDefine, MARKERDEFINE, int, markerNumber, int, markerSymbols)
|
||||
DeclareSciCallV2(MarkerSetFore, MARKERSETFORE, int, markerNumber, COLORREF, colour)
|
||||
DeclareSciCallV2(MarkerSetBack, MARKERSETBACK, int, markerNumber, COLORREF, colour)
|
||||
DeclareSciCallV2(MarkerSetAlpha, MARKERSETALPHA, int, markerNumber, int, alpha)
|
||||
DeclareSciCallR2(MarkerAdd, MARKERADD, int, DocLn, line, int, markerNumber)
|
||||
DeclareSciCallV2(MarkerDelete, MARKERDELETE, DocLn, line, int, markerNumber)
|
||||
DeclareSciCallV1(MarkerDeleteAll, MARKERDELETEALL, int, markerNumber)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Indicators
|
||||
//
|
||||
DeclareSciCallR2(IndicatorValueAt, INDICATORVALUEAT, int, int, indicatorID, DocPos, position)
|
||||
DeclareSciCallV2(IndicatorFillRange, INDICATORFILLRANGE, DocPos, position, DocPos, length)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Folding
|
||||
//
|
||||
//
|
||||
DeclareSciCallR1(GetLineVisible, GETLINEVISIBLE, bool, DocLn, line)
|
||||
DeclareSciCallV2(SetFoldLevel, SETFOLDLEVEL, DocLn, line, int, flags)
|
||||
DeclareSciCallR1(GetFoldLevel, GETFOLDLEVEL, int, DocLn, line)
|
||||
DeclareSciCallV1(SetFoldFlags, SETFOLDFLAGS, int, flags)
|
||||
DeclareSciCallV1(FoldDisplayTextSetStyle, FOLDDISPLAYTEXTSETSTYLE, int, flags)
|
||||
DeclareSciCallR1(GetFoldParent, GETFOLDPARENT, int, DocLn, line)
|
||||
DeclareSciCallR1(GetFoldExpanded, GETFOLDEXPANDED, int, DocLn, line)
|
||||
DeclareSciCallV1(ToggleFold, TOGGLEFOLD, DocLn, line)
|
||||
DeclareSciCallV1(FoldAll, FOLDALL, int, flags)
|
||||
DeclareSciCallV1(EnsureVisible, ENSUREVISIBLE, DocLn, line)
|
||||
DeclareSciCallV1(EnsureVisibleEnforcePolicy, ENSUREVISIBLEENFORCEPOLICY, DocLn, line)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Lexer
|
||||
//
|
||||
DeclareSciCallV2(SetProperty, SETPROPERTY, const char *, key, const char *, value)
|
||||
DeclareSciCallV2(Colourise, COLOURISE, DocPos, startPos, DocPos, endPos)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
DeclareSciCallV1(SetCursor, SETCURSOR, int, flags)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Undo/Redo Stack
|
||||
//
|
||||
DeclareSciCallR0(GetUndoCollection, GETUNDOCOLLECTION, bool)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SetTechnology
|
||||
//
|
||||
DeclareSciCallV1(SetBufferedDraw, SETBUFFEREDDRAW, bool, value)
|
||||
DeclareSciCallV1(SetTechnology, SETTECHNOLOGY, int, technology)
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Utilities
|
||||
//
|
||||
#define Sci_IsStreamSelected() (SciCall_GetSelectionMode() == SC_SEL_STREAM)
|
||||
#define Sci_IsFullLineSelected() (SciCall_GetSelectionMode() == SC_SEL_LINES)
|
||||
#define Sci_IsThinRectangleSelected() (SciCall_GetSelectionMode() == SC_SEL_THIN)
|
||||
#define Sci_IsSingleLineSelection() \
|
||||
(SciCall_LineFromPosition(SciCall_GetCurrentPos()) == SciCall_LineFromPosition(SciCall_GetAnchor()))
|
||||
|
||||
#define Sci_GetEOLLen() ((SciCall_GetEOLMode() == SC_EOL_CRLF) ? 2 : 1)
|
||||
|
||||
#define Sci_GetCurrentLine() SciCall_LineFromPosition(SciCall_GetCurrentPos())
|
||||
|
||||
// length of line w/o line-end chars (full use SciCall_LineLength()
|
||||
#define Sci_GetNetLineLength(line) (SciCall_GetLineEndPosition(line) - SciCall_PositionFromLine(line))
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#endif //_NP3_SCICALL_H_
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
#define IDC_NOANSICPDETECTION 232
|
||||
#define IDC_REMEMBERSEARCHPATTERN 233
|
||||
#define IDC_TOGGLE_VISIBILITY 234
|
||||
#define IDC_FR_RESET_STATE 235
|
||||
#define IDC_DOC_MODIFIED 235
|
||||
#define IDACC_FIND 302
|
||||
#define IDACC_REPLACE 303
|
||||
#define IDACC_SAVEPOS 304
|
||||
|
||||
Loading…
Reference in New Issue
Block a user