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

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

?? macbuttons.cpp

?? 這是我仿照串口助手(龔建偉)作的一個例子并修正了其中的一些bug
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// Return Value:	None.
//
// Parameters	:	None.
//
// Remarks		:	Invalidates the check rectangle of a radio button or check box.
//
{
	CRect rect;
	GetClientRect(rect);
	InvalidateRect(GetCheckRect(rect, GetStyle()));
}	// RedrawCheck

//-------------------------------------------------------------------
//
void CMacButton::DrawButtonText(CDC *pDC, CRect &rect, const CString &sText, UINT nStyle, UINT nState)
//
// Return Value:	None.
//
// Parameters	:	pDC - A pointer to the DC being drawn on.
//						rect - The button's rectangle.
//						sText - The button's text.
//						nStyle - The button's style.
//						nState - The button's state.
//
// Remarks		:	Draws the text on the button.
//
{
	CFont *pFont = GetFont();
	CFont *pOldFont = (CFont *)pDC->SelectObject(pFont);
	CFont fontBold;

	if (m_bBold)
	{
		LOGFONT lf;
		pFont->GetLogFont(&lf);
		lf.lfWeight = FW_BOLD;
		fontBold.CreateFontIndirect(&lf);
		pDC->SelectObject(&fontBold);
	}
	

	CSize sizeText = pDC->GetTextExtent(sText);

	// Determine the rect for the text.
	if ((m_nType == TYPE_STANDARD) || (nStyle & BS_PUSHLIKE))
	{
		if (nStyle & BS_LEFT)
			rect.left += 5;
		else if (nStyle & BS_RIGHT)
			rect.left = rect.right - sizeText.cx - 5;
		else
			rect.left = (rect.Width() - sizeText.cx) >> 1;
		rect.right = rect.left + sizeText.cx;

		if (nStyle & BS_TOP)
			rect.top += (m_nType == TYPE_RADIO? 4 : 5);
		else if (nStyle & BS_BOTTOM)
			rect.top = rect.bottom - sizeText.cy - 5;
		else
			rect.top = (rect.Height() - sizeText.cy) >> 1;
		rect.bottom = rect.top + sizeText.cy;
	}
	else
	{
		if (nStyle & BS_LEFT)
			rect.left = (nStyle & BS_LEFTTEXT ? 2 : CHECKBOX_HEIGHT + 5);
		else if (nStyle & BS_RIGHT)
			rect.left = rect.right - sizeText.cx - (nStyle & BS_LEFTTEXT ? CHECKBOX_HEIGHT + 10 : 5);
		else
		{
			if (m_nType == TYPE_CHECKBOX || m_nType == TYPE_RADIO)
				rect.left = (nStyle & BS_LEFTTEXT ? 2 : CHECKBOX_HEIGHT + 5);
			else
				rect.left = (rect.Width() - sizeText.cx) >> 1;
		}
		rect.right = rect.left + sizeText.cx + (nStyle & BS_LEFTTEXT ? 2 : 0);

		if (nStyle & BS_TOP)
			rect.top = rect.top;
		else if (nStyle & BS_BOTTOM)
			rect.top = rect.bottom - sizeText.cy - 3;
		else
			rect.top = ((rect.Height() - sizeText.cy) >> 1) - 1;
		rect.bottom = rect.top + sizeText.cy;
	}

	if (((m_nType == TYPE_STANDARD) && (nState & ODS_SELECTED)) || 
		 (nStyle & BS_PUSHLIKE) && (m_bMouseDown || ((nStyle & BS_FLAT) && m_nCheck)))
		pDC->SetTextColor(m_crHilight);
	if ((m_nType == TYPE_CHECKBOX) && (nStyle & BS_PUSHLIKE) && (m_nCheck == 2))
		pDC->SetTextColor(m_crShadow);

	// Draw the text.
	pDC->SetBkMode(TRANSPARENT);
	if (nState & ODS_DISABLED)
	{
		pDC->SetTextColor(m_crShadow);
		pDC->DrawText(sText, rect, DT_CENTER);
	}
	else
		pDC->DrawText(sText, rect, DT_CENTER);

	// Restore the original font.
	pDC->SelectObject(pOldFont);
	if (m_bBold)
		fontBold.DeleteObject();

}	// DrawButtonText

