diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 05cdbc5e..0b53e344 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -33,17 +33,18 @@ #define IDC_STATIC -1 #endif -IDD_PREFERENCE_BOX DIALOGEX 0, 0, 470, 235 +IDD_PREFERENCE_BOX DIALOGEX 0, 0, 560, 220 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE CAPTION "Preferences" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - PUSHBUTTON "Close",IDC_BUTTON_CLOSE,213,212,45,14 + LISTBOX IDC_LIST_DLGTITLE,10,10,80,185,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "Close",IDC_BUTTON_CLOSE,255,200,45,14 END IDD_PREFERENCE_BAR_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Toolbar",IDC_TOOLBAR_GB_STATIC,57,45,147,68,BS_CENTER @@ -75,65 +76,73 @@ BEGIN END IDD_PREFERENCE_MARGEIN_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Folder Margin Style",IDC_FMS_GB_STATIC,44,48,83,89,BS_CENTER - CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,53,61,59,10 - CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,53,75,60,10 - CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,53,90,62,10 - CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,53,119,61,10 - CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,53,104,61,10 - CONTROL "Display line number",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,111,141,10 - CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,124,150,10 - CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,137,129,10 - CONTROL "Show vertical edge",IDC_CHECK_SHOWVERTICALEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,60,122,10 - RTEXT "Number of columns :",IDC_NBCOLONE_STATIC,146,108,83,8 - LTEXT "0",IDC_COLONENUMBER_STATIC,236,107,18,8,SS_LEFT | WS_TABSTOP - GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,140,48,148,77,BS_CENTER - CONTROL "Line mode",IDC_RADIO_LNMODE,"Button",BS_AUTORADIOBUTTON,154,76,91,10 - CONTROL "Background mode",IDC_RADIO_BGMODE,"Button",BS_AUTORADIOBUTTON,154,90,91,10 - GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,44,5,199,40,BS_CENTER - LTEXT "Width :",IDC_WIDTH_STATIC,48,24,37,8,0,WS_EX_RIGHT - COMBOBOX IDC_WIDTH_COMBO,87,22,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Blink rate :",IDC_BLINKRATE_STATIC,159,17,50,8 - CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,154,29,67,13 - LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,223,29,12,8 - LTEXT "F",IDC_CARETBLINKRATE_F_STATIC,142,29,12,8,0,WS_EX_RIGHT - GROUPBOX "Multi-Editing Settings",IDC_MULTISELECTION_GB_STATIC,251,5,140,40,BS_CENTER + GROUPBOX "Folder Margin Style",IDC_FMS_GB_STATIC,46,54,83,89,BS_CENTER + CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,55,67,59,10 + CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,55,81,60,10 + CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,55,96,62,10 + CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,55,125,61,10 + CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,55,110,61,10 + CONTROL "Display line number",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,298,117,141,10 + CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,298,130,150,10 + CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,298,143,129,10 + CONTROL "Show vertical edge",IDC_CHECK_SHOWVERTICALEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,153,66,122,10 + RTEXT "Number of columns :",IDC_NBCOLONE_STATIC,148,114,83,8 + LTEXT "0",IDC_COLONENUMBER_STATIC,238,113,18,8,WS_TABSTOP + GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,142,54,148,77,BS_CENTER + CONTROL "Line mode",IDC_RADIO_LNMODE,"Button",BS_AUTORADIOBUTTON,156,82,91,10 + CONTROL "Background mode",IDC_RADIO_BGMODE,"Button",BS_AUTORADIOBUTTON,156,96,91,10 + GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,46,11,199,40,BS_CENTER + LTEXT "Width :",IDC_WIDTH_STATIC,50,30,37,8,0,WS_EX_RIGHT + COMBOBOX IDC_WIDTH_COMBO,89,28,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Blink rate :",IDC_BLINKRATE_STATIC,161,23,50,8 + CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,156,35,67,13 + LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,225,35,12,8 + LTEXT "F",IDC_CARETBLINKRATE_F_STATIC,144,35,12,8,0,WS_EX_RIGHT + GROUPBOX "Multi-Editing Settings",IDC_MULTISELECTION_GB_STATIC,253,11,140,40,BS_CENTER CONTROL "Enable (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,259,22,130,10 - GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,299,48,92,56,BS_CENTER - CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,309,61,59,10 - CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,309,75,60,10 - CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,309,89,62,10 - - GROUPBOX "Border Width",IDC_BORDERWIDTH_STATIC,140,126,148,30,BS_CENTER - CONTROL "",IDC_BORDERWIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,154,139,67,13 - LTEXT "0",IDC_BORDERWIDTHVAL_STATIC,223,139,12,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,261,28,130,10 + GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,301,54,92,56,BS_CENTER + CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,311,67,59,10 + CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,311,81,60,10 + CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,311,95,62,10 + GROUPBOX "Border Width",IDC_BORDERWIDTH_STATIC,142,132,148,30,BS_CENTER + CONTROL "",IDC_BORDERWIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,156,145,67,13 + LTEXT "0",IDC_BORDERWIDTHVAL_STATIC,225,145,12,8 END IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,15,69,10 CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,28,140,10 CONTROL "Enable",IDC_CHECK_ENABLSMARTHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,45,57,142,10 - CONTROL "Highlighting is case sensitive",IDC_CHECK_SMARTHILITECASESENSITIVE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,45,71,142,10 - CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,105,150,10 + CONTROL "Highlighting is case sensitive",IDC_CHECK_SMARTHILITECASESENSITIVE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,45,71,142,10 + CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,105,150,10 CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,120,150,10 CONTROL "Minimize to system tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,135,150,10 - CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,150,217,10 - CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,165,217,10 + CONTROL "Show only filename in title bar",IDC_CHECK_SHORTTITLE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,37,150,217,10 + CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,165,217,10 CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,15,140,10 - CONTROL "No underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,28,140,10 + CONTROL "No underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,28,140,10 CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,57,140,10 CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,69,140,10 - CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,81,140,10 + CONTROL "Scroll to the last line after update",IDC_CHECK_UPDATEGOTOEOF, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,81,140,10 CONTROL "Enable",IDC_CHECK_ENABLTAGSMATCHHILITE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,111,140,10 - CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,123,140,10 - CONTROL "Highlight comment/php/asp zone",IDC_CHECK_HIGHLITENONEHTMLZONE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,136,140,10 + CONTROL "Highlight tag attributes",IDC_CHECK_ENABLTAGATTRHILITE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,123,140,10 + CONTROL "Highlight comment/php/asp zone",IDC_CHECK_HIGHLITENONEHTMLZONE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,267,136,140,10 EDITTEXT IDC_EDIT_SESSIONFILEEXT,381,157,34,14,ES_AUTOHSCROLL GROUPBOX "Document Switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,37,4,155,39,BS_CENTER GROUPBOX "Smart Highlighting",IDC_SMARTHILITING_STATIC,37,47,155,39,BS_CENTER @@ -144,77 +153,91 @@ BEGIN END IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "New Document",IDC_NEWDOCUMENT_GR_STATIC,7,2,195,178,BS_CENTER - - GROUPBOX "Format",IDC_FORMAT_GB_STATIC,17,12,176,25,BS_CENTER - CONTROL "Windows",IDC_RADIO_F_WIN,"Button",BS_AUTORADIOBUTTON | WS_GROUP,27,23,50,10 - CONTROL "Old Mac",IDC_RADIO_F_MAC,"Button",BS_AUTORADIOBUTTON,80,23,50,10 - CONTROL "Unix/OSX",IDC_RADIO_F_UNIX,"Button",BS_AUTORADIOBUTTON,135,23,50,10 - - GROUPBOX "Encoding",IDC_ENCODING_STATIC,17,44,175,110,BS_CENTER - CONTROL "ANSI",IDC_RADIO_ANSI,"Button",BS_AUTORADIOBUTTON | WS_GROUP,27,53,80,10 - CONTROL "UTF-8 without BOM",IDC_RADIO_UTF8SANSBOM,"Button",BS_AUTORADIOBUTTON,27,67,128,10 - CONTROL "UTF-8",IDC_RADIO_UTF8,"Button",BS_AUTORADIOBUTTON,27,92,62,10 - CONTROL "UCS-2 Big Endian",IDC_RADIO_UCS2BIG,"Button",BS_AUTORADIOBUTTON,27,106,103,10 - CONTROL "UCS-2 Little Endian",IDC_RADIO_UCS2SMALL,"Button",BS_AUTORADIOBUTTON,27,120,102,10 - CONTROL "",IDC_RADIO_OTHERCP,"Button",BS_AUTORADIOBUTTON,27,135,10,10 - COMBOBOX IDC_COMBO_OTHERCP,41,134,100,140,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Default language :",IDC_DEFAULTLANG_STATIC,12,161,77,8 - COMBOBOX IDC_COMBO_DEFAULTLANG,94,159,60,140,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - - GROUPBOX "Default Directory (Open/Save)",IDC_OPENSAVEDIR_GR_STATIC,213,2,232,63,BS_CENTER - CONTROL "Follow current document",IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO, - "Button",BS_AUTORADIOBUTTON | WS_GROUP,221,14,200,10 - CONTROL "Remember last used directory",IDC_OPENSAVEDIR_REMEMBERLAST_RADIO, - "Button",BS_AUTORADIOBUTTON,221,29,217,10 - CONTROL "",IDC_OPENSAVEDIR_ALWAYSON_RADIO,"Button",BS_AUTORADIOBUTTON,221,43,11,10 - EDITTEXT IDC_OPENSAVEDIR_ALWAYSON_EDIT,237,42,179,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON,423,41,16,14 + GROUPBOX "New Document",IDC_NEWDOCUMENT_GR_STATIC,50,8,354,161,BS_CENTER + GROUPBOX "Format",IDC_FORMAT_GB_STATIC,68,29,129,79,BS_CENTER + CONTROL "Windows",IDC_RADIO_F_WIN,"Button",BS_AUTORADIOBUTTON | WS_GROUP,75,48,50,10 + CONTROL "Old Mac",IDC_RADIO_F_MAC,"Button",BS_AUTORADIOBUTTON,75,64,50,10 + CONTROL "Unix/OSX",IDC_RADIO_F_UNIX,"Button",BS_AUTORADIOBUTTON,75,81,50,10 + GROUPBOX "Encoding",IDC_ENCODING_STATIC,212,28,175,122,BS_CENTER + CONTROL "ANSI",IDC_RADIO_ANSI,"Button",BS_AUTORADIOBUTTON | WS_GROUP,222,39,80,10 + CONTROL "UTF-8 without BOM",IDC_RADIO_UTF8SANSBOM,"Button",BS_AUTORADIOBUTTON,222,53,128,10 CONTROL "Apply to opened ANSI files",IDC_CHECK_OPENANSIASUTF8, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,79,124,10 - GROUPBOX "Recent Files History",IDC_HISTORY_GB_STATIC,213,69,232,110,BS_CENTER - RTEXT "Max. number of entries :",IDC_MAXNBFILE_STATIC,217,91,112,8 - LTEXT "0",IDC_MAXNBFILEVAL_STATIC,338,91,15,8,SS_LEFT | WS_TABSTOP - CONTROL "Don't check at launch time",IDC_CHECK_DONTCHECKHISTORY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,221,78,140,10 - GROUPBOX "Display",IDC_STATIC,226,103,207,69,BS_CENTER - CONTROL "In Submenu",IDC_CHECK_INSUBMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,234,114,79,10 - CONTROL "Only File Name",IDC_RADIO_ONLYFILENAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,235,130,88,10 - CONTROL "Full File Name Path",IDC_RADIO_FULLFILENAMEPATH,"Button",BS_AUTORADIOBUTTON,235,144,109,10 - CONTROL "Customize Maximum Length:",IDC_RADIO_CUSTOMIZELENTH, - "Button",BS_AUTORADIOBUTTON,235,157,114,10 - LTEXT "0",IDC_CUSTOMIZELENGTHVAL_STATIC,353,158,18,8,SS_LEFT | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,232,65,124,10 + CONTROL "UTF-8",IDC_RADIO_UTF8,"Button",BS_AUTORADIOBUTTON,222,79,62,10 + CONTROL "UCS-2 Big Endian",IDC_RADIO_UCS2BIG,"Button",BS_AUTORADIOBUTTON,222,95,103,10 + CONTROL "UCS-2 Little Endian",IDC_RADIO_UCS2SMALL,"Button",BS_AUTORADIOBUTTON,222,111,102,10 + CONTROL "",IDC_RADIO_OTHERCP,"Button",BS_AUTORADIOBUTTON,222,126,10,10 + COMBOBOX IDC_COMBO_OTHERCP,236,126,100,140,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Default language :",IDC_DEFAULTLANG_STATIC,57,130,77,8 + COMBOBOX IDC_COMBO_DEFAULTLANG,139,128,60,140,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END +IDD_PREFERENCE_DEFAULTDIRECTORY_BOX DIALOGEX 0, 0, 455, 185 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Default Directory (Open/Save)",IDC_OPENSAVEDIR_GR_STATIC,110,29,232,101,BS_CENTER + CONTROL "Follow current document",IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO, + "Button",BS_AUTORADIOBUTTON | WS_GROUP,118,60,200,10 + CONTROL "Remember last used directory",IDC_OPENSAVEDIR_REMEMBERLAST_RADIO, + "Button",BS_AUTORADIOBUTTON,118,75,217,10 + CONTROL "",IDC_OPENSAVEDIR_ALWAYSON_RADIO,"Button",BS_AUTORADIOBUTTON,118,89,11,10 + EDITTEXT IDC_OPENSAVEDIR_ALWAYSON_EDIT,134,88,179,14,ES_AUTOHSCROLL + PUSHBUTTON "...",IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON,320,87,16,14 +END + +IDD_PREFERENCE_RECENTFILESHISTORY_BOX DIALOGEX 0, 0, 455, 185 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Recent Files History",IDC_HISTORY_GB_STATIC,104,25,260,126,BS_CENTER + RTEXT "Max. number of entries :",IDC_MAXNBFILE_STATIC,108,52,112,8 + LTEXT "0",IDC_MAXNBFILEVAL_STATIC,229,52,15,8,WS_TABSTOP + CONTROL "Don't check at launch time",IDC_CHECK_DONTCHECKHISTORY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,121,39,140,10 + GROUPBOX "Display",IDC_STATIC,121,65,225,73,BS_CENTER + CONTROL "In Submenu",IDC_CHECK_INSUBMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,76,79,10 + CONTROL "Only File Name",IDC_RADIO_ONLYFILENAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,133,92,88,10 + CONTROL "Full File Name Path",IDC_RADIO_FULLFILENAMEPATH,"Button",BS_AUTORADIOBUTTON,133,106,109,10 + CONTROL "Customize Maximum Length:",IDC_RADIO_CUSTOMIZELENTH, + "Button",BS_AUTORADIOBUTTON,133,120,114,10 + LTEXT "0",IDC_CUSTOMIZELENGTHVAL_STATIC,251,120,18,8,WS_TABSTOP END IDD_PREFERENCE_LANG_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Language Menu",IDC_CHECK_LANGMENU_GR_STATIC,37,3,220,172,BS_CENTER + GROUPBOX "Language Menu",IDC_CHECK_LANGMENU_GR_STATIC,111,3,220,172,BS_CENTER CONTROL "Make language menu compact",IDC_CHECK_LANGMENUCOMPACT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,51,14,174,10 - CTEXT "Available items",IDC_ENABLEDITEMS_STATIC,55,31,72,8 - LISTBOX IDC_LIST_ENABLEDLANG,50,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "->",IDC_BUTTON_REMOVE,135,76,25,14 - PUSHBUTTON "<-",IDC_BUTTON_RESTORE,135,107,25,14 - CTEXT "Disabled items",IDC_DISABLEDITEMS_STATIC,170,31,72,8 - LISTBOX IDC_LIST_DISABLEDLANG,167,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Tab Settings",IDC_TABSETTING_GB_STATIC,283,3,130,172,BS_CENTER - LISTBOX IDC_LIST_TABSETTNG,305,18,84,100,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - GROUPBOX "",IDC_GR_TABVALUE_STATIC,295,125,110,42,BS_CENTER - CONTROL "Use default value",IDC_CHECK_DEFAULTTABVALUE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,291,125,85,10 - RTEXT "Tab size : ",IDC_TABSIZE_STATIC,296,138,58,8 - LTEXT "0",IDC_TABSIZEVAL_STATIC,356,138,18,8,SS_LEFT | WS_TABSTOP - LTEXT "0",IDC_TABSIZEVAL_DISABLE_STATIC,356,138,18,8 - CONTROL "Replace by space",IDC_CHECK_REPLACEBYSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,303,149,100,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,14,174,10 + CTEXT "Available items",IDC_ENABLEDITEMS_STATIC,129,31,72,8 + LISTBOX IDC_LIST_ENABLEDLANG,124,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "->",IDC_BUTTON_REMOVE,209,76,25,14 + PUSHBUTTON "<-",IDC_BUTTON_RESTORE,209,107,25,14 + CTEXT "Disabled items",IDC_DISABLEDITEMS_STATIC,244,31,72,8 + LISTBOX IDC_LIST_DISABLEDLANG,241,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP +END + +IDD_PREFERENCE_TABSETTINGS_BOX DIALOGEX 0, 0, 455, 185 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Tab Settings",IDC_TABSETTING_GB_STATIC,156,3,130,172,BS_CENTER + LISTBOX IDC_LIST_TABSETTNG,178,18,84,100,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + GROUPBOX "",IDC_GR_TABVALUE_STATIC,168,125,110,42,BS_CENTER + CONTROL "Use default value",IDC_CHECK_DEFAULTTABVALUE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,125,85,10 + RTEXT "Tab size : ",IDC_TABSIZE_STATIC,169,138,58,8 + LTEXT "0",IDC_TABSIZEVAL_STATIC,229,138,18,8,WS_TABSTOP + LTEXT "0",IDC_TABSIZEVAL_DISABLE_STATIC,229,138,18,8 + CONTROL "Replace by space",IDC_CHECK_REPLACEBYSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,149,100,10 END IDD_PREFERENCE_PRINT_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "WYSIWYG",IDC_RADIO_WYSIWYG,"Button",BS_AUTORADIOBUTTON,12,30,123,10 @@ -262,37 +285,35 @@ BEGIN GROUPBOX "Header and Footer",IDC_HEADERFPPTER_GR_STATIC,150,7,296,172,BS_CENTER END -/* -IDD_PREFERENCE_PRINT2_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN -END -*/ - IDD_PREFERENCE_BACKUP_BOX DIALOGEX 0, 0, 455, 185 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Backup",IDC_BACKUPDIR_GRP_STATIC,79,11,289,86,BS_CENTER - CONTROL "None",IDC_RADIO_BKNONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,104,24,87,10 - CONTROL "Simple backup",IDC_RADIO_BKSIMPLE,"Button",BS_AUTORADIOBUTTON,228,24,111,10 - CONTROL "Verbose backup",IDC_RADIO_BKVERBOSE,"Button",BS_AUTORADIOBUTTON,228,38,111,10 - GROUPBOX "Custom Backup Directory",IDC_BACKUPDIR_USERCUSTOMDIR_GRPSTATIC,95,50,260,40 - CONTROL "",IDC_BACKUPDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,50,8,10 - RTEXT "Directory :",IDD_BACKUPDIR_STATIC,99,67,40,8 - EDITTEXT IDC_BACKUPDIR_EDIT,146,65,179,14,ES_AUTOHSCROLL - PUSHBUTTON "...",IDD_BACKUPDIR_BROWSE_BUTTON,332,65,16,14 - GROUPBOX "Auto-Completion",IDD_AUTOC_GRPSTATIC,79,103,289,73,BS_CENTER - CONTROL "Enable auto-completion on each input",IDD_AUTOC_ENABLECHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,114,150,10 - CONTROL "Function completion",IDD_AUTOC_FUNCRADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,111,128,145,10 - CONTROL "Word completion",IDD_AUTOC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,111,144,145,10 - RTEXT "From",IDD_AUTOC_STATIC_FROM,241,114,47,8 - CTEXT "1",IDD_AUTOC_STATIC_N,292,114,8,8,SS_CENTER | WS_TABSTOP - LTEXT "th character",IDD_AUTOC_STATIC_CHAR,306,114,57,8 - LTEXT "Valid value : 1 - 9",IDD_AUTOC_STATIC_NOTE,271,124,93,8 - CONTROL "Function parameters hint on input",IDD_FUNC_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,156,160,10 + GROUPBOX "Backup",IDC_BACKUPDIR_GRP_STATIC,79,19,289,128,BS_CENTER + CONTROL "None",IDC_RADIO_BKNONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,104,32,87,10 + CONTROL "Simple backup",IDC_RADIO_BKSIMPLE,"Button",BS_AUTORADIOBUTTON,104,46,111,10 + CONTROL "Verbose backup",IDC_RADIO_BKVERBOSE,"Button",BS_AUTORADIOBUTTON,104,60,111,10 + GROUPBOX "Custom Backup Directory",IDC_BACKUPDIR_USERCUSTOMDIR_GRPSTATIC,95,87,260,40 + CONTROL "",IDC_BACKUPDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,87,8,10 + RTEXT "Directory :",IDD_BACKUPDIR_STATIC,99,98,40,8 + EDITTEXT IDC_BACKUPDIR_EDIT,146,102,179,14,ES_AUTOHSCROLL + PUSHBUTTON "...",IDD_BACKUPDIR_BROWSE_BUTTON,332,102,16,14 +END + +IDD_PREFERENCE_AUTOCOMPLETION_BOX DIALOGEX 0, 0, 455, 185 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Auto-Completion",IDD_AUTOC_GRPSTATIC,86,40,289,92,BS_CENTER + CONTROL "Enable auto-completion on each input",IDD_AUTOC_ENABLECHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,51,150,10 + CONTROL "Function completion",IDD_AUTOC_FUNCRADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,118,65,145,10 + CONTROL "Word completion",IDD_AUTOC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,118,81,145,10 + RTEXT "From",IDD_AUTOC_STATIC_FROM,248,51,47,8 + CTEXT "1",IDD_AUTOC_STATIC_N,299,51,8,8,WS_TABSTOP + LTEXT "th character",IDD_AUTOC_STATIC_CHAR,313,51,57,8 + LTEXT "Valid value : 1 - 9",IDD_AUTOC_STATIC_NOTE,278,61,93,8 + CONTROL "Function parameters hint on input",IDD_FUNC_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,103,160,10 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 7791e6d2..7080053c 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -96,8 +96,8 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa { case WM_INITDIALOG : { - _ctrlTab.init(_hInst, _hSelf, false, true, true); - _ctrlTab.setFont(TEXT("Tahoma"), 13); + //_ctrlTab.init(_hInst, _hSelf, false, true, true); + //_ctrlTab.setFont(TEXT("Tahoma"), 13); _barsDlg.init(_hInst, _hSelf); _barsDlg.create(IDD_PREFERENCE_BAR_BOX, false, false); @@ -112,6 +112,12 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa _defaultNewDocDlg.init(_hInst, _hSelf); _defaultNewDocDlg.create(IDD_PREFERENCE_NEWDOCSETTING_BOX, false, false); + _defaultDirectoryDlg.init(_hInst, _hSelf); + _defaultDirectoryDlg.create(IDD_PREFERENCE_DEFAULTDIRECTORY_BOX, false, false); + + _recentFilesHistoryDlg.init(_hInst, _hSelf); + _recentFilesHistoryDlg.create(IDD_PREFERENCE_RECENTFILESHISTORY_BOX, false, false); + _fileAssocDlg.init(_hInst, _hSelf); _fileAssocDlg.create(IDD_REGEXT_BOX, false, false); @@ -121,32 +127,49 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa _langMenuDlg.init(_hInst, _hSelf); _langMenuDlg.create(IDD_PREFERENCE_LANG_BOX, false, false); + _tabSettings.init(_hInst, _hSelf); + _tabSettings.create(IDD_PREFERENCE_TABSETTINGS_BOX, false, false); + _backupDlg.init(_hInst, _hSelf); _backupDlg.create(IDD_PREFERENCE_BACKUP_BOX, false, false); + _autoCompletionDlg.init(_hInst, _hSelf); + _autoCompletionDlg.create(IDD_PREFERENCE_AUTOCOMPLETION_BOX, false, false); + _wVector.push_back(DlgInfo(&_barsDlg, TEXT("General"), TEXT("Global"))); _wVector.push_back(DlgInfo(&_marginsDlg, TEXT("Editing"), TEXT("Scintillas"))); - _wVector.push_back(DlgInfo(&_defaultNewDocDlg, TEXT("New Document/Default Directory"), TEXT("NewDoc"))); + _wVector.push_back(DlgInfo(&_defaultNewDocDlg, TEXT("New Document"), TEXT("NewDoc"))); + _wVector.push_back(DlgInfo(&_defaultDirectoryDlg, TEXT("Default Directory"), TEXT("DefaultDir"))); + _wVector.push_back(DlgInfo(&_recentFilesHistoryDlg, TEXT("Recent Files History"), TEXT("NewDoc"))); _wVector.push_back(DlgInfo(&_fileAssocDlg, TEXT("File Association"), TEXT("FileAssoc"))); - _wVector.push_back(DlgInfo(&_langMenuDlg, TEXT("Language Menu/Tab Settings"), TEXT("LangMenu"))); + _wVector.push_back(DlgInfo(&_langMenuDlg, TEXT("Language Menu"), TEXT("LangMenu"))); + _wVector.push_back(DlgInfo(&_tabSettings, TEXT("Tab Settings"), TEXT("TabSettings"))); _wVector.push_back(DlgInfo(&_printSettingsDlg, TEXT("Print"), TEXT("Print"))); - _wVector.push_back(DlgInfo(&_backupDlg, TEXT("Backup/Auto-Completion"), TEXT("Backup"))); + _wVector.push_back(DlgInfo(&_backupDlg, TEXT("Backup"), TEXT("Backup"))); + _wVector.push_back(DlgInfo(&_autoCompletionDlg, TEXT("Auto-Completion"), TEXT("AutoCompletion"))); _wVector.push_back(DlgInfo(&_settingsDlg, TEXT("MISC."), TEXT("MISC"))); - _ctrlTab.createTabs(_wVector); - _ctrlTab.display(); + //_ctrlTab.createTabs(_wVector); + //_ctrlTab.display(); + makeCategoryList(); RECT rc; getClientRect(rc); - _ctrlTab.reSizeTo(rc); - rc.bottom -= 30; + //_ctrlTab.reSizeTo(rc); + rc.top += 10; + rc.bottom -= 50; + rc.left += 150; _barsDlg.reSizeTo(rc); _marginsDlg.reSizeTo(rc); _settingsDlg.reSizeTo(rc); _defaultNewDocDlg.reSizeTo(rc); + _defaultDirectoryDlg.reSizeTo(rc); + _recentFilesHistoryDlg.reSizeTo(rc); _fileAssocDlg.reSizeTo(rc); _langMenuDlg.reSizeTo(rc); + _tabSettings.reSizeTo(rc); _printSettingsDlg.reSizeTo(rc); _backupDlg.reSizeTo(rc); + _autoCompletionDlg.reSizeTo(rc); NppParameters *pNppParam = NppParameters::getInstance(); ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); @@ -154,7 +177,7 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa enableDlgTheme(_hSelf, ETDT_ENABLETAB); return TRUE; } - +/* case WM_NOTIFY : { NMHDR *nmhdr = (NMHDR *)lParam; @@ -168,25 +191,93 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa } break; } - +*/ case WM_COMMAND : { - switch (wParam) + if (LOWORD(wParam) == IDC_LIST_DLGTITLE) { - case IDC_BUTTON_CLOSE : - case IDCANCEL : - display(false); - return TRUE; - - default : - ::SendMessage(_hParent, WM_COMMAND, wParam, lParam); - return TRUE; + if (HIWORD(wParam) == CBN_SELCHANGE) + { + int i = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETCURSEL, 0, 0); + if (i != LB_ERR) + { + //printInt(i); + showDialogByIndex(i); + } + } + } + else + { + switch (wParam) + { + case IDC_BUTTON_CLOSE : + case IDCANCEL : + display(false); + return TRUE; + + default : + ::SendMessage(_hParent, WM_COMMAND, wParam, lParam); + return TRUE; + } } } } return FALSE; } +void PreferenceDlg::makeCategoryList() +{ + for (size_t i = 0, len = _wVector.size(); i < len; i++) + { + ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_ADDSTRING, 0, (LPARAM)_wVector[i]._name.c_str()); + } + + ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_SETSEL, (WPARAM)TRUE, 0); +} + +bool PreferenceDlg::renameDialogTitle(const TCHAR *internalName, const TCHAR *newName) +{ + bool foundIt = false; + size_t i = 0; + for (size_t len = _wVector.size(); i < len; i++) + { + if (_wVector[i]._internalName == internalName) + { + foundIt = true; + break; + } + } + if (!foundIt) + return false; + + const size_t lenMax = 256; + TCHAR oldName[lenMax]; + size_t txtLen = ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXTLEN, i, 0); + if (txtLen >= lenMax) + return false; + + ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_GETTEXT, i, (LPARAM)oldName); + + // Same name, no need to change, but operation is considered success + if (lstrcmp(newName, oldName) == 0) + return true; + + ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_DELETESTRING, i, 0); + ::SendDlgItemMessage(_hSelf, IDC_LIST_DLGTITLE, LB_INSERTSTRING, i, (LPARAM)newName); + + return true; +} + +void PreferenceDlg::showDialogByIndex(int index) +{ + size_t len = _wVector.size(); + for (size_t i = 0; i < len; i++) + { + _wVector[i]._dlg->display(false); + } + _wVector[index]._dlg->display(true); +} + BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { NppParameters *pNppParam = NppParameters::getInstance(); @@ -944,7 +1035,7 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) } -void DefaultNewDocDlg::setCustomLen(int val) +void RecentFilesHistoryDlg::setCustomLen(int val) { ::EnableWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), val > 0); ::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, val, FALSE); @@ -1047,65 +1138,6 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) } } ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETCURSEL, index, 0); - - bool shouldActivated; - switch (nppGUI._openSaveDir) - { - case dir_last : - ID2Check = IDC_OPENSAVEDIR_REMEMBERLAST_RADIO; - shouldActivated = false; - break; - case dir_userDef : - ID2Check = IDC_OPENSAVEDIR_ALWAYSON_RADIO; - shouldActivated = true; - break; - - default : - ID2Check = IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO; - shouldActivated = false; - } - ::SendDlgItemMessage(_hSelf, ID2Check, BM_SETCHECK, BST_CHECKED, 0); - ::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._defaultDir); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), shouldActivated); - ::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), shouldActivated); - - // - // Recent File History - // - - // Max number recent file setting - ::SetDlgItemInt(_hSelf, IDC_MAXNBFILEVAL_STATIC, pNppParam->getNbMaxRecentFile(), FALSE); - _nbHistoryVal.init(_hInst, _hSelf); - _nbHistoryVal.create(::GetDlgItem(_hSelf, IDC_MAXNBFILEVAL_STATIC), IDC_MAXNBFILEVAL_STATIC); - - // Check on launch time settings - ::SendDlgItemMessage(_hSelf, IDC_CHECK_DONTCHECKHISTORY, BM_SETCHECK, !nppGUI._checkHistoryFiles, 0); - - // Disply in submenu setting - ::SendDlgItemMessage(_hSelf, IDC_CHECK_INSUBMENU, BM_SETCHECK, pNppParam->putRecentFileInSubMenu(), 0); - - // Recent File menu entry length setting - int customLength = pNppParam->getRecentFileCustomLength(); - int id = IDC_RADIO_CUSTOMIZELENTH; - int length = customLength; - - if (customLength == RECENTFILES_SHOWONLYFILENAME) - { - id = IDC_RADIO_ONLYFILENAME; - length = 0; - } - else if (customLength == RECENTFILES_SHOWFULLPATH || customLength < 0) - { - id = IDC_RADIO_FULLFILENAMEPATH; - length = 0; - } - ::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, BST_CHECKED, 0); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), id == IDC_RADIO_CUSTOMIZELENTH); - ::ShowWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), id == IDC_RADIO_CUSTOMIZELENTH?SW_SHOW:SW_HIDE); - - ::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, length, FALSE); - _customLenVal.init(_hInst, _hSelf); - _customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), NULL); // // To avoid the white control background to be displayed in dialog @@ -1116,23 +1148,6 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) } case WM_COMMAND : - { - if (HIWORD(wParam) == EN_CHANGE) - { - switch (LOWORD(wParam)) - { - case IDC_OPENSAVEDIR_ALWAYSON_EDIT: - { - TCHAR inputDir[MAX_PATH]; - ::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT, WM_GETTEXT, MAX_PATH, (LPARAM)inputDir); - lstrcpy(nppGUI._defaultDir, inputDir); - ::ExpandEnvironmentStrings(nppGUI._defaultDir, nppGUI._defaultDirExp, 500); - pNppParam->setWorkingDir(nppGUI._defaultDirExp); - return TRUE; - } - } - } - switch (wParam) { case IDC_RADIO_UCS2BIG: @@ -1193,9 +1208,88 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ndds._format = WIN_FORMAT; return TRUE; - - - + default: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + if (LOWORD(wParam) == IDC_COMBO_DEFAULTLANG) + { + int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETCURSEL, 0, 0); + ndds._lang = _langList[index]._id; + return TRUE; + } + else if (LOWORD(wParam) == IDC_COMBO_OTHERCP) + { + int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_GETCURSEL, 0, 0); + int cp = ::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_GETITEMDATA, index, 0); + ndds._codepage = cp; + return TRUE; + } + } + return FALSE; + } + } + return FALSE; +} + +BOOL CALLBACK DefaultDirectoryDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) +{ + NppParameters *pNppParam = NppParameters::getInstance(); + NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI(); + + switch (Message) + { + case WM_INITDIALOG : + { + int ID2Check = 0; + bool shouldActivated; + switch (nppGUI._openSaveDir) + { + case dir_last : + ID2Check = IDC_OPENSAVEDIR_REMEMBERLAST_RADIO; + shouldActivated = false; + break; + case dir_userDef : + ID2Check = IDC_OPENSAVEDIR_ALWAYSON_RADIO; + shouldActivated = true; + break; + + default : + ID2Check = IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO; + shouldActivated = false; + } + ::SendDlgItemMessage(_hSelf, ID2Check, BM_SETCHECK, BST_CHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._defaultDir); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), shouldActivated); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON), shouldActivated); + + // + // To avoid the white control background to be displayed in dialog + // + ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); + if (enableDlgTheme) + enableDlgTheme(_hSelf, ETDT_ENABLETAB); + } + + case WM_COMMAND : + { + if (HIWORD(wParam) == EN_CHANGE) + { + switch (LOWORD(wParam)) + { + case IDC_OPENSAVEDIR_ALWAYSON_EDIT: + { + TCHAR inputDir[MAX_PATH]; + ::SendDlgItemMessage(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT, WM_GETTEXT, MAX_PATH, (LPARAM)inputDir); + lstrcpy(nppGUI._defaultDir, inputDir); + ::ExpandEnvironmentStrings(nppGUI._defaultDir, nppGUI._defaultDirExp, 500); + pNppParam->setWorkingDir(nppGUI._defaultDirExp); + return TRUE; + } + } + } + + switch (wParam) + { case IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO: nppGUI._openSaveDir = dir_followCurrent; ::EnableWindow(::GetDlgItem(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT), false); @@ -1216,10 +1310,69 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) folderBrowser(_hSelf, IDC_OPENSAVEDIR_ALWAYSON_EDIT); return TRUE; + default: + return FALSE; + } + } + } + return FALSE; +} - // - // Recent File History - // +BOOL CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) +{ + NppParameters *pNppParam = NppParameters::getInstance(); + NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI(); + + switch (Message) + { + case WM_INITDIALOG : + { + // Max number recent file setting + ::SetDlgItemInt(_hSelf, IDC_MAXNBFILEVAL_STATIC, pNppParam->getNbMaxRecentFile(), FALSE); + _nbHistoryVal.init(_hInst, _hSelf); + _nbHistoryVal.create(::GetDlgItem(_hSelf, IDC_MAXNBFILEVAL_STATIC), IDC_MAXNBFILEVAL_STATIC); + + // Check on launch time settings + ::SendDlgItemMessage(_hSelf, IDC_CHECK_DONTCHECKHISTORY, BM_SETCHECK, !nppGUI._checkHistoryFiles, 0); + + // Disply in submenu setting + ::SendDlgItemMessage(_hSelf, IDC_CHECK_INSUBMENU, BM_SETCHECK, pNppParam->putRecentFileInSubMenu(), 0); + + // Recent File menu entry length setting + int customLength = pNppParam->getRecentFileCustomLength(); + int id = IDC_RADIO_CUSTOMIZELENTH; + int length = customLength; + + if (customLength == RECENTFILES_SHOWONLYFILENAME) + { + id = IDC_RADIO_ONLYFILENAME; + length = 0; + } + else if (customLength == RECENTFILES_SHOWFULLPATH || customLength < 0) + { + id = IDC_RADIO_FULLFILENAMEPATH; + length = 0; + } + ::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, BST_CHECKED, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), id == IDC_RADIO_CUSTOMIZELENTH); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), id == IDC_RADIO_CUSTOMIZELENTH?SW_SHOW:SW_HIDE); + + ::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, length, FALSE); + _customLenVal.init(_hInst, _hSelf); + _customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), NULL); + + // + // To avoid the white control background to be displayed in dialog + // + ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); + if (enableDlgTheme) + enableDlgTheme(_hSelf, ETDT_ENABLETAB); + } + + case WM_COMMAND : + { + switch (wParam) + { case IDC_CHECK_DONTCHECKHISTORY: nppGUI._checkHistoryFiles = !isCheckedOrNot(IDC_CHECK_DONTCHECKHISTORY); return TRUE; @@ -1292,25 +1445,7 @@ BOOL CALLBACK DefaultNewDocDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) } return TRUE; } - - default: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - if (LOWORD(wParam) == IDC_COMBO_DEFAULTLANG) - { - int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETCURSEL, 0, 0); - ndds._lang = _langList[index]._id; - return TRUE; - } - else if (LOWORD(wParam) == IDC_COMBO_OTHERCP) - { - int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_GETCURSEL, 0, 0); - int cp = ::SendDlgItemMessage(_hSelf, IDC_COMBO_OTHERCP, CB_GETITEMDATA, index, 0); - ndds._codepage = cp; - return TRUE; - } - } return FALSE; } } @@ -1327,25 +1462,27 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara { case WM_INITDIALOG : { + /* ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, nppGUI._tabSize, FALSE); _tabSizeVal.init(_hInst, _hSelf); _tabSizeVal.create(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), IDC_TABSIZEVAL_STATIC); ::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEBYSPACE, BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); - + */ int nbLang = pNppParam->getNbLang(); - ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)TEXT("[Default]")); + //::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)TEXT("[Default]")); for (int i = 0 ; i < nbLang ; i++) { ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)pNppParam->getLangFromIndex(i)->_langName.c_str()); } + /* const int index2Begin = 0; ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_SETCURSEL, 0, index2Begin); ::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), SW_HIDE); ::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), SW_HIDE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), FALSE); ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); - + */ for (int i = L_TEXT ; i < pNppParam->L_END ; i++) { generic_string str; @@ -1382,6 +1519,317 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara case WM_COMMAND : { if (HIWORD(wParam) == LBN_SELCHANGE) + { + /* + if (LOWORD(wParam) == IDC_LIST_TABSETTNG) + { + int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) + return FALSE; + ::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), index?SW_SHOW:SW_HIDE); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), index?SW_SHOW:SW_HIDE); + + if (index) + { + Lang *lang = pNppParam->getLangFromIndex(index - 1); + if (!lang) return FALSE; + bool useDefaultTab = (lang->_tabSize == -1 || lang->_tabSize == 0); + + ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), BM_SETCHECK, useDefaultTab, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), !useDefaultTab); + + int size = useDefaultTab?nppGUI._tabSize:lang->_tabSize; + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, size, FALSE); + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC, size, FALSE); + + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), useDefaultTab); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); + ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, useDefaultTab?nppGUI._tabReplacedBySpace:lang->_isTabReplacedBySpace, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), !useDefaultTab); + + if (!useDefaultTab) + { + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, lang->_tabSize, FALSE); + ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, lang->_isTabReplacedBySpace, 0); + } + } + else + { + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), TRUE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), TRUE); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), SW_SHOW); + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, nppGUI._tabSize, FALSE); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), TRUE); + ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); + } + + return TRUE; + } + */ + if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) + { + HWND hEnableList = ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG); + HWND hDisableList = ::GetDlgItem(_hSelf, IDC_LIST_DISABLEDLANG); + if (HIWORD(wParam) == LBN_DBLCLK) + { + if (HWND(lParam) == hEnableList) + ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0); + else if (HWND(lParam) == hDisableList) + ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0); + return TRUE; + } + int idButton2Enable; + int idButton2Disable; + + if (LOWORD(wParam) == IDC_LIST_ENABLEDLANG) + { + idButton2Enable = IDC_BUTTON_REMOVE; + idButton2Disable = IDC_BUTTON_RESTORE; + } + else //IDC_LIST_DISABLEDLANG + { + idButton2Enable = IDC_BUTTON_RESTORE; + idButton2Disable = IDC_BUTTON_REMOVE; + } + + int i = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0); + if (i != LB_ERR) + { + ::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE); + int idListbox2Disable = (LOWORD(wParam)== IDC_LIST_ENABLEDLANG)?IDC_LIST_DISABLEDLANG:IDC_LIST_ENABLEDLANG; + ::SendDlgItemMessage(_hSelf, idListbox2Disable, LB_SETCURSEL, (WPARAM)-1, 0); + ::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE); + } + return TRUE; + + } + } + + switch (wParam) + { + /* + case IDC_TABSIZEVAL_STATIC: + { + ValueDlg tabSizeDlg; + tabSizeDlg.init(_hInst, _hParent, nppGUI._tabSize, TEXT("Tab Size : ")); + POINT p; + ::GetCursorPos(&p); + int size = tabSizeDlg.doDialog(p); + if (size == -1) return FALSE; + + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, size, FALSE); + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC, size, FALSE); + + int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) return FALSE; + + if (index != 0) + { + Lang *lang = pNppParam->getLangFromIndex(index - 1); + if (!lang) return FALSE; + lang->_tabSize = size; + + // write in langs.xml + pNppParam->insertTabInfo(lang->getLangName(), lang->getTabInfo()); + } + else + { + nppGUI._tabSize = size; + } + + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETTING_TAB_SIZE, 0, 0); + return TRUE; + } + + case IDC_CHECK_REPLACEBYSPACE: + { + bool isTabReplacedBySpace = BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_GETCHECK, 0, 0); + int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) return FALSE; + if (index != 0) + { + Lang *lang = pNppParam->getLangFromIndex(index - 1); + if (!lang) return FALSE; + if (!lang->_tabSize || lang->_tabSize == -1) + lang->_tabSize = nppGUI._tabSize; + lang->_isTabReplacedBySpace = isTabReplacedBySpace; + + // write in langs.xml + pNppParam->insertTabInfo(lang->getLangName(), lang->getTabInfo()); + } + else + { + nppGUI._tabReplacedBySpace = isTabReplacedBySpace; + } + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETTING_TAB_REPLCESPACE, 0, 0); + return TRUE; + } + + case IDC_CHECK_DEFAULTTABVALUE: + { + bool useDefaultTab = BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), BM_GETCHECK, 0, 0); + int index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); + if (index == LB_ERR || index == 0) // index == 0 shouldn't happen + return FALSE; + + Lang *lang = pNppParam->getLangFromIndex(index - 1); + if (!lang) + return FALSE; + + //- Set tab setting in choosed language + lang->_tabSize = useDefaultTab?0:nppGUI._tabSize; + lang->_isTabReplacedBySpace = useDefaultTab?false:nppGUI._tabReplacedBySpace; + + //- set visual effect + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), !useDefaultTab); + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, useDefaultTab?nppGUI._tabSize:lang->_tabSize, FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), useDefaultTab); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); + ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, useDefaultTab?nppGUI._tabReplacedBySpace:lang->_isTabReplacedBySpace, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), !useDefaultTab); + + // write in langs.xml + if (useDefaultTab) + pNppParam->insertTabInfo(lang->getLangName(), -1); + + return TRUE; + } + */ + case IDC_CHECK_LANGMENUCOMPACT : + { + nppGUI._isLangMenuCompact = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_LANGMENUCOMPACT), BM_GETCHECK, 0, 0)); + ::MessageBox(_hSelf, + nppGUI._isLangMenuCompact?TEXT("This option will be enabled on the next launch."):TEXT("This option will be disabled on the next launch."), + TEXT("Compact Language Menu"), MB_OK); + return TRUE; + } + + case IDC_BUTTON_RESTORE : + case IDC_BUTTON_REMOVE : + { + int list2Remove, list2Add, idButton2Enable, idButton2Disable; + vector *pSrcLst, *pDestLst; + + if (LOWORD(wParam)==IDC_BUTTON_REMOVE) + { + list2Remove = IDC_LIST_ENABLEDLANG; + list2Add = IDC_LIST_DISABLEDLANG; + idButton2Enable = IDC_BUTTON_RESTORE; + idButton2Disable = IDC_BUTTON_REMOVE; + pSrcLst = &_langList; + pDestLst = &nppGUI._excludedLangList; + } + else + { + list2Remove = IDC_LIST_DISABLEDLANG; + list2Add = IDC_LIST_ENABLEDLANG; + idButton2Enable = IDC_BUTTON_REMOVE; + idButton2Disable = IDC_BUTTON_RESTORE; + pSrcLst = &nppGUI._excludedLangList; + pDestLst = &_langList; + } + size_t iRemove = ::SendDlgItemMessage(_hSelf, list2Remove, LB_GETCURSEL, 0, 0); + if (iRemove == -1) + return TRUE; + + TCHAR s[32]; + ::SendDlgItemMessage(_hSelf, list2Remove, LB_GETTEXT, iRemove, (LPARAM)s); + + LangMenuItem lmi = pSrcLst->at(iRemove); + vector::iterator lang2Remove = pSrcLst->begin() + iRemove; + pSrcLst->erase(lang2Remove); + + int iAdd = ::SendDlgItemMessage(_hSelf, list2Add, LB_ADDSTRING, 0, (LPARAM)s); + ::SendDlgItemMessage(_hSelf, list2Remove, LB_DELETESTRING, iRemove, 0); + pDestLst->push_back(lmi); + + ::SendDlgItemMessage(_hSelf, list2Add, LB_SETCURSEL, iAdd, 0); + ::SendDlgItemMessage(_hSelf, list2Remove, LB_SETCURSEL, (WPARAM)-1, 0); + ::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE); + ::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE); + + if ((lmi._langType >= L_EXTERNAL) && (lmi._langType < pNppParam->L_END)) + { + bool found(false); + for(size_t x = 0; x < pNppParam->getExternalLexerDoc()->size() && !found; x++) + { + TiXmlNode *lexersRoot = pNppParam->getExternalLexerDoc()->at(x)->FirstChild(TEXT("NotepadPlus"))->FirstChildElement(TEXT("LexerStyles")); + for (TiXmlNode *childNode = lexersRoot->FirstChildElement(TEXT("LexerType")); + childNode ; + childNode = childNode->NextSibling(TEXT("LexerType"))) + { + TiXmlElement *element = childNode->ToElement(); + + if (generic_string(element->Attribute(TEXT("name"))) == lmi._langName) + { + element->SetAttribute(TEXT("excluded"), (LOWORD(wParam)==IDC_BUTTON_REMOVE)?TEXT("yes"):TEXT("no")); + pNppParam->getExternalLexerDoc()->at(x)->SaveFile(); + found = true; + break; + } + } + } + } + + HWND grandParent = ::GetParent(_hParent); + + if (LOWORD(wParam)==IDC_BUTTON_REMOVE) + { + ::DeleteMenu((HMENU)::SendMessage(grandParent, NPPM_INTERNAL_GETMENU, 0, 0), lmi._cmdID, MF_BYCOMMAND); + } + else + { + ::InsertMenu(::GetSubMenu((HMENU)::SendMessage(grandParent, NPPM_INTERNAL_GETMENU, 0, 0), MENUINDEX_LANGUAGE), iAdd-1, MF_BYPOSITION, lmi._cmdID, lmi._langName.c_str()); + } + ::DrawMenuBar(grandParent); + return TRUE; + } + } + } + } + return FALSE; +} + +BOOL CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/* lParam*/) +{ + NppParameters *pNppParam = NppParameters::getInstance(); + NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI(); + + switch (Message) + { + case WM_INITDIALOG : + { + ::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, nppGUI._tabSize, FALSE); + + _tabSizeVal.init(_hInst, _hSelf); + _tabSizeVal.create(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), IDC_TABSIZEVAL_STATIC); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEBYSPACE, BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); + + int nbLang = pNppParam->getNbLang(); + ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)TEXT("[Default]")); + for (int i = 0 ; i < nbLang ; i++) + { + ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, (LPARAM)pNppParam->getLangFromIndex(i)->_langName.c_str()); + } + const int index2Begin = 0; + ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_SETCURSEL, 0, index2Begin); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), SW_HIDE); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), SW_HIDE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), FALSE); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); + + ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture(); + if (enableDlgTheme) + enableDlgTheme(_hSelf, ETDT_ENABLETAB); + + return TRUE; + } + case WM_COMMAND : + { + if (HIWORD(wParam) == LBN_SELCHANGE) { if (LOWORD(wParam) == IDC_LIST_TABSETTNG) { @@ -1429,43 +1877,6 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara return TRUE; } - else if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) - { - HWND hEnableList = ::GetDlgItem(_hSelf, IDC_LIST_ENABLEDLANG); - HWND hDisableList = ::GetDlgItem(_hSelf, IDC_LIST_DISABLEDLANG); - if (HIWORD(wParam) == LBN_DBLCLK) - { - if (HWND(lParam) == hEnableList) - ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_REMOVE, 0); - else if (HWND(lParam) == hDisableList) - ::SendMessage(_hSelf, WM_COMMAND, IDC_BUTTON_RESTORE, 0); - return TRUE; - } - int idButton2Enable; - int idButton2Disable; - - if (LOWORD(wParam) == IDC_LIST_ENABLEDLANG) - { - idButton2Enable = IDC_BUTTON_REMOVE; - idButton2Disable = IDC_BUTTON_RESTORE; - } - else //IDC_LIST_DISABLEDLANG - { - idButton2Enable = IDC_BUTTON_RESTORE; - idButton2Disable = IDC_BUTTON_REMOVE; - } - - int i = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0); - if (i != LB_ERR) - { - ::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE); - int idListbox2Disable = (LOWORD(wParam)== IDC_LIST_ENABLEDLANG)?IDC_LIST_DISABLEDLANG:IDC_LIST_ENABLEDLANG; - ::SendDlgItemMessage(_hSelf, idListbox2Disable, LB_SETCURSEL, (WPARAM)-1, 0); - ::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE); - } - return TRUE; - - } } switch (wParam) @@ -1557,96 +1968,6 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara return TRUE; } - - case IDC_CHECK_LANGMENUCOMPACT : - { - nppGUI._isLangMenuCompact = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_LANGMENUCOMPACT), BM_GETCHECK, 0, 0)); - ::MessageBox(_hSelf, - nppGUI._isLangMenuCompact?TEXT("This option will be enabled on the next launch."):TEXT("This option will be disabled on the next launch."), - TEXT("Compact Language Menu"), MB_OK); - return TRUE; - } - - case IDC_BUTTON_RESTORE : - case IDC_BUTTON_REMOVE : - { - int list2Remove, list2Add, idButton2Enable, idButton2Disable; - vector *pSrcLst, *pDestLst; - - if (LOWORD(wParam)==IDC_BUTTON_REMOVE) - { - list2Remove = IDC_LIST_ENABLEDLANG; - list2Add = IDC_LIST_DISABLEDLANG; - idButton2Enable = IDC_BUTTON_RESTORE; - idButton2Disable = IDC_BUTTON_REMOVE; - pSrcLst = &_langList; - pDestLst = &nppGUI._excludedLangList; - } - else - { - list2Remove = IDC_LIST_DISABLEDLANG; - list2Add = IDC_LIST_ENABLEDLANG; - idButton2Enable = IDC_BUTTON_REMOVE; - idButton2Disable = IDC_BUTTON_RESTORE; - pSrcLst = &nppGUI._excludedLangList; - pDestLst = &_langList; - } - size_t iRemove = ::SendDlgItemMessage(_hSelf, list2Remove, LB_GETCURSEL, 0, 0); - if (iRemove == -1) - return TRUE; - - TCHAR s[32]; - ::SendDlgItemMessage(_hSelf, list2Remove, LB_GETTEXT, iRemove, (LPARAM)s); - - LangMenuItem lmi = pSrcLst->at(iRemove); - vector::iterator lang2Remove = pSrcLst->begin() + iRemove; - pSrcLst->erase(lang2Remove); - - int iAdd = ::SendDlgItemMessage(_hSelf, list2Add, LB_ADDSTRING, 0, (LPARAM)s); - ::SendDlgItemMessage(_hSelf, list2Remove, LB_DELETESTRING, iRemove, 0); - pDestLst->push_back(lmi); - - ::SendDlgItemMessage(_hSelf, list2Add, LB_SETCURSEL, iAdd, 0); - ::SendDlgItemMessage(_hSelf, list2Remove, LB_SETCURSEL, (WPARAM)-1, 0); - ::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE); - ::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE); - - if ((lmi._langType >= L_EXTERNAL) && (lmi._langType < pNppParam->L_END)) - { - bool found(false); - for(size_t x = 0; x < pNppParam->getExternalLexerDoc()->size() && !found; x++) - { - TiXmlNode *lexersRoot = pNppParam->getExternalLexerDoc()->at(x)->FirstChild(TEXT("NotepadPlus"))->FirstChildElement(TEXT("LexerStyles")); - for (TiXmlNode *childNode = lexersRoot->FirstChildElement(TEXT("LexerType")); - childNode ; - childNode = childNode->NextSibling(TEXT("LexerType"))) - { - TiXmlElement *element = childNode->ToElement(); - - if (generic_string(element->Attribute(TEXT("name"))) == lmi._langName) - { - element->SetAttribute(TEXT("excluded"), (LOWORD(wParam)==IDC_BUTTON_REMOVE)?TEXT("yes"):TEXT("no")); - pNppParam->getExternalLexerDoc()->at(x)->SaveFile(); - found = true; - break; - } - } - } - } - - HWND grandParent = ::GetParent(_hParent); - - if (LOWORD(wParam)==IDC_BUTTON_REMOVE) - { - ::DeleteMenu((HMENU)::SendMessage(grandParent, NPPM_INTERNAL_GETMENU, 0, 0), lmi._cmdID, MF_BYCOMMAND); - } - else - { - ::InsertMenu(::GetSubMenu((HMENU)::SendMessage(grandParent, NPPM_INTERNAL_GETMENU, 0, 0), MENUINDEX_LANGUAGE), iAdd-1, MF_BYPOSITION, lmi._cmdID, lmi._langName.c_str()); - } - ::DrawMenuBar(grandParent); - return TRUE; - } } } } @@ -1978,10 +2299,11 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { case WM_INITDIALOG : { + /* ::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, nppGUI._autocFromLen, FALSE); _nbCharVal.init(_hInst, _hSelf); _nbCharVal.create(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), IDD_AUTOC_STATIC_N); - + */ int ID2Check = 0; switch (nppGUI._backup) @@ -2002,7 +2324,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_CHECK, BM_SETCHECK, BST_CHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_SETTEXT, 0, (LPARAM)nppGUI._backupDir.c_str()); - + /* bool isEnableAutoC = nppGUI._autocStatus != nppGUI.autoc_none; ::SendDlgItemMessage(_hSelf, IDD_AUTOC_ENABLECHECK, BM_SETCHECK, isEnableAutoC?BST_CHECKED:BST_UNCHECKED, 0); @@ -2018,6 +2340,7 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_CHAR), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_NOTE), FALSE); } + */ updateBackupGUI(); return TRUE; } @@ -2072,6 +2395,84 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) return TRUE; } + + default : + return FALSE; + } + + } + } + return FALSE; +} + +void BackupDlg::updateBackupGUI() +{ + bool noBackup = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_BKNONE, BM_GETCHECK, 0, 0); + bool isEnableGlobableCheck = false; + bool isEnableLocalCheck = false; + + if (!noBackup) + { + isEnableGlobableCheck = true; + isEnableLocalCheck = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_CHECK, BM_GETCHECK, 0, 0); + } + ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_USERCUSTOMDIR_GRPSTATIC), isEnableGlobableCheck); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_CHECK), isEnableGlobableCheck); + + ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_STATIC), isEnableLocalCheck); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_EDIT), isEnableLocalCheck); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_BROWSE_BUTTON), isEnableLocalCheck); +} + + +BOOL CALLBACK AutoCompletionDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) +{ + NppParameters *pNppParam = NppParameters::getInstance(); + NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI(); + switch (Message) + { + case WM_INITDIALOG : + { + ::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, nppGUI._autocFromLen, FALSE); + _nbCharVal.init(_hInst, _hSelf); + _nbCharVal.create(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), IDD_AUTOC_STATIC_N); + + bool isEnableAutoC = nppGUI._autocStatus != nppGUI.autoc_none; + + ::SendDlgItemMessage(_hSelf, IDD_AUTOC_ENABLECHECK, BM_SETCHECK, isEnableAutoC?BST_CHECKED:BST_UNCHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDD_AUTOC_FUNCRADIO, BM_SETCHECK, nppGUI._autocStatus == nppGUI.autoc_func?BST_CHECKED:BST_UNCHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDD_AUTOC_WORDRADIO, BM_SETCHECK, nppGUI._autocStatus == nppGUI.autoc_word?BST_CHECKED:BST_UNCHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDD_FUNC_CHECK, BM_SETCHECK, nppGUI._funcParams?BST_CHECKED:BST_UNCHECKED, 0); + if (!isEnableAutoC) + { + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_FUNCRADIO), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_WORDRADIO), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_FROM), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_CHAR), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_NOTE), FALSE); + } + return TRUE; + } + case WM_COMMAND : + { + if (HIWORD(wParam) == EN_CHANGE) + { + switch (LOWORD(wParam)) + { + case IDC_BACKUPDIR_EDIT: + { + TCHAR inputDir[MAX_PATH]; + ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_EDIT, WM_GETTEXT, MAX_PATH, (LPARAM)inputDir); + nppGUI._backupDir = inputDir; + return TRUE; + } + } + } + + switch (wParam) + { + case IDD_AUTOC_ENABLECHECK : { bool isEnableAutoC = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDD_AUTOC_ENABLECHECK, BM_GETCHECK, 0, 0); @@ -2147,23 +2548,4 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) } } return FALSE; -} - -void BackupDlg::updateBackupGUI() -{ - bool noBackup = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_BKNONE, BM_GETCHECK, 0, 0); - bool isEnableGlobableCheck = false; - bool isEnableLocalCheck = false; - - if (!noBackup) - { - isEnableGlobableCheck = true; - isEnableLocalCheck = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_CHECK, BM_GETCHECK, 0, 0); - } - ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_USERCUSTOMDIR_GRPSTATIC), isEnableGlobableCheck); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_CHECK), isEnableGlobableCheck); - - ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_STATIC), isEnableLocalCheck); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_EDIT), isEnableLocalCheck); - ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_BROWSE_BUTTON), isEnableLocalCheck); -} +} \ No newline at end of file diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index 66609a3a..92ea33ed 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -95,6 +95,54 @@ class DefaultNewDocDlg : public StaticDialog { public : DefaultNewDocDlg() {}; + /* + virtual void destroy() { + _nbHistoryVal.destroy(); + _customLenVal.destroy(); + }; + */ +private : + //URLCtrl _nbHistoryVal; + //URLCtrl _customLenVal; + std::vector _langList; + void makeOpenAnsiAsUtf8(bool doIt){ + if (!doIt) + ::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, BST_UNCHECKED, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), doIt); + }; + //void setCustomLen(int val); + BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); +}; + +class DefaultDirectoryDlg : public StaticDialog +{ +public : + DefaultDirectoryDlg() {}; + /* + virtual void destroy() { + _nbHistoryVal.destroy(); + _customLenVal.destroy(); + }; + */ +private : + //URLCtrl _nbHistoryVal; + //URLCtrl _customLenVal; + //std::vector _langList; + /* + void makeOpenAnsiAsUtf8(bool doIt){ + if (!doIt) + ::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, BST_UNCHECKED, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), doIt); + }; + */ + //void setCustomLen(int val); + BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); +}; + +class RecentFilesHistoryDlg : public StaticDialog +{ +public : + RecentFilesHistoryDlg() {}; virtual void destroy() { _nbHistoryVal.destroy(); _customLenVal.destroy(); @@ -103,11 +151,6 @@ private : URLCtrl _nbHistoryVal; URLCtrl _customLenVal; std::vector _langList; - void makeOpenAnsiAsUtf8(bool doIt){ - if (!doIt) - ::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, BST_UNCHECKED, 0); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), doIt); - }; void setCustomLen(int val); BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); }; @@ -116,17 +159,33 @@ class LangMenuDlg : public StaticDialog { public : LangMenuDlg() {}; + /* + virtual void destroy() { + _tabSizeVal.destroy(); + }; + */ + +private : + //URLCtrl _tabSizeVal; + LexerStylerArray _lsArray; + BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); + vector _langList; +}; + +class TabSettings : public StaticDialog +{ +public : + TabSettings() {}; virtual void destroy() { _tabSizeVal.destroy(); }; private : URLCtrl _tabSizeVal; - LexerStylerArray _lsArray; BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); - vector _langList; }; + struct strCouple { generic_string _varDesc; generic_string _var; @@ -150,12 +209,21 @@ class BackupDlg : public StaticDialog public : BackupDlg() {}; private : - URLCtrl _nbCharVal; + //URLCtrl _nbCharVal; void updateBackupGUI(); BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); }; +class AutoCompletionDlg : public StaticDialog +{ +public : + AutoCompletionDlg() {}; +private : + URLCtrl _nbCharVal; + //void updateAutoCompletionGUI(); + BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); +}; class PreferenceDlg : public StaticDialog @@ -177,9 +245,10 @@ public : } display(); }; + bool renameDialogTitle(const TCHAR *internalName, const TCHAR *newName); virtual void destroy() { - _ctrlTab.destroy(); + //_ctrlTab.destroy(); _barsDlg.destroy(); _marginsDlg.destroy(); _settingsDlg.destroy(); @@ -190,16 +259,22 @@ public : }; private : BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); - ControlsTab _ctrlTab; + void makeCategoryList(); + void showDialogByIndex(int index); + //ControlsTab _ctrlTab; WindowVector _wVector; BarsDlg _barsDlg; MarginsDlg _marginsDlg; SettingsDlg _settingsDlg; RegExtDlg _fileAssocDlg; LangMenuDlg _langMenuDlg; + TabSettings _tabSettings; PrintSettingsDlg _printSettingsDlg; DefaultNewDocDlg _defaultNewDocDlg; + DefaultDirectoryDlg _defaultDirectoryDlg; + RecentFilesHistoryDlg _recentFilesHistoryDlg; BackupDlg _backupDlg; + AutoCompletionDlg _autoCompletionDlg; }; diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index 6a16f2d9..fcde5cf8 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -30,6 +30,7 @@ #define IDD_PREFERENCE_BOX 6000 #define IDC_BUTTON_CLOSE (IDD_PREFERENCE_BOX + 1) + #define IDC_LIST_DLGTITLE (IDD_PREFERENCE_BOX + 2) #define IDD_PREFERENCE_BAR_BOX 6100 //(IDD_PREFERENCE_BOX + 100) @@ -143,6 +144,7 @@ #define IDC_REMEMBEREDITVIEWPERFILE_STATIC (IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 2) #define IDC_EDIT_REMEMBEREDITVIEWPERFILE (IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 3) + #define IDD_PREFERENCE_NEWDOCSETTING_BOX 6400 //(IDD_PREFERENCE_BOX + 400) #define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 1) #define IDC_RADIO_F_WIN (IDD_PREFERENCE_NEWDOCSETTING_BOX + 2) @@ -173,6 +175,9 @@ #define IDC_RADIO_CUSTOMIZELENTH (IDD_PREFERENCE_NEWDOCSETTING_BOX + 27) #define IDC_CUSTOMIZELENGTHVAL_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 28) +#define IDD_PREFERENCE_DEFAULTDIRECTORY_BOX 6450 //(IDD_PREFERENCE_BOX + 400) +#define IDD_PREFERENCE_RECENTFILESHISTORY_BOX 6460 //(IDD_PREFERENCE_BOX + 400) + #define IDD_PREFERENCE_LANG_BOX 6500 //(IDD_PREFERENCE_BOX + 500) #define IDC_LIST_ENABLEDLANG (IDD_PREFERENCE_LANG_BOX + 1) #define IDC_LIST_DISABLEDLANG (IDD_PREFERENCE_LANG_BOX + 2) @@ -186,6 +191,7 @@ #define IDC_CHECK_DEFAULTTABVALUE (IDD_PREFERENCE_LANG_BOX + 10) #define IDC_GR_TABVALUE_STATIC (IDD_PREFERENCE_LANG_BOX + 11) #define IDC_TABSIZEVAL_DISABLE_STATIC (IDD_PREFERENCE_LANG_BOX + 12) +#define IDD_PREFERENCE_TABSETTINGS_BOX 6550 //(IDD_PREFERENCE_BOX + 500) #define IDD_PREFERENCE_PRINT_BOX 6600 //(IDD_PREFERENCE_BOX + 600) #define IDC_CHECK_PRINTLINENUM (IDD_PREFERENCE_PRINT_BOX + 1) @@ -252,4 +258,6 @@ #define IDD_AUTOC_STATIC_NOTE (IDD_PREFERENCE_BACKUP_BOX + 14) #define IDD_FUNC_CHECK (IDD_PREFERENCE_BACKUP_BOX + 15) +#define IDD_PREFERENCE_AUTOCOMPLETION_BOX 6850 //(IDD_PREFERENCE_BOX + 850) + #endif //PREFERENCE_RC_H diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index 3e79b550..3b764e49 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -252,9 +252,7 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle, generic_string & plugin childNode = childNode->NextSibling("Item") ) { TiXmlElementA *element = childNode->ToElement(); - //int id; const char *menuIdStr = element->Attribute("menuId"); - //if (element->Attribute("id", &id)) if (menuIdStr) { MenuPosition & menuPos = getMenuPosition(menuIdStr); @@ -866,93 +864,59 @@ void NativeLangSpeaker::changePrefereceDlgLang(PreferenceDlg & preference) char titre[128]; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); -#endif changeDlgLang(preference._barsDlg.getHSelf(), "Global", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("Global"), nameW); -#else - preference._ctrlTab.renameTab("Global", titre); -#endif + preference.renameDialogTitle(TEXT("Global"), nameW); } changeDlgLang(preference._marginsDlg.getHSelf(), "Scintillas", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("Scintillas"), nameW); -#else - preference._ctrlTab.renameTab("Scintillas", titre); -#endif + preference.renameDialogTitle(TEXT("Scintillas"), nameW); } changeDlgLang(preference._defaultNewDocDlg.getHSelf(), "NewDoc", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("NewDoc"), nameW); -#else - preference._ctrlTab.renameTab("NewDoc", titre); -#endif + preference.renameDialogTitle(TEXT("NewDoc"), nameW); } changeDlgLang(preference._fileAssocDlg.getHSelf(), "FileAssoc", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("FileAssoc"), nameW); -#else - preference._ctrlTab.renameTab("FileAssoc", titre); -#endif + preference.renameDialogTitle(TEXT("FileAssoc"), nameW); } changeDlgLang(preference._langMenuDlg.getHSelf(), "LangMenu", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("LangMenu"), nameW); -#else - preference._ctrlTab.renameTab("LangMenu", titre); -#endif + preference.renameDialogTitle(TEXT("LangMenu"), nameW); } changeDlgLang(preference._printSettingsDlg.getHSelf(), "Print", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("Print"), nameW); -#else - preference._ctrlTab.renameTab("Print", titre); -#endif + preference.renameDialogTitle(TEXT("Print"), nameW); } changeDlgLang(preference._settingsDlg.getHSelf(), "MISC", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("MISC"), nameW); -#else - preference._ctrlTab.renameTab("MISC", titre); -#endif + preference.renameDialogTitle(TEXT("MISC"), nameW); } changeDlgLang(preference._backupDlg.getHSelf(), "Backup", titre); - if (*titre) + if (titre[0] != '\0') { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, _nativeLangEncoding); - preference._ctrlTab.renameTab(TEXT("Backup"), nameW); -#else - preference._ctrlTab.renameTab("Backup", titre); -#endif + preference.renameDialogTitle(TEXT("Backup"), nameW); } } diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index fbd8cbc5..25560a05 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -1226,10 +1226,6 @@ RelativePath="..\src\WinControls\DocumentMap\documentMap.h" > - -