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

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

?? toolbarex.cpp

?? 開發環境為VC++ 的數據庫管理系統
?? CPP
字號:
// ToolBarEx.cpp : implementation file
//

#include "stdafx.h"
#include "ToolBarEx.h"
#include <afxadv.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CToolBarEx message handlers

BEGIN_MESSAGE_MAP(CToolBarEx, CToolBar)
	//{{AFX_MSG_MAP(CToolBarEx)
	ON_WM_PAINT()
	ON_WM_MOUSEMOVE()
	ON_WM_CREATE()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CToolBarEx Constructor/Creator.

CToolBarEx::CToolBarEx ()
{
	// Init variables.
 	all_frame = true;
	ImageStyle = IM_TRANSPARENT;
	MaskColor = RGB(198, 195, 198);
	nbButtons = 1;
	DrawGripper = false;
	button_flat = false;
	init = false;
	button_down = false;
}

CToolBarEx::~CToolBarEx ()
{
	dcMemSave.DeleteDC();
}

BOOL CToolBarEx::CreateEx ( CWnd* pParentWnd,
							DWORD dwCtrlStyle,
							DWORD dwStyle,
							UINT BkBitMapId,
							UINT TbBitMapId,
							UINT NBButtons,
							bool strechBackGround )
{
	// Get the button's style.
	if ( dwCtrlStyle == TBSTYLE_FLAT )
		button_flat = true;

	// Set the existing toolbar as transparent to avoid flickering.
	dwCtrlStyle = TBSTYLE_TRANSPARENT;

	// Check if the gripper must be drawn.
	if ( (dwStyle & CBRS_GRIPPER) != 0 )
		DrawGripper = true;

	// Load the background image.
	bmpBackground.LoadBitmap(BkBitMapId);
	bmpBackground.GetObject(sizeof(bk_bm),&bk_bm);

	BkSave.LoadBitmap(BkBitMapId);
	BkSave.GetObject(sizeof(bk_bm),&bk_bm);

	// Load the toolbar image.
	bmptoolbar.LoadBitmap(TbBitMapId);	
	bmptoolbar.GetObject(sizeof(bmt),&bmt);

	StrechBackGround = strechBackGround;
	nbButtons =  NBButtons;
	image_len = ((bmt.bmWidth)/nbButtons);

	BOOL rc = CToolBar::CreateEx ( pParentWnd, dwCtrlStyle, dwStyle );

	dcMemSave.CreateCompatibleDC(this->GetDC());
	dcMemSave.SelectObject(&BkSave);
	
	return rc;
}

///////////////////////////////////////////////////////////////////////////////
// OnPaint method.

void CToolBarEx::OnPaint() 
{
	// Get a paint handle to disable the system paint.
	CPaintDC pDC(this);

	DrawBackGround();

}

///////////////////////////////////////////////////////////////////////////////
// Draw the toolbar.

