Skip to content

Commit

Permalink
Disable not yet implemented call tips function.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 28, 2018
1 parent 9b2b395 commit 4b8e693
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define NP2_DEBUG_FOLD_LEVEL 0
// enable the .LOG feature
#define NP2_ENABLE_DOT_LOG_FEATURE 0
// enable call tips (currently not yet implemented)
#define NP2_ENABLE_SHOW_CALL_TIPS 0

/******************************************************************************
*
Expand Down Expand Up @@ -146,8 +148,10 @@ int iAutoCMinNumberLength = 3;
BOOL bAutoCIncludeDocWord = TRUE;
BOOL bAutoCloseBracesQuotes;
BOOL bShowCodeFolding;
#if NP2_ENABLE_SHOW_CALL_TIPS
BOOL bShowCallTips = FALSE;
int iCallTipsWaitTime = 500; // 500 ms
#endif
BOOL bViewWhiteSpace;
BOOL bViewEOLs;
int iDefaultEncoding;
Expand Down Expand Up @@ -1404,8 +1408,10 @@ static inline void UpdateFoldMarginWidth() {
SciCall_SetMarginWidth(MARGIN_FOLD_INDEX, width);
}

#if NP2_ENABLE_SHOW_CALL_TIPS
#define SetCallTipsWaitTime() \
SendMessage(hwndEdit, SCI_SETMOUSEDWELLTIME, bShowCallTips? iCallTipsWaitTime : SC_TIME_FOREVER, 0);
#endif

LRESULT MsgCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) {
HINSTANCE hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
Expand Down Expand Up @@ -1522,8 +1528,10 @@ LRESULT MsgCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) {
#endif
// highlight for current folding block
SciCall_MarkerEnableHighlight(TRUE);
#if NP2_ENABLE_SHOW_CALL_TIPS
// CallTips
SetCallTipsWaitTime();
#endif

// Nonprinting characters
SendMessage(hwndEdit, SCI_SETVIEWWS, (bViewWhiteSpace) ? SCWS_VISIBLEALWAYS : SCWS_INVISIBLE, 0);
Expand Down Expand Up @@ -2216,7 +2224,9 @@ void MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam) {
CheckCmd(hmenu, IDM_VIEW_SHOWWHITESPACE, bViewWhiteSpace);
CheckCmd(hmenu, IDM_VIEW_SHOWEOLS, bViewEOLs);
CheckCmd(hmenu, IDM_VIEW_WORDWRAPSYMBOLS, bShowWordWrapSymbols);
#if NP2_ENABLE_SHOW_CALL_TIPS
CheckCmd(hmenu, IDM_VIEW_SHOWCALLTIPS, bShowCallTips);
#endif
CheckCmd(hmenu, IDM_VIEW_MATCHBRACES, bMatchBraces);
CheckCmd(hmenu, IDM_VIEW_TOOLBAR, bShowToolbar);
EnableCmd(hmenu, IDM_VIEW_CUSTOMIZETB, bShowToolbar);
Expand Down Expand Up @@ -3958,10 +3968,12 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
}
break;

#if NP2_ENABLE_SHOW_CALL_TIPS
case IDM_VIEW_SHOWCALLTIPS:
bShowCallTips = (bShowCallTips) ? FALSE : TRUE;
SetCallTipsWaitTime();
break;
#endif

case IDM_VIEW_MATCHBRACES:
bMatchBraces = (bMatchBraces) ? FALSE : TRUE;
Expand Down Expand Up @@ -5014,6 +5026,7 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) {
}
break;

#if NP2_ENABLE_SHOW_CALL_TIPS
// CallTips
case SCN_DWELLSTART:
if (bShowCallTips && scn->position >= 0) {
Expand All @@ -5024,6 +5037,7 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) {
case SCN_DWELLEND:
SendMessage(hwndEdit, SCI_CALLTIPCANCEL, 0, 0);
break;
#endif

case SCN_MODIFIED:
case SCN_ZOOM:
Expand Down Expand Up @@ -5223,7 +5237,9 @@ void LoadSettings(void) {
bAutoCloseBracesQuotes = IniSectionGetBool(pIniSection, L"AutoCloseBracesQuotes", 1);
bAutoCompleteWords = IniSectionGetBool(pIniSection, L"AutoCompleteWords", 1);
bAutoCIncludeDocWord = IniSectionGetBool(pIniSection, L"AutoCIncludeDocWord", 1);
#if NP2_ENABLE_SHOW_CALL_TIPS
bShowCallTips = IniSectionGetBool(pIniSection, L"ShowCallTips", 0);
#endif

bTabsAsSpaces = IniSectionGetBool(pIniSection, L"TabsAsSpaces", 0);
bTabsAsSpacesG = bTabsAsSpaces;
Expand Down Expand Up @@ -5385,7 +5401,9 @@ void LoadSettings(void) {
iAutoCDefaultShowItemCount = IniSectionGetInt(pIniSection, L"AutoCDefaultShowItemCount", 15);
iAutoCMinWordLength = IniSectionGetInt(pIniSection, L"AutoCMinWordLength", 1);
iAutoCMinNumberLength = IniSectionGetInt(pIniSection, L"AutoCMinNumberLength", 3);
#if NP2_ENABLE_SHOW_CALL_TIPS
iCallTipsWaitTime = IniSectionGetInt(pIniSection, L"CallTipsWaitTime", 500);
#endif

bStickyWinPos = IniSectionGetBool(pIniSection, L"StickyWindowPosition", 0);

Expand Down Expand Up @@ -5500,7 +5518,9 @@ void SaveSettings(BOOL bSaveSettingsNow) {
IniSectionSetBool(pIniSection, L"AutoCloseBracesQuotes", bAutoCloseBracesQuotes);
IniSectionSetBool(pIniSection, L"AutoCompleteWords", bAutoCompleteWords);
IniSectionSetBool(pIniSection, L"AutoCIncludeDocWord", bAutoCIncludeDocWord);
#if NP2_ENABLE_SHOW_CALL_TIPS
IniSectionSetBool(pIniSection, L"ShowCallTips", bShowCallTips);
#endif
IniSectionSetBool(pIniSection, L"TabsAsSpaces", bTabsAsSpacesG);
IniSectionSetBool(pIniSection, L"TabIndents", bTabIndentsG);
IniSectionSetBool(pIniSection, L"BackspaceUnindents", bBackspaceUnindents);
Expand Down
2 changes: 1 addition & 1 deletion src/Notepad2.rc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ BEGIN
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 "Show Call Tips", IDM_VIEW_SHOWCALLTIPS
//MENUITEM "Show Call Tips", IDM_VIEW_SHOWCALLTIPS
MENUITEM SEPARATOR
MENUITEM "Visual &Brace Matching\tCtrl+Shift+V", IDM_VIEW_MATCHBRACES
MENUITEM "Highlight C&urrent Line\tCtrl+Shift+I", IDM_VIEW_HILITECURRENTLINE
Expand Down

0 comments on commit 4b8e693

Please sign in to comment.