mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+enh: Enhanced File-Change Notification Messagebox
This commit is contained in:
parent
dd2fd09c20
commit
e047096596
@ -317,14 +317,16 @@
|
||||
#define IDD_MUI_INFOBOX3 17029
|
||||
#define IDD_MUI_INFOBOX4 17030
|
||||
#define IDD_MUI_INFOBOX5 17031
|
||||
#define IDD_MUI_SORT 17032
|
||||
#define IDD_MUI_RECODE 17033
|
||||
#define IDD_MUI_ENCODING 17034
|
||||
#define IDD_MUI_ALIGN 17035
|
||||
#define IDD_MUI_CMDLINEHELP 17037
|
||||
#define IDD_MUI_SYSFONT_WITHLINK 17038
|
||||
#define IDD_MUI_SYSCOLOR_DLG 17039
|
||||
#define IDD_MUI_AUTOSAVE_BACKUP 17040
|
||||
#define IDD_MUI_INFOBOX6 17032
|
||||
#define IDD_MUI_INFOBOX7 17033
|
||||
#define IDD_MUI_SORT 17034
|
||||
#define IDD_MUI_RECODE 17035
|
||||
#define IDD_MUI_ENCODING 17036
|
||||
#define IDD_MUI_ALIGN 17037
|
||||
#define IDD_MUI_CMDLINEHELP 17038
|
||||
#define IDD_MUI_SYSFONT_WITHLINK 17039
|
||||
#define IDD_MUI_SYSCOLOR_DLG 17040
|
||||
#define IDD_MUI_AUTOSAVE_BACKUP 17041
|
||||
|
||||
#define IDC_COMMANDLINE 18000
|
||||
#define IDC_SEARCHEXE 18001
|
||||
|
||||
@ -276,7 +276,7 @@ CAPTION "Nachricht bei Dateiänderung"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "&Keine.", IDC_RADIO_BTN_A,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,7,99,10
|
||||
CONTROL "&Indikator (lautlos).", IDC_RADIO_BTN_B, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 7, 19, 99, 10
|
||||
CONTROL "&Indikator (still).", IDC_RADIO_BTN_B, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 7, 19, 99, 10
|
||||
CONTROL "&Zeige Nachricht.", IDC_RADIO_BTN_C,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,31,99,10
|
||||
CONTROL "&Auto-Neuladen.", IDC_RADIO_BTN_D,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,43,99,10
|
||||
CONTROL "&Exklusive Sperrung der Datei.", IDC_RADIO_BTN_E,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,55,120,10
|
||||
@ -615,7 +615,7 @@ BEGIN
|
||||
PUSHBUTTON "&Nein",IDNO,61,70,50,14
|
||||
PUSHBUTTON "&Abbrechen",IDCANCEL,115,70,50,14
|
||||
CONTROL "&Diese Nachricht nicht nochmals anzeigen.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,54,122,10
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,54,140,10
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX5 DIALOGEX 0, 0, 244, 71
|
||||
@ -626,12 +626,42 @@ BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
DEFPUSHBUTTON "Wiederholen",IDRETRY,131,50,50,14
|
||||
DEFPUSHBUTTON "&Wiederholen",IDRETRY,131,50,50,14
|
||||
PUSHBUTTON "&Abbrechen",IDCANCEL,187,50,50,14
|
||||
CONTROL "&Diese Nachricht nicht nochmals anzeigen.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX6 DIALOGEX 0, 0, 299, 91
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Notepad3"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
CONTROL "&Diese Nachricht nicht nochmals anzeigen.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,140,10
|
||||
DEFPUSHBUTTON "&Wiederholen",IDRETRY,186,70,50,14
|
||||
PUSHBUTTON "&Abbrechen",IDABORT,130,70, 50, 14
|
||||
PUSHBUTTON "&Ignorieren",IDIGNORE,242,70,50,14
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX7 DIALOGEX 0, 0, 299, 91
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Notepad3"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
CONTROL "&Diese Nachricht nicht nochmals anzeigen.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,140,10
|
||||
DEFPUSHBUTTON "&Wiederholen", IDRETRY, 186, 70, 50, 14
|
||||
PUSHBUTTON "&Abbrechen",IDCANCEL,130,70, 50, 14
|
||||
PUSHBUTTON "&Weiter",IDCONTINUE,242,70,50,14
|
||||
END
|
||||
|
||||
IDD_MUI_SORT DIALOGEX 0, 0, 185, 188
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Sortiere Zeilen"
|
||||
@ -1072,6 +1102,38 @@ BEGIN
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX4, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 181
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX5, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 251
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX6, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 306
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX7, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 306
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_SORT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
|
||||
@ -177,7 +177,7 @@ BEGIN
|
||||
IDS_MUI_ASK_CLEAR_UNDO "Diese Operation wird die Undo-History löschen. Weiter machen?"
|
||||
IDS_MUI_READONLY_SAVE """%s"" ist schreibgeschützt. Dokument unter einem anderen Dateipfad speichern?"
|
||||
IDS_MUI_FILECHANGENOTIFY
|
||||
"Die geladene Datei wurde durch ein anderes Programm auf dem Datenträger verändert. Neu laden?"
|
||||
"Die geladene Datei wurde durch ein anderes Programm auf dem Datenträger verändert.\n[Abbrechen]: \tIgnoriere alle Änderungen (Stiller Indikator).\n[Wiederholen]:\tDatei neu laden.\n[Weiter]: \tWechsle ins Logfile Monitoring."
|
||||
IDS_MUI_FILECHANGENOTIFY2 "Die geladene Datei wurde auf dem Datenträger gelöscht. Nochmals speichern?"
|
||||
IDS_MUI_FILELOCK_ERROR "Es konnte keine exklusive Dateisperre auf ""%s"" gesetzt werden!"
|
||||
IDS_MUI_STICKYWINPOS "Eingefrorene Fensterpositionierung is eingeschaltet worden. Jede neue Notepad3 Instanz wird nun diese Fensterpositionierung initial verwenden."
|
||||
|
||||
@ -611,11 +611,11 @@ BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,126,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,54,122,10
|
||||
DEFPUSHBUTTON "&Yes",IDOK,7,70,50,14
|
||||
PUSHBUTTON "&No",IDNO,61,70,50,14
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,115,70,50,14
|
||||
CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,54,122,10
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX5 DIALOGEX 0, 0, 244, 71
|
||||
@ -626,12 +626,42 @@ BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
DEFPUSHBUTTON "Retry",IDRETRY,131,50,50,14
|
||||
DEFPUSHBUTTON "&Retry",IDRETRY,131,50,50,14
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,187,50,50,14
|
||||
CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX6 DIALOGEX 0, 0, 299, 91
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Notepad3"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10
|
||||
DEFPUSHBUTTON "&Retry",IDRETRY,186,70,50,14
|
||||
PUSHBUTTON "&Abort",IDABORT, 130, 70, 50, 14
|
||||
PUSHBUTTON "&Ignore",IDIGNORE,242,70,50,14
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX7 DIALOGEX 0, 0, 299, 91
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Notepad3"
|
||||
FONT 9, "Segoe UI", 400, 0, 0x1
|
||||
BEGIN
|
||||
//~ICON IDR_MAINWND,IDC_INFOBOXICON,7,7,0,0
|
||||
CONTROL IDR_MAINWND, IDC_INFOBOXICON, "Static", SS_BITMAP | SS_NOTIFY, 7, 7, 24, 24, WS_EX_TRANSPARENT
|
||||
LTEXT "",IDC_INFOBOXTEXT,35,7,202,41,SS_EDITCONTROL | SS_NOPREFIX | SS_LEFT
|
||||
CONTROL "&Don't display this message again.",IDC_INFOBOXCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,54,122,10
|
||||
DEFPUSHBUTTON "&Try Again",IDRETRY,186,70,50,14
|
||||
PUSHBUTTON "&Cancel", IDCANCEL, 130, 70, 50, 14
|
||||
PUSHBUTTON "&Continue",IDCONTINUE,242,70,50,14
|
||||
END
|
||||
|
||||
IDD_MUI_SORT DIALOGEX 0, 0, 185, 188
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Sort Lines"
|
||||
@ -1051,7 +1081,7 @@ BEGIN
|
||||
IDD_MUI_INFOBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 237
|
||||
RIGHTMARGIN, 251
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
@ -1059,7 +1089,7 @@ BEGIN
|
||||
IDD_MUI_INFOBOX2, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 237
|
||||
RIGHTMARGIN, 251
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
@ -1067,11 +1097,43 @@ BEGIN
|
||||
IDD_MUI_INFOBOX3, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 237
|
||||
RIGHTMARGIN, 251
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX4, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 181
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX5, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 251
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 64
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX6, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 306
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_INFOBOX7, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 306
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 84
|
||||
END
|
||||
|
||||
IDD_MUI_SORT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
|
||||
@ -177,7 +177,7 @@ BEGIN
|
||||
IDS_MUI_ASK_CLEAR_UNDO "This operation will clear the undo history. Continue?"
|
||||
IDS_MUI_READONLY_SAVE """%s"" is read only. Save to a different file?"
|
||||
IDS_MUI_FILECHANGENOTIFY
|
||||
"The current file has been modified by an external program. Reload?"
|
||||
"The current file has been modified by an external program.\n[Cancel]: \tIgnore any changes (silent indicator).\n[Try Again]:\tReload File.\n[Continue]: \tSwitch to File Monitoring."
|
||||
IDS_MUI_FILECHANGENOTIFY2 "The current file has been deleted. Save now?"
|
||||
IDS_MUI_FILELOCK_ERROR "Can not acquire exclusive file lock for ""%s""!"
|
||||
IDS_MUI_STICKYWINPOS "Sticky Window Position is enabled. Any new Notepad3 windows will use the current window placement settings."
|
||||
|
||||
@ -311,6 +311,10 @@ static INT_PTR CALLBACK _InfoBoxLngDlgProc(HWND hwnd, UINT umsg, WPARAM wParam,
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, LOWORD(IDCLOSE));
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hIconBmp) {
|
||||
DeleteObject(hIconBmp);
|
||||
@ -374,6 +378,8 @@ CASE_WM_CTLCOLOR_SET:
|
||||
bool const isChecked = IsButtonChecked(hwnd, IDC_INFOBOXCHECK);
|
||||
DialogEnableControl(hwnd, IDNO, !isChecked);
|
||||
DialogEnableControl(hwnd, IDABORT, !isChecked);
|
||||
DialogEnableControl(hwnd, IDIGNORE, !isChecked);
|
||||
DialogEnableControl(hwnd, IDCONTINUE, !isChecked);
|
||||
DialogEnableControl(hwnd, IDCLOSE, !isChecked);
|
||||
DialogEnableControl(hwnd, IDCANCEL, !isChecked);
|
||||
SendMessage(hwnd, WM_NEXTDLGCTL, 0, FALSE);
|
||||
@ -488,7 +494,11 @@ LONG InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMsg, ...)
|
||||
int idDlg;
|
||||
switch (uType & MB_TYPEMASK) {
|
||||
|
||||
case MB_YESNO: // contains two push buttons : Yes and No.
|
||||
case MB_OK: // one push button : OK. This is the default.
|
||||
idDlg = IDD_MUI_INFOBOX;
|
||||
break;
|
||||
|
||||
case MB_YESNO: // contains two push buttons : Yes and No.
|
||||
idDlg = IDD_MUI_INFOBOX2;
|
||||
break;
|
||||
|
||||
@ -505,9 +515,13 @@ LONG InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMsg, ...)
|
||||
break;
|
||||
|
||||
case MB_ABORTRETRYIGNORE: // three push buttons : Abort, Retry, and Ignore.
|
||||
case MB_CANCELTRYCONTINUE: // three push buttons : Cancel, Try Again, Continue.Use this message box type instead of MB_ABORTRETRYIGNORE.
|
||||
idDlg = IDD_MUI_INFOBOX6;
|
||||
break;
|
||||
// Use this message box type instead of MB_ABORTRETRYIGNORE.
|
||||
case MB_CANCELTRYCONTINUE: // three push buttons : Cancel, Try Again, Continue.
|
||||
idDlg = IDD_MUI_INFOBOX7;
|
||||
break;
|
||||
|
||||
case MB_OK: // one push button : OK. This is the default.
|
||||
default:
|
||||
idDlg = IDD_MUI_INFOBOX;
|
||||
break;
|
||||
@ -1040,6 +1054,10 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hVersionFont) {
|
||||
DeleteObject(hVersionFont);
|
||||
@ -1329,6 +1347,10 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
DeleteBitmapButton(hwnd, IDC_SEARCHEXE);
|
||||
return FALSE;
|
||||
@ -1582,6 +1604,10 @@ static INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
DirList_Destroy(hwndLV);
|
||||
hwndLV = NULL;
|
||||
@ -1838,6 +1864,11 @@ static INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
DirList_Destroy(hwndLV);
|
||||
hwndLV = NULL;
|
||||
@ -2046,6 +2077,11 @@ static INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPA
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
ResizeDlg_Destroy(hwnd, &Settings.AddToFavDlgSizeX, NULL);
|
||||
return FALSE;
|
||||
@ -2316,6 +2352,10 @@ static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPAR
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
case WM_DESTROY: {
|
||||
BackgroundWorker *worker = (BackgroundWorker *)GetProp(hwnd, L"it");
|
||||
BackgroundWorker_Destroy(worker);
|
||||
@ -3628,6 +3668,11 @@ static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
|
||||
case WM_DESTROY: {
|
||||
ImageList_Destroy(himl);
|
||||
himl = NULL;
|
||||
|
||||
@ -83,14 +83,15 @@ DWORD MsgBoxLastError(LPCWSTR lpszMessage, DWORD dwErrID);
|
||||
LONG InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMsg, ...);
|
||||
#define INFOBOX_ANSW(_R_) LOWORD(_R_)
|
||||
#define INFOBOX_MODE(_R_) HIWORD(_R_)
|
||||
|
||||
inline bool IsYesOkay(INT_PTR answ) {
|
||||
return ((LOWORD(answ) == IDOK) || (LOWORD(answ) == IDYES));
|
||||
}
|
||||
inline bool IsRetryContinue(INT_PTR answ) {
|
||||
return ((LOWORD(answ) == IDRETRY) || (LOWORD(answ) == IDCONTINUE));
|
||||
}
|
||||
inline bool IsNoCancel(INT_PTR answ) {
|
||||
return ((LOWORD(answ) == IDNO) || (LOWORD(answ) == IDCANCEL));
|
||||
inline bool IsNoCancelClose(INT_PTR answ) {
|
||||
return ((LOWORD(answ) == IDNO) || (LOWORD(answ) == IDCANCEL) || (LOWORD(answ) == 0));
|
||||
}
|
||||
|
||||
void SetWindowTitle(HWND hwnd, const HPATHL pthFilePath, int iFormat,
|
||||
|
||||
@ -3926,27 +3926,70 @@ LRESULT MsgFileChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
SET_FCT_GUARD(TRUE);
|
||||
|
||||
ResetFileObservationData(true);
|
||||
|
||||
DocPos const iCurPos = SciCall_GetCurrentPos();
|
||||
|
||||
if ((FileWatching.FileWatchingMode == FWM_MSGBOX) || IsSaveNeeded()) {
|
||||
SetForegroundWindow(hwnd);
|
||||
}
|
||||
|
||||
if (Path_IsExistingFile(Paths.CurrentFile)) {
|
||||
|
||||
bool bRevertFile = ((FileWatching.FileWatchingMode == FWM_AUTORELOAD) && !IsSaveNeeded());
|
||||
bool bRevertFile = IsSaveNeeded();
|
||||
|
||||
switch (FileWatching.FileWatchingMode)
|
||||
{
|
||||
case FWM_AUTORELOAD:
|
||||
bRevertFile = true;
|
||||
break;
|
||||
|
||||
if (!bRevertFile) {
|
||||
if (FileWatching.FileWatchingMode == FWM_MSGBOX) {
|
||||
bRevertFile = IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_FILECHANGENOTIFY));
|
||||
} else {
|
||||
// FWM_INDICATORSILENT: nothing todo here
|
||||
case FWM_MSGBOX:
|
||||
{
|
||||
SetForegroundWindow(hwnd);
|
||||
/// LONG const answer = MessageBoxExW(Globals.hwndMain, L"File change, Cancel, Retry, Continue", L"NP3", MB_ABORTRETRYIGNORE, GetLangIdByLocaleName(Globals.CurrentLngLocaleName));
|
||||
LONG const answer = InfoBoxLng(MB_CANCELTRYCONTINUE | MB_ICONWARNING, NULL, IDS_MUI_FILECHANGENOTIFY);
|
||||
switch (LOWORD(answer)) {
|
||||
case IDCANCEL:
|
||||
case IDABORT:
|
||||
FileWatching.FileWatchingMode = FWM_INDICATORSILENT;
|
||||
UpdateToolbar();
|
||||
bRevertFile = false;
|
||||
ResetFileObservationData(true);
|
||||
break;
|
||||
|
||||
case IDIGNORE:
|
||||
case IDCONTINUE:
|
||||
UndoRedoReset();
|
||||
FileRevert(Paths.CurrentFile, false);
|
||||
SciCall_SetReadOnly(true);
|
||||
FileWatching.MonitoringLog = false; // will be reset in IDM_VIEW_CHASING_DOCTAIL
|
||||
PostWMCommand(Globals.hwndMain, IDM_VIEW_CHASING_DOCTAIL);
|
||||
bRevertFile = false; // done already
|
||||
break;
|
||||
|
||||
case IDTRYAGAIN:
|
||||
case IDCLOSE:
|
||||
default:
|
||||
bRevertFile = true;
|
||||
ResetFileObservationData(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FWM_DONT_CARE:
|
||||
case FWM_EXCLUSIVELOCK:
|
||||
ResetFileObservationData(true);
|
||||
break;
|
||||
|
||||
case FWM_INDICATORSILENT:
|
||||
bRevertFile = false;
|
||||
UpdateToolbar();
|
||||
break;
|
||||
|
||||
case FWM_NO_INIT:
|
||||
default:
|
||||
assert("Invalid FileWatching Mode!" && 0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (bRevertFile) {
|
||||
SetForegroundWindow(hwnd);
|
||||
FileRevert(Paths.CurrentFile, false);
|
||||
if (FileWatching.MonitoringLog) {
|
||||
SciCall_SetReadOnly(FileWatching.MonitoringLog);
|
||||
@ -4652,15 +4695,17 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
case IDM_FILE_REVERT:
|
||||
if (IsSaveNeeded()) {
|
||||
if (!IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONQUESTION, NULL, IDS_MUI_ASK_REVERT))) {
|
||||
break;
|
||||
if (!FileWatching.MonitoringLog) {
|
||||
if (IsSaveNeeded()) {
|
||||
if (!IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONQUESTION, NULL, IDS_MUI_ASK_REVERT))) {
|
||||
break;
|
||||
}
|
||||
//~ don't revert if no save needed
|
||||
//~FileRevert(Paths.CurrentFile, false);
|
||||
}
|
||||
//~ don't revert if no save needed
|
||||
//~FileRevert(Paths.CurrentFile, false);
|
||||
// revert in any case (manually forced)
|
||||
FileRevert(Paths.CurrentFile, true);
|
||||
}
|
||||
// revert in any case (manually forced)
|
||||
FileRevert(Paths.CurrentFile, true);
|
||||
break;
|
||||
|
||||
|
||||
@ -6263,6 +6308,9 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_VIEW_CHASING_DOCTAIL: {
|
||||
|
||||
InstallFileWatching(false);
|
||||
|
||||
static FILE_WATCHING_MODE _saveChgNotify = FWM_NO_INIT;
|
||||
if (_saveChgNotify == FWM_NO_INIT) {
|
||||
_saveChgNotify = FileWatching.FileWatchingMode;
|
||||
@ -8643,7 +8691,9 @@ inline static LRESULT _MsgNotifyLean(const SCNotification *const scn, bool* bMod
|
||||
EditToggleView(Globals.hwndEdit);
|
||||
}
|
||||
else {
|
||||
if (!IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONINFORMATION, L"QuietKeepReadonlyLock", IDS_MUI_DOCUMENT_READONLY))) {
|
||||
if (!FileWatching.MonitoringLog
|
||||
&& !IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONINFORMATION, L"QuietKeepReadonlyLock", IDS_MUI_DOCUMENT_READONLY)))
|
||||
{
|
||||
SendWMCommand(Globals.hwndMain, IDM_VIEW_READONLY);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -5173,6 +5173,11 @@ INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPAR
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwnd, IDCLOSE);
|
||||
break;
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
return TRUE;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user