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

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

?? splitter.cpp

?? 文字編輯器源碼 Text editor source code
?? 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 "Splitter.h"
#include "Common.h"

bool Splitter::_isHorizontalRegistered = false;
bool Splitter::_isVerticalRegistered = false;
bool Splitter::_isHorizontalFixedRegistered = false;
bool Splitter::_isVerticalFixedRegistered = false;


#define SPLITTER_SIZE 8

Splitter::Splitter() : Window() 
{
	//hInstance = GetModuleHandle(NULL);
	_rect.left   = 0; // x axis 
	_rect.top    = 0; // y axis 
	_rect.right  = 0; // Width of the spliter.
	_rect.bottom = 0; // Height of the spliter
	_isFixed = false;
}


void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize,
				int iSplitRatio, DWORD dwFlags)
{
	Window::init(hInst, hPere);
	_spiltterSize = splitterSize;

	WNDCLASSEX wcex;
	DWORD dwExStyle = 0L;
	DWORD dwStyle   = WS_CHILD | WS_VISIBLE;
	
	if (hPere == NULL)
	{
		::MessageBox(NULL, TEXT("pas de pere?"), TEXT("Splitter::init"), MB_OK);
		throw int(96);
	}
	if (iSplitRatio < 0)
	{
		::MessageBox(NULL, TEXT("it shoulds be 0 < ratio < 100"), TEXT("Splitter::init"), MB_OK);
		throw int(96);
	}
	_hParent = hPere;
	_dwFlags = dwFlags;
	
	if (_dwFlags & SV_FIXED)
	{
		//Fixed spliter
		_isFixed = true;
	}
	else
	{
		if (iSplitRatio >= 100)
		{
			//cant be 100 % or more 
			::MessageBox(NULL, TEXT("it shoulds be 0 < ratio < 100"), TEXT("Splitter::init"), MB_OK);
			throw int(96);
		}
	}

	_splitPercent = iSplitRatio;
	
	wcex.cbSize			= sizeof(WNDCLASSEX); 
	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)staticWndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= _hInst;
	wcex.hIcon			= NULL;
	
	::GetClientRect(_hParent, &_rect);
	
	if (_dwFlags & SV_HORIZONTAL) //Horizontal spliter
	{
		_rect.top  = ((_rect.bottom * _splitPercent)/100);
		// y axis determined by the split% of the parent windows height
		
		_rect.left = 0;
		// x axis is always 0
		
		_rect.bottom = _spiltterSize;
		// the height of the spliter
		
		// the width of the splitter remains the same as the width of the parent window.
	}
	else //Vertical spliter
	{
		// y axis is 0 always 
		
		_rect.left = ((_rect.right * _splitPercent)/100); 
		// x axis determined by split% of the parent windows width.
		
		_rect.right = _spiltterSize; 
		// width of the spliter.			
		
		//height of the spliter remains the same as the height of the parent window
	}
	
	if (!_isFixed)
	{
		if ((_dwFlags & SV_ENABLERDBLCLK) || (_dwFlags & SV_ENABLELDBLCLK))
		{
			wcex.style = wcex.style | CS_DBLCLKS;
			// enable mouse double click messages.
		}
	}
	
	if (_isFixed)
	{
		wcex.hCursor		= ::LoadCursor(NULL, IDC_ARROW);
		// if fixed spliter then choose default cursor type.
        if (_dwFlags & SV_HORIZONTAL)
		    wcex.lpszClassName	= TEXT("fxdnsspliter");
        else
            wcex.lpszClassName	= TEXT("fxdwespliter");
	}
	else
	{
		if (_dwFlags & SV_HORIZONTAL)
		{
			//double sided arrow pointing north-south as cursor
			wcex.hCursor		= ::LoadCursor(NULL,IDC_SIZENS);
			wcex.lpszClassName	= TEXT("nsspliter");
		}
		else
		{
			// double sided arrow pointing east-west as cursor
			wcex.hCursor		= ::LoadCursor(NULL,IDC_SIZEWE);
			wcex.lpszClassName	= TEXT("wespliter");
		}
	}
	
	wcex.hbrBackground	= (HBRUSH)(COLOR_3DFACE+1);
	wcex.lpszMenuName	= NULL;
	wcex.hIconSm		= NULL;
	
	if ((_dwFlags & SV_HORIZONTAL)&&(!_isHorizontalRegistered))
	{
		RegisterClassEx(&wcex);
		_isHorizontalRegistered = true;
	}
	else if (isVertical()&&(!_isVerticalRegistered))
	{
		RegisterClassEx(&wcex);
		_isVerticalRegistered = true;
	}
    else if ((_dwFlags & SV_HORIZONTAL)&&(!_isHorizontalFixedRegistered))
    {
        RegisterClassEx(&wcex);
        _isHorizontalFixedRegistered = true;
    }
    else if (isVertical()&&(!_isVerticalFixedRegistered))
    {
        RegisterClassEx(&wcex);
        _isVerticalFixedRegistered = true;
    }

	_hSelf = CreateWindowEx(
				dwExStyle,
				wcex.lpszClassName,
				TEXT(""),
				dwStyle,
				_rect.left, 
				_rect.top, 
				_rect.right, 
				_rect.bottom, 
				_hParent,
				NULL,
				_hInst,
				(LPVOID)this);
	
	if (!_hSelf)
	{
		systemMessage(TEXT("System Err"));
		throw int(345);
	}

	RECT rc;
	getClientRect(rc);
	//::GetClientRect(_hParent,&rc);

	_clickZone2TL.left = rc.left;
	_clickZone2TL.top = rc.top;

	int clickZoneWidth = getClickZone(WIDTH);
	int clickZoneHeight = getClickZone(HEIGHT);
	_clickZone2TL.right = clickZoneWidth;
	_clickZone2TL.bottom = clickZoneHeight;

	_clickZone2BR.left = rc.right - clickZoneWidth;
	_clickZone2BR.top = rc.bottom - clickZoneHeight;
	_clickZone2BR.right = clickZoneWidth;
	_clickZone2BR.bottom = clickZoneHeight;

	display();
	::SendMessage(_hParent, WM_RESIZE_CONTAINER, _rect.left, _rect.top);

}
// determinated by (_dwFlags & SV_VERTICAL) && _splitterSize
int Splitter::getClickZone(WH which)
{
	if (_spiltterSize <= 8)
	{
		return isVertical()?(which==WIDTH?_spiltterSize:HIEGHT_MINIMAL)
							:(which==WIDTH?HIEGHT_MINIMAL:_spiltterSize);
	}
	else // (_spiltterSize > 8)
	{
		return isVertical()?(which==WIDTH? 8:15)
							:(which==WIDTH?15:8);
	}
}