//-------------------------------------------------------------------
//
void CMacButton::SetImageEffect(int nEffect)
//
// Return Value:	None.
//
// Parameters	:	nEffect - The effect to add when drawing the image.
//							Can be one of the following values: 
//							- IMAGE_EFFECT_NONE - No effect is added to the image.
//							- IMAGE_EFFECT_RAISED - The image will appear raised.
//							- IMAGE_EFFECT_SUNKEN - The image will appear sunken.
//
// Remarks		:	Sets the image effect member.
//
{
	m_nImageEffect = nEffect;	
	RedrawWindow();
}	// SetImageEffect

//-------------------------------------------------------------------
//
void CMacButton::SetCheck(int nCheck)
//
// Return Value:	None.
//
// Parameters	:	nCheck - Specifies the check state. This parameter 
//							can be one of the following:
//							Value	Meaning 
//							0		Set the button state to unchecked. 
//							1		Set the button state to checked. 
//							2		Set the button state to indeterminate.
//
// Remarks		:	Sets or resets the check state of a radio button or 
//						check box. This member function has no effect on a pushbutton.
//
{
	if (m_nType == TYPE_STANDARD)
		return;

	int nOldCheck = m_nCheck;

	m_nCheck = nCheck;

	if (m_nCheck != nOldCheck)
	{
		if (GetStyle() & BS_PUSHLIKE)
			RedrawWindow();
		else
			RedrawCheck();
	}
}	// SetCheck

//-------------------------------------------------------------------
//
int CMacButton::GetCheck() const
//
// Return Value:	1 if checked, 0 otherwise.
//
// Parameters	:	None.
//
// Remarks		:	Retrieves the check state of button.
//
{
	return m_nCheck;
}	// GetCheck

//-------------------------------------------------------------------
//
void CMacButton::SetBold(BOOL bBold /*= TRUE*/)
//
// Return Value:	None.
//
// Parameters	:	bBold - Used to sed the m_bBold flag. Default value: TRUE.
//
// Remarks		:	Sets the m_bBold flag.
//
{
	m_bBold = bBold;
	RedrawWindow();
}	// SetBold

//-------------------------------------------------------------------
//
BOOL CMacButton::GetBold() const
//
// Return Value:	The bold flag.
//
// Parameters	:	None.
//
// Remarks		:	Returns the bold flag.
//
{
	return m_bBold;
}	// GetBold

/////////////////////////////////////////////////////////////////////////////
//
//	CMacCheckBox class, version 2.0
//
//	Copyright (c) 1999, 2000 Paul M. Meidinger (pmmeidinger@yahoo.com)
//
// Thanks to:
//		Eric Hwang <erichw@21cn.com>
//			For fixing the problem that was not sending a message
//			to the parent when the button was clicked.
//
//	History:
//		PMM	12/13/1999		Initial implementation.		
//
//		PMM	12/17/1999		Modified drawing code to use a memory DC. 
//									Added CPen member variables in an attempt to 
//									speed up drawing. Made other minor changes.
//
//		PMM	12/29/1999		Fixed a bug that would not send a message to the parent
//									when the button was clicked (fix by Eric Hwang). Added
//									code to draw a push-like button when that style is used.
//
/////////////////////////////////////////////////////////////////////////////

//-------------------------------------------------------------------
//
CMacCheckBox::CMacCheckBox()
	: CMacButton()
//
// Return Value:	None.
//
// Parameters	:	None.
//
// Remarks		:	Standard constructor.
//
{
	m_nType = TYPE_CHECKBOX;
	m_nCheckStyle = CHECK_STYLE_CHECK;
}	// CMacCheckBox

//-------------------------------------------------------------------
//
CMacCheckBox::~CMacCheckBox()
//
// Return Value:	None.
//
// Parameters	:	None.
//
// Remarks		:	Destructor. Does nothing.
//
{
}	// ~CMacCheckBox


