[NEW_FEATURE] Add NPPM_HIDETABBAR and NPPM_ISTABBARHIDE plugins messages.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@84 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2007-12-14 00:58:06 +00:00
parent 6ab3326870
commit c67df4644b
6 changed files with 49 additions and 15 deletions

View File

@ -174,12 +174,22 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
//void NPPM_ACTIVATEDOCMENU(int view, int index2Activate) //void NPPM_ACTIVATEDOCMENU(int view, int index2Activate)
#define NPPM_GETNPPVERSION (NPPMSG + 50) #define NPPM_GETNPPVERSION (NPPMSG + 50)
// int NPPM_GETNPPVERSION() // int NPPM_GETNPPVERSION(0, 0)
// return version // return version
// ex : v4.6 // ex : v4.6
// HIWORD(version) == 4 // HIWORD(version) == 4
// LOWORD(version) == 6 // LOWORD(version) == 6
#define NPPM_HIDETABBAR (NPPMSG + 51)
// BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
// if hideOrNot is set as TRUE then tab bar will be hidden
// otherwise it'll be shown.
// return value : the old status value
#define NPPM_ISTABBARHIDE (NPPMSG + 52)
// BOOL NPPM_ISTABBARHIDE(0, 0)
// returned value : TRUE if tab bar is hidden, otherwise FALSE
#define RUNCOMMAND_USER (WM_USER + 3000) #define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)

View File

@ -3333,7 +3333,7 @@ void Notepad_plus::command(int id)
} }
break; break;
} }
case IDM_VIEW_GOTO_ANOTHER_VIEW: case IDM_VIEW_GOTO_ANOTHER_VIEW:
docGotoAnotherEditView(MODE_TRANSFER); docGotoAnotherEditView(MODE_TRANSFER);
checkSyncState(); checkSyncState();
@ -7121,6 +7121,20 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return _pluginsManager.relayPluginMessages(Message, wParam, lParam); return _pluginsManager.relayPluginMessages(Message, wParam, lParam);
} }
case NPPM_HIDETABBAR :
{
bool hide = (lParam != 0);
bool oldVal = _mainDocTab.setHideTabBarStatus(hide);
_subDocTab.setHideTabBarStatus(hide);
::SendMessage(_hSelf, WM_SIZE, 0, 0);
return oldVal;
}
case NPPM_ISTABBARHIDE :
{
return _mainDocTab.getHideTabBarStatus();
}
default: default:
{ {
if (Message == WDN_NOTIFY) if (Message == WDN_NOTIFY)

View File

@ -29,7 +29,7 @@ const int REDONLY_IMG_INDEX = 2;
class DocTabView : public TabBarPlus class DocTabView : public TabBarPlus
{ {
public : public :
DocTabView():TabBarPlus(), _pView(NULL){}; DocTabView():TabBarPlus(), _pView(NULL), _hideTabBarStatus(false){};
virtual ~DocTabView(){}; virtual ~DocTabView(){};
virtual void destroy() { virtual void destroy() {
@ -63,20 +63,32 @@ public :
void updateCurrentTabItem(const char *title = NULL); void updateCurrentTabItem(const char *title = NULL);
void updateTabItem(int index, const char *title = NULL); void updateTabItem(int index, const char *title = NULL);
virtual void reSizeTo(RECT & rc) bool setHideTabBarStatus(bool hideOrNot){
{ bool temp = _hideTabBarStatus;
TabBar::reSizeTo(rc); _hideTabBarStatus = hideOrNot;
//rc.left += 3; return temp;
rc.top += 2; };
rc.right -= 4;
rc.bottom -= 26;
bool getHideTabBarStatus() const {
return _hideTabBarStatus;
};
virtual void reSizeTo(RECT & rc) {
if (!_hideTabBarStatus)
{
TabBar::reSizeTo(rc);
//rc.left += 3;
rc.top += 2;
rc.right -= 4;
rc.bottom -= 26;
}
_pView->reSizeTo(rc); _pView->reSizeTo(rc);
}; };
private : private :
static unsigned short _nbNewTitle; static unsigned short _nbNewTitle;
ScintillaEditView *_pView; ScintillaEditView *_pView;
bool _hideTabBarStatus;
}; };
#endif //DOCTABVIEW_H #endif //DOCTABVIEW_H

View File

@ -125,9 +125,7 @@ void TabBar::reSizeTo(RECT & rc2Ajust)
// Otherwise, the window(s) it contains will take all the resouce of CPU // Otherwise, the window(s) it contains will take all the resouce of CPU
// We don't need to resiz the contained windows if they are even invisible anyway! // We don't need to resiz the contained windows if they are even invisible anyway!
display(rc2Ajust.right > 10); display(rc2Ajust.right > 10);
RECT rc = rc2Ajust; RECT rc = rc2Ajust;
Window::reSizeTo(rc); Window::reSizeTo(rc);
TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust); TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust);
} }

View File

@ -250,7 +250,7 @@
#define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3) #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3)
#define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4) #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4)
#define IDM_SETTING_FILEASSOCIATION_DLG (IDM_SETTING + 5) #define IDM_SETTING_FILEASSOCIATION_DLG (IDM_SETTING + 5)
//#define IDM_SETTING_FILE_AUTODETECTION (IDM_SETTING + 6)
#define IDM_SETTING_HISTORY_DONT_CHECK (IDM_SETTING + 7) #define IDM_SETTING_HISTORY_DONT_CHECK (IDM_SETTING + 7)
#define IDM_SETTING_TRAYICON (IDM_SETTING + 8) #define IDM_SETTING_TRAYICON (IDM_SETTING + 8)
#define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9) #define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9)

View File

@ -573,11 +573,11 @@
> >
</File> </File>
<File <File
RelativePath="..\src\resource.h" RelativePath="..\src\WinControls\Preference\resource.h"
> >
</File> </File>
<File <File
RelativePath="..\src\WinControls\Preference\resource.h" RelativePath="..\src\resource.h"
> >
</File> </File>
<File <File