void CToolBarEx::DrawBackGround()
{
	// Get a paint handle to the parent frame control.
	CFrameWnd*  frame = this->GetParentFrame();	
	CClientDC frameDC(frame);

	// Get a paint handle to the toolbar control.
	CClientDC toolbarDC(this);
	
	// Get the size of the toolbar parent control.
	frame->GetClientRect(&Frame_rect);
	
	// Get the size of the toolbar control.
	GetClientRect(&ToolBar_rect);
	ToolBar_rect.right = Frame_rect.right;	

	// Handle to display the background.
	CDC dcMem;
	dcMem.CreateCompatibleDC(&frameDC);
	dcMem.SelectObject(&bmpBackground);

	// Check if the gripper is to be drawn.
	if ( DrawGripper == true && all_frame == true )
	{
		CPoint frame_client_pt(Frame_rect.left, Frame_rect.top);
		frame->ClientToScreen(&frame_client_pt);
		
		CPoint control_client_pt(ToolBar_rect.left, ToolBar_rect.top);
		ClientToScreen(&control_client_pt);
		
		ToolBar_rect.left += control_client_pt.x - frame_client_pt.x;
		ToolBar_rect.top += control_client_pt.y - frame_client_pt.y;
		ToolBar_rect.bottom += 2;

		frameDC.BitBlt (	Frame_rect.left, Frame_rect.top + 1, ToolBar_rect.left - 7, ToolBar_rect.bottom - 1,
							&dcMem, 0, 0, SRCCOPY );
	}


	//
	// Draw the background image.
	//

	if ( all_frame == true )
	{
		if ( StrechBackGround == false )
			frameDC.BitBlt (	ToolBar_rect.left, ToolBar_rect.top, ToolBar_rect.Width(), ToolBar_rect.Height(),
								&dcMem, 0, 0, SRCCOPY );
		
		else
			frameDC.StretchBlt (	ToolBar_rect.left, ToolBar_rect.top, ToolBar_rect.Width(), ToolBar_rect.Height(),
									&dcMem, 0, 0, bk_bm.bmWidth, bk_bm.bmHeight, SRCCOPY );
	}
	else
	{
		if ( StrechBackGround == false )
			toolbarDC.BitBlt (	ToolBar_rect.left, ToolBar_rect.top, ToolBar_rect.Width(), ToolBar_rect.Height(),
								&dcMem, 0, 0, SRCCOPY );
		
		else
			toolbarDC.StretchBlt ( ToolBar_rect.left, ToolBar_rect.top, ToolBar_rect.Width(), ToolBar_rect.Height(),
								&dcMem, 0, 0, bk_bm.bmWidth, bk_bm.bmHeight, SRCCOPY );
	}


	//
	// Draw the button's image.
	//

	// Get a handle to the toolbar control to get the button's info.
	CToolBarCtrl& control = GetToolBarCtrl();

	// Handle to display the toolbar buttons.
	CDC dcMemt;
	dcMemt.CreateCompatibleDC(&toolbarDC);
	dcMemt.SelectObject(&bmptoolbar);

	// Loop to get each button.
	for ( short i = 0 ; i < control.GetButtonCount() ; i++ )
	{
		// Get button's info.
		GetButtonInfo ( i, id, style, index );
		GetItemRect ( i, &button_rect );

		// Position of the button's bitmap into the toolbar bitmap row.
		image_pos = ((bmt.bmWidth)/nbButtons) * index;

		// Insert the button's bitmap if this is a button.
		if ( ImageStyle == IM_STRECH && style != TBBS_SEPARATOR  )
		{
			if ( style == TBBS_DISABLED )
			{
				for ( short x = 0 ; x < image_len ; x++ )
				{
					for ( short y = 0 ; y < bmt.bmHeight ; y++ )
					{
						if ( dcMemt.GetPixel(x + image_pos, y) != MaskColor )
						{
							if ( init == false )
							{
								dcMemSave.SetPixel ( x + image_pos, y, GetSysColor(COLOR_GRAYTEXT) );
							}
							
							dcMemt.SetPixel ( x + image_pos, y, GetSysColor(COLOR_GRAYTEXT) );
						}
					}
				}
			}

			// Strech the bitmap onto the toolbar button.
			toolbarDC.StretchBlt (	button_rect.left + 2, button_rect.top + 3, button_rect.right - button_rect.left - 4, button_rect.bottom - button_rect.top - 4,
								&dcMemt, image_pos, 0, image_len, bmt.bmHeight,	SRCCOPY );

			if ( init == false )
			{				
				dcMemSave.StretchBlt (	button_rect.left + 2, button_rect.top + 3, button_rect.right - button_rect.left - 4, button_rect.bottom - button_rect.top - 4,
								&dcMemt, image_pos, 0, image_len, bmt.bmHeight,	SRCCOPY );
			}
		}

		else if ( ImageStyle == IM_TRANSPARENT && style != TBBS_SEPARATOR )
		{
			// If the button size < image size, ot process this one, could also strech the image...)
			if ( (button_rect.right - button_rect.left) < image_len || (button_rect.bottom - button_rect.top) < bmt.bmHeight )
			{
				//**toolbarDC.StretchBlt (	button_rect.left + 2, button_rect.top + 3, button_rect.right - button_rect.left - 4, button_rect.bottom - button_rect.top - 4,
				//**				&dcMemt, image_pos, 0, image_len, bmt.bmHeight,	SRCCOPY );
			}

			else
			{
				// Remove mask background.
				for ( short x = 0 ; x < image_len ; x++ )
				{
					for ( short y = 0 ; y < bmt.bmHeight ; y++ )
					{
						COLORREF color = dcMemt.GetPixel ( x + image_pos, y );

						int center_x = (button_rect.right - button_rect.left)/2;
						int center_y = (button_rect.bottom - button_rect.top)/2;

						dest_pt.x = button_rect.left + center_x - image_len/2 + x;
						dest_pt.y = button_rect.top + center_y - bmt.bmHeight/2 + y;

						if ( color != MaskColor )
						{
							if ( style == TBBS_DISABLED )
							{
								if ( init == false )
								{				
									dcMemSave.SetPixel ( dest_pt.x, dest_pt.y, GetSysColor(COLOR_GRAYTEXT) );
								}

								toolbarDC.SetPixel ( dest_pt.x, dest_pt.y, GetSysColor(COLOR_GRAYTEXT) );
							}
						
							else
							{
								if ( init == false )
								{				
									dcMemSave.SetPixel ( dest_pt.x, dest_pt.y, color );
								}
							
								toolbarDC.SetPixel ( dest_pt.x, dest_pt.y, color );
							}
						}
					}
				}
			}
		}
	}

	init = true;
	
	// Free the device context.
	dcMem.DeleteDC();
	dcMemt.DeleteDC();
}

