[IN_PROGRESS] VERTICAL/MULTILINE feature in progress.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@112 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
bf507dc5ee
commit
63ec780bfb
|
@ -2953,15 +2953,12 @@ void Notepad_plus::command(int id)
|
||||||
|
|
||||||
//Resize the tab height
|
//Resize the tab height
|
||||||
int tabHeight = _toReduceTabBar?20:25;
|
int tabHeight = _toReduceTabBar?20:25;
|
||||||
|
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), 45, tabHeight);
|
||||||
|
TabCtrl_SetItemSize(_subDocTab.getHSelf(), 45, tabHeight);
|
||||||
|
_docTabIconList.setIconSize(iconSize);
|
||||||
|
|
||||||
//change the font
|
//change the font
|
||||||
int stockedFont = _toReduceTabBar?DEFAULT_GUI_FONT:SYSTEM_FONT;
|
int stockedFont = _toReduceTabBar?DEFAULT_GUI_FONT:SYSTEM_FONT;
|
||||||
|
|
||||||
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), 45, tabHeight);
|
|
||||||
TabCtrl_SetItemSize(_subDocTab.getHSelf(), 45, tabHeight);
|
|
||||||
|
|
||||||
_docTabIconList.setIconSize(iconSize);
|
|
||||||
|
|
||||||
HFONT hf = (HFONT)::GetStockObject(stockedFont);
|
HFONT hf = (HFONT)::GetStockObject(stockedFont);
|
||||||
|
|
||||||
if (hf)
|
if (hf)
|
||||||
|
@ -2977,6 +2974,8 @@ void Notepad_plus::command(int id)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case IDM_VIEW_REFRESHTABAR :
|
case IDM_VIEW_REFRESHTABAR :
|
||||||
{
|
{
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
@ -6906,6 +6905,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_INTERNAL_ISTABBARREDUCED :
|
||||||
|
{
|
||||||
|
return _toReduceTabBar?TRUE:FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// ADD: success->hwnd; failure->NULL
|
// ADD: success->hwnd; failure->NULL
|
||||||
// REMOVE: success->NULL; failure->hwnd
|
// REMOVE: success->NULL; failure->hwnd
|
||||||
case NPPM_MODELESSDIALOG :
|
case NPPM_MODELESSDIALOG :
|
||||||
|
@ -7228,11 +7232,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||||
case NPPM_HIDETABBAR :
|
case NPPM_HIDETABBAR :
|
||||||
{
|
{
|
||||||
bool hide = (lParam != 0);
|
bool hide = (lParam != 0);
|
||||||
bool oldVal = _mainDocTab.setHideTabBarStatus(205);
|
bool oldVal = _mainDocTab.setHideTabBarStatus(hide);
|
||||||
_subDocTab.setHideTabBarStatus(hide);
|
_subDocTab.setHideTabBarStatus(hide);
|
||||||
::SendMessage(_hSelf, WM_SIZE, 0, 0);
|
::SendMessage(_hSelf, WM_SIZE, 0, 0);
|
||||||
::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
//::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
||||||
::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
//::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
||||||
|
|
||||||
return oldVal;
|
return oldVal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,10 +89,6 @@ char * DocTabView::activate(int index)
|
||||||
{
|
{
|
||||||
TabBar::activateAt(index);
|
TabBar::activateAt(index);
|
||||||
return _pView->activateDocAt(index);
|
return _pView->activateDocAt(index);
|
||||||
|
|
||||||
//char *title = _pView->activateDocAt(index);
|
|
||||||
//_pView->execute(SCI_SETLEXER, SCLEX_CONTAINER);
|
|
||||||
//return title;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this method updates the doc when user clicks a sub tab
|
// this method updates the doc when user clicks a sub tab
|
||||||
|
@ -145,7 +141,6 @@ void DocTabView::closeDocAt(int index2Close)
|
||||||
|
|
||||||
void DocTabView::updateCurrentTabItem(const char *title)
|
void DocTabView::updateCurrentTabItem(const char *title)
|
||||||
{
|
{
|
||||||
//char str[32];
|
|
||||||
int currentIndex = TabCtrl_GetCurSel(_hSelf);
|
int currentIndex = TabCtrl_GetCurSel(_hSelf);
|
||||||
|
|
||||||
updateTabItem(currentIndex, title);
|
updateTabItem(currentIndex, title);
|
||||||
|
|
|
@ -76,6 +76,7 @@ public :
|
||||||
virtual void reSizeTo(RECT & rc) {
|
virtual void reSizeTo(RECT & rc) {
|
||||||
if (!_hideTabBarStatus)
|
if (!_hideTabBarStatus)
|
||||||
{
|
{
|
||||||
|
//::ShowWindow(getHSelf(), SW_SHOW);
|
||||||
TabBar::reSizeTo(rc);
|
TabBar::reSizeTo(rc);
|
||||||
//rc.top += 2;
|
//rc.top += 2;
|
||||||
//rc.right -= 4;
|
//rc.right -= 4;
|
||||||
|
|
|
@ -179,6 +179,7 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
_pWin0->reSizeTo(rc0);
|
_pWin0->reSizeTo(rc0);
|
||||||
_pWin1->reSizeTo(rc1);
|
_pWin1->reSizeTo(rc1);
|
||||||
|
|
||||||
|
::InvalidateRect(_splitter.getHSelf(), NULL, TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,10 @@ public :
|
||||||
};
|
};
|
||||||
virtual void display(bool toShow = true) const {
|
virtual void display(bool toShow = true) const {
|
||||||
Window::display(toShow);
|
Window::display(toShow);
|
||||||
_splitter.display(toShow);
|
|
||||||
_pWin0->display(toShow);
|
_pWin0->display(toShow);
|
||||||
_pWin1->display(toShow);
|
_pWin1->display(toShow);
|
||||||
|
_splitter.display(toShow);
|
||||||
};
|
};
|
||||||
virtual void redraw() const {
|
virtual void redraw() const {
|
||||||
_pWin0->redraw();
|
_pWin0->redraw();
|
||||||
|
|
|
@ -236,12 +236,17 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
|
||||||
if (_hFont == NULL)
|
if (_hFont == NULL)
|
||||||
_hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
|
_hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
|
||||||
|
|
||||||
|
if (_hLargeFont == NULL)
|
||||||
|
_hLargeFont = (HFONT)::GetStockObject(SYSTEM_FONT);
|
||||||
|
|
||||||
if (::GetObject(_hFont, sizeof(LOGFONT), &LogFont) != 0)
|
if (::GetObject(_hFont, sizeof(LOGFONT), &LogFont) != 0)
|
||||||
{
|
{
|
||||||
LogFont.lfEscapement = 900;
|
LogFont.lfEscapement = 900;
|
||||||
LogFont.lfOrientation = 900;
|
LogFont.lfOrientation = 900;
|
||||||
|
|
||||||
_hVerticalFont = CreateFontIndirect(&LogFont);
|
_hVerticalFont = CreateFontIndirect(&LogFont);
|
||||||
|
|
||||||
|
LogFont.lfWeight = 900;
|
||||||
|
_hVerticalLargeFont = CreateFontIndirect(&LogFont);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,10 +620,22 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (_isVertical)
|
bool isStandardSize = (::SendMessage(_hParent, NPPM_INTERNAL_ISTABBARREDUCED, 0, 0) == TRUE);
|
||||||
//SelectObject(hDC, _hVerticalFont);
|
|
||||||
//else
|
if (isStandardSize)
|
||||||
//SelectObject(hDC, _hFont);
|
{
|
||||||
|
if (_isVertical)
|
||||||
|
SelectObject(hDC, _hVerticalFont);
|
||||||
|
else
|
||||||
|
SelectObject(hDC, _hFont);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_isVertical)
|
||||||
|
SelectObject(hDC, _hVerticalLargeFont);
|
||||||
|
else
|
||||||
|
SelectObject(hDC, _hLargeFont);
|
||||||
|
}
|
||||||
|
|
||||||
int Flags = DT_SINGLELINE;
|
int Flags = DT_SINGLELINE;
|
||||||
|
|
||||||
|
|
|
@ -49,19 +49,17 @@ public:
|
||||||
if (_hFont)
|
if (_hFont)
|
||||||
DeleteObject(_hFont);
|
DeleteObject(_hFont);
|
||||||
|
|
||||||
|
if (_hLargeFont)
|
||||||
|
DeleteObject(_hLargeFont);
|
||||||
|
|
||||||
if (_hVerticalFont)
|
if (_hVerticalFont)
|
||||||
DeleteObject(_hVerticalFont);
|
DeleteObject(_hVerticalFont);
|
||||||
|
|
||||||
|
if (_hVerticalLargeFont)
|
||||||
|
DeleteObject(_hVerticalLargeFont);
|
||||||
|
|
||||||
::DestroyWindow(_hSelf);
|
::DestroyWindow(_hSelf);
|
||||||
_hSelf = NULL;
|
_hSelf = NULL;
|
||||||
|
|
||||||
/*
|
|
||||||
if ((!_isTraditional) && (_ctrlID != -1))
|
|
||||||
{
|
|
||||||
_hwndArray[_ctrlID] = NULL;
|
|
||||||
_nbCtrl--;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void init(HINSTANCE hInst, HWND hwnd, bool isVertical = false, bool isTraditional = false, bool isMultiLine = false);
|
virtual void init(HINSTANCE hInst, HWND hwnd, bool isVertical = false, bool isTraditional = false, bool isMultiLine = false);
|
||||||
|
@ -125,7 +123,9 @@ protected:
|
||||||
size_t _nbItem;
|
size_t _nbItem;
|
||||||
bool _hasImgLst;
|
bool _hasImgLst;
|
||||||
HFONT _hFont;
|
HFONT _hFont;
|
||||||
|
HFONT _hLargeFont;
|
||||||
HFONT _hVerticalFont;
|
HFONT _hVerticalFont;
|
||||||
|
HFONT _hVerticalLargeFont;
|
||||||
|
|
||||||
int _ctrlID;
|
int _ctrlID;
|
||||||
bool _isTraditional;
|
bool _isTraditional;
|
||||||
|
|
|
@ -147,6 +147,7 @@
|
||||||
#define IDM_VIEW_HIDELINES (IDM_VIEW + 42)
|
#define IDM_VIEW_HIDELINES (IDM_VIEW + 42)
|
||||||
#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
|
#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
|
||||||
#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
|
#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
|
||||||
|
//#define (IDM_VIEW + 45)
|
||||||
|
|
||||||
#define IDM_VIEW_FOLD (IDM_VIEW + 50)
|
#define IDM_VIEW_FOLD (IDM_VIEW + 50)
|
||||||
#define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1)
|
#define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1)
|
||||||
|
|
|
@ -282,6 +282,7 @@
|
||||||
#define NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE (NOTEPADPLUS_USER_INTERNAL + 9)
|
#define NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE (NOTEPADPLUS_USER_INTERNAL + 9)
|
||||||
#define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10)
|
#define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10)
|
||||||
#define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11)
|
#define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11)
|
||||||
|
#define NPPM_INTERNAL_ISTABBARREDUCED (NOTEPADPLUS_USER_INTERNAL + 12)
|
||||||
// See Notepad_plus_msgs.h
|
// See Notepad_plus_msgs.h
|
||||||
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
||||||
#define SCINTILLA_USER (WM_USER + 2000)
|
#define SCINTILLA_USER (WM_USER + 2000)
|
||||||
|
|
Loading…
Reference in New Issue