mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+fix: don't jump on initial F/R Dialog on empty clipboard
+fix: cursor hand on ctrl-keydown hover hyperlink
This commit is contained in:
parent
9e93a97742
commit
1bf905e93b
@ -1654,7 +1654,7 @@ sptr_t ScintillaWin::MouseMessage(unsigned int iMessage, uptr_t wParam, sptr_t l
|
||||
HorizontalScrollTo(xPos);
|
||||
}
|
||||
return 0;
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
|
||||
}
|
||||
return 0;
|
||||
@ -1685,6 +1685,15 @@ sptr_t ScintillaWin::KeyMessage(unsigned int iMessage, uptr_t wParam, sptr_t lPa
|
||||
altDown),
|
||||
&lastKeyDownConsumed);
|
||||
if (!ret && !lastKeyDownConsumed) {
|
||||
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
|
||||
if (hoverIndicatorPos != Sci::invalidPosition) {
|
||||
POINT pt;
|
||||
if (::GetCursorPos(&pt)) {
|
||||
::ScreenToClient(MainHWND(), &pt);
|
||||
DisplayCursor(ContextCursor(PointFromPOINT(pt)));
|
||||
}
|
||||
}
|
||||
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
|
||||
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -6445,8 +6445,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
} else {
|
||||
if (s_bIsReplaceDlg) {
|
||||
SciCall_ScrollRange(s_InitialAnchorPos, s_InitialCaretPos);
|
||||
} else {
|
||||
EditSetSelectionEx(end, iPos, -1, -1);
|
||||
}
|
||||
if (s_InitialTopLine >= 0) {
|
||||
SciCall_SetFirstVisibleLine(s_InitialTopLine);
|
||||
|
||||
@ -1792,6 +1792,9 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
case WM_NOTIFY:
|
||||
return MsgNotify(hwnd, wParam, lParam);
|
||||
|
||||
//~case WM_KEYDOWN:
|
||||
//~ return MsgKeyDown(hwnd, wParam, lParam);
|
||||
|
||||
case WM_FILECHANGEDNOTIFY:
|
||||
return MsgFileChangeNotify(hwnd, wParam, lParam);
|
||||
|
||||
@ -4005,6 +4008,28 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//=============================================================================
|
||||
//
|
||||
// MsgKeyDown() - Handles WM_KEYDOWN event
|
||||
// ~~~ no event from Scintilla ~~~
|
||||
//
|
||||
//
|
||||
LRESULT MsgKeyDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hwnd);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
if (IsKeyDown(VK_CONTROL)) {
|
||||
SciCall_SetCursor(SC_NP3_CURSORHAND);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// MsgCommand() - Handles WM_COMMAND
|
||||
@ -6831,7 +6856,7 @@ LRESULT MsgSysCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
//
|
||||
static DocPos prevCursorPosition = -1;
|
||||
|
||||
void HandleDWellStartEnd(const DocPos position, const int modifiers, const UINT uid)
|
||||
void HandleDWellStartEnd(const DocPos position, const UINT uid)
|
||||
{
|
||||
static DocPos prevStartPosition = -1;
|
||||
static DocPos prevEndPosition = -1;
|
||||
@ -6881,9 +6906,6 @@ void HandleDWellStartEnd(const DocPos position, const int modifiers, const UINT
|
||||
switch (indicator_id) {
|
||||
|
||||
case INDIC_NP3_HYPERLINK:
|
||||
if (modifiers & SCMOD_CTRL) {
|
||||
SciCall_SetCursor(SC_NP3_CURSORHAND);
|
||||
}
|
||||
if (!Settings.ShowHypLnkToolTip || SciCall_CallTipActive()) {
|
||||
return;
|
||||
}
|
||||
@ -7503,7 +7525,10 @@ inline static LRESULT _MsgNotifyLean(const SCNotification *const scn, bool* bMod
|
||||
|
||||
// --- check only mandatory events (must be fast !!!) ---
|
||||
if (pnmh->idFrom == IDC_EDIT) {
|
||||
if (pnmh->code == SCN_MODIFIED) {
|
||||
|
||||
switch (pnmh->code) {
|
||||
|
||||
case SCN_MODIFIED: {
|
||||
int const iModType = scn->modificationType;
|
||||
if ((iModType & SC_MULTISTEPUNDOREDO) && !(iModType & SC_LASTSTEPINUNDOREDO)) {
|
||||
return TRUE;
|
||||
@ -7551,15 +7576,26 @@ inline static LRESULT _MsgNotifyLean(const SCNotification *const scn, bool* bMod
|
||||
_DelaySplitUndoTransaction(bInUndoRedo ? max_dw(_MQ_FAST, timeout) : timeout);
|
||||
}
|
||||
}
|
||||
} else if (pnmh->code == SCN_SAVEPOINTREACHED) {
|
||||
} break;
|
||||
|
||||
case SCN_SAVEPOINTREACHED: {
|
||||
SetSavePoint();
|
||||
} else if (pnmh->code == SCN_SAVEPOINTLEFT) {
|
||||
} break;
|
||||
|
||||
case SCN_SAVEPOINTLEFT: {
|
||||
SetSaveNeeded();
|
||||
} else if (pnmh->code == SCN_MODIFYATTEMPTRO) {
|
||||
} break;
|
||||
|
||||
case SCN_MODIFYATTEMPTRO: {
|
||||
if (FocusedView.HideNonMatchedLines) {
|
||||
EditToggleView(Globals.hwndEdit);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
} // switch
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@ -7698,7 +7734,7 @@ static LRESULT _MsgNotifyFromEdit(HWND hwnd, const SCNotification* const scn)
|
||||
|
||||
case SCN_DWELLSTART:
|
||||
case SCN_DWELLEND: {
|
||||
HandleDWellStartEnd(scn->position, scn->modifiers, pnmh->code);
|
||||
HandleDWellStartEnd(scn->position, pnmh->code);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -11264,7 +11300,7 @@ void SetNotifyIconTitle(HWND hwnd)
|
||||
//
|
||||
void ResetMouseDWellTime()
|
||||
{
|
||||
if (Settings.HyperlinkHotspot || IsColorDefHotspotEnabled() || Settings.HighlightUnicodePoints) {
|
||||
if (Settings.ShowHypLnkToolTip || IsColorDefHotspotEnabled() || Settings.HighlightUnicodePoints) {
|
||||
SciCall_SetMouseDWellTime(USER_TIMER_MINIMUM << 4);
|
||||
} else {
|
||||
Sci_DisableMouseDWellNotification();
|
||||
|
||||
@ -139,7 +139,7 @@ int BeginUndoAction();
|
||||
void EndUndoAction(int token);
|
||||
bool RestoreAction(int token, DoAction doAct);
|
||||
|
||||
void HandleDWellStartEnd(const DocPos position, const int modifiers, const UINT uid);
|
||||
void HandleDWellStartEnd(const DocPos position, const UINT uid);
|
||||
bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operation);
|
||||
void HandleColorDefClicked(HWND hwnd, const DocPos position);
|
||||
|
||||
@ -181,6 +181,7 @@ LRESULT MsgExitMenuLoop(HWND hwnd, WPARAM wParam);
|
||||
LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT MsgFileChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT MsgTrayMessage(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
//~LRESULT MsgKeyDown(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
LRESULT MsgSysCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
@ -337,7 +337,8 @@ typedef struct _encloseselectiondata {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#define SC_NP3_CURSORHAND 8
|
||||
#define SC_NP3_CURSORARROW 2
|
||||
#define SC_NP3_CURSORHAND 8
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user