LRESULT CALLBACK Splitter::staticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_NCCREATE:
		{
			Splitter * pSplitter = (Splitter *)((LPCREATESTRUCT)lParam)->lpCreateParams;
			pSplitter->_hSelf = hWnd;
			::SetWindowLongPtr(hWnd, GWL_USERDATA, (long)pSplitter);
			return TRUE;
		}
		default:
		{
			Splitter * pSplitter = (Splitter *)::GetWindowLongPtr(hWnd, GWL_USERDATA);
			if (!pSplitter)
				return ::DefWindowProc(hWnd, uMsg, wParam, lParam);

			return pSplitter->spliterWndProc(uMsg, wParam, lParam);
		}
	}
}

LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
/*	
	case WM_LBUTTONDBLCLK:
		{
::MessageBox(NULL, TEXT(""), TEXT(""), MB_OK);
		}
		return 0;

	case WM_RBUTTONDBLCLK:
		{

		}
		return 0;
	*/
	case WM_LBUTTONDOWN:
		{
			POINT p;
			p.x = LOWORD(lParam);
			p.y = HIWORD(lParam);

			if ((isInLeftTopZone(p))&&(wParam == MK_LBUTTON))
			{
				gotoTopLeft();
				return TRUE;
			}

			if ((isInRightBottomZone(p))&&(wParam == MK_LBUTTON))
			{
				gotoRightBouuom();
				return TRUE;
			}

			if (!_isFixed)
			{
				::SetCapture(_hSelf);
				_isDraged = true;
			}
		}
		return 0;

	case WM_RBUTTONDOWN :
		::SendMessage(_hParent, WM_DOPOPUPMENU, wParam, lParam);
		return TRUE;

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

			if (isInLeftTopZone(p) || isInRightBottomZone(p))
			{
				//::SetCursor(::LoadCursor(_hInst, MAKEINTRESOURCE(IDC_UP_ARROW)));
				::SetCursor(::LoadCursor(NULL, IDC_ARROW));
				return TRUE;
			}

			if ((!_isFixed) && (wParam == MK_LBUTTON))
			{
				POINT pt; RECT rt;
				::GetClientRect(_hParent, &rt);

				::GetCursorPos(&pt);
				::ScreenToClient(_hParent, &pt);

				if (_dwFlags & SV_HORIZONTAL)
				{
					if (pt.y <= 1)
					{
						_rect.top = 1;
						_splitPercent = 1;
					}
					else
					{
						if (pt.y <= (rt.bottom - 5))
						{
							_rect.top = pt.y;
							_splitPercent = ((pt.y * 100 / rt.bottom*100) / 100);
						}
						else
						{
							_rect.top = rt.bottom - 5;
							_splitPercent = 99;
						}
					}
				}
				else
				{
					if (pt.x <= 1)
					{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品夜夜爽| 在线精品视频免费观看| 亚洲欧美成人一区二区三区| 69久久99精品久久久久婷婷| 成人性视频免费网站| 日韩国产在线一| 亚洲欧美日韩中文播放| 国产日韩欧美不卡| 日韩欧美专区在线| 欧美丝袜丝nylons| 99久久综合狠狠综合久久| 另类综合日韩欧美亚洲| 亚洲一区二区三区四区中文字幕| 国产欧美日韩精品a在线观看| 日韩精品一区在线观看| 欧美少妇xxx| 色国产综合视频| 99久精品国产| 成人美女视频在线看| 韩国av一区二区| 免费在线观看日韩欧美| 天天影视色香欲综合网老头| 亚洲综合av网| 一区二区三区中文字幕| 国产精品久99| 国产精品第13页| 国产精品丝袜一区| 久久精品欧美一区二区三区不卡 | 国产乱淫av一区二区三区| 日韩国产欧美在线观看| 亚洲成av人片| 午夜亚洲福利老司机| 亚洲无人区一区| 亚洲一级在线观看| 亚洲欧美日韩在线| 亚洲精品欧美在线| 亚洲理论在线观看| 亚洲综合偷拍欧美一区色| 亚洲美女视频在线观看| 亚洲人成在线播放网站岛国| 亚洲天堂久久久久久久| 亚洲男人天堂一区| 亚洲精品美腿丝袜| 夜色激情一区二区| 亚洲午夜久久久久久久久电影网| 夜夜嗨av一区二区三区网页| 一区二区三区欧美| 亚洲综合一区二区三区| 天堂午夜影视日韩欧美一区二区| 日韩精品三区四区| 久久成人久久鬼色| 国产a级毛片一区| 波多野结衣中文一区| 91小视频在线| 欧美日韩国产小视频在线观看| 精品视频一区二区不卡| 欧美一区二区三区电影| 久久欧美中文字幕| 中文字幕在线不卡一区 | 亚洲第四色夜色| 日本亚洲一区二区| 国产福利一区二区三区在线视频| 波多野结衣一区二区三区 | 青青青爽久久午夜综合久久午夜| 久久精品国产久精国产| 国产成人一级电影| 91久久国产最好的精华液| 在线播放国产精品二区一二区四区| 欧美r级电影在线观看| 国产精品天干天干在线综合| 亚洲小说欧美激情另类| 老司机精品视频导航| 99综合电影在线视频| 欧美日韩亚洲综合在线| 精品国产电影一区二区| 中文字幕一区二区三区视频| 香蕉久久一区二区不卡无毒影院| 国产一区二区三区国产| 色综合色综合色综合| 日韩欧美电影一区| 最新欧美精品一区二区三区| 日韩影院精彩在线| 国产精品1区二区.| 欧美美女bb生活片| 中文天堂在线一区| 日韩av电影免费观看高清完整版在线观看| 国产一区在线精品| 在线亚洲+欧美+日本专区| 欧美成人综合网站| 亚洲一级二级在线| 国产不卡一区视频| 欧美一区中文字幕| 亚洲日本韩国一区| 国产精品一区二区免费不卡 | 久久久久久97三级| 一区二区三区四区乱视频| 国产美女久久久久| 3d动漫精品啪啪一区二区竹菊| 亚洲国产高清在线| 激情深爱一区二区| 欧美三级乱人伦电影| 中文一区在线播放| 九一久久久久久| 欧美少妇xxx| ●精品国产综合乱码久久久久 | eeuss鲁一区二区三区| 日韩精品一区二区三区蜜臀| 一区二区三区欧美日| 成人av网站在线观看免费| 日韩一级二级三级| 亚洲电影一级黄| 91精彩视频在线观看| 国产精品久久精品日日| 激情欧美一区二区| 欧美一级二级三级蜜桃| 亚洲免费观看高清完整版在线| 高清视频一区二区| 久久久.com| 国产一区在线观看麻豆| 日韩美女在线视频| 日韩国产欧美在线观看| 欧美日韩国产乱码电影| 一区二区三区欧美日韩| 91免费在线播放| 中文字幕日韩一区二区| 成人午夜激情在线| 中文字幕电影一区| 国产成人精品亚洲午夜麻豆| 久久综合九色综合97婷婷| 蜜桃av一区二区| 欧美一二三四在线| 免费看黄色91| 欧美一级日韩不卡播放免费| 日韩高清在线观看| 欧美日韩精品免费| 亚洲bt欧美bt精品| 欧美一区二区精品在线| 秋霞av亚洲一区二区三| 日韩欧美电影一二三| 黄色小说综合网站| 国产三级久久久| 国产成人av一区二区三区在线| 国产日产欧美一区| 9久草视频在线视频精品| 亚洲精品国产第一综合99久久| 色综合久久久久网| 亚洲福利一二三区| 日韩欧美国产一区在线观看| 国产一区二区在线观看视频| 国产视频一区在线观看| 成人av免费在线播放| 亚洲精品国产品国语在线app| 一本高清dvd不卡在线观看| 亚洲国产色一区| 日韩视频免费观看高清完整版| 激情欧美一区二区三区在线观看| 欧美激情艳妇裸体舞| 97se亚洲国产综合自在线观| 亚洲第一成年网| 日韩精品在线网站| 成人免费观看av| 亚洲精品中文在线影院| 欧美精品九九99久久| 极品少妇xxxx精品少妇偷拍| 亚洲国产精品99久久久久久久久| 色综合天天做天天爱| 奇米精品一区二区三区在线观看一| 久久婷婷成人综合色| 99re6这里只有精品视频在线观看| 亚洲一区av在线| 久久久夜色精品亚洲| 91亚洲精品一区二区乱码| 日韩精品电影一区亚洲| 久久精品一区八戒影视| 91麻豆国产自产在线观看| 免费成人结看片| 中文字幕一区av| 在线综合视频播放| 波多野结衣在线aⅴ中文字幕不卡| 午夜久久久久久久久久一区二区| xf在线a精品一区二区视频网站| 一本久道中文字幕精品亚洲嫩| 天天色天天爱天天射综合| 日本一区二区三区视频视频| 欧美日韩三级视频| 粉嫩蜜臀av国产精品网站| 亚洲高清不卡在线| 国产精品麻豆视频| 4438x亚洲最大成人网| 91丨九色丨蝌蚪丨老版| 久久av中文字幕片| 亚洲精品ww久久久久久p站 | 婷婷开心激情综合| 国产精品麻豆久久久| 日韩一区二区电影在线| 欧洲av在线精品| 成人免费高清视频| 麻豆视频一区二区| 亚洲一级二级三级在线免费观看| 国产农村妇女毛片精品久久麻豆 |