///////////////////////////////////////////////////////////////////////////////
// Draw the edge of the button.

void CToolBarEx::DrawButtonEdge()
{
	short i = 0;

	// Get a paint handle to the toolbar control.
	CClientDC toolbarDC(this);
	
	// Get a handle to the toolbar control to get the button's info.
	CToolBarCtrl& control = GetToolBarCtrl();
	
	// Loop to get each button.
	for ( i = 0 ; i < control.GetButtonCount() ; i++ )
	{
		// Get button's info.
		GetButtonInfo ( i, id, style, index );
		GetItemRect ( i, &button_rect );

		// Do no draw separators.
		//if ( style != TBBS_SEPARATOR && style != TBBS_DISABLED )
		{
			button_rect.left += 1;
			button_rect.right -= 1;
			button_rect.top += 1;
			button_rect.bottom -= 1;

			if ( button_flat == true )
			{
				// If flat, only the selected button will be displayed.
				if ( button_rect.left <= mousePosition.x &&
					 button_rect.right >= mousePosition.x &&
					 button_rect.top <= mousePosition.y  &&
					 button_rect.bottom >= mousePosition.y )
				{
					CClientDC toolbarDC(this);
					toolbarDC.BitBlt (	0, 0,
										bk_bm.bmWidth, bk_bm.bmHeight,
										&dcMemSave, 0, 0, SRCCOPY );

					if ( style != TBBS_SEPARATOR && style != TBBS_DISABLED )
					{
						toolbarDC.DrawEdge ( &button_rect, EDGE_BUMP, BF_BOTTOMLEFT );
						return;
					}
				}
			}
  			
			else
			{
				if ( style != TBBS_SEPARATOR && style != TBBS_DISABLED )
				{
					if ( button_down == true && i == control.HitTest(&mousePosition) )
						toolbarDC.DrawEdge ( &button_rect, EDGE_BUMP, BF_BOTTOMLEFT );
					else
						toolbarDC.DrawEdge ( &button_rect, EDGE_RAISED, BF_RECT );
				}
			}
		}
	}
}

///////////////////////////////////////////////////////////////////////////////
// Indicate the mouse moved.

void CToolBarEx::OnMouseMove(UINT nFlags, CPoint point) 
{
	mousePosition = point;
	DrawButtonEdge();
	
	CToolBar::OnMouseMove(nFlags, point);
}

///////////////////////////////////////////////////////////////////////////////
// Indicate a button down/up.

void CToolBarEx::OnLButtonDown(UINT nFlags, CPoint point) 
{
	button_down = true;
	DrawButtonEdge();
	CToolBar::OnLButtonDown(nFlags, point);
}

