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

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

?? btnst.cpp

?? 多進(jìn)程的串口通訊的示例
?? CPP
?? 第 1 頁 / 共 4 頁
字號(hào):
	byRed = GetRValue(m_crColors[byColorIndex]);
	byGreen = GetGValue(m_crColors[byColorIndex]);
	byBlue = GetBValue(m_crColors[byColorIndex]);

	// Calculate max. allowed real offset
	if (shOffset > 0)
	{
		if (byRed + shOffset > 255)		shOffsetR = 255 - byRed;
		if (byGreen + shOffset > 255)	shOffsetG = 255 - byGreen;
		if (byBlue + shOffset > 255)	shOffsetB = 255 - byBlue;

		shOffset = min(min(shOffsetR, shOffsetG), shOffsetB);
	} // if
	else
	{
		if (byRed + shOffset < 0)		shOffsetR = -byRed;
		if (byGreen + shOffset < 0)		shOffsetG = -byGreen;
		if (byBlue + shOffset < 0)		shOffsetB = -byBlue;

		shOffset = max(max(shOffsetR, shOffsetG), shOffsetB);
	} // else

	// Set new color
	m_crColors[byColorIndex] = RGB(byRed + shOffset, byGreen + shOffset, byBlue + shOffset);

	if (bRepaint)	Invalidate();

	return BTNST_OK;
} // End of OffsetColor

// This function sets the hilight logic for the button.
// Applies only to flat buttons.
//
// Parameters:
//		[IN]	bAlwaysTrack
//				If TRUE the button will be hilighted even if the window that owns it, is
//				not the active window.
//				If FALSE the button will be hilighted only if the window that owns it,
//				is the active window.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::SetAlwaysTrack(BOOL bAlwaysTrack)
{
	m_bAlwaysTrack = bAlwaysTrack;
	return BTNST_OK;
} // End of SetAlwaysTrack

// This function sets the cursor to be used when the mouse is over the button.
//
// Parameters:
//		[IN]	nCursorId
//				ID number of the cursor resource.
//				Pass NULL to remove a previously loaded cursor.
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//		BTNST_INVALIDRESOURCE
//			Failed loading the specified resource.
//
DWORD CButtonST::SetBtnCursor(int nCursorId, BOOL bRepaint)
{
	HINSTANCE	hInstResource = NULL;
	// Destroy any previous cursor
	if (m_hCursor)
	{
		::DestroyCursor(m_hCursor);
		m_hCursor = NULL;
	} // if

	// Load cursor
	if (nCursorId)
	{
		hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nCursorId), RT_GROUP_CURSOR);
		// Load cursor resource
		m_hCursor = (HCURSOR)::LoadImage(hInstResource, MAKEINTRESOURCE(nCursorId), IMAGE_CURSOR, 0, 0, 0);
		// Repaint the button
		if (bRepaint) Invalidate();
		// If something wrong
		if (m_hCursor == NULL) return BTNST_INVALIDRESOURCE;
	} // if

	return BTNST_OK;
} // End of SetBtnCursor

// This function sets if the button border must be drawn.
// Applies only to flat buttons.
//
// Parameters:
//		[IN]	bDrawBorder
//				If TRUE the border will be drawn.
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::DrawBorder(BOOL bDrawBorder, BOOL bRepaint)
{
	m_bDrawBorder = bDrawBorder;
	// Repaint the button
	if (bRepaint) Invalidate();

	return BTNST_OK;
} // End of DrawBorder

// This function sets if the focus rectangle must be drawn for flat buttons.
//
// Parameters:
//		[IN]	bDrawFlatFocus
//				If TRUE the focus rectangle will be drawn also for flat buttons.
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::DrawFlatFocus(BOOL bDrawFlatFocus, BOOL bRepaint)
{
	m_bDrawFlatFocus = bDrawFlatFocus;
	// Repaint the button
	if (bRepaint) Invalidate();

	return BTNST_OK;
} // End of DrawFlatFocus

void CButtonST::InitToolTip()
{
	if (m_ToolTip.m_hWnd == NULL)
	{
		// Create ToolTip control
		m_ToolTip.Create(this);
		// Create inactive
		m_ToolTip.Activate(FALSE);
		// Enable multiline
		m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, 400);
	} // if
} // End of InitToolTip

