[NEW_FEATURE] Add launch "as notepad" style feature (detection of asNotepad.xml, then launch notepad++ with -multiInst -nosession -notabbar options).

vertical/multiline tab is in progression.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@111 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-01-20 02:41:42 +00:00
parent 4b34c681af
commit bf507dc5ee
8 changed files with 159 additions and 97 deletions

View File

@ -193,12 +193,12 @@ OutFile "..\bin\npp.4.7.5.Installer.exe"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Serbian"
;!insertmacro MUI_LANGUAGE "Thai"
;!insertmacro MUI_LANGUAGE "Latvian"
;!insertmacro MUI_LANGUAGE "Macedonian"
;!insertmacro MUI_LANGUAGE "Estonian"
;!insertmacro MUI_LANGUAGE "Serbian"
;
!insertmacro MUI_RESERVEFILE_LANGDLL

View File

@ -3850,6 +3850,9 @@ void Notepad_plus::command(int id)
case IDM_EDIT_STREAM_COMMENT:
case IDM_EDIT_TRIMTRAILING:
case IDM_EDIT_SETREADONLY :
case IDM_EDIT_FULLPATHTOCLIP :
case IDM_EDIT_FILENAMETOCLIP :
case IDM_EDIT_CURRENTDIRTOCLIP :
case IDM_EDIT_CLEARREADONLY :
case IDM_EDIT_RTL :
case IDM_EDIT_LTR :
@ -7225,11 +7228,12 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
case NPPM_HIDETABBAR :
{
bool hide = (lParam != 0);
bool oldVal = _mainDocTab.setHideTabBarStatus(hide);
bool oldVal = _mainDocTab.setHideTabBarStatus(205);
_subDocTab.setHideTabBarStatus(hide);
::SendMessage(_hSelf, WM_SIZE, 0, 0);
::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
return oldVal;
}

View File

