亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tabbar.cpp

?? 一個功能強大的代碼編輯器源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//this file is part of notepad++
//Copyright (C)2003 Don HO ( donho@altern.org )
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#include "TabBar.h"
#include "SysMsg.h"

const COLORREF blue      	            = RGB(0,       0, 0xFF);
const COLORREF black     	            = RGB(0,       0,    0);
const COLORREF white     	            = RGB(0xFF, 0xFF, 0xFF);
const COLORREF grey      	            = RGB(128,   128,  128);

#define	IDC_DRAG_TAB     1404
#define	IDC_DRAG_INTERDIT_TAB 1405
#define	IDC_DRAG_PLUS_TAB 1406

bool TabBarPlus::_doDragNDrop = false;

bool TabBarPlus::_drawTopBar = true;
bool TabBarPlus::_drawInactiveTab = true;
bool TabBarPlus::_drawTabCloseButton = false;
bool TabBarPlus::_isDbClk2Close = false;
bool TabBarPlus::_isCtrlVertical = false;
bool TabBarPlus::_isCtrlMultiLine = false;

HWND TabBarPlus::_hwndArray[nbCtrlMax] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
int TabBarPlus::_nbCtrl = 0;

void TabBar::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTraditional, bool isMultiLine)
{
	Window::init(hInst, parent);
	int vertical = isVertical?(TCS_VERTICAL | TCS_MULTILINE | TCS_RIGHTJUSTIFY):0;
	_isTraditional = isTraditional;
	_isVertical = isVertical;
	_isMultiLine = isMultiLine;	

	INITCOMMONCONTROLSEX icce;
	icce.dwSize = sizeof(icce);
	icce.dwICC = ICC_TAB_CLASSES;
	InitCommonControlsEx(&icce);
    int multiLine = isMultiLine?(_isTraditional?TCS_MULTILINE:0):0;

	int style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE |\
        /* WS_BORDER |*/TCS_FOCUSNEVER | TCS_TABS | vertical | multiLine;

	_hSelf = ::CreateWindowEx(
				0/*TCS_EX_FLATSEPARATORS*/ ,
				WC_TABCONTROL,
				"Tab",
				style,
				0, 0, 0, 0,
				_hParent,
				NULL,
				_hInst,
				0);

	if (!_hSelf)
	{
		systemMessage("System Err");
		throw int(69);
	}
}

int TabBar::insertAtEnd(const char *subTabName)
{
	TCITEM tie; 
	tie.mask = TCIF_TEXT | TCIF_IMAGE;
	int index = -1;

	if (_hasImgLst)
		index = 0;
	tie.iImage = index; 
	tie.pszText = (char *)subTabName; 
	return int(::SendMessage(_hSelf, TCM_INSERTITEM, _nbItem++, reinterpret_cast<LPARAM>(&tie)));
}

void TabBar::getCurrentTitle(char *title, int titleLen)
{
	TCITEM tci;
	tci.mask = TCIF_TEXT;
	tci.pszText = title;     
	tci.cchTextMax = titleLen-1;
	::SendMessage(_hSelf, TCM_GETITEM, getCurrentTabIndex(), reinterpret_cast<LPARAM>(&tci));
}

void TabBar::reSizeTo(RECT & rc2Ajust)
{
	RECT RowRect;
	int RowCount, TabsLength;

	// Important to do that!
	// Otherwise, the window(s) it contains will take all the resouce of CPU
	// We don't need to resize the contained windows if they are even invisible anyway
	display(rc2Ajust.right > 10);
	RECT rc = rc2Ajust;
	Window::reSizeTo(rc);
	//TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust);
		
	// Do our own calculations because TabCtrl_AdjustRect doesn't work
	// on vertical or multi-lined tab controls	
	
	RowCount = TabCtrl_GetRowCount(_hSelf);
	TabCtrl_GetItemRect(_hSelf, 0, &RowRect);
	if (_isTraditional)
	{
		TabCtrl_AdjustRect(_hSelf, FALSE, &rc2Ajust);
	}
	else if (_isVertical)
	{		
		TabsLength  = RowCount * (RowRect.right - RowRect.left);
		TabsLength += GetSystemMetrics(SM_CXEDGE);
		
		rc2Ajust.left	+= TabsLength + 5;
		rc2Ajust.right	-= TabsLength + 10;	
		rc2Ajust.top    += 5;
		rc2Ajust.bottom -= 10;		
	}
	else
	{
		TabsLength  = RowCount * (RowRect.bottom - RowRect.top);
		TabsLength += GetSystemMetrics(SM_CYEDGE);

		rc2Ajust.top	+= TabsLength + 5;
		rc2Ajust.bottom -= TabsLength + 10;
		rc2Ajust.left	+= 5;
		rc2Ajust.right	-= 10;
	}
}