// This function sets the text to show in the button tooltip.
//
// Parameters:
//		[IN]	nText
//				ID number of the string resource containing the text to show.
//		[IN]	bActivate
//				If TRUE the tooltip will be created active.
//
void CButtonST::SetTooltipText(int nText, BOOL bActivate)
{
	CString sText;

	// Load string resource
	sText.LoadString(nText);
	// If string resource is not empty
	if (sText.IsEmpty() == FALSE) SetTooltipText((LPCTSTR)sText, bActivate);
} // End of SetTooltipText

// This function sets the text to show in the button tooltip.
//
// Parameters:
//		[IN]	lpszText
//				Pointer to a null-terminated string containing the text to show.
//		[IN]	bActivate
//				If TRUE the tooltip will be created active.
//
void CButtonST::SetTooltipText(LPCTSTR lpszText, BOOL bActivate)
{
	// We cannot accept NULL pointer
	if (lpszText == NULL) return;

	// Initialize ToolTip
	InitToolTip();

	// If there is no tooltip defined then add it
	if (m_ToolTip.GetToolCount() == 0)
	{
		CRect rectBtn; 
		GetClientRect(rectBtn);
		m_ToolTip.AddTool(this, lpszText, rectBtn, 1);
	} // if

	// Set text for tooltip
	m_ToolTip.UpdateTipText(lpszText, this, 1);
	m_ToolTip.Activate(bActivate);
} // End of SetTooltipText

// This function enables or disables the button tooltip.
//
// Parameters:
//		[IN]	bActivate
//				If TRUE the tooltip will be activated.
//
void CButtonST::ActivateTooltip(BOOL bActivate)
{
	// If there is no tooltip then do nothing
	if (m_ToolTip.GetToolCount() == 0) return;

	// Activate tooltip
	m_ToolTip.Activate(bActivate);
} // End of EnableTooltip

// This function returns if the button is the default button.
//
// Return value:
//		TRUE
//			The button is the default button.
//		FALSE
//			The button is not the default button.
//
BOOL CButtonST::GetDefault()
{
	return m_bIsDefault;
} // End of GetDefault

// This function enables the transparent mode.
// Note: this operation is not reversible.
// DrawTransparent should be called just after the button is created.
// Do not use trasparent buttons until you really need it (you have a bitmapped
// background) since each transparent button makes a copy in memory of its background.
// This may bring unnecessary memory use and execution overload.
//
// Parameters:
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
void CButtonST::DrawTransparent(BOOL bRepaint)
{
	m_bDrawTransparent = TRUE;

	// Restore old bitmap (if any)
	if (m_dcBk.m_hDC != NULL && m_pbmpOldBk != NULL)
	{
		m_dcBk.SelectObject(m_pbmpOldBk);
	} // if

	m_bmpBk.DeleteObject();
	m_dcBk.DeleteDC();

	// Repaint the button
	if (bRepaint) Invalidate();
} // End of DrawTransparent

// This function sets the URL that will be opened when the button is clicked.
//
// Parameters:
//		[IN]	lpszURL
//				Pointer to a null-terminated string that contains the URL.
//				Pass NULL to removed any previously specified URL.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::SetURL(LPCTSTR lpszURL)
{
	// Remove any existing URL
	memset(m_szURL, 0, sizeof(m_szURL));

	if (lpszURL)
	{
		// Store the URL
		_tcsncpy(m_szURL, lpszURL, _MAX_PATH);
	} // if

	return BTNST_OK;
} // End of SetURL