BEGIN_MESSAGE_MAP(CMacCheckBox, CMacButton)
	//{{AFX_MSG_MAP(CMacCheckBox)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_KEYUP()
	ON_WM_MOUSEMOVE()
	ON_WM_LBUTTONDBLCLK()
	ON_WM_KEYDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMacCheckBox message handlers

//-------------------------------------------------------------------
//
void CMacCheckBox::DrawItem(LPDRAWITEMSTRUCT lpDIS) 
//
// Return Value:	None.
//
// Parameters	:	lpDIS - A long pointer to a DRAWITEMSTRUCT structure.
//
// Remarks		:	Called by the framework when a visual aspect of an 
//						owner-drawn button has changed.
//
{
	DrawButton(lpDIS);
}	// DrawItem

//-------------------------------------------------------------------
//
void CMacCheckBox::OnLButtonUp(UINT /*nFlags*/, CPoint point) 
//
// Return Value:	None.
//
// Parameters	:	nFlags - Indicates whether various virtual keys are down. 
//						point - Specifies the x- and y-coordinate of the cursor. 
//							These coordinates are always relative to the upper-left 
//							corner of the window.
//
// Remarks		:	The framework calls this member function when the user 
//						releases the left mouse button. Checks to see if the mouse
//						was released over the button. If so, check it.
//
{
	ReleaseCapture();

	UINT nStyle = GetStyle();

	if (!(nStyle & BS_AUTOCHECKBOX))
		return;

	CRect rect;
	GetClientRect(rect);

	if (rect.PtInRect(point))
	{
		m_nCheck = (m_nCheck == 0 ? 1 : 0);

		// Send notify message to parent window.
		// Added by Eric Hwang.
		GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)GetSafeHwnd());
	}

	m_bMouseDown = FALSE;

	if (nStyle & BS_PUSHLIKE)
		RedrawWindow();
	else
		RedrawCheck();
}	// OnLButtonUp

//-------------------------------------------------------------------
//
void CMacCheckBox::OnLButtonDown(UINT /*nFlags*/, CPoint /*point*/) 
//
// Return Value:	None.
//
// Parameters	:	nFlags - Indicates whether various virtual keys are down. 
//						point - Specifies the x- and y-coordinate of the cursor. 
//							These coordinates are always relative to the upper-left 
//							corner of the window.
//
// Remarks		:	The framework calls this member function when the user 
//						presses the left mouse button. Sets focus to this button,
//						captures the mouse, and redraws the check.
//
{
	m_bMouseDown = TRUE;
	SetFocus();
	SetCapture();

	if (GetStyle() & BS_PUSHLIKE)
		RedrawWindow();
	else
		RedrawCheck();
}	// OnLButtonDown 

//-------------------------------------------------------------------
//
void CMacCheckBox::OnLButtonDblClk(UINT /*nFlags*/, CPoint point) 
//
// Return Value:	None.
//
// Parameters	:	nFlags - Indicates whether various virtual keys are down.
//						point - Specifies the x- and y-coordinate of the cursor. 
//							These coordinates are always relative to the upper-left
//							 corner of the window.
//
// Remarks		:	The framework calls this member function when the user 
//						double-clicks the left mouse button. The WM_LBUTTONDOWN
//						message is sent to simulate a single click.
//
{
	SendMessage(WM_LBUTTONDOWN, 0, MAKELPARAM(point.x, point.y));	
}	// OnLButtonDblClk

//-------------------------------------------------------------------
//
void CMacCheckBox::OnMouseMove(UINT /*nFlags*/, CPoint point) 
//
// Return Value:	None.
//
// Parameters	:	nFlags - Indicates whether various virtual keys are down. 
//						point - Specifies the x- and y-coordinate of the cursor. 
//							These coordinates are always relative to the upper-left 
//							corner of the window.
//
// Remarks		:	The framework calls this member function when the 
//						mouse cursor moves. Checks to see if the mouse is over
//						the button, and redraws the check if it is, but wasn't previously.
//
{
	if (GetCapture() != this)
		return;

	BOOL bWasMouseDown = m_bMouseDown;

	CRect rect;
	GetClientRect(rect);
	m_bMouseDown = rect.PtInRect(point);

	if (bWasMouseDown != m_bMouseDown)
	{
		if (GetStyle() & BS_PUSHLIKE)
			RedrawWindow();
		else
			RedrawCheck();
	}
}	// OnMouseMove

