From 6d1521e995cb21514a12d108dc961c9410de714f Mon Sep 17 00:00:00 2001 From: donho Date: Sat, 15 Dec 2007 13:18:26 +0000 Subject: [PATCH] [NEW_FEATURE] Add "-notabbar" flag to hide the tab bar (ie. Notepad style). git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@85 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 5 +++++ PowerEditor/src/Parameters.h | 11 +++-------- PowerEditor/src/winmain.cpp | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 5de57cb5..8fa1994e 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -287,6 +287,11 @@ void Notepad_plus::init(HINSTANCE hInst, HWND parent, const char *cmdLine, CmdLi _pluginsManager.notify(&scnN); ::ShowWindow(_hSelf, nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW); + if (cmdLineParams->_isNoTab) + { + //::MessageBox(_hSelf, "bingo", "", MB_OK); + ::SendMessage(_hSelf, NPPM_HIDETABBAR, 0, TRUE); + } } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 442b87df..13c67a58 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -126,6 +126,7 @@ struct CmdLineParams { bool _isNoPlugin; bool _isReadOnly; bool _isNoSession; + bool _isNoTab; int _line2go; LangType _langType; @@ -905,15 +906,9 @@ public: void removeTransparent(HWND hwnd) { ::SetWindowLong(hwnd, GWL_EXSTYLE, ::GetWindowLong(hwnd, GWL_EXSTYLE) & ~/*WS_EX_LAYERED*/0x00080000); }; - - //void setDefLang(LangType langType) {_defLangType = langType;}; - //LangType getDefLang() const {return _defLangType;}; - //void setLineNumber2go(int ln) {_lineNumber2Go = ln;}; - //int getLineNumber2go() const {return _lineNumber2Go;}; - - void setCmdlineParam(const CmdLineParams & cmdLineParams) {_cmdLineParams = cmdLineParams; - //::MessageBox(NULL, "", _cmdLineParams._isReadOnly?"Param:RO":"Param:RW", MB_OK); + void setCmdlineParam(const CmdLineParams & cmdLineParams) { + _cmdLineParams = cmdLineParams; }; CmdLineParams & getCmdLineParams() {return _cmdLineParams;}; diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index 8cea6d59..605257a9 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -137,6 +137,7 @@ const char FLAG_MULTI_INSTANCE[] = "-multiInst"; const char FLAG_NO_PLUGIN[] = "-noPlugin"; const char FLAG_READONLY[] = "-ro"; const char FLAG_NOSESSION[] = "-nosession"; +const char FLAG_NOTABBAR[] = "-notabbar"; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdShow) { @@ -149,6 +150,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, int nCmdSh CmdLineParams cmdLineParams; bool isMultiInst = isInList(FLAG_MULTI_INSTANCE, lpszCmdLine); + cmdLineParams._isNoTab = isInList(FLAG_NOTABBAR, lpszCmdLine); cmdLineParams._isNoPlugin = isInList(FLAG_NO_PLUGIN, lpszCmdLine); cmdLineParams._isReadOnly = isInList(FLAG_READONLY, lpszCmdLine); cmdLineParams._isNoSession = isInList(FLAG_NOSESSION, lpszCmdLine);