[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
|
||||
int tabHeight = _toReduceTabBar?20:25;
|
||||
TabCtrl_SetItemSize(_mainDocTab.getHSelf(), 45, tabHeight);
|
||||
TabCtrl_SetItemSize(_subDocTab.getHSelf(), 45, tabHeight);
|
||||
_docTabIconList.setIconSize(iconSize);
|
||||
|
||||
//change the 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);
|
||||
|
||||
if (hf)
|
||||
@ -2977,6 +2974,8 @@ void Notepad_plus::command(int id)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
case IDM_VIEW_REFRESHTABAR :
|
||||
{
|
||||
RECT rc;
|
||||
@ -6905,6 +6904,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
updateStatusBar();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_ISTABBARREDUCED :
|
||||
{
|
||||
return _toReduceTabBar?TRUE:FALSE;
|
||||
}
|
||||
|
||||
// ADD: success->hwnd; failure->NULL
|
||||
// REMOVE: success->NULL; failure->hwnd
|
||||
@ -7228,11 +7232,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_HIDETABBAR :
|
||||
{
|
||||
bool hide = (lParam != 0);
|
||||
bool oldVal = _mainDocTab.setHideTabBarStatus(205);
|
||||
bool oldVal = _mainDocTab.setHideTabBarStatus(hide);
|
||||
_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);
|
||||
//::ShowWindow(_mainDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
||||
//::ShowWindow(_subDocTab.getHSelf(), hide?SW_FORCEMINIMIZE:SW_SHOW);
|
||||
|
||||
return oldVal;
|
||||
}
|
||||
|
@ -89,10 +89,6 @@ char * DocTabView::activate(int index)
|
||||
{
|
||||
TabBar::activateAt(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
|
||||
@ -145,7 +141,6 @@ void DocTabView::closeDocAt(int index2Close)
|
||||
|
||||
void DocTabView::updateCurrentTabItem(const char *title)
|
||||
{
|
||||
//char str[32];
|
||||
int currentIndex = TabCtrl_GetCurSel(_hSelf);
|
||||
|
||||
updateTabItem(currentIndex, title);
|
||||
|
@ -76,6 +76,7 @@ public :
|
||||
virtual void reSizeTo(RECT & rc) {
|
||||
if (!_hideTabBarStatus)
|
||||
{
|
||||
//::ShowWindow(getHSelf(), SW_SHOW);
|
||||
TabBar::reSizeTo(rc);
|
||||
//rc.top += 2;
|
||||
//rc.right -= 4;
|
||||
|
@ -179,6 +179,7 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
_pWin0->reSizeTo(rc0);
|
||||
_pWin1->reSizeTo(rc1);
|
||||
|
||||
::InvalidateRect(_splitter.getHSelf(), NULL, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,10 @@ public :
|
||||
};
|
||||
virtual void display(bool toShow = true) const {
|
||||
Window::display(toShow);
|
||||
_splitter.display(toShow);
|
||||
|
||||
_pWin0->display(toShow);
|
||||
_pWin1->display(toShow);
|
||||
_splitter.display(toShow);
|
||||
};
|
||||
virtual void redraw() const {
|
||||
_pWin0->redraw();
|
||||
|
@ -230,18 +230,23 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTrad
|
||||
}
|
||||
|
||||
LOGFONT LogFont;
|
||||
|
||||
|
||||
_hFont = (HFONT)::SendMessage(_hSelf, WM_GETFONT, 0, 0);
|
||||
|
||||
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)
|
||||
{
|
||||
LogFont.lfEscapement = 900;
|
||||
LogFont.lfOrientation = 900;
|
||||
_hVerticalFont = CreateFontIndirect(&LogFont);
|
||||
|
||||
_hVerticalFont = CreateFontIndirect(&LogFont);
|
||||
LogFont.lfWeight = 900;
|
||||
_hVerticalLargeFont = CreateFontIndirect(&LogFont);
|
||||
}
|
||||
}
|
||||
|
||||
@ -615,11 +620,23 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
||||
}
|
||||
}
|
||||
|
||||
//if (_isVertical)
|
||||
//SelectObject(hDC, _hVerticalFont);
|
||||
//else
|
||||
//SelectObject(hDC, _hFont);
|
||||
|
||||
bool isStandardSize = (::SendMessage(_hParent, NPPM_INTERNAL_ISTABBARREDUCED, 0, 0) == TRUE);
|
||||
|
||||
if (isStandardSize)
|
||||
{
|
||||
if (_isVertical)
|
||||
SelectObject(hDC, _hVerticalFont);
|
||||
else
|
||||
SelectObject(hDC, _hFont);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_isVertical)
|
||||
SelectObject(hDC, _hVerticalLargeFont);
|
||||
else
|
||||
SelectObject(hDC, _hLargeFont);
|
||||
}
|
||||
|
||||
int Flags = DT_SINGLELINE;
|
||||
|
||||
if (_drawTabCloseButton)
|
||||
|
@ -49,19 +49,17 @@ public:
|
||||
if (_hFont)
|
||||
DeleteObject(_hFont);
|
||||
|
||||
if (_hLargeFont)
|
||||
DeleteObject(_hLargeFont);
|
||||
|
||||
if (_hVerticalFont)
|
||||
DeleteObject(_hVerticalFont);
|
||||
|
||||
if (_hVerticalLargeFont)
|
||||
DeleteObject(_hVerticalLargeFont);
|
||||
|
||||
::DestroyWindow(_hSelf);
|
||||
_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);
|
||||
@ -125,7 +123,9 @@ protected:
|
||||
size_t _nbItem;
|
||||
bool _hasImgLst;
|
||||
HFONT _hFont;
|
||||
HFONT _hLargeFont;
|
||||
HFONT _hVerticalFont;
|
||||
HFONT _hVerticalLargeFont;
|
||||
|
||||
int _ctrlID;
|
||||
bool _isTraditional;
|
||||
|
@ -147,6 +147,7 @@
|
||||
#define IDM_VIEW_HIDELINES (IDM_VIEW + 42)
|
||||
#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
|
||||
#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
|
||||
//#define (IDM_VIEW + 45)
|
||||
|
||||
#define IDM_VIEW_FOLD (IDM_VIEW + 50)
|
||||
#define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1)
|
||||
|
@ -282,6 +282,7 @@
|
||||
#define NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE (NOTEPADPLUS_USER_INTERNAL + 9)
|
||||
#define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10)
|
||||
#define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11)
|
||||
#define NPPM_INTERNAL_ISTABBARREDUCED (NOTEPADPLUS_USER_INTERNAL + 12)
|
||||
// See Notepad_plus_msgs.h
|
||||
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
||||
#define SCINTILLA_USER (WM_USER + 2000)
|
||||
|
Loading…
Reference in New Issue
Block a user