void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isTraditional, bool isMultiLine)
{
	Window::init(hInst, parent);
	int vertical = isVertical?(TCS_VERTICAL | TCS_MULTILINE | TCS_RIGHTJUSTIFY):0;
	_isTraditional = isTraditional;
	_isVertical = isVertical;
	_isMultiLine = isMultiLine;	

	INITCOMMONCONTROLSEX icce;
	icce.dwSize = sizeof(icce);
	icce.dwICC = ICC_TAB_CLASSES;
	InitCommonControlsEx(&icce);
    int multiLine = isMultiLine?(_isTraditional?TCS_MULTILINE:0):0;

	int style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE |\
        TCS_FOCUSNEVER | TCS_TABS | vertical | multiLine;

	//if (isOwnerDrawTab() && (!_isTraditional))
	{
		style |= TCS_OWNERDRAWFIXED;
		//printStr("ownerDraw");
	}
	_hSelf = ::CreateWindowEx(
				/*TCS_EX_FLATSEPARATORS */0,
				WC_TABCONTROL,
				"Tab",
				style,
				0, 0, 0, 0,
				_hParent,
				NULL,
				_hInst,
				0);

	if (!_hSelf)
	{
		systemMessage("System Err");
		throw int(69);
	}
	if (!_isTraditional)
    {
		if (!_hwndArray[_nbCtrl])
		{
			_hwndArray[_nbCtrl] = _hSelf;
			_ctrlID = _nbCtrl;
		}
		else 
		{
			int i = 0;
			bool found = false;
			for ( ; i < nbCtrlMax && !found ; i++)
				if (!_hwndArray[i])
					found = true;
			if (!found)
			{
				_ctrlID = -1;
				::MessageBox(NULL, "The nb of Tab Control is over its limit", "Tab Control err", MB_OK);
				destroy();
				throw int(96);
			}
			_hwndArray[i] = _hSelf;
			_ctrlID = i;
		}
		_nbCtrl++;

        ::SetWindowLong(_hSelf, GWL_USERDATA, reinterpret_cast<LONG>(this));
	    _tabBarDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLong(_hSelf, GWL_WNDPROC, reinterpret_cast<LONG>(TabBarPlus_Proc)));	 
    }

	LOGFONT LogFont;

	_hFont = (HFONT)::SendMessage(_hSelf, WM_GETFONT, 0, 0);
	
	if (_hFont == NULL)
		_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);		
		
		LogFont.lfWeight = 900;
		_hVerticalLargeFont = CreateFontIndirect(&LogFont);
	}
}

LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
	switch (Message)
	{
		// Custom window message to change tab control style on the fly
		case WM_TABSETSTYLE:
		{
			DWORD style;
			//::SendMessage(upDownWnd, UDM_SETBUDDY, NULL, 0);	
			style = ::GetWindowLong(hwnd, GWL_STYLE);
			
			if (wParam > 0)
				style |= lParam;
			else
				style &= ~lParam;
		
			_isVertical  = ((style & TCS_VERTICAL) != 0);
			_isMultiLine = ((style & TCS_MULTILINE) != 0);
		
			::SetWindowLong(hwnd, GWL_STYLE, style);
			::InvalidateRect(hwnd, NULL, TRUE);	

			return TRUE;
		}

		case WM_LBUTTONDOWN :
		{
			if (_drawTabCloseButton)
			{
				int xPos = LOWORD(lParam);
				int yPos = HIWORD(lParam);

				if (_closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect))
				{
					_whichCloseClickDown = getTabIndexAt(xPos, yPos);
					::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REFRESHTABAR, 0);
					return TRUE;
				}
			}

            ::CallWindowProc(_tabBarDefaultProc, hwnd, Message, wParam, lParam);

			if (wParam == 2)
				return TRUE;

            if (_doDragNDrop)
            {
                _nSrcTab = _nTabDragged = ::SendMessage(_hSelf, TCM_GETCURSEL, 0, 0);
        
                POINT point;
			    point.x = LOWORD(lParam);
			    point.y = HIWORD(lParam);
			    if(::DragDetect(hwnd, point)) 
			    {
				    // Yes, we're beginning to drag, so capture the mouse...
				    _isDragging = true;
				    ::SetCapture(hwnd);
			    }
            }

			NMHDR nmhdr;
			nmhdr.hwndFrom = _hSelf;
			nmhdr.code = NM_CLICK;
            nmhdr.idFrom = reinterpret_cast<unsigned int>(this);

			::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));

            return TRUE;
		}

		case WM_MOUSEMOVE :
		{
			if (_isDragging)
			{
				POINT p; 
 				p.x = LOWORD(lParam);
				p.y = HIWORD(lParam);
                exchangeItemData(p);

				// Get cursor position of "Screen"
				// For using the function "WindowFromPoint" afterward!!!
				::GetCursorPos(&_draggingPoint);
				draggingCursor(_draggingPoint);
			    return TRUE;
			}
			
			if (_drawTabCloseButton)
			{
				int xPos = LOWORD(lParam);
				int yPos = HIWORD(lParam);

				int index = getTabIndexAt(xPos, yPos);
				
				if (index != -1)
				{
					// Reduce flicker by only redrawing needed tabs
					
					bool oldVal = _isCloseHover;
					int oldIndex = _currentHoverTabItem;
					RECT oldRect;

					::SendMessage(_hSelf, TCM_GETITEMRECT, index, (LPARAM)&_currentHoverTabRect);
					::SendMessage(_hSelf, TCM_GETITEMRECT, oldIndex, (LPARAM)&oldRect);
					_currentHoverTabItem = index;
					_isCloseHover = _closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect);
					
					if (oldVal != _isCloseHover)
					{
						InvalidateRect(hwnd, &oldRect, FALSE);
						InvalidateRect(hwnd, &_currentHoverTabRect, FALSE);
					}
				}				
			}
			break;
		}

		case WM_LBUTTONUP :
		{
            if (_isDragging)
			{
				if(::GetCapture() == _hSelf)
					::ReleaseCapture();

				// Send a notification message to the parent with wParam = 0, lParam = 0
				// nmhdr.idFrom = this
				// destIndex = this->_nSrcTab
				// scrIndex  = this->_nTabDragged
				NMHDR nmhdr;
				nmhdr.hwndFrom = _hSelf;
				nmhdr.code = _isDraggingInside?TCN_TABDROPPED:TCN_TABDROPPEDOUTSIDE;
	            nmhdr.idFrom = reinterpret_cast<unsigned int>(this);

				::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));
				return TRUE;				
			}

			if (_drawTabCloseButton)
			{
				int xPos = LOWORD(lParam);
				int yPos = HIWORD(lParam);

				int currentTabOn = getTabIndexAt(xPos, yPos);

				if ((_whichCloseClickDown == currentTabOn) && _closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect))
				{
					NMHDR nmhdr;
					nmhdr.hwndFrom = _hSelf;
					nmhdr.code = TCN_TABDELETE;
					nmhdr.idFrom = reinterpret_cast<unsigned int>(this);

					::CallWindowProc(_tabBarDefaultProc, hwnd, WM_LBUTTONDOWN, wParam, lParam);
					::SendMessage(_hParent, WM_NOTIFY, 0, reinterpret_cast<LPARAM>(&nmhdr));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一级免费一区| 国产精品1区二区.| 欧美日韩国产首页| 亚洲一区电影777| 欧美精品 国产精品| 男人操女人的视频在线观看欧美| 欧美一区二区精品在线| 狠狠色综合日日| 国产精品久久福利| 在线观看日韩高清av| 日韩综合小视频| 精品国产91乱码一区二区三区 | 亚洲欧洲三级电影| 色综合视频在线观看| 亚州成人在线电影| 26uuu国产一区二区三区| 高清国产午夜精品久久久久久| 亚洲欧洲成人精品av97| 欧美日韩亚洲综合一区| 国内精品自线一区二区三区视频| 中文字幕精品一区| 欧美日韩精品综合在线| 国产美女娇喘av呻吟久久| 国产精品毛片a∨一区二区三区| 色屁屁一区二区| 秋霞电影一区二区| 中文字幕亚洲欧美在线不卡| 欧美蜜桃一区二区三区| 风间由美性色一区二区三区| 亚洲国产综合视频在线观看| 精品对白一区国产伦| 色婷婷久久一区二区三区麻豆| 毛片基地黄久久久久久天堂| 国产精品卡一卡二| 日韩一区二区三区在线| 色妹子一区二区| 国内精品免费在线观看| 亚洲综合一二三区| 中文一区二区完整视频在线观看| 欧美精品aⅴ在线视频| av不卡一区二区三区| 久久精品99久久久| 亚洲高清免费视频| 国产精品亲子乱子伦xxxx裸| 欧美精品乱码久久久久久按摩| 成人h动漫精品一区二| 狠狠色丁香久久婷婷综| 天天操天天干天天综合网| 国产精品欧美一区喷水| 精品欧美乱码久久久久久 | 日韩午夜激情电影| 91网站在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲bt欧美bt精品| 一二三区精品视频| 成人欧美一区二区三区在线播放| 精品国产伦一区二区三区免费| 欧美日本免费一区二区三区| 日本高清不卡在线观看| 成人免费的视频| 岛国一区二区三区| 国产一区二区在线观看视频| 日本sm残虐另类| 日韩制服丝袜av| 亚洲va国产va欧美va观看| 亚洲综合免费观看高清完整版| 中文字幕日韩精品一区| 中文字幕日韩av资源站| 国产精品美女久久久久久久网站| 国产欧美一区二区精品忘忧草| 欧美va在线播放| 欧美变态tickle挠乳网站| 欧美一级日韩不卡播放免费| 日韩一区二区在线播放| 日韩视频一区二区三区| 精品理论电影在线观看| 精品999在线播放| 国产一区在线看| 日本在线不卡视频| 韩国av一区二区三区四区| 国产精品区一区二区三| 久久久午夜电影| 亚洲欧美综合另类在线卡通| 亚洲欧美日韩在线不卡| 亚洲精品中文字幕乱码三区| 亚洲精品自拍动漫在线| 夜夜爽夜夜爽精品视频| 亚洲sss视频在线视频| 国产精品18久久久| 午夜精品福利一区二区三区av| 精品一区二区三区在线播放 | 亚洲va国产天堂va久久en| 国产成人av一区二区三区在线| 色综合网站在线| 91麻豆国产精品久久| 欧洲亚洲精品在线| 91精品国产综合久久久久久漫画 | 亚洲成a人片综合在线| 午夜视频一区在线观看| 韩国一区二区在线观看| hitomi一区二区三区精品| 色综合久久中文字幕综合网| 欧美亚洲动漫制服丝袜| 91精品国模一区二区三区| 久久久久久久久久看片| 综合av第一页| 蜜臀国产一区二区三区在线播放| 国产成人综合自拍| 欧美最猛黑人xxxxx猛交| 欧美一二三在线| 中文字幕一区二区三区在线观看| 香蕉成人啪国产精品视频综合网| 极品瑜伽女神91| 91伊人久久大香线蕉| 91精品婷婷国产综合久久性色 | 国产91在线|亚洲| 一本色道久久综合狠狠躁的推荐| 99国产精品久久久| 欧美日韩精品欧美日韩精品一| 久久久久成人黄色影片| 亚洲成人先锋电影| 国产一区亚洲一区| 欧美三级中文字| 国产精品天美传媒沈樵| 日韩激情一区二区| 99精品视频一区| 精品久久人人做人人爱| 一区二区三区欧美亚洲| 国产一区二区电影| 91精品国产高清一区二区三区蜜臀| 国产精品久久久久久久久图文区 | 在线视频一区二区三| 亚洲精品一区二区精华| 亚洲成人动漫精品| 99久久777色| 国产欧美精品在线观看| 麻豆久久一区二区| 成人性色生活片| 亚洲视频综合在线| 国产一区二区三区黄视频| 欧美日韩专区在线| 国产精品久久久久影院| 国产自产视频一区二区三区| 欧美日韩国产首页在线观看| 亚洲靠逼com| av在线这里只有精品| 国产亚洲1区2区3区| 久久精品72免费观看| 欧美日韩精品一区二区三区蜜桃| 中文字幕欧美一| 成人免费毛片a| 国产亚洲女人久久久久毛片| 黑人巨大精品欧美黑白配亚洲| 欧美一区二区三区四区五区| 亚洲高清久久久| 欧美午夜精品一区二区三区| 亚洲欧美电影一区二区| 不卡电影一区二区三区| 久久精品视频网| 国产精品小仙女| 国产婷婷色一区二区三区 | 亚洲国产精品视频| 在线观看国产日韩| 亚洲国产另类av| 欧美日韩国产中文| 日韩精品乱码免费| 欧美一区二区网站| 捆绑紧缚一区二区三区视频| 精品国精品国产尤物美女| 久久99精品久久久久婷婷| 精品国产污网站| 福利一区二区在线| 亚洲欧洲av另类| 欧美午夜在线一二页| 日韩成人一区二区| 精品国产乱码久久久久久蜜臀| 精品一区二区三区av| 欧美激情资源网| 色婷婷亚洲综合| 五月天中文字幕一区二区| 欧美电影免费提供在线观看| 国产在线国偷精品产拍免费yy| 欧美激情一区二区| 色欧美88888久久久久久影院| 亚洲国产精品久久久久婷婷884| 欧美精品三级日韩久久| 激情文学综合插| 亚洲欧美怡红院| 欧美日韩一区在线| 韩国一区二区三区| 亚洲欧美在线视频| 宅男噜噜噜66一区二区66| 九九国产精品视频| 国产精品福利一区| 91精品国产色综合久久久蜜香臀| 久久99国产精品久久99果冻传媒| 久久久久成人黄色影片| 在线观看91精品国产入口| 精久久久久久久久久久| 亚洲人成网站在线|