// This function associates a menu to the button.
// The menu will be displayed clicking the button.
//
// Parameters:
//		[IN]	nMenu
//				ID number of the menu resource.
//				Pass NULL to remove any menu from the button.
//		[IN]	hParentWnd
//				Handle to the window that owns the menu.
//				This window receives all messages from the menu.
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//		BTNST_INVALIDRESOURCE
//			Failed loading the specified resource.
//
#ifndef	BTNST_USE_BCMENU
DWORD CButtonST::SetMenu(UINT nMenu, HWND hParentWnd, BOOL bRepaint)
{
	HINSTANCE	hInstResource	= NULL;

	// Destroy any previous menu
	if (m_hMenu)
	{
		::DestroyMenu(m_hMenu);
		m_hMenu = NULL;
		m_hParentWndMenu = NULL;
		m_bMenuDisplayed = FALSE;
	} // if

	// Load menu
	if (nMenu)
	{
		// Find correct resource handle
		hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nMenu), RT_MENU);
		// Load menu resource
		m_hMenu = ::LoadMenu(hInstResource, MAKEINTRESOURCE(nMenu));
		m_hParentWndMenu = hParentWnd;
		// If something wrong
		if (m_hMenu == NULL) return BTNST_INVALIDRESOURCE;
	} // if

	// Repaint the button
	if (bRepaint) Invalidate();

	return BTNST_OK;
} // End of SetMenu
#endif

// This function associates a menu to the button.
// The menu will be displayed clicking the button.
// The menu will be handled by the BCMenu class.
//
// Parameters:
//		[IN]	nMenu
//				ID number of the menu resource.
//				Pass NULL to remove any menu from the button.
//		[IN]	hParentWnd
//				Handle to the window that owns the menu.
//				This window receives all messages from the menu.
//		[IN]	bWinXPStyle
//				If TRUE the menu will be displayed using the new Windows XP style.
//				If FALSE the menu will be displayed using the standard style.
//		[IN]	nToolbarID
//				Resource ID of the toolbar to be associated to the menu.
//		[IN]	sizeToolbarIcon
//				A CSize object indicating the size (in pixels) of each icon into the toolbar.
//				All icons into the toolbar must have the same size.
//		[IN]	crToolbarBk
//				A COLORREF value indicating the color to use as background for the icons into the toolbar.
//				This color will be used as the "transparent" color.
//		[IN]	bRepaint
//				If TRUE the control will be repainted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//		BTNST_INVALIDRESOURCE
//			Failed loading the specified resource.
//
#ifdef	BTNST_USE_BCMENU
DWORD CButtonST::SetMenu(UINT nMenu, HWND hParentWnd, BOOL bWinXPStyle, UINT nToolbarID, CSize sizeToolbarIcon, COLORREF crToolbarBk, BOOL bRepaint)
{
	BOOL	bRetValue = FALSE;

	// Destroy any previous menu
	if (m_menuPopup.m_hMenu)
	{
		m_menuPopup.DestroyMenu();
		m_hParentWndMenu = NULL;
		m_bMenuDisplayed = FALSE;
	} // if

	// Load menu
	if (nMenu)
	{
		m_menuPopup.SetMenuDrawMode(bWinXPStyle);
		// Load menu
		bRetValue = m_menuPopup.LoadMenu(nMenu);
		// If something wrong
		if (bRetValue == FALSE) return BTNST_INVALIDRESOURCE;

		// Load toolbar
		if (nToolbarID)
		{
			m_menuPopup.SetBitmapBackground(crToolbarBk);
			m_menuPopup.SetIconSize(sizeToolbarIcon.cx, sizeToolbarIcon.cy);

			bRetValue = m_menuPopup.LoadToolbar(nToolbarID);
			// If something wrong
			if (bRetValue == FALSE) 
			{
				m_menuPopup.DestroyMenu();
				return BTNST_INVALIDRESOURCE;
			} // if
		} // if

		m_hParentWndMenu = hParentWnd;
	} // if

	// Repaint the button
	if (bRepaint) Invalidate();

	return BTNST_OK;
} // End of SetMenu
#endif

// This function is called every time the button background needs to be painted.
// If the button is in transparent mode this function will NOT be called.
// This is a virtual function that can be rewritten in CButtonST-derived classes
// to produce a whole range of buttons not available by default.
//
// Parameters:
//		[IN]	pDC
//				Pointer to a CDC object that indicates the device context.
//		[IN]	pRect
//				Pointer to a CRect object that indicates the bounds of the
//				area to be painted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::OnDrawBackground(CDC* pDC, LPCRECT pRect)
{
	COLORREF	crColor;

	if (m_bMouseOnButton || m_bIsPressed)
		crColor = m_crColors[BTNST_COLOR_BK_IN];
	else
	{
		if (m_bIsFocused)
			crColor = m_crColors[BTNST_COLOR_BK_FOCUS];
		else
			crColor = m_crColors[BTNST_COLOR_BK_OUT];
	} // else

	CBrush		brBackground(crColor);

	pDC->FillRect(pRect, &brBackground);

	return BTNST_OK;
} // End of OnDrawBackground

