mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ add: Context-Menu to toggle margins
This commit is contained in:
parent
d636261979
commit
ea105505e8
@ -360,7 +360,7 @@ BEGIN
|
||||
POPUP "Code &Faltung"
|
||||
BEGIN
|
||||
MENUITEM "&Aktiviere Faltung", IDM_VIEW_FOLDING
|
||||
MENUITEM "Alle Falten &Umschalten\tCtrl+Alt+F", IDM_VIEW_TOGGLEFOLDS
|
||||
MENUITEM "Alle Falten &Umschalten\tCtrl+Alt+F", IDM_VIEW_TOGGLEFOLDS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Gehe zur &Nächsten\tAlt+ +", CMD_FOLDJUMPDOWN
|
||||
MENUITEM "Gehe zur &Vorherigen\tAlt+ –", CMD_FOLDJUMPUP
|
||||
@ -513,6 +513,10 @@ BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Öffne Web-Aktion &1", CMD_WEBACTION1
|
||||
MENUITEM "Öffne Web Aktion &2", CMD_WEBACTION2
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Code &Faltung", IDM_VIEW_FOLDING
|
||||
MENUITEM "&Zeilen Nummern", IDM_VIEW_LINENUMBERS
|
||||
MENUITEM "&Selektionsrand", IDM_VIEW_MARGIN
|
||||
END
|
||||
POPUP "+"
|
||||
BEGIN
|
||||
|
||||
@ -360,7 +360,7 @@ BEGIN
|
||||
POPUP "&Folding"
|
||||
BEGIN
|
||||
MENUITEM "Code &Folding", IDM_VIEW_FOLDING
|
||||
MENUITEM "&Toggle Folds\tCtrl+Alt+F", IDM_VIEW_TOGGLEFOLDS
|
||||
MENUITEM "&Toggle Folds\tCtrl+Alt+F", IDM_VIEW_TOGGLEFOLDS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Jump &Next Fold\tAlt+ +", CMD_FOLDJUMPDOWN
|
||||
MENUITEM "Jump &Prev Fold\tAlt+ –", CMD_FOLDJUMPUP
|
||||
@ -513,6 +513,10 @@ BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Open Web Action &1", CMD_WEBACTION1
|
||||
MENUITEM "Open Web Action &2", CMD_WEBACTION2
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Folding", IDM_VIEW_FOLDING
|
||||
MENUITEM "Line &Numbers", IDM_VIEW_LINENUMBERS
|
||||
MENUITEM "Selection &Margin", IDM_VIEW_MARGIN
|
||||
END
|
||||
POPUP "+"
|
||||
BEGIN
|
||||
|
||||
@ -158,8 +158,7 @@ static void _GetTrueWindowsVersion()
|
||||
|
||||
// load the System-DLL
|
||||
HINSTANCE const hNTdllDll = LoadLibrary(L"ntdll.dll");
|
||||
|
||||
if (hNTdllDll != NULL)
|
||||
if (hNTdllDll)
|
||||
{
|
||||
// get the function pointer to RtlGetVersion
|
||||
pRtlGetVersion = (void (WINAPI*)(PRTL_OSVERSIONINFOW)) GetProcAddress(hNTdllDll, "RtlGetVersion");
|
||||
|
||||
@ -714,6 +714,8 @@ static bool _InsertLanguageMenu(HMENU hMenuBar)
|
||||
//
|
||||
// _CleanUpResources()
|
||||
//
|
||||
static _invalid_parameter_handler _hOldInvalidParamHandler = NULL;
|
||||
|
||||
static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
|
||||
{
|
||||
if (hwnd) {
|
||||
@ -734,9 +736,9 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
|
||||
UndoRedoSelectionUTArray = NULL;
|
||||
}
|
||||
|
||||
// -------------------------------
|
||||
// Save Settings is done elsewhere
|
||||
|
||||
Scintilla_ReleaseResources();
|
||||
// -------------------------------
|
||||
|
||||
if (Globals.hMainMenu) {
|
||||
DestroyMenu(Globals.hMainMenu);
|
||||
@ -744,6 +746,8 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
|
||||
|
||||
FreeLanguageResources();
|
||||
|
||||
Scintilla_ReleaseResources();
|
||||
|
||||
if (bIsInitialized) {
|
||||
UnregisterClass(s_wchWndClass, Globals.hInstance);
|
||||
}
|
||||
@ -754,6 +758,10 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
|
||||
FreeMem(s_lpOrigFileArg);
|
||||
s_lpOrigFileArg = NULL;
|
||||
}
|
||||
|
||||
if (_hOldInvalidParamHandler) {
|
||||
_set_invalid_parameter_handler(_hOldInvalidParamHandler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -785,7 +793,7 @@ void InvalidParameterHandler(const wchar_t* expression,
|
||||
//
|
||||
int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nShowCmd)
|
||||
{
|
||||
_set_invalid_parameter_handler(InvalidParameterHandler);
|
||||
_hOldInvalidParamHandler = _set_invalid_parameter_handler(InvalidParameterHandler);
|
||||
_CrtSetReportMode(_CRT_ASSERT, 0); // Disable the message box for assertions.
|
||||
|
||||
_InitGlobals();
|
||||
@ -2987,7 +2995,7 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
(nID != IDC_REBAR) && (nID != IDC_TOOLBAR))
|
||||
return DefWindowProc(hwnd, umsg, wParam, lParam);
|
||||
|
||||
HMENU hmenu = LoadMenu(Globals.hLngResContainer, MAKEINTRESOURCE(IDR_MUI_POPUPMENU));
|
||||
HMENU hMenuCtx = LoadMenu(Globals.hLngResContainer, MAKEINTRESOURCE(IDR_MUI_POPUPMENU));
|
||||
//SetMenuDefaultItem(GetSubMenu(hmenu,1),0,false);
|
||||
|
||||
POINT pt;
|
||||
@ -3023,10 +3031,10 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
}
|
||||
|
||||
TrackPopupMenuEx(GetSubMenu(hmenu, imenu),
|
||||
TrackPopupMenuEx(GetSubMenu(hMenuCtx, imenu),
|
||||
TPM_LEFTBUTTON | TPM_RIGHTBUTTON, pt.x + 1, pt.y + 1, hwnd, NULL);
|
||||
|
||||
DestroyMenu(hmenu);
|
||||
DestroyMenu(hMenuCtx);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -3096,9 +3104,8 @@ LRESULT MsgTrayMessage(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
case WM_RBUTTONUP:
|
||||
{
|
||||
|
||||
HMENU hMenu = LoadMenu(Globals.hLngResContainer, MAKEINTRESOURCE(IDR_MUI_POPUPMENU));
|
||||
HMENU hMenuPopup = GetSubMenu(hMenu, 2);
|
||||
HMENU hTrayMenu = LoadMenu(Globals.hLngResContainer, MAKEINTRESOURCE(IDR_MUI_POPUPMENU));
|
||||
HMENU hMenuPopup = GetSubMenu(hTrayMenu, 2);
|
||||
|
||||
POINT pt;
|
||||
int iCmd;
|
||||
@ -3113,7 +3120,7 @@ LRESULT MsgTrayMessage(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
PostMessage(hwnd, WM_NULL, 0, 0);
|
||||
|
||||
DestroyMenu(hMenu);
|
||||
DestroyMenu(hTrayMenu);
|
||||
|
||||
if (iCmd == IDM_TRAY_RESTORE) {
|
||||
ShowNotifyIcon(hwnd, false);
|
||||
@ -5613,9 +5620,9 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_HELP_ABOUT:
|
||||
{
|
||||
//~HMODULE hRichEdit = LoadLibrary(L"RICHED20.DLL"); // Use RICHEDIT_CONTROL_VER for control in common_res.h
|
||||
HMODULE hRichEdit = LoadLibrary(L"MSFTEDIT.DLL"); // Use "RichEdit50W" for control in common_res.h;
|
||||
if (hRichEdit != INVALID_HANDLE_VALUE) {
|
||||
ThemedDialogBox(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_ABOUT), hwnd, AboutDlgProc);
|
||||
HMODULE const hRichEdit = LoadLibrary(L"MSFTEDIT.DLL"); // Use "RichEdit50W" for control in common_res.h;
|
||||
if (hRichEdit) {
|
||||
ThemedDialogBox(Globals.hLngResContainer, MAKEINTRESOURCE(IDD_MUI_ABOUT), hwnd, AboutDlgProc);
|
||||
FreeLibrary(hRichEdit);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,6 +130,7 @@
|
||||
<AdditionalLibraryDirectories>$(IntermediateOutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<ManifestFile />
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@ -194,6 +195,7 @@
|
||||
<AdditionalLibraryDirectories>$(IntermediateOutputPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<ManifestFile />
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@ -264,6 +266,7 @@
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<ManifestFile />
|
||||
<Profile>true</Profile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@ -334,6 +337,7 @@
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
<ManifestFile />
|
||||
<Profile>true</Profile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user