void CToolBarEx::OnLButtonUp(UINT nFlags, CPoint point) 
{
	button_down = false;	
	CToolBar::OnLButtonUp(nFlags, point);
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产免费成人在线视频| 国产高清久久久| 9191精品国产综合久久久久久 | 五月天一区二区三区| 亚洲视频一区二区在线| 国产人成一区二区三区影院| 26uuu另类欧美| 精品国产一区二区三区四区四| 欧美美女一区二区| 欧美午夜精品电影| 欧美日高清视频| 欧美日韩高清影院| 日韩欧美一级特黄在线播放| 91精品国产一区二区三区香蕉| 欧美精品乱码久久久久久按摩| 欧美精品久久久久久久多人混战 | 国产盗摄一区二区| 国产精品一级在线| 国产精品一品二品| 99久久国产综合精品女不卡| 99国产精品久| 91黄色激情网站| 欧美亚洲国产怡红院影院| 欧美午夜不卡视频| 日韩三级在线免费观看| 精品卡一卡二卡三卡四在线| 久久久久久久综合色一本| 中文字幕电影一区| 亚洲免费在线电影| 舔着乳尖日韩一区| 国产一区二区毛片| 91亚洲国产成人精品一区二三| 欧美最猛黑人xxxxx猛交| 欧美一级久久久| 久久精品一区二区三区四区| 18涩涩午夜精品.www| 水野朝阳av一区二区三区| 精品一区二区三区免费观看 | 欧美日韩在线播放| 久久网这里都是精品| 国产精品久久久久7777按摩| 亚洲午夜激情av| 激情综合色综合久久| 成人免费看视频| 欧美日韩国产精品成人| 久久午夜老司机| 一区二区在线看| 午夜不卡av在线| 高清国产午夜精品久久久久久| 成人18视频日本| 欧美性生交片4| 欧美变态凌虐bdsm| 国产精品美日韩| 亚洲午夜免费电影| 久久成人精品无人区| 国产91丝袜在线18| 成人黄色电影在线 | 亚洲不卡av一区二区三区| 蜜桃传媒麻豆第一区在线观看| 国产一区二区精品久久| 91丝袜高跟美女视频| 欧美高清视频一二三区| 国产日韩视频一区二区三区| 亚洲女人的天堂| 蜜臀av性久久久久蜜臀av麻豆| 国产另类ts人妖一区二区| 色屁屁一区二区| 精品毛片乱码1区2区3区| 亚洲丝袜美腿综合| 麻豆精品视频在线观看免费| 99免费精品在线观看| 日韩欧美国产电影| 亚洲精品欧美综合四区| 激情六月婷婷综合| 在线观看日韩一区| 日韩亚洲国产中文字幕欧美| 亚洲精品少妇30p| 国产成人综合在线播放| 精品视频在线免费看| 亚洲国产高清不卡| 日本不卡视频在线观看| 91丨porny丨户外露出| 日韩丝袜美女视频| 亚洲一区二区精品久久av| 国产精品99久久久久久宅男| 欧美日韩不卡在线| 国产精品久久久久影院老司| 蜜臀精品久久久久久蜜臀| 91视频.com| 国产午夜亚洲精品羞羞网站| 久久99精品网久久| 欧美三级日本三级少妇99| 国产精品沙发午睡系列990531| 麻豆精品一二三| 欧美日韩一区二区三区在线| 国产精品人成在线观看免费| 精品综合免费视频观看| 欧美三级电影一区| 亚洲欧美国产三级| 国产.精品.日韩.另类.中文.在线.播放 | 亚洲精品成人天堂一二三| 国产精品69毛片高清亚洲| 制服丝袜av成人在线看| 伊人一区二区三区| 91蜜桃网址入口| 欧美国产一区视频在线观看| 久久超碰97中文字幕| 日韩一区国产二区欧美三区| 亚洲制服欧美中文字幕中文字幕| 成人亚洲精品久久久久软件| 久久综合999| 国内国产精品久久| 精品日韩在线一区| 青青草国产精品亚洲专区无| 一本久道中文字幕精品亚洲嫩| 国产欧美一区二区精品忘忧草| 国产精品 欧美精品| 欧美日韩五月天| 亚洲香肠在线观看| 欧美丝袜丝交足nylons图片| 亚洲精品亚洲人成人网在线播放| 91丝袜美腿高跟国产极品老师 | 国产精品卡一卡二| proumb性欧美在线观看| 中文字幕亚洲区| 99视频在线观看一区三区| 国产精品三级av| 91视频一区二区三区| 一区二区在线免费| 欧美午夜影院一区| 午夜精品一区二区三区免费视频| 欧美偷拍一区二区| 天堂av在线一区| 91精品国产色综合久久| 精品一区二区三区av| 精品国产在天天线2019| 国产suv精品一区二区6| 久久蜜桃一区二区| 色偷偷久久一区二区三区| 亚洲国产人成综合网站| 欧美电影在线免费观看| 蜜臀va亚洲va欧美va天堂| 亚洲精品一区二区三区蜜桃下载| 国产一区二区精品久久| 国产精品麻豆久久久| 91小视频免费看| 亚洲高清免费观看 | 国产盗摄视频一区二区三区| 中文字幕视频一区| 欧洲色大大久久| 视频一区视频二区中文| 日韩欧美亚洲国产另类| 91免费小视频| 日韩专区欧美专区| 久久麻豆一区二区| 91丨porny丨在线| 日韩av一区二| 久久九九影视网| 色婷婷国产精品| 日日夜夜一区二区| 久久午夜老司机| 在线精品亚洲一区二区不卡| 水野朝阳av一区二区三区| 久久免费的精品国产v∧| 日本高清无吗v一区| 老鸭窝一区二区久久精品| 国产精品人成在线观看免费 | 欧美久久一区二区| 国产精品小仙女| 亚洲18影院在线观看| 久久综合久久久久88| 91网站最新地址| 激情小说亚洲一区| 亚洲精品水蜜桃| 精品剧情在线观看| 色综合久久中文综合久久97| 老司机精品视频导航| 亚洲欧美成人一区二区三区| 欧美一区二区播放| 91在线视频在线| 国产精品一区在线观看乱码| 一区二区欧美视频| 国产欧美一区二区精品性| 91精品国产一区二区三区| 色综合久久88色综合天天| 久热成人在线视频| 一区二区三区四区高清精品免费观看| 日韩欧美精品三级| 欧美色区777第一页| 丁香另类激情小说| 美女国产一区二区| 亚洲午夜私人影院| 久久久久久麻豆| 欧美酷刑日本凌虐凌虐| 一本色道久久综合狠狠躁的推荐| 国产一区二区三区黄视频| 日本欧美韩国一区三区| 亚洲在线一区二区三区| 中日韩免费视频中文字幕| 精品国产91久久久久久久妲己 |