// This function is called every time the button border needs to be painted.
// If the button is in standard (not flat) mode this function will NOT be called.
// This is a virtual function that can be rewritten in CButtonST-derived classes
// to produce a whole range of buttons not available by default.
//
// Parameters:
//		[IN]	pDC
//				Pointer to a CDC object that indicates the device context.
//		[IN]	pRect
//				Pointer to a CRect object that indicates the bounds of the
//				area to be painted.
//
// Return value:
//		BTNST_OK
//			Function executed successfully.
//
DWORD CButtonST::OnDrawBorder(CDC* pDC, LPCRECT pRect)
{
	if (m_bIsPressed)
		pDC->Draw3dRect(pRect, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHILIGHT));
	else
		pDC->Draw3dRect(pRect, ::GetSysColor(COLOR_BTNHILIGHT), ::GetSysColor(COLOR_BTNSHADOW));

	return BTNST_OK;
} // End of OnDrawBorder

#undef BS_TYPEMASK

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久精品日日躁夜夜躁欧美| 看国产成人h片视频| 粉嫩av一区二区三区| 久久精品欧美一区二区三区不卡 | 国产精品乱人伦一区二区| 国产精品白丝av| 国产精品欧美久久久久一区二区| 成人一级视频在线观看| 亚洲日本青草视频在线怡红院| 91久久精品一区二区三区| 亚洲国产欧美在线人成| 欧美一二三四区在线| 国产综合色产在线精品| 国产精品激情偷乱一区二区∴| 91首页免费视频| 喷白浆一区二区| 国产日产欧美一区| 欧美在线观看一区二区| 美女精品一区二区| 中文字幕在线一区免费| 欧美日韩精品一区二区三区四区| 久久精品国产精品亚洲综合| 国产精品麻豆99久久久久久| 久久久国产午夜精品| 亚洲成人精品在线观看| 欧美综合视频在线观看| 精品国产网站在线观看| 成人激情综合网站| 亚洲成人动漫精品| 国产夜色精品一区二区av| 91免费在线看| 久久99在线观看| 亚洲欧洲综合另类在线| 欧美一区二区福利在线| 91在线免费看| 看片网站欧美日韩| 亚洲综合一二区| 2024国产精品视频| 精品1区2区3区| 成人一区二区三区视频在线观看| 日韩电影网1区2区| 亚洲天堂av一区| 久久久久99精品一区| 欧美日韩免费一区二区三区| 国产精品一二三区| 亚洲v中文字幕| 亚洲欧美日韩一区二区 | 麻豆精品视频在线观看| 亚洲精品久久久久久国产精华液| 精品久久久久久久一区二区蜜臀| 欧美在线观看一区| 99精品国产视频| 国产一区二区精品久久99| 亚洲图片欧美视频| 亚洲蜜臀av乱码久久精品蜜桃| 久久精品一区蜜桃臀影院| 欧美日韩国产成人在线免费| 99国产精品久久久久久久久久| 精品一区二区三区免费视频| 亚洲成人www| 亚洲伊人伊色伊影伊综合网| 中文字幕亚洲综合久久菠萝蜜| 精品少妇一区二区三区| 6080日韩午夜伦伦午夜伦| 日本黄色一区二区| 色综合久久久久综合99| 91亚洲精品久久久蜜桃| 不卡一卡二卡三乱码免费网站| 国产伦精品一区二区三区在线观看 | 中文字幕av不卡| 精品国内二区三区| 91精品国产综合久久久久久漫画| 一本一道久久a久久精品综合蜜臀| 国产99久久久国产精品潘金网站| 精品一二三四区| 九九精品一区二区| 国产一区二区主播在线| 久久成人免费网站| 精品午夜久久福利影院| 久久aⅴ国产欧美74aaa| 国产一区二区三区国产| 国模冰冰炮一区二区| 国产精品888| 99视频有精品| 99久久99久久久精品齐齐| caoporen国产精品视频| 91亚洲男人天堂| 色婷婷av久久久久久久| 欧亚洲嫩模精品一区三区| 91福利精品第一导航| 欧美午夜精品久久久久久超碰| 欧美在线观看视频一区二区三区| 欧美日韩一区二区在线观看| 91精品国产综合久久香蕉的特点| 日韩免费成人网| 国产肉丝袜一区二区| 国产精品久久久久久久久快鸭| 1024成人网| 亚洲国产cao| 麻豆精品在线观看| 国产 欧美在线| 在线观看欧美日本| 欧美一区二区三区四区五区| 久久亚洲欧美国产精品乐播 | 色综合色综合色综合色综合色综合| 色老汉一区二区三区| 5566中文字幕一区二区电影| 久久综合九色综合97婷婷女人| 国产欧美精品一区aⅴ影院| 一区二区三区中文在线| 日本va欧美va瓶| 成人一区二区三区| 欧美精品18+| 亚洲国产成人一区二区三区| 亚洲欧美日韩国产一区二区三区| 视频一区二区中文字幕| 国产成人av福利| 欧美视频一区二区| 久久久99久久| 亚洲va欧美va人人爽| 国产成人在线观看| 欧美精品乱码久久久久久 | 国产精品久久精品日日| 水野朝阳av一区二区三区| 国产91丝袜在线18| 8x8x8国产精品| **欧美大码日韩| 国产精品综合视频| 欧美老女人第四色| 综合亚洲深深色噜噜狠狠网站| 久久综合综合久久综合| 色综合久久中文综合久久97| 精品国产成人在线影院| 亚洲成人一二三| 99久久精品免费看国产 | 成人精品免费网站| 日韩三级视频在线看| 亚洲美女偷拍久久| 国产91高潮流白浆在线麻豆 | 国产伦精品一区二区三区免费迷| 欧美日韩中文字幕一区| 中文字幕日韩一区| 国产成人av福利| 久久婷婷国产综合国色天香| 天堂蜜桃91精品| 色94色欧美sute亚洲线路一ni| 欧美国产日韩在线观看| 国内久久婷婷综合| 欧美岛国在线观看| 日韩制服丝袜av| 欧美日韩一区二区三区四区五区| 1区2区3区国产精品| 粉嫩av一区二区三区在线播放| 精品国产麻豆免费人成网站| 日韩精品一级二级 | 欧美亚洲另类激情小说| 国产精品国产三级国产普通话蜜臀 | 色哟哟精品一区| 中文字幕精品一区二区三区精品| 精品制服美女久久| 精品免费一区二区三区| 美女视频网站久久| 91精品国产色综合久久ai换脸| 一区二区免费视频| 91福利在线导航| 亚洲国产精品一区二区久久恐怖片 | 3d动漫精品啪啪1区2区免费| 亚洲一区二区三区四区的| 欧美午夜精品久久久久久孕妇| 亚洲一区av在线| 欧美日韩一区在线| 日本一不卡视频| 日韩女优毛片在线| 国产麻豆视频一区| 欧美国产丝袜视频| 91麻豆高清视频| 亚洲综合色区另类av| 欧美精品tushy高清| 麻豆久久一区二区| 欧美激情综合五月色丁香小说| 成人三级伦理片| 亚洲色图欧美偷拍| 欧美日韩小视频| 麻豆成人在线观看| 国产色91在线| 色综合天天综合在线视频| 亚洲综合色噜噜狠狠| 91精品国产免费| 国产精品资源在线看| 国产精品久久久久婷婷二区次| 91国偷自产一区二区开放时间| 首页亚洲欧美制服丝腿| 亚洲精品一区二区三区影院| 成人网男人的天堂| 一区二区三区四区精品在线视频| 欧美精品第1页| 国产精品羞羞答答xxdd| 亚洲综合色婷婷| 久久午夜国产精品| 在线视频一区二区三区|