mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ fix: inconsistent line endings dialog (thanx zufuliu)
This commit is contained in:
parent
6d50e12394
commit
5ea8e2e098
@ -77,6 +77,10 @@
|
||||
#define IDS_MUI_WARN_UNKNOWN_EXT 13014
|
||||
#define IDS_MUI_WARN_INCONSIST_EOLS 13015
|
||||
#define IDS_MUI_WARN_INCONS_INDENTS 13016
|
||||
// keep order (CRLF(0), CR(1), LF(2))
|
||||
#define IDS_MUI_EOLMODENAME_CRLF 13017
|
||||
#define IDS_MUI_EOLMODENAME_CR 13018
|
||||
#define IDS_MUI_EOLMODENAME_LF 13019
|
||||
|
||||
#define IDS_MUI_SELRECT 14000
|
||||
#define IDS_MUI_BUFFERTOOSMALL 14001
|
||||
@ -181,32 +185,33 @@
|
||||
#define IDD_MUI_OPENWITH 17005
|
||||
#define IDD_MUI_DEFENCODING 17006
|
||||
#define IDD_MUI_DEFEOLMODE 17007
|
||||
#define IDD_MUI_LINENUM 17008
|
||||
#define IDD_MUI_FILEMRU 17009
|
||||
#define IDD_MUI_CHANGENOTIFY 17010
|
||||
#define IDD_MUI_STYLESELECT 17011
|
||||
#define IDD_MUI_STYLECONFIG 17012
|
||||
#define IDD_MUI_TABSETTINGS 17013
|
||||
#define IDD_MUI_LONGLINES 17014
|
||||
#define IDD_MUI_WORDWRAP 17015
|
||||
#define IDD_MUI_PAGESETUP 17016
|
||||
#define IDD_MUI_FAVORITES 17017
|
||||
#define IDD_MUI_ADDTOFAV 17018
|
||||
#define IDD_MUI_PASSWORDS 17019
|
||||
#define IDD_MUI_READPW 17020
|
||||
#define IDD_MUI_COLUMNWRAP 17021
|
||||
#define IDD_MUI_MODIFYLINES 17022
|
||||
#define IDD_MUI_INSERTTAG 17023
|
||||
#define IDD_MUI_ENCLOSESELECTION 17024
|
||||
#define IDD_MUI_INFOBOX 17025
|
||||
#define IDD_MUI_INFOBOX2 17026
|
||||
#define IDD_MUI_INFOBOX3 17027
|
||||
#define IDD_MUI_SORT 17028
|
||||
#define IDD_MUI_RECODE 17029
|
||||
#define IDD_MUI_ENCODING 17030
|
||||
#define IDD_MUI_ALIGN 17031
|
||||
#define IDD_MUI_CHOOSEFONT 17032
|
||||
#define IDD_MUI_CMDLINEHELP 17033
|
||||
#define IDD_MUI_WARNLINEENDS 17008
|
||||
#define IDD_MUI_LINENUM 17009
|
||||
#define IDD_MUI_FILEMRU 17010
|
||||
#define IDD_MUI_CHANGENOTIFY 17011
|
||||
#define IDD_MUI_STYLESELECT 17012
|
||||
#define IDD_MUI_STYLECONFIG 17013
|
||||
#define IDD_MUI_TABSETTINGS 17014
|
||||
#define IDD_MUI_LONGLINES 17015
|
||||
#define IDD_MUI_WORDWRAP 17016
|
||||
#define IDD_MUI_PAGESETUP 17017
|
||||
#define IDD_MUI_FAVORITES 17018
|
||||
#define IDD_MUI_ADDTOFAV 17019
|
||||
#define IDD_MUI_PASSWORDS 17020
|
||||
#define IDD_MUI_READPW 17021
|
||||
#define IDD_MUI_COLUMNWRAP 17022
|
||||
#define IDD_MUI_MODIFYLINES 17023
|
||||
#define IDD_MUI_INSERTTAG 17024
|
||||
#define IDD_MUI_ENCLOSESELECTION 17025
|
||||
#define IDD_MUI_INFOBOX 17026
|
||||
#define IDD_MUI_INFOBOX2 17027
|
||||
#define IDD_MUI_INFOBOX3 17028
|
||||
#define IDD_MUI_SORT 17029
|
||||
#define IDD_MUI_RECODE 17030
|
||||
#define IDD_MUI_ENCODING 17031
|
||||
#define IDD_MUI_ALIGN 17032
|
||||
#define IDD_MUI_CHOOSEFONT 17033
|
||||
#define IDD_MUI_CMDLINEHELP 17034
|
||||
|
||||
#define IDC_COMMANDLINE 18000
|
||||
#define IDC_SEARCHEXE 18001
|
||||
@ -247,72 +252,76 @@
|
||||
#define IDC_EOLMODELIST 18036
|
||||
#define IDC_WARN_INCONSISTENT_EOLS 18037
|
||||
#define IDC_CONSISTENT_EOLS 18038
|
||||
#define IDC_AUTOSTRIPBLANKS 18039
|
||||
#define IDC_LINENUM 18040
|
||||
#define IDC_COLNUM 18041
|
||||
#define IDC_FILEMRU 18042
|
||||
#define IDC_PRESERVECARET 18043
|
||||
#define IDC_SAVEMRU 18044
|
||||
#define IDC_REMOVE 18045
|
||||
#define IDC_RESIZEGRIP 18046
|
||||
#define IDC_REMEMBERSEARCHPATTERN 18047
|
||||
#define IDC_STYLELIST 18048
|
||||
#define IDC_DEFAULTSCHEME 18049
|
||||
#define IDC_AUTOSELECT 18050
|
||||
#define IDC_STYLELABEL_ROOT 18051
|
||||
#define IDC_STYLEEDIT_ROOT 18052
|
||||
#define IDC_STYLELABEL 18053
|
||||
#define IDC_STYLEFORE 18054
|
||||
#define IDC_STYLEBACK 18055
|
||||
#define IDC_STYLEFONT 18056
|
||||
#define IDC_PREVIEW 18057
|
||||
#define IDC_STYLEDEFAULT 18058
|
||||
#define IDC_PREVSTYLE 18059
|
||||
#define IDC_NEXTSTYLE 18060
|
||||
#define IDC_IMPORT 18061
|
||||
#define IDC_EXPORT 18062
|
||||
#define IDC_TITLE 18063
|
||||
#define IDC_STYLEEDIT 18064
|
||||
#define IDC_PRINTER 18065
|
||||
#define IDC_FAVORITESDIR 18066
|
||||
#define IDC_GETFAVORITESDIR 18067
|
||||
#define IDC_FAVORITESDESCR 18068
|
||||
#define IDC_PWD_EDIT1 18069
|
||||
#define IDC_PWD_EDIT2 18070
|
||||
#define IDC_PWD_EDIT3 18071
|
||||
#define IDC_PWD_CHECK1 18072
|
||||
#define IDC_PWD_CHECK2 18073
|
||||
#define IDC_PWD_CHECK3 18074
|
||||
#define IDC_PWD_CHECK4 18075
|
||||
#define IDC_PWD_STATMPW 18076
|
||||
#define IDC_COLUMNWRAP 18077
|
||||
#define IDC_INFOBOXTEXT 18078
|
||||
#define IDC_INFOBOXCHECK 18079
|
||||
#define IDC_INFOBOXICON 18080
|
||||
#define IDC_RESIZEGRIP4 18081
|
||||
#define IDC_VERSION 18082
|
||||
#define IDC_SCI_VERSION 18083
|
||||
#define IDC_COMPILER 18084
|
||||
#define IDC_COPYRIGHT 18085
|
||||
#define IDC_WEBPAGE2 18086
|
||||
#define IDC_WEBPAGE 18087
|
||||
#define IDR_RIZBITMAP 18088
|
||||
#define IDC_RIZONEBMP 18089
|
||||
#define IDC_COPYVERSTRG 18090
|
||||
#define IDC_RICHEDITABOUT 18091
|
||||
#define IDC_TRANSL_AUTH 18092
|
||||
#define IDC_TRANSPARENT 18093
|
||||
#define IDC_TAB_WIDTH 18094
|
||||
#define IDC_INDENT_DEPTH 18095
|
||||
#define IDC_TAB_AS_SPC 18096
|
||||
#define IDC_TAB_INDENTS 18097
|
||||
#define IDC_BACKTAB_INDENTS 18098
|
||||
#define IDC_WARN_INCONSISTENT_INDENTS 18099
|
||||
#define IDC_CMDLINEHELP 18100
|
||||
#define IDC_STYLEEDIT_HELP 18101
|
||||
#define IDC_RELIABLE_DETECTION_RES 18102
|
||||
#define IDC_LINE_TEXT 18103
|
||||
#define IDC_COLUMN_TEXT 18104
|
||||
// keep order (CRLF(0), CR(1), LF(2))
|
||||
#define IDC_EOL_SUM_CRLF 18039
|
||||
#define IDC_EOL_SUM_CR 18040
|
||||
#define IDC_EOL_SUM_LF 18041
|
||||
#define IDC_AUTOSTRIPBLANKS 18042
|
||||
#define IDC_LINENUM 18043
|
||||
#define IDC_COLNUM 18044
|
||||
#define IDC_FILEMRU 18045
|
||||
#define IDC_PRESERVECARET 18046
|
||||
#define IDC_SAVEMRU 18047
|
||||
#define IDC_REMOVE 18048
|
||||
#define IDC_RESIZEGRIP 18049
|
||||
#define IDC_REMEMBERSEARCHPATTERN 18050
|
||||
#define IDC_STYLELIST 18051
|
||||
#define IDC_DEFAULTSCHEME 18052
|
||||
#define IDC_AUTOSELECT 18053
|
||||
#define IDC_STYLELABEL_ROOT 18054
|
||||
#define IDC_STYLEEDIT_ROOT 18055
|
||||
#define IDC_STYLELABEL 18056
|
||||
#define IDC_STYLEFORE 18057
|
||||
#define IDC_STYLEBACK 18058
|
||||
#define IDC_STYLEFONT 18059
|
||||
#define IDC_PREVIEW 18060
|
||||
#define IDC_STYLEDEFAULT 18061
|
||||
#define IDC_PREVSTYLE 18062
|
||||
#define IDC_NEXTSTYLE 18063
|
||||
#define IDC_IMPORT 18064
|
||||
#define IDC_EXPORT 18065
|
||||
#define IDC_TITLE 18066
|
||||
#define IDC_STYLEEDIT 18067
|
||||
#define IDC_PRINTER 18068
|
||||
#define IDC_FAVORITESDIR 18069
|
||||
#define IDC_GETFAVORITESDIR 18070
|
||||
#define IDC_FAVORITESDESCR 18071
|
||||
#define IDC_PWD_EDIT1 18072
|
||||
#define IDC_PWD_EDIT2 18073
|
||||
#define IDC_PWD_EDIT3 18074
|
||||
#define IDC_PWD_CHECK1 18075
|
||||
#define IDC_PWD_CHECK2 18076
|
||||
#define IDC_PWD_CHECK3 18077
|
||||
#define IDC_PWD_CHECK4 18078
|
||||
#define IDC_PWD_STATMPW 18079
|
||||
#define IDC_COLUMNWRAP 18080
|
||||
#define IDC_INFOBOXTEXT 18081
|
||||
#define IDC_INFOBOXCHECK 18082
|
||||
#define IDC_INFOBOXICON 18083
|
||||
#define IDC_RESIZEGRIP4 18084
|
||||
#define IDC_VERSION 18085
|
||||
#define IDC_SCI_VERSION 18086
|
||||
#define IDC_COMPILER 18087
|
||||
#define IDC_COPYRIGHT 18088
|
||||
#define IDC_WEBPAGE2 18089
|
||||
#define IDC_WEBPAGE 18090
|
||||
#define IDR_RIZBITMAP 18091
|
||||
#define IDC_RIZONEBMP 18092
|
||||
#define IDC_COPYVERSTRG 18093
|
||||
#define IDC_RICHEDITABOUT 18094
|
||||
#define IDC_TRANSL_AUTH 18095
|
||||
#define IDC_TRANSPARENT 18096
|
||||
#define IDC_TAB_WIDTH 18097
|
||||
#define IDC_INDENT_DEPTH 18098
|
||||
#define IDC_TAB_AS_SPC 18099
|
||||
#define IDC_TAB_INDENTS 18100
|
||||
#define IDC_BACKTAB_INDENTS 18101
|
||||
#define IDC_WARN_INCONSISTENT_INDENTS 18102
|
||||
#define IDC_CMDLINEHELP 18103
|
||||
#define IDC_STYLEEDIT_HELP 18104
|
||||
#define IDC_RELIABLE_DETECTION_RES 18105
|
||||
#define IDC_LINE_TEXT 18106
|
||||
#define IDC_COLUMN_TEXT 18107
|
||||
|
||||
#define CMD_ESCAPE 20000
|
||||
#define CMD_SHIFTESC 20001
|
||||
|
||||
@ -215,6 +215,26 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,139,24,50,14
|
||||
END
|
||||
|
||||
IDD_MUI_WARNLINEENDS DIALOGEX 0, 0, 196, 100
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Inconsistent Line Endings"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Inconsistent line endings found in file:",IDC_STATIC,7,7,180,8
|
||||
LTEXT "CR+LF:",IDC_STATIC,10,18,34,8,SS_RIGHT
|
||||
LTEXT "LF:",IDC_STATIC,10,28,34,8,SS_RIGHT
|
||||
LTEXT "CR:",IDC_STATIC,10,38,34,8,SS_RIGHT
|
||||
LTEXT "%s line(s).",IDC_EOL_SUM_CRLF,48,18,136,8
|
||||
LTEXT "%s line(s).",IDC_EOL_SUM_LF,48,28,136,8
|
||||
LTEXT "%s line(s).",IDC_EOL_SUM_CR,48,38,136,8
|
||||
LTEXT "&Do you want to normalize the line endings?",IDC_STATIC,7,52,180,8
|
||||
COMBOBOX IDC_EOLMODELIST,7,64,118,81,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "&Yes",IDOK,138,63,50,14
|
||||
PUSHBUTTON "&No",IDCANCEL,138,80,50,14
|
||||
CONTROL "&Always show this dialog.", IDC_WARN_INCONSISTENT_EOLS,
|
||||
"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,7,82,118,10
|
||||
END
|
||||
|
||||
IDD_MUI_LINENUM DIALOGEX 0, 0, 115, 95
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Goto"
|
||||
|
||||
@ -149,6 +149,9 @@ BEGIN
|
||||
"The file has inconsistent line-breaks!\n%s\nReplace all line-breaks with '%s'?"
|
||||
IDS_MUI_WARN_INCONS_INDENTS
|
||||
"The file has inconsistent indentation!\n%s\nReplace indentation with '%s'?"
|
||||
IDS_MUI_EOLMODENAME_CRLF "Windows (CR+LF)"
|
||||
IDS_MUI_EOLMODENAME_LF "Unix/Mac (LF)"
|
||||
IDS_MUI_EOLMODENAME_CR "Old Mac (CR)"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
|
||||
287
src/Dialogs.c
287
src/Dialogs.c
@ -148,7 +148,7 @@ typedef struct _infobox {
|
||||
bool bDisableCheckBox;
|
||||
} INFOBOX, *LPINFOBOX;
|
||||
|
||||
INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
LPINFOBOX lpib;
|
||||
|
||||
@ -157,8 +157,8 @@ INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPar
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
lpib = (LPINFOBOX)lParam;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
lpib = (LPINFOBOX)lParam;
|
||||
SendDlgItemMessage(hwnd, IDC_INFOBOXICON, STM_SETICON, (WPARAM)LoadIcon(NULL, IDI_EXCLAMATION), 0);
|
||||
SetDlgItemText(hwnd, IDC_INFOBOXTEXT, lpib->lpstrMessage);
|
||||
if (lpib->bDisableCheckBox)
|
||||
@ -270,7 +270,7 @@ void DisplayCmdLineHelp(HWND hwnd)
|
||||
}
|
||||
#else
|
||||
|
||||
INT_PTR CALLBACK CmdLineHelpProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK CmdLineHelpProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNUSED(lParam);
|
||||
|
||||
@ -500,6 +500,8 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
SetDlgItemText(hwnd, IDC_VERSION, _W(_STRG(VERSION_FILEVERSION_LONG)));
|
||||
@ -703,7 +705,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
(GetDlgCtrlID((HWND)wParam) == IDC_RIZONEBMP))
|
||||
{
|
||||
SetCursor(LoadCursor(NULL, IDC_HAND));
|
||||
SetWindowLongPtr(hwnd, DWLP_MSGRESULT, true);
|
||||
SetWindowLongPtr(hwnd, DWLP_MSGRESULT, (LONG_PTR)true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -747,13 +749,13 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam
|
||||
//
|
||||
// RunDlgProc()
|
||||
//
|
||||
INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
|
||||
switch(umsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
// MakeBitmapButton(hwnd,IDC_SEARCHEXE,Globals.hInstance,IDB_OPEN);
|
||||
SendDlgItemMessage(hwnd,IDC_COMMANDLINE,EM_LIMITTEXT,MAX_PATH - 1,0);
|
||||
@ -916,21 +918,18 @@ INT_PTR RunDlg(HWND hwnd,LPCWSTR lpstrDefault)
|
||||
//
|
||||
// OpenWithDlgProc()
|
||||
//
|
||||
INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
|
||||
switch(umsg)
|
||||
{
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
LVCOLUMN lvc = { LVCF_FMT|LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
|
||||
ResizeDlg_Init(hwnd,Settings.OpenWithDlgSizeX,Settings.OpenWithDlgSizeY,IDC_RESIZEGRIP3);
|
||||
|
||||
SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
|
||||
LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
|
||||
//SetExplorerTheme(GetDlgItem(hwnd,IDC_OPENWITHDIR));
|
||||
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd,IDC_OPENWITHDIR),/*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER|LVS_EX_LABELTIP);
|
||||
@ -1117,20 +1116,18 @@ bool OpenWithDlg(HWND hwnd,LPCWSTR lpstrFile)
|
||||
//
|
||||
// FavoritesDlgProc()
|
||||
//
|
||||
INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
switch(umsg)
|
||||
{
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
LVCOLUMN lvc = { LVCF_FMT|LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
|
||||
ResizeDlg_Init(hwnd,Settings.FavoritesDlgSizeX,Settings.FavoritesDlgSizeY,IDC_RESIZEGRIP3);
|
||||
|
||||
SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
|
||||
LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
|
||||
//SetExplorerTheme(GetDlgItem(hwnd,IDC_FAVORITESDIR));
|
||||
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd,IDC_FAVORITESDIR),/*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER|LVS_EX_LABELTIP);
|
||||
@ -1293,15 +1290,14 @@ bool FavoritesDlg(HWND hwnd,LPWSTR lpstrFile)
|
||||
//
|
||||
// Controls: 100 Edit
|
||||
//
|
||||
INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (umsg) {
|
||||
WCHAR *pszName;
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
pszName = (LPWSTR)lParam;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)pszName);
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
LPCWSTR const pszName = (LPCWSTR)lParam;
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
SendDlgItemMessage(hwnd, 100, EM_LIMITTEXT, MAX_PATH - 1, 0);
|
||||
@ -1324,9 +1320,11 @@ INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lPa
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
pszName = (LPWSTR)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
GetDlgItemText(hwnd, 100, pszName, MAX_PATH - 1);
|
||||
EndDialog(hwnd, IDOK);
|
||||
{
|
||||
LPWSTR pszName = (LPWSTR)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
GetDlgItemText(hwnd, 100, pszName, MAX_PATH - 1);
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
@ -1470,12 +1468,14 @@ DWORD WINAPI FileMRUIconThread(LPVOID lpParam) {
|
||||
//return(0);
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
switch(umsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
|
||||
SHFILEINFO shfi;
|
||||
ZeroMemory(&shfi, sizeof(SHFILEINFO));
|
||||
LVCOLUMN lvc = { LVCF_FMT|LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
@ -1490,8 +1490,6 @@ INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
lpit->hExitThread = CreateEvent(NULL, true, false, NULL);
|
||||
lpit->hTerminatedThread = CreateEvent(NULL, true, true, NULL);
|
||||
}
|
||||
SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
|
||||
|
||||
ResizeDlg_Init(hwnd,Settings.FileMRUDlgSizeX,Settings.FileMRUDlgSizeY,IDC_RESIZEGRIP);
|
||||
|
||||
ListView_SetImageList(GetDlgItem(hwnd,IDC_FILEMRU),
|
||||
@ -1842,15 +1840,17 @@ bool FileMRUDlg(HWND hwnd,LPWSTR lpstrFile)
|
||||
// 103 Check Box (Reset on New)
|
||||
//
|
||||
|
||||
INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (umsg) {
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
CheckRadioButton(hwnd, 100, 102, 100 + Settings.FileWatchingMode);
|
||||
if (Settings.ResetFileWatching)
|
||||
if (Settings.ResetFileWatching) {
|
||||
CheckDlgButton(hwnd, 103, BST_CHECKED);
|
||||
}
|
||||
CenterDlgInParent(hwnd);
|
||||
}
|
||||
return true;
|
||||
@ -1882,7 +1882,6 @@ INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM
|
||||
}
|
||||
return true;
|
||||
}
|
||||
UNUSED(lParam);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1915,17 +1914,16 @@ bool ChangeNotifyDlg(HWND hwnd)
|
||||
//
|
||||
// Controls: Edit IDC_COLUMNWRAP
|
||||
//
|
||||
INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
||||
static UINT *piNumber;
|
||||
|
||||
switch (umsg) {
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
piNumber = (UINT*)lParam;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
UINT const uiNumber = *((UINT*)lParam);
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
SetDlgItemInt(hwnd, IDC_COLUMNWRAP, *piNumber, false);
|
||||
SetDlgItemInt(hwnd, IDC_COLUMNWRAP, uiNumber, false);
|
||||
SendDlgItemMessage(hwnd, IDC_COLUMNWRAP, EM_LIMITTEXT, 15, 0);
|
||||
CenterDlgInParent(hwnd);
|
||||
}
|
||||
@ -1944,9 +1942,11 @@ INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM l
|
||||
case IDOK:
|
||||
{
|
||||
BOOL fTranslated;
|
||||
UINT iNewNumber = GetDlgItemInt(hwnd, IDC_COLUMNWRAP, &fTranslated, FALSE);
|
||||
UINT const iNewNumber = GetDlgItemInt(hwnd, IDC_COLUMNWRAP, &fTranslated, FALSE);
|
||||
if (fTranslated) {
|
||||
UINT* piNumber = (UINT*)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
*piNumber = iNewNumber;
|
||||
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
else
|
||||
@ -1999,14 +1999,13 @@ bool ColumnWrapDlg(HWND hwnd,UINT uidDlg, UINT *iNumber)
|
||||
// 202 Text
|
||||
// 203 Text
|
||||
//
|
||||
INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNUSED(lParam);
|
||||
|
||||
switch (umsg) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
WCHAR tch[512];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@ -2104,24 +2103,26 @@ bool WordWrapSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
|
||||
// 101 Radio1
|
||||
// 102 Radio2
|
||||
//
|
||||
INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static int *piNumber;
|
||||
|
||||
switch (umsg) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
UINT const iNumber = *((UINT*)lParam);
|
||||
|
||||
// TODO: @@@ set GUI IDS for hard coded numbers
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
piNumber = (int*)lParam;
|
||||
SetDlgItemInt(hwnd, 100, *piNumber, false);
|
||||
SetDlgItemInt(hwnd, 100, iNumber, false);
|
||||
SendDlgItemMessage(hwnd, 100, EM_LIMITTEXT, 15, 0);
|
||||
|
||||
if (Settings.LongLineMode == EDGE_LINE)
|
||||
if (Settings.LongLineMode == EDGE_LINE) {
|
||||
CheckRadioButton(hwnd, 101, 102, 101);
|
||||
else
|
||||
}
|
||||
else {
|
||||
CheckRadioButton(hwnd, 101, 102, 102);
|
||||
|
||||
}
|
||||
CenterDlgInParent(hwnd);
|
||||
|
||||
}
|
||||
@ -2139,22 +2140,20 @@ INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LP
|
||||
|
||||
case IDOK:
|
||||
{
|
||||
|
||||
BOOL fTranslated;
|
||||
|
||||
UINT iNewNumber = GetDlgItemInt(hwnd, 100, &fTranslated, FALSE);
|
||||
UINT const iNewNumber = GetDlgItemInt(hwnd, 100, &fTranslated, FALSE);
|
||||
|
||||
if (fTranslated) {
|
||||
UINT* piNumber = (UINT*)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
*piNumber = iNewNumber;
|
||||
|
||||
Settings.LongLineMode = (IsDlgButtonChecked(hwnd, 101)) ? EDGE_LINE : EDGE_BACKGROUND;
|
||||
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
|
||||
else
|
||||
else {
|
||||
PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)(GetDlgItem(hwnd, 100)), 1);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2201,14 +2200,13 @@ bool LongLineSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
|
||||
// 104 Check
|
||||
//
|
||||
|
||||
INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
UNUSED(lParam);
|
||||
|
||||
switch(umsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
SetDlgItemInt(hwnd,IDC_TAB_WIDTH,Settings.TabWidth,false);
|
||||
@ -2302,10 +2300,8 @@ typedef struct encodedlg {
|
||||
int cyDlg;
|
||||
} ENCODEDLG, *PENCODEDLG;
|
||||
|
||||
INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
static INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static PENCODEDLG pdd;
|
||||
|
||||
static int s_iEnc;
|
||||
static bool s_bUseAsFallback;
|
||||
static bool s_bLoadASCIIasUTF8;
|
||||
@ -2314,17 +2310,15 @@ INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
HBITMAP hbmp;
|
||||
HIMAGELIST himl;
|
||||
|
||||
pdd = (PENCODEDLG)lParam;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
PENCODEDLG const pdd = (PENCODEDLG)lParam;
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
hbmp = LoadImage(Globals.hInstance, MAKEINTRESOURCE(IDB_ENCODING), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
|
||||
HBITMAP hbmp = LoadImage(Globals.hInstance, MAKEINTRESOURCE(IDB_ENCODING), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
|
||||
hbmp = ResizeImageForCurrentDPI(hbmp);
|
||||
|
||||
himl = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 0);
|
||||
HIMAGELIST himl = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 0);
|
||||
ImageList_AddMasked(himl, hbmp, CLR_DEFAULT);
|
||||
DeleteObject(hbmp);
|
||||
SendDlgItemMessage(hwnd, IDC_ENCODINGLIST, CBEM_SETIMAGELIST, 0, (LPARAM)himl);
|
||||
@ -2414,6 +2408,7 @@ INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
|
||||
break;
|
||||
|
||||
case IDOK: {
|
||||
PENCODEDLG pdd = (PENCODEDLG)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
if (Encoding_GetFromComboboxEx(GetDlgItem(hwnd, IDC_ENCODINGLIST), &pdd->idEncoding)) {
|
||||
if (pdd->idEncoding < 0) {
|
||||
MsgBoxLng(MBWARN, IDS_MUI_ERR_ENCODINGNA);
|
||||
@ -2430,8 +2425,9 @@ INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, L
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)(GetDlgItem(hwnd, IDC_ENCODINGLIST)), 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2478,10 +2474,9 @@ bool SelectDefEncodingDlg(HWND hwnd,int *pidREncoding)
|
||||
// SelectEncodingDlgProc()
|
||||
//
|
||||
//
|
||||
INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
|
||||
static PENCODEDLG pdd;
|
||||
static HWND hwndLV;
|
||||
|
||||
switch(umsg)
|
||||
@ -2489,11 +2484,10 @@ INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
LVCOLUMN lvc = { LVCF_FMT|LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
HBITMAP hbmp;
|
||||
HIMAGELIST himl;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
PENCODEDLG const pdd = (PENCODEDLG)lParam;
|
||||
|
||||
pdd = (PENCODEDLG)lParam;
|
||||
LVCOLUMN lvc = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, L"", -1, 0, 0, 0 };
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
@ -2501,10 +2495,10 @@ INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
|
||||
hwndLV = GetDlgItem(hwnd,IDC_ENCODINGLIST);
|
||||
|
||||
hbmp = LoadImage(Globals.hInstance,MAKEINTRESOURCE(IDB_ENCODING),IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);
|
||||
HBITMAP hbmp = LoadImage(Globals.hInstance,MAKEINTRESOURCE(IDB_ENCODING),IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);
|
||||
hbmp = ResizeImageForCurrentDPI(hbmp);
|
||||
|
||||
himl = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0);
|
||||
HIMAGELIST himl = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0);
|
||||
ImageList_AddMasked(himl,hbmp,CLR_DEFAULT);
|
||||
DeleteObject(hbmp);
|
||||
ListView_SetImageList(GetDlgItem(hwnd,IDC_ENCODINGLIST),himl,LVSIL_SMALL);
|
||||
@ -2527,20 +2521,20 @@ INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
break;
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
ResizeDlg_Destroy(hwnd,&pdd->cxDlg,&pdd->cyDlg);
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PENCODEDLG pdd = (PENCODEDLG)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
ResizeDlg_Destroy(hwnd, &pdd->cxDlg, &pdd->cyDlg);
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
case WM_SIZE:
|
||||
{
|
||||
int dx;
|
||||
int dy;
|
||||
HDWP hdwp;
|
||||
|
||||
int dx, dy;
|
||||
ResizeDlg_Size(hwnd,lParam,&dx,&dy);
|
||||
|
||||
hdwp = BeginDeferWindowPos(4);
|
||||
HDWP hdwp = BeginDeferWindowPos(4);
|
||||
hdwp = DeferCtlPos(hdwp,hwnd,IDC_RESIZEGRIP4,dx,dy,SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp,hwnd,IDOK,dx,dy,SWP_NOSIZE);
|
||||
hdwp = DeferCtlPos(hdwp,hwnd,IDCANCEL,dx,dy,SWP_NOSIZE);
|
||||
@ -2583,17 +2577,21 @@ INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
|
||||
{
|
||||
|
||||
case IDOK:
|
||||
if (Encoding_GetFromListView(hwndLV,&pdd->idEncoding)) {
|
||||
{
|
||||
PENCODEDLG pdd = (PENCODEDLG)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
if (Encoding_GetFromListView(hwndLV, &pdd->idEncoding)) {
|
||||
if (pdd->idEncoding < 0) {
|
||||
MsgBoxLng(MBWARN,IDS_MUI_ERR_ENCODINGNA);
|
||||
EndDialog(hwnd,IDCANCEL);
|
||||
MsgBoxLng(MBWARN, IDS_MUI_ERR_ENCODINGNA);
|
||||
EndDialog(hwnd, IDCANCEL);
|
||||
}
|
||||
else {
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
else
|
||||
EndDialog(hwnd,IDOK);
|
||||
}
|
||||
else
|
||||
PostMessage(hwnd,WM_NEXTDLGCTL,(WPARAM)(GetDlgItem(hwnd,IDC_ENCODINGLIST)),1);
|
||||
|
||||
else {
|
||||
PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)(GetDlgItem(hwnd, IDC_ENCODINGLIST)), 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@ -2678,33 +2676,34 @@ bool RecodeDlg(HWND hwnd,int *pidREncoding)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SelectDefLineEndingDlgProc()
|
||||
//
|
||||
//
|
||||
INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static int* piOption;
|
||||
|
||||
switch(umsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
int i;
|
||||
WCHAR wch[256] = { L'\0' };
|
||||
|
||||
piOption = (int*)lParam;
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
|
||||
int const iOption = *((int*)lParam);
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
// Load options
|
||||
for (i = 0; i < 3; i++) {
|
||||
WCHAR wch[256] = { L'\0' };
|
||||
for (int i = 0; i < 3; i++) {
|
||||
GetLngString(IDS_EOL_WIN+i,wch,COUNTOF(wch));
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST,CB_ADDSTRING,0,(LPARAM)wch);
|
||||
}
|
||||
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST,CB_SETCURSEL,(WPARAM)*piOption,0);
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST,CB_SETCURSEL,iOption,0);
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST,CB_SETEXTENDEDUI,true,0);
|
||||
|
||||
CheckDlgButton(hwnd,IDC_WARN_INCONSISTENT_EOLS, DlgBtnChk(Settings.WarnInconsistEOLs));
|
||||
@ -2725,10 +2724,11 @@ INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LP
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDOK: {
|
||||
int* piOption = (int*)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
*piOption = (int)SendDlgItemMessage(hwnd,IDC_EOLMODELIST,CB_GETCURSEL,0,0);
|
||||
Settings.WarnInconsistEOLs = (IsDlgButtonChecked(hwnd,IDC_WARN_INCONSISTENT_EOLS) == BST_CHECKED);
|
||||
Settings.FixLineEndings = (IsDlgButtonChecked(hwnd,IDC_CONSISTENT_EOLS) == BST_CHECKED);
|
||||
Settings.FixTrailingBlanks = (IsDlgButtonChecked(hwnd,IDC_AUTOSTRIPBLANKS) == BST_CHECKED);
|
||||
Settings.WarnInconsistEOLs = IsDlgButtonChecked(hwnd,IDC_WARN_INCONSISTENT_EOLS);
|
||||
Settings.FixLineEndings = IsDlgButtonChecked(hwnd,IDC_CONSISTENT_EOLS);
|
||||
Settings.FixTrailingBlanks = IsDlgButtonChecked(hwnd,IDC_AUTOSTRIPBLANKS);
|
||||
EndDialog(hwnd,IDOK);
|
||||
}
|
||||
break;
|
||||
@ -2759,6 +2759,89 @@ bool SelectDefLineEndingDlg(HWND hwnd, LPARAM piOption)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// WarnLineEndingDlgProc()
|
||||
//
|
||||
//
|
||||
static INT_PTR CALLBACK WarnLineEndingDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (umsg) {
|
||||
case WM_INITDIALOG: {
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, lParam);
|
||||
const EditFileIOStatus* const fioStatus = (EditFileIOStatus*)lParam;
|
||||
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
int const iEOLMode = fioStatus->iEOLMode;
|
||||
|
||||
// Load options
|
||||
WCHAR wch[128];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
GetLngString(IDS_MUI_EOLMODENAME_CRLF + i, wch, COUNTOF(wch));
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST, CB_ADDSTRING, 0, (LPARAM)wch);
|
||||
}
|
||||
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST, CB_SETCURSEL, iEOLMode, 0);
|
||||
SendDlgItemMessage(hwnd, IDC_EOLMODELIST, CB_SETEXTENDEDUI, TRUE, 0);
|
||||
|
||||
WCHAR tchFmt[128];
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
WCHAR tchLn[32];
|
||||
StringCchPrintf(tchLn, COUNTOF(tchLn), L"%i", fioStatus->eolCount[i]);
|
||||
FormatNumberStr(tchLn);
|
||||
GetDlgItemText(hwnd, IDC_EOL_SUM_CRLF + i, tchFmt, COUNTOF(tchFmt));
|
||||
StringCchPrintf(wch, COUNTOF(wch), tchFmt, tchLn);
|
||||
SetDlgItemText(hwnd, IDC_EOL_SUM_CRLF + i, wch);
|
||||
}
|
||||
|
||||
if (Settings.WarnInconsistEOLs) {
|
||||
CheckDlgButton(hwnd, IDC_WARN_INCONSISTENT_EOLS, BST_CHECKED);
|
||||
}
|
||||
|
||||
CenterDlgInParent(hwnd);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK: {
|
||||
EditFileIOStatus* status = (EditFileIOStatus*)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
const int iEOLMode = (int)SendDlgItemMessage(hwnd, IDC_EOLMODELIST, CB_GETCURSEL, 0, 0);
|
||||
status->iEOLMode = iEOLMode;
|
||||
Settings.WarnInconsistEOLs = IsDlgButtonChecked(hwnd, IDC_WARN_INCONSISTENT_EOLS);
|
||||
EndDialog(hwnd, IDOK);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
Settings.WarnInconsistEOLs = IsDlgButtonChecked(hwnd, IDC_WARN_INCONSISTENT_EOLS);
|
||||
EndDialog(hwnd, IDCANCEL);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// SelectDefLineEndingDlg()
|
||||
//
|
||||
bool WarnLineEndingDlg(HWND hwnd, EditFileIOStatus* fioStatus) {
|
||||
MessageBeep(MB_ICONEXCLAMATION);
|
||||
const INT_PTR iResult = ThemedDialogBoxParam(Globals.hLngResContainer,
|
||||
MAKEINTRESOURCE(IDD_MUI_WARNLINEENDS),
|
||||
hwnd,
|
||||
WarnLineEndingDlgProc,
|
||||
(LPARAM)fioStatus);
|
||||
return iResult == IDOK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// GetMonitorInfoFromRect()
|
||||
|
||||
@ -36,6 +36,7 @@ bool SelectDefEncodingDlg(HWND hwnd,int * pidREncoding);
|
||||
bool SelectEncodingDlg(HWND hwnd,int * pidREncoding);
|
||||
bool RecodeDlg(HWND hwnd,int * pidREncoding);
|
||||
bool SelectDefLineEndingDlg(HWND hwnd,LPARAM piOption);
|
||||
bool WarnLineEndingDlg(HWND hwnd, EditFileIOStatus* fioStatus);
|
||||
|
||||
bool GetMonitorInfoFromRect(const RECT* rc, MONITORINFO* hMonitorInfo);
|
||||
void WinInfoToScreen(WININFO* pWinInfo);
|
||||
|
||||
14
src/Edit.c
14
src/Edit.c
@ -4992,7 +4992,7 @@ static char s_lastFind[FNDRPL_BUFFER] = { L'\0' };
|
||||
static WCHAR s_tchBuf[FNDRPL_BUFFER] = { L'\0' };
|
||||
static WCHAR s_tchBuf2[FNDRPL_BUFFER] = { L'\0' };
|
||||
|
||||
INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static LPEDITFINDREPLACE sg_pefrData = NULL;
|
||||
static DocPos s_InitialSearchStart = 0;
|
||||
@ -7039,7 +7039,7 @@ void EditMatchBrace(HWND hwnd)
|
||||
//
|
||||
// EditLinenumDlgProc()
|
||||
//
|
||||
INT_PTR CALLBACK EditLinenumDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditLinenumDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
UNUSED(lParam);
|
||||
|
||||
@ -7173,7 +7173,7 @@ typedef struct _modlinesdata {
|
||||
} MODLINESDATA, *PMODLINESDATA;
|
||||
|
||||
|
||||
INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditModifyLinesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static PMODLINESDATA pdata;
|
||||
|
||||
@ -7385,7 +7385,7 @@ bool EditModifyLinesDlg(HWND hwnd,LPWSTR pwsz1,LPWSTR pwsz2)
|
||||
// 103 Radio Button
|
||||
// 104 Radio Button
|
||||
//
|
||||
INT_PTR CALLBACK EditAlignDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditAlignDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static int *piAlignMode;
|
||||
switch(umsg)
|
||||
@ -7466,7 +7466,7 @@ typedef struct _encloseselectiondata {
|
||||
} ENCLOSESELDATA, *PENCLOSESELDATA;
|
||||
|
||||
|
||||
INT_PTR CALLBACK EditEncloseSelectionDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditEncloseSelectionDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static PENCLOSESELDATA pdata;
|
||||
switch(umsg)
|
||||
@ -7542,7 +7542,7 @@ typedef struct _tagsdata {
|
||||
} TAGSDATA, *PTAGSDATA;
|
||||
|
||||
|
||||
INT_PTR CALLBACK EditInsertTagDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditInsertTagDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static PTAGSDATA pdata;
|
||||
switch(umsg)
|
||||
@ -7669,7 +7669,7 @@ bool EditInsertTagDlg(HWND hwnd,LPWSTR pwszOpen,LPWSTR pwszClose)
|
||||
// Controls: 100-102 Radio Button
|
||||
// 103-109 Check Box
|
||||
//
|
||||
INT_PTR CALLBACK EditSortDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
static INT_PTR CALLBACK EditSortDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static int* piSortFlags;
|
||||
switch(umsg)
|
||||
|
||||
@ -9682,10 +9682,16 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
// Show inconsistent line endings warning
|
||||
if (fioStatus.bInconsistentEOLs && Settings.WarnInconsistEOLs)
|
||||
{
|
||||
if (WarnLineEndingDlg(Globals.hwndMain, &fioStatus)) {
|
||||
SciCall_ConvertEOLs(fioStatus.iEOLMode);
|
||||
}
|
||||
|
||||
#if 0
|
||||
int const eolm = SciCall_GetEOLMode(); //Settings.DefaultEOLMode;
|
||||
|
||||
WCHAR szDefault[32];
|
||||
WCHAR szStatistic[80];
|
||||
int const eolm = SciCall_GetEOLMode(); //Settings.DefaultEOLMode;
|
||||
StringCchPrintf(szDefault, COUNTOF(szDefault), L"%s",
|
||||
StringCchPrintf(szDefault, COUNTOF(szDefault), L"%s",
|
||||
((eolm == SC_EOL_CRLF) ? L"CRLF (\\r\\n)" : ((eolm == SC_EOL_CR) ? L"CR (\\r)" : L"LF (\\n)")));
|
||||
StringCchPrintf(szStatistic, COUNTOF(szStatistic), L" #CRLF = %lli\n #CR = %lli\n #LF = %lli\n",
|
||||
fioStatus.eolCount[SC_EOL_CRLF], fioStatus.eolCount[SC_EOL_CR], fioStatus.eolCount[SC_EOL_LF]);
|
||||
@ -9693,6 +9699,8 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
if (res == IDYES) {
|
||||
SciCall_ConvertEOLs(eolm);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (Settings.WarnInconsistentIndents && !Style_IsCurLexerStandard()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user