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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久色婷婷小香蕉久久| 一区二区三区精品在线| 国内精品不卡在线| 精品久久人人做人人爱| 久久99精品久久只有精品| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲va韩国va欧美va| 欧美性淫爽ww久久久久无| 午夜精品国产更新| 精品久久免费看| 成人国产精品免费观看视频| 中文字幕制服丝袜成人av| 99久久精品免费精品国产| 亚洲天堂成人在线观看| 欧美日韩国产影片| 韩日av一区二区| 国产精品久久久久久久蜜臀| 欧美优质美女网站| 日日骚欧美日韩| 久久精品免费在线观看| 色综合欧美在线| 日本亚洲电影天堂| 国产日韩欧美在线一区| 色综合久久88色综合天天免费| 视频在线在亚洲| 久久久久久久免费视频了| 91亚洲永久精品| 蜜臀精品久久久久久蜜臀| 国产精品三级av| 51久久夜色精品国产麻豆| 国产成人自拍在线| 亚洲成人第一页| 国产精品久久久一区麻豆最新章节| 欧美综合一区二区| 国产乱国产乱300精品| 亚洲一区二区三区影院| 精品99999| 欧美优质美女网站| 成人在线综合网站| 麻豆91在线播放免费| 亚洲欧美日本在线| 精品国产乱码久久久久久久 | 亚洲一区二区3| 国产色91在线| 日韩一区二区三区免费看| 色综合天天综合在线视频| 国产剧情av麻豆香蕉精品| 偷拍一区二区三区| 亚洲欧美日韩国产另类专区| 久久久久久久久99精品| 欧美放荡的少妇| 在线观看一区日韩| 成人av资源在线| 国产在线一区观看| 日本亚洲免费观看| 亚洲国产wwwccc36天堂| 亚洲欧美日韩在线| 国产精品久久三区| 久久先锋影音av| 日韩精品中文字幕一区| 7777精品伊人久久久大香线蕉完整版 | 日韩高清在线电影| 综合电影一区二区三区| 国产精品日产欧美久久久久| 精品福利一区二区三区免费视频| 欧美午夜寂寞影院| 色先锋久久av资源部| aaa欧美色吧激情视频| 国产91在线|亚洲| 国产美女精品在线| 久久99久久精品欧美| 秋霞午夜av一区二区三区| 午夜国产精品影院在线观看| 亚洲一区二区三区视频在线| 亚洲一区影音先锋| 亚洲综合成人在线视频| 亚洲一线二线三线视频| 亚洲国产欧美另类丝袜| 亚洲国产一区在线观看| 亚洲狠狠爱一区二区三区| 亚洲成人av一区二区| 亚洲va国产天堂va久久en| 天天免费综合色| 免费成人性网站| 老汉av免费一区二区三区| 久久精品99国产精品| 国产一区二区三区在线观看精品| 国产乱码字幕精品高清av | 欧美一区二区精品在线| 欧美一区二区三区人| 精品久久人人做人人爰| 久久久久青草大香线综合精品| 国产日韩欧美精品一区| 国产精品美女久久久久aⅴ| 亚洲欧美国产三级| 午夜精品久久一牛影视| 麻豆视频一区二区| 国产69精品一区二区亚洲孕妇 | 亚洲欧美激情一区二区| 亚洲高清视频在线| 久久激情综合网| 国产99久久久国产精品免费看 | 国产高清一区日本| 91麻豆swag| 欧美一区二区三区成人| 久久久精品免费免费| 国产精品卡一卡二| 亚洲高清视频的网址| 国内精品免费在线观看| 色综合中文综合网| 天天av天天翘天天综合网| 狠狠色综合日日| av资源网一区| 91精品福利在线一区二区三区| 精品国产第一区二区三区观看体验| 国产精品色婷婷久久58| 亚洲一区二区三区四区在线| 韩国理伦片一区二区三区在线播放 | 日韩av在线播放中文字幕| 国产精品资源在线观看| 欧洲精品在线观看| 久久五月婷婷丁香社区| 亚洲激情自拍视频| 激情综合网av| 欧美一a一片一级一片| 久久久久久久久一| 婷婷综合久久一区二区三区| 国产成人午夜99999| 欧美日韩不卡一区二区| 国产精品―色哟哟| 麻豆精品精品国产自在97香蕉| 色综合一个色综合亚洲| 久久天堂av综合合色蜜桃网| 亚洲成人免费在线观看| 成人av免费网站| 2021国产精品久久精品| 五月婷婷久久综合| 91丨porny丨中文| 国产亚洲人成网站| 爽好多水快深点欧美视频| 91丨国产丨九色丨pron| 国产日韩高清在线| 麻豆精品视频在线观看免费| 欧美日韩一区二区电影| ...av二区三区久久精品| 国产很黄免费观看久久| 欧美大片拔萝卜| 日本色综合中文字幕| 精品视频资源站| 一区二区日韩电影| 色伊人久久综合中文字幕| 国产精品狼人久久影院观看方式| 久久精品久久99精品久久| 欧美日韩国产中文| 亚洲午夜久久久久久久久电影网 | 国产一区二区三区精品欧美日韩一区二区三区 | 日韩欧美国产一二三区| 天天综合网天天综合色| 精品视频在线免费| 亚洲国产美国国产综合一区二区| 91麻豆免费在线观看| 亚洲视频在线一区观看| 99久久精品国产一区| 国产精品蜜臀在线观看| 成人高清视频免费观看| 一色屋精品亚洲香蕉网站| 91天堂素人约啪| 一区二区三区国产精华| 欧美在线你懂的| 午夜精品久久久久久久| 欧美一区二区三区不卡| 免费高清在线视频一区·| 日韩欧美高清在线| 久久成人精品无人区| 精品国产网站在线观看| 国产精品自拍av| 国产精品国产自产拍高清av| 91在线看国产| 亚洲综合色噜噜狠狠| 欧美日韩中文字幕一区| 秋霞影院一区二区| 久久午夜国产精品| 国产 日韩 欧美大片| 亚洲日本一区二区| 欧美性xxxxx极品少妇| 日韩电影一区二区三区四区| 精品美女被调教视频大全网站| 国产真实乱偷精品视频免| 中文字幕欧美国产| 色综合一个色综合亚洲| 午夜伊人狠狠久久| 欧美成人一区二区三区| 粉嫩蜜臀av国产精品网站| 亚洲激情网站免费观看| 91精品中文字幕一区二区三区| 久久精品国产第一区二区三区| 久久久一区二区三区捆绑**| 91美女视频网站| 美女在线观看视频一区二区| 亚洲国产成人午夜在线一区|