//-------------------------------------------------------------------
//
void CMacCheckBox::OnKeyUp(UINT nChar, UINT /*nRepCnt*/, UINT /*nFlags*/) 
//
// Return Value:	None.
//
// Parameters	:	nChar - Specifies the virtual-key code of the given key.
//						nRepCnt - Repeat count (the number of times the keystroke
//							is repeated as a result of the user holding down the key).
//						nFlags - Specifies the scan code, key-transition code, previous 
//							key state, and context code
//
// Remarks		:	The framework calls this member function when a nonsystem 
//						key is released. Checks/unchecks the button when the space bar
//						is pressed.
//
{		
	if (nChar == VK_SPACE)
	{
		m_bMouseDown = FALSE;
		m_nCheck = (m_nCheck == 0 ? 1 : 0);

		// Send notify message to parent window.
		// Added by Eric Hwang.
		GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), BN_CLICKED), (LPARAM)GetSafeHwnd());

		if (GetStyle() & BS_PUSHLIKE)
			RedrawWindow();
		else
			RedrawCheck();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类在线| 欧美影院精品一区| 色网综合在线观看| 欧美成人免费网站| 性久久久久久久久久久久| 国产成人综合亚洲网站| 欧美一区二区黄| 亚洲精品国产无套在线观| 国产精品一二三| 6080亚洲精品一区二区| 亚洲色图一区二区| 国产精品综合一区二区| 日韩你懂的在线播放| 亚洲精品成人天堂一二三| 成人综合激情网| 久久免费看少妇高潮| 日本一不卡视频| 欧美日韩电影一区| 亚洲主播在线播放| 色欧美88888久久久久久影院| 欧美韩国日本不卡| 国产麻豆视频精品| 欧美精品一区男女天堂| 日韩—二三区免费观看av| 欧美性受xxxx| 亚洲成人激情av| 欧美精三区欧美精三区| 午夜精品福利一区二区三区蜜桃| 色域天天综合网| 亚洲精品菠萝久久久久久久| 一本久道中文字幕精品亚洲嫩| 国产精品无遮挡| 成人av电影在线网| 国产精品国产三级国产普通话三级| 国产91精品入口| 国产精品乱子久久久久| av一区二区三区黑人| 亚洲欧洲日产国产综合网| 99视频精品全部免费在线| 亚洲天堂av一区| 欧美日韩mp4| 蜜桃一区二区三区在线| 精品久久久久久久久久久久包黑料 | 欧美一区二区三区在线视频| 亚洲大型综合色站| 91麻豆精品国产91久久久久 | 狠狠色丁香久久婷婷综| 国产无遮挡一区二区三区毛片日本| 丰满亚洲少妇av| 亚洲乱码国产乱码精品精的特点| 日本久久精品电影| 日韩高清不卡一区| 国产日本亚洲高清| 在线视频国内自拍亚洲视频| 日韩专区一卡二卡| 久久亚洲欧美国产精品乐播| 成人免费av网站| 亚洲综合视频在线| 欧美成人a在线| 91麻豆精品视频| 麻豆成人久久精品二区三区红| 国产日韩欧美不卡在线| 在线免费观看日本一区| 免费观看成人av| 亚洲欧美综合色| 日韩一区国产二区欧美三区| av亚洲精华国产精华精华| 调教+趴+乳夹+国产+精品| 久久久国产午夜精品| 欧美视频在线观看一区| 国产成人亚洲精品青草天美| 亚洲在线视频一区| 国产欧美日韩综合| 欧美日韩aaaaa| 成人一区二区三区视频| 日本不卡不码高清免费观看| 国产精品卡一卡二卡三| 日韩欧美国产成人一区二区| 91视频你懂的| 国产一区二区在线影院| 香蕉影视欧美成人| 日本一区二区三区免费乱视频| 欧美日韩国产综合视频在线观看 | 99精品一区二区| 麻豆国产欧美一区二区三区| 尤物视频一区二区| 久久精品人人做人人爽97| 欧美丰满嫩嫩电影| 在线观看一区二区视频| 成人综合在线网站| 国产在线一区观看| 日本欧美一区二区三区乱码| 亚洲一区中文在线| 国产精品久久久一本精品 | 亚洲人成在线播放网站岛国| 国产午夜亚洲精品羞羞网站| 欧美成人a∨高清免费观看| 7777精品伊人久久久大香线蕉完整版| 91亚洲男人天堂| 9色porny自拍视频一区二区| 国产精品性做久久久久久| 久久精品二区亚洲w码| 五月综合激情网| 一区二区不卡在线播放| 亚洲欧洲制服丝袜| 亚洲视频免费看| 日韩美女视频一区二区 | 国产亚洲精品福利| 欧美va天堂va视频va在线| 欧美久久久一区| 欧美一区二区三区在线| 欧美日韩国产小视频在线观看| 91福利视频在线| 欧美在线你懂的| 欧美日韩精品一区二区三区四区| 在线精品视频一区二区| 欧美午夜精品电影| 欧美日韩另类国产亚洲欧美一级| 欧美三级视频在线| 欧美美女激情18p| 51精品国自产在线| 日韩一区二区三区电影在线观看| 555www色欧美视频| 精品乱人伦一区二区三区| 久久久久久影视| 中文字幕精品一区二区三区精品| 中文成人综合网| 一区二区三区免费网站| 亚洲大尺度视频在线观看| 日韩精品91亚洲二区在线观看| 免费观看在线综合色| 国产一区二区精品在线观看| 成人国产精品免费观看动漫| 99国产精品久久久久久久久久 | 91丨porny丨中文| 欧美一a一片一级一片| 欧美精品在线一区二区| 精品国产伦理网| 国产精品素人一区二区| 亚洲九九爱视频| 蜜臀va亚洲va欧美va天堂| 国产馆精品极品| 欧美午夜电影在线播放| 日韩精品一区二区三区在线播放 | 久久国产精品72免费观看| 国产精品一区2区| 色八戒一区二区三区| 欧美一卡二卡三卡| 亚洲欧洲99久久| 美脚の诱脚舐め脚责91| av电影在线观看完整版一区二区| 欧美人妖巨大在线| 久久久夜色精品亚洲| 亚洲一区自拍偷拍| 懂色av一区二区夜夜嗨| 欧美亚洲综合色| 国产精品五月天| 麻豆91免费观看| 91国在线观看| 久久久亚洲精品一区二区三区| 一二三区精品福利视频| 国产露脸91国语对白| 欧美区一区二区三区| 国产精品免费人成网站| 久久精品久久综合| 欧美做爰猛烈大尺度电影无法无天| 欧美电影免费观看高清完整版在线| 亚洲日本韩国一区| 国产成人8x视频一区二区| 欧美电影在哪看比较好| 亚洲欧洲www| 国产盗摄女厕一区二区三区| 日韩一区二区三区视频在线| 夜夜精品视频一区二区| 粉嫩aⅴ一区二区三区四区五区| 欧美一区午夜视频在线观看 | 蜜桃视频第一区免费观看| 欧美综合天天夜夜久久| 国产精品区一区二区三| 国产一区免费电影| 日韩午夜精品电影| 亚洲成人动漫在线免费观看| 色老头久久综合| 中文字幕一区二区三| 国产成人免费视频一区| 26uuu欧美| 极品美女销魂一区二区三区免费| 51午夜精品国产| 亚洲二区在线视频| 日本精品一区二区三区高清| 国产精品国产三级国产有无不卡 | 国产成人综合亚洲91猫咪| 日韩免费高清av| 日本不卡免费在线视频| 91精品免费观看| 蜜臀精品久久久久久蜜臀| 欧美一区二区国产| 另类成人小视频在线| 精品国产区一区| 黄色资源网久久资源365|