@ -30,9 +30,21 @@ NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserSty
_pXmlShortcutDoc(NULL), _pXmlContextMenuDoc(NULL), _pXmlSessionDoc(NULL),\
_nbUserLang(0), _nbExternalLang(0), _hUser32(NULL), _hUXTheme(NULL),\
_transparentFuncAddr(NULL), _enableThemeDialogTextureFuncAddr(NULL),\
_isTaskListRBUTTONUP_Active(false), _fileSaveDlgFilterIndex(-1)
_isTaskListRBUTTONUP_Active(false), _fileSaveDlgFilterIndex(-1), _asNotepadStyle(false)
{
// Prepare for default path
char nppPath[MAX_PATH];
::GetModuleFileName(NULL, nppPath, sizeof(nppPath));
PathRemoveFileSpec(nppPath);
strcpy(_nppPath, nppPath);
_appdataNppDir[0] = '\0';
char notepadStylePath[MAX_PATH];
strcpy(notepadStylePath, _nppPath);
PathAppend(notepadStylePath, notepadStyleFile);
_asNotepadStyle = (PathFileExists(notepadStylePath) == TRUE);
}
void cutString(const char *str2cut, vector<string> & patternVect)
@ -74,15 +86,9 @@ bool NppParameters::load(/*bool noUserPath*/)
L_END = L_EXTERNAL;
bool isAllLaoded = true;
for (int i = 0 ; i < NB_LANG ; _langList[i] = NULL, i++);
char nppPath[MAX_PATH];
char userPath[MAX_PATH];
// Prepare for default path
::GetModuleFileName(NULL, nppPath, sizeof(nppPath));
PathRemoveFileSpec(nppPath);
strcpy(_nppPath, nppPath);
// Make localConf.xml path
char localConfPath[MAX_PATH];
strcpy(localConfPath, _nppPath);
@ -129,13 +135,13 @@ bool NppParameters::load(/*bool noUserPath*/)
// langs.xml : for every user statically //
//---------------------------------------//
char langs_xml_path[MAX_PATH];
strcpy(langs_xml_path, nppPath);
strcpy(langs_xml_path, _nppPath);
PathAppend(langs_xml_path, "langs.xml");
if (!PathFileExists(langs_xml_path))
{
char srcLangsPath[MAX_PATH];
strcpy(srcLangsPath, nppPath);
strcpy(srcLangsPath, _nppPath);
PathAppend(srcLangsPath, "langs.model.xml");
::CopyFile(srcLangsPath, langs_xml_path, TRUE);
@ -161,7 +167,7 @@ bool NppParameters::load(/*bool noUserPath*/)
PathAppend(configPath, "config.xml");
char srcConfigPath[MAX_PATH];
strcpy(srcConfigPath, nppPath);
strcpy(srcConfigPath, _nppPath);
PathAppend(srcConfigPath, "config.model.xml");
if (!::PathFileExists(configPath))
@ -207,7 +213,7 @@ bool NppParameters::load(/*bool noUserPath*/)
if (!PathFileExists(stylerPath))
{
char srcStylersPath[MAX_PATH];
strcpy(srcStylersPath, nppPath);
strcpy(srcStylersPath, _nppPath);
PathAppend(srcStylersPath, "stylers.model.xml");
::CopyFile(srcStylersPath, stylerPath, TRUE);
@ -253,7 +259,7 @@ bool NppParameters::load(/*bool noUserPath*/)
if (!PathFileExists(nativeLangPath))
{
strcpy(nativeLangPath, nppPath);
strcpy(nativeLangPath, _nppPath);
PathAppend(nativeLangPath, "nativeLang.xml");
}
@ -291,7 +297,7 @@ bool NppParameters::load(/*bool noUserPath*/)
if (!PathFileExists(_shortcutsPath))
{
char srcShortcutsPath[MAX_PATH];
strcpy(srcShortcutsPath, nppPath);
strcpy(srcShortcutsPath, _nppPath);
PathAppend(srcShortcutsPath, "shortcuts.xml");
::CopyFile(srcShortcutsPath, _shortcutsPath, TRUE);
@ -329,7 +335,7 @@ bool NppParameters::load(/*bool noUserPath*/)
if (!PathFileExists(_contextMenuPath))
{
char srcContextMenuPath[MAX_PATH];
strcpy(srcContextMenuPath, nppPath);
strcpy(srcContextMenuPath, _nppPath);
PathAppend(srcContextMenuPath, "contextMenu.xml");
::CopyFile(srcContextMenuPath, _contextMenuPath, TRUE);

View File

@ -78,6 +78,7 @@ const char fontSizeStrs[][3] = {"", "8", "9", "10", "11", "12", "14", "16", "18"
#define LINEDRAW_FONT "LINEDRAW.TTF"
const char localConfFile[] = "doLocalConf.xml";
const char notepadStyleFile[] = "asNotepad.xml";
void cutString(const char *str2cut, vector<string> & patternVect);
/*
@ -1043,6 +1044,7 @@ public:
}
return NULL;
};
bool asNotepadStyle() const {return _asNotepadStyle;};
private:
NppParameters();
@ -1120,6 +1122,7 @@ private:
Accelerator *_pAccelerator;
FindDlgTabTitiles _findDlgTabTitiles;
bool _asNotepadStyle;
static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, int FontType, LPARAM lParam) {
vector<string> *pStrVect = (vector<string> *)lParam;

View File

@ -24,16 +24,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define IDC_STATIC -1
#endif
IDD_PREFERENCE_BOX DIALOGEX 0, 0, 345, 206
IDD_PREFERENCE_BOX DIALOGEX 0, 0, 395, 231
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,146,186,45,14
PUSHBUTTON "Close",IDC_BUTTON_CLOSE,174,206,45,14
END
IDD_PREFERENCE_BAR_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_BAR_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -43,22 +43,24 @@ BEGIN
CONTROL "Big icons",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,18,43,109,10
CONTROL "Small standard icons",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,18,57,119,10
GROUPBOX "Tab bar",IDC_TABBAR_GB_STATIC,149,5,146,102,BS_CENTER
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,14,108,10
CONTROL "Lock (No Drag N Drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,29,134,10
CONTROL "Draw the inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,44,134,10
CONTROL "Draw the orange top bar",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,59,133,10
CONTROL "Enable close button on each tab", IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,74,133,10
CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,89,133,10
GROUPBOX "Tab bar",IDC_TABBAR_GB_STATIC,177,5,176,151,BS_CENTER
CONTROL "Hide",IDC_CHECK_TAB_HIDE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,16,108,10
CONTROL "Multi-Line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,30,134,10
CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,44,134,10
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,59,108,10
CONTROL "Lock (No Drag N Drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,73,134,10
CONTROL "Draw the inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,88,134,10
CONTROL "Draw the orange top bar",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,103,133,10
CONTROL "Enable close button on each tab", IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,118,133,10
CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,183,133,133,10
CONTROL "Show Status Bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,133,130,10
CONTROL "Show Status Bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,80,130,10
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,95,130,10
CONTROL "Remember the last operation directory",IDC_CHECK_KEEPINSAMEDIR,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,110,210,10
CONTROL "Enable document switcher (Ctrl+Tab)",IDC_CHECK_ENABLEDOCSWITCHER,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,12,125,180,10
CONTROL "Enable MRU behaviour for document switcher",IDC_CHECK_STYLEMRU,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,23,140,210,10
END
IDD_PREFERENCE_MARGEIN_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_MARGEIN_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -85,35 +87,42 @@ BEGIN
END
IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Tab Setting",IDC_TABSETTING_GB_STATIC,11,4,119,44,BS_CENTER
GROUPBOX "Tab Setting",IDC_TABSETTING_GB_STATIC,11,4,143,44,BS_CENTER
CONTROL "Replace by space",IDC_CHECK_REPLACEBYSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,31,100,10
RTEXT "Tab size : ",IDC_TABSIZE_STATIC,16,18,58,8
LTEXT "0",IDC_TABSIZEVAL_STATIC,76,18,18,8
GROUPBOX "History File Setting",IDC_HISTORY_GB_STATIC,144,4,150,44,BS_CENTER
GROUPBOX "History File Setting",IDC_HISTORY_GB_STATIC,188,4,150,44,BS_CENTER
CONTROL "Don't check at launch time",IDC_CHECK_DONTCHECKHISTORY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,31,133,10
RTEXT "Max number history file :",IDC_MAXNBFILE_STATIC,147,18,112,8
LTEXT "0",IDC_MAXNBFILEVAL_STATIC,266,18,15,8
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,196,31,133,10
RTEXT "Max number history file :",IDC_MAXNBFILE_STATIC,191,18,112,8
LTEXT "0",IDC_MAXNBFILEVAL_STATIC,310,18,15,8
CONTROL "Enable",IDC_CHECK_FILEAUTODETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,65,98,10
CONTROL "Minimize to sys tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,101,130,10
CONTROL "Remember the current session for next launch",IDC_CHECK_REMEMBERSESSION, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,111,160,23
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE, "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,134,150,10
GROUPBOX "File Status Auto-detection",IDC_FILEAUTODETECTION_STATIC,11,54,120,39,BS_CENTER
CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,78,98,10
//GROUPBOX "Backup Option",IDC_BACKUP_GB_STATIC,11,98,120,46,BS_CENTER
CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,65,98,10
GROUPBOX "Clickable link setting",IDC_CLICKABLELINK_STATIC,144,54,150,39,BS_CENTER
CONTROL "Don't draw underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,78,119,10
EDITTEXT IDC_EDIT_SESSIONFILEEXT,231,113,67,14,ES_AUTOHSCROLL
LTEXT "Session file ext:",IDC_SESSIONFILEEXT_STATIC,233,101,66,8
CONTROL "Minimize to sys tray",IDC_CHECK_MIN2SYSTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,102,130,10
CONTROL "Remember the current session for next launch",IDC_CHECK_REMEMBERSESSION,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,163,217,11
CONTROL "Enable Notepad++ auto-updater",IDC_CHECK_AUTOUPDATE,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,133,150,10
GROUPBOX "File Status Auto-detection",IDC_FILEAUTODETECTION_STATIC,11,54,144,39,BS_CENTER
CONTROL "Update silently",IDC_CHECK_UPDATESILENTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,78,103,10
CONTROL "Enable",IDC_CHECK_CLICKABLELINK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,196,65,98,10
GROUPBOX "Clickable link setting",IDC_CLICKABLELINK_STATIC,188,54,150,39,BS_CENTER
CONTROL "Don't draw underline",IDC_CHECK_CLICKABLELINK_NOUNDERLINE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,196,78,119,10
EDITTEXT IDC_EDIT_SESSIONFILEEXT,293,162,67,14,ES_AUTOHSCROLL
LTEXT "Session file ext:",IDC_SESSIONFILEEXT_STATIC,295,150,66,8
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,117,130,10
CONTROL "Remember the last operation directory",IDC_CHECK_KEEPINSAMEDIR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,148,210,10
CONTROL "Enable",IDC_CHECK_ENABLEDOCSWITCHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,196,109,69,10
CONTROL "Enable MRU behaviour",IDC_CHECK_STYLEMRU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,196,122,134,10
GROUPBOX "Document switcher (Ctrl+TAB)",IDC_DOCUMENTSWITCHER_STATIC,188,98,150,39,BS_CENTER
END
IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_NEWDOCSETTING_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -139,7 +148,7 @@ BEGIN
COMBOBOX IDC_COMBO_DEFAULTLANG,100,108,72,140,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_PREFERENCE_LANG_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_LANG_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -151,7 +160,7 @@ BEGIN
CTEXT "Disabled items",IDC_DISABLEDITEMS_STATIC,203,8,72,8
END
IDD_PREFERENCE_PRINT_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_PRINT_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -172,7 +181,7 @@ BEGIN
GROUPBOX "Margin Setting (Unit:mm)",IDC_MARGESETTINGS_STATIC,153,32,144,96,BS_CENTER
END
IDD_PREFERENCE_PRINT2_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_PRINT2_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
@ -210,7 +219,7 @@ BEGIN
LTEXT "",IDC_VIEWPANEL_STATIC,85,137,213,8
END
IDD_PREFERENCE_BACKUP_BOX DIALOGEX 0, 0, 305, 147
IDD_PREFERENCE_BACKUP_BOX DIALOGEX 0, 0, 370, 180
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN

View File

@ -117,10 +117,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
toolBarStatusType tbStatus = nppGUI._toolBarStatus;
int tabBarStatus = nppGUI._tabStatus;
bool showStatus = nppGUI._statusBarShow;
bool enableTaskList = nppGUI._doTaskList;
bool enableMaintainIndent = nppGUI._maitainIndent;
bool saveOpenKeepInSameDir = nppGUI._saveOpenKeepInSameDir;
bool styleMRU = nppGUI._styleMRU;
int ID2Check = 0;
switch (tbStatus)
@ -148,10 +145,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
::SendDlgItemMessage(_hSelf, IDC_CHECK_DBCLICK2CLOSE, BM_SETCHECK, tabBarStatus & TAB_DBCLK2CLOSE, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHOWSTATUSBAR, BM_SETCHECK, showStatus, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCSWITCHER, BM_SETCHECK, enableTaskList, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, enableMaintainIndent, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_KEEPINSAMEDIR, BM_SETCHECK, saveOpenKeepInSameDir, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, styleMRU, 0);
if (!nppGUI._doTaskList)
{
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_STYLEMRU), FALSE);
@ -172,43 +166,31 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_STATUSBAR, 0);
return TRUE;
case IDC_CHECK_ENABLEDOCSWITCHER :
case IDC_CHECK_TAB_HIDE :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._doTaskList = !nppGUI._doTaskList;
if (nppGUI._doTaskList)
{
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_STYLEMRU), TRUE);
}
else
{
nppGUI._styleMRU = false;
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, false, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_STYLEMRU), FALSE);
}
bool toBeHidden = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_TAB_HIDE), BM_GETCHECK, 0, 0));
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_TAB_MULTILINE), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_TAB_VERTICAL), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REDUCE), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_LOCK), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_ORANGE), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_DRAWINACTIVE), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_ENABLETABCLOSE), !toBeHidden);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_DBCLICK2CLOSE), !toBeHidden);
::SendMessage(::GetParent(_hParent), NPPM_HIDETABBAR, 0, toBeHidden);
return TRUE;
}
case IDC_CHECK_KEEPINSAMEDIR :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._saveOpenKeepInSameDir = !nppGUI._saveOpenKeepInSameDir;
case IDC_CHECK_TAB_VERTICAL:
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_VERTICAL, 0);
return TRUE;
}
case IDC_CHECK_MAINTAININDENT :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._maitainIndent = !nppGUI._maitainIndent;
case IDC_CHECK_TAB_MULTILINE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0);
return TRUE;
}
case IDC_CHECK_STYLEMRU :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._styleMRU = !nppGUI._styleMRU;
return TRUE;
}
case IDC_CHECK_REDUCE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0);
@ -498,6 +480,15 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
::SendDlgItemMessage(_hSelf, IDC_EDIT_SESSIONFILEEXT, WM_SETTEXT, 0, (LPARAM)nppGUI._definedSessionExt.c_str());
bool enableTaskList = nppGUI._doTaskList;
bool enableMaintainIndent = nppGUI._maitainIndent;
bool saveOpenKeepInSameDir = nppGUI._saveOpenKeepInSameDir;
bool styleMRU = nppGUI._styleMRU;
::SendDlgItemMessage(_hSelf, IDC_CHECK_ENABLEDOCSWITCHER, BM_SETCHECK, enableTaskList, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, enableMaintainIndent, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_KEEPINSAMEDIR, BM_SETCHECK, saveOpenKeepInSameDir, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, styleMRU, 0);
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
if (enableDlgTheme)
enableDlgTheme(_hSelf, ETDT_ENABLETAB);
@ -597,6 +588,43 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
::SetWindowText(::GetDlgItem(_hSelf, IDC_MAXNBFILEVAL_STATIC), nbStr);
return TRUE;
}
case IDC_CHECK_ENABLEDOCSWITCHER :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._doTaskList = !nppGUI._doTaskList;
if (nppGUI._doTaskList)
{
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_STYLEMRU), TRUE);
}
else
{
nppGUI._styleMRU = false;
::SendDlgItemMessage(_hSelf, IDC_CHECK_STYLEMRU, BM_SETCHECK, false, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_STYLEMRU), FALSE);
}
return TRUE;
}
case IDC_CHECK_KEEPINSAMEDIR :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._saveOpenKeepInSameDir = !nppGUI._saveOpenKeepInSameDir;
return TRUE;
}
case IDC_CHECK_MAINTAININDENT :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._maitainIndent = !nppGUI._maitainIndent;
return TRUE;
}
case IDC_CHECK_STYLEMRU :
{
NppGUI & nppGUI = (NppGUI &)NppParameters::getInstance()->getNppGUI();
nppGUI._styleMRU = !nppGUI._styleMRU;
return TRUE;
}
}
}
}

View File

@ -40,6 +40,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define IDC_CHECK_MAINTAININDENT (IDD_PREFERENCE_BAR_BOX + 15)
#define IDC_CHECK_KEEPINSAMEDIR (IDD_PREFERENCE_BAR_BOX + 16)
#define IDC_CHECK_STYLEMRU (IDD_PREFERENCE_BAR_BOX + 17)
#define IDC_CHECK_TAB_HIDE (IDD_PREFERENCE_BAR_BOX + 18)
#define IDC_CHECK_TAB_MULTILINE (IDD_PREFERENCE_BAR_BOX + 19)
#define IDC_CHECK_TAB_VERTICAL (IDD_PREFERENCE_BAR_BOX + 20)
#define IDD_PREFERENCE_MARGEIN_BOX 6200 //(IDD_PREFERENCE_BOX + 200)
#define IDC_FMS_GB_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 1)
@ -85,6 +88,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define IDC_EDIT_SESSIONFILEEXT (IDD_PREFERENCE_SETTING_BOX + 21)
#define IDC_SESSIONFILEEXT_STATIC (IDD_PREFERENCE_SETTING_BOX + 22)
#define IDC_CHECK_AUTOUPDATE (IDD_PREFERENCE_SETTING_BOX + 23)
#define IDC_DOCUMENTSWITCHER_STATIC (IDD_PREFERENCE_SETTING_BOX + 24)
#define IDD_PREFERENCE_NEWDOCSETTING_BOX 6400 //(IDD_PREFERENCE_BOX + 400)
#define IDC_FORMAT_GB_STATIC (IDD_PREFERENCE_NEWDOCSETTING_BOX + 1)

View File

@ -159,6 +159,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdSh
NppParameters *pNppParameters = NppParameters::getInstance();
// override the settings if notepad style is present
if (pNppParameters->asNotepadStyle())
{
isMultiInst = true;
cmdLineParams._isNoTab = true;
cmdLineParams._isNoSession = true;
}
if ((!isMultiInst) && (!TheFirstOne))
{
HWND hNotepad_plus = ::FindWindow(Notepad_plus::getClassName(), NULL);