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

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

?? pptooltip.cpp

?? 對excel的操作提供了一個類
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
    return &LogFont; 
}

/////////////////////////////////////////////////////////////////
// Prints the formating string of the tooltip
//  
// Parameters:
//		pDC			 - [in] The device context to print the string
//      str			 - [in] The formating string for drawing
//      rect         - [in] The rectangle to draws the tooltip
//		bEnableAlign - [in] If TRUE align's operators are enables.
//
// Return values:
//      None.
//---------------------------------------------------------------
// Format of string:
//  <b> text </b> - The bold string
//  <i> text </i> - The italic string 
//  <u> text </u> - The underline string
//  <s> text </s> - The strike out string
//
//  <cb=0x123456> text </cb> - The background color (RGB (12,34,56))
//  <ct=0x123456> text </ct> - The text color (RGB (12,34,56))
//
//  <cbi=1> text </cbi> - The index background color(0 - F)
//  <cti=1> text </cti> - The index text color(0 - F)
//
//	<al> or <al_l> - sets align to left edge
//  <al_c> - sets align to the center 
//  <al_r> - sets align to the right edge
//
//	<hr=100%> - the horizontal line with length 100%
//  <hr=32> - the horizontal line with length 32 pixels.
//
//	<a="link"> text </a> - The hyperlink 
//
//  <h=1> text </h> - hot zone (number of zone)
//
//	<br[=1]> - new line (numbers of the lines)
//  <t[=1]> - tabulation (number of tabulations)
//
//  <img[=0x0000] [cx=0] [cy=0]>				 - draws the image by his name
//  <ilst[=0x0000]>								 - draws the image from image list
//  <bmp[=0x0000] mask[=0xFF00FF] [cx=0] [cy=0]> - draws bitmap
//  <icon[=0x0000] [cx=0] [cy=0]>				 - draws the icon
////////////////////////////////////////////////////////////////
CSize CPPToolTip::PrintTitleString(CDC * pDC, CRect rect, CString str, BOOL bCalculate /* = TRUE */)
{
	enum{	CMD_NONE = 0,
			CMD_BOLD,
			CMD_ITALIC,
			CMD_STRIKE,
			CMD_UNDERLINE,
			CMD_COLOR_TEXT,
			CMD_COLOR_TEXT_INDEX,
			CMD_COLOR_BK,
			CMD_COLOR_BK_INDEX,
			CMD_NEW_LINE,
			CMD_TABULATION,
			CMD_HORZ_LINE,
			CMD_HORZ_LINE_PERCENT,
			CMD_DRAW_IMAGE,
			CMD_DRAW_IMAGE_LIST,
			CMD_DRAW_BITMAP,
			CMD_DRAW_BITMAP_MASK,
			CMD_DRAW_ICON
	};

	enum{	ALIGN_LEFT = 0,
			ALIGN_CENTER,
			ALIGN_RIGHT
		};

	//Clears the length of the lines
	if (bCalculate)
	{
		m_nLengthLines.RemoveAll();
		m_nHeightLines.RemoveAll();
	}
	
	int nLine = 0;
	int nCmd = CMD_NONE;
	int nAlign = ALIGN_LEFT;
	BOOL bCloseTag = FALSE;

	CSize sz(0, 0);
	CSize szLine (0, 0);
	CSize szIcon (0, 0); //The size of icon

	if (str.IsEmpty())
		return sz;

	CPoint	pt = rect.TopLeft();
	CPoint  ptCur = pt;
	
	// Copies default logfont's structure
	LOGFONT lf;
    memcpy(&lf, &m_LogFont, sizeof(LOGFONT));

	CFont font;
	font.CreateFontIndirect(&lf);

	CFont * pOldFont = pDC->SelectObject(&font);

	TEXTMETRIC tm;
	pDC->GetTextMetrics(&tm);
	int nHeight = tm.tmHeight; //The height of the font
	int nWidth = tm.tmAveCharWidth; //The width of the font

	CString strTag = _T("");  // Tag's name 
	CString strText = _T(""); // The current text to output
	CString sParam = _T(""); // The text parameter

	UINT nParam = 0, nParam1 = 0;
	int nLineHeight = bCalculate ? nHeight : m_nHeightLines.GetAt(0); //The height of the current line
	
	CUIntArray percent;
	percent.Add(0);

	int nTemp = 0; //the temporary variable
	BOOL bFirstOutput = TRUE;
	
	for (int i = 0; i <= str.GetLength(); i++)
	{
		if (i < str.GetLength())
		{
			nCmd = CMD_NONE;
			strText = SearchBeginOfTag(str, i);
			if (strText.IsEmpty())
			{
				//Tag was found
				strTag = GetNameOfTag(str, i);
				bCloseTag = (strTag.GetAt(0) == _T('/')) ? TRUE : FALSE;
				if (bCloseTag)
					strTag = strTag.Right(strTag.GetLength() - 1);
				
				if (!strTag.CompareNoCase(_T("b")))
				{
					nCmd = CMD_BOLD;
				}
				else if (!strTag.CompareNoCase(_T("i")))
				{
					nCmd = CMD_ITALIC;
				}
				else if (!strTag.CompareNoCase(_T("u")))
				{
					nCmd = CMD_UNDERLINE;
				}
				else if (!strTag.CompareNoCase(_T("s")))
				{
					nCmd = CMD_STRIKE;
				}
				else if (!strTag.CompareNoCase(_T("br")))
				{
					nCmd = CMD_NEW_LINE;
					nParam = GetUIntValue(str, i, 1);
				}
				else if (!strTag.CompareNoCase(_T("t")))
				{
					nCmd = CMD_TABULATION;
					nParam = GetUIntValue(str, i, 1);
				}
				else if (strTag.GetAt(0) == _T('\n'))
				{
					nCmd = CMD_NEW_LINE;
					nParam = 1;
				}
				else if (strTag.GetAt(0) == _T('\t'))
				{
					nCmd = CMD_TABULATION;
					nParam = 1;
				}
				else if (!strTag.CompareNoCase(_T("ct")))
				{
					nCmd = CMD_COLOR_TEXT;
					nParam = GetUIntValue(str, i, (UINT)m_crColor[PPTOOLTIP_COLOR_FG]);
				}
				else if (!strTag.CompareNoCase(_T("cti")))
				{
					nCmd = CMD_COLOR_TEXT;
					nParam = GetUIntValue(str, i, PPTOOLTIP_COLOR_FG);
				}
				else if (!strTag.CompareNoCase(_T("cb")))
				{
					nCmd = CMD_COLOR_BK;
					nParam = GetUIntValue(str, i, (UINT)m_crColor[PPTOOLTIP_COLOR_BK_BEGIN]);
				}
				else if (!strTag.CompareNoCase(_T("cbi")))
				{
					nCmd = CMD_COLOR_BK_INDEX;
					nParam = GetUIntValue(str, i, PPTOOLTIP_COLOR_BK_BEGIN);
				}
				else if (!strTag.CompareNoCase(_T("al")) || !strTag.CompareNoCase(_T("al_l")))
				{
					nAlign = ALIGN_LEFT;
				}
				else if (!strTag.CompareNoCase(_T("al_c")))
				{
					if (!bCalculate)
						nAlign = ALIGN_CENTER;
				}
				else if (!strTag.CompareNoCase(_T("al_r")))
				{
					if (!bCalculate)
						nAlign = ALIGN_RIGHT;
				}
				else if (!strTag.CompareNoCase(_T("hr")))
				{
					sParam = GetStringValue(str, i);
					if (!sParam.IsEmpty())
						nParam = _tcstoul(sParam, 0, 0);
					else
						nParam = 100;
					nCmd = (sParam.Right(1) == _T("%"))? CMD_HORZ_LINE_PERCENT : CMD_HORZ_LINE;
				}
				else if (!strTag.CompareNoCase(_T("img")))
				{
					nCmd = CMD_DRAW_IMAGE;
					sParam = GetStringValue(str, i);
					szIcon = CSize(0, 0);
					//Gets two param
					for (nTemp = 0; nTemp < 2; nTemp++)
					{
						strTag = GetPropertiesOfTag(str, i);
						if (!strTag.CompareNoCase(_T("cx")))
							szIcon.cx = GetUIntValue(str, i, 0);
						else if (!strTag.CompareNoCase(_T("cy")))
							szIcon.cy = GetUIntValue(str, i, 0);
					}
				}
				else if (!strTag.CompareNoCase(_T("ilst")))
				{
					nCmd = CMD_DRAW_IMAGE_LIST;
					nParam = GetUIntValue(str, i, 0);
				}
				else if (!strTag.CompareNoCase(_T("icon")))
				{
					nCmd = CMD_DRAW_ICON;
					nParam = GetUIntValue(str, i, 0);
					szIcon = CSize(0, 0);
					//Gets two param
					for (nTemp = 0; nTemp < 2; nTemp++)
					{
						strTag = GetPropertiesOfTag(str, i);
						if (!strTag.CompareNoCase(_T("cx")))
							szIcon.cx = GetUIntValue(str, i, 0);
						else if (!strTag.CompareNoCase(_T("cy")))
							szIcon.cy = GetUIntValue(str, i, 0);
					}
				}
				else if (!strTag.CompareNoCase(_T("bmp")))
				{
					nCmd = CMD_DRAW_BITMAP;
					nParam = GetUIntValue(str, i, 0);
					sParam.Empty();
					//Gets three param
					for (nTemp = 0; nTemp < 3; nTemp++)
					{
						strTag = GetPropertiesOfTag(str, i);
						if (!strTag.CompareNoCase(_T("mask")))
						{
							sParam = strTag;
							nParam1 = GetUIntValue(str, i, 0xFF00FF);
						}
						else if (!strTag.CompareNoCase(_T("cx")))
							szIcon.cx = GetUIntValue(str, i, 0);
						else if (!strTag.CompareNoCase(_T("cy")))
							szIcon.cy = GetUIntValue(str, i, 0);
					}
				}
				else nCmd = CMD_NONE;
				SearchEndOfTag(str, i);
			}
			else
			{
				//If text to output is exist
				if (bFirstOutput)
				{
					switch (nAlign)
					{
					case ALIGN_CENTER:
						ptCur.x = pt.x + (rect.Width() - m_nLengthLines.GetAt(nLine)) / 2;
						break;
					case ALIGN_RIGHT:
						ptCur.x = pt.x + rect.Width() - m_nLengthLines.GetAt(nLine);
						break;
					}
				}
				szLine = pDC->GetTextExtent(strText);
				if (bCalculate)
					nLineHeight = max(nLineHeight, szLine.cy);
				else
					pDC->TextOut(ptCur.x, ptCur.y + m_nHeightLines.GetAt(nLine) - nHeight, strText);
				ptCur.x += szLine.cx;
				strText = _T("");
				bFirstOutput = FALSE;
				i--;
			}
		}
		else
		{
			nCmd = CMD_NEW_LINE;
			nParam = 1; 
		}
				
		//Prepares to first draw in line
		switch (nCmd)
		{
		case CMD_DRAW_IMAGE:
		case CMD_DRAW_IMAGE_LIST:
		case CMD_DRAW_BITMAP:
		case CMD_DRAW_ICON:
			if (bFirstOutput)
			{
				switch (nAlign)
				{
				case ALIGN_CENTER:
					ptCur.x = pt.x + (rect.Width() - m_nLengthLines.GetAt(nLine)) / 2;
					break;
				case ALIGN_RIGHT:
					ptCur.x = pt.x + rect.Width() - m_nLengthLines.GetAt(nLine);
					break;
				}
				bFirstOutput = FALSE;
			}
			break;
		}
		
		//Executes command
		switch (nCmd)
		{
		case CMD_BOLD:
			//Bold text
			pDC->SelectObject(pOldFont);
			font.DeleteObject();
			lf.lfWeight = m_LogFont.lfWeight;
			if (!bCloseTag)
			{
				lf.lfWeight *= 2;
				if (lf.lfWeight > FW_BLACK)
					lf.lfWeight = FW_BLACK;
			}
			font.CreateFontIndirect(&lf);
			pDC->SelectObject(&font);
			break;
		case CMD_ITALIC:
			//Italic text
			pDC->SelectObject(pOldFont);
			font.DeleteObject();
			lf.lfItalic = bCloseTag ? FALSE : TRUE;
			font.CreateFontIndirect(&lf);
			pDC->SelectObject(&font);
			break;
		case CMD_STRIKE:
			//Strikeout text
			pDC->SelectObject(pOldFont);
			font.DeleteObject();
			lf.lfStrikeOut = bCloseTag ? FALSE : TRUE;
			font.CreateFontIndirect(&lf);
			pDC->SelectObject(&font);
			break;
		case CMD_UNDERLINE:
			//Underline text
			pDC->SelectObject(pOldFont);
			font.DeleteObject();
			lf.lfUnderline = bCloseTag ? FALSE : TRUE;
			font.CreateFontIndirect(&lf);
			pDC->SelectObject(&font);
			break;
		case CMD_COLOR_TEXT:
			//Color of the text
			pDC->SetTextColor((COLORREF)nParam);
			break;
		case CMD_COLOR_TEXT_INDEX:
			//Indexed color of the text
			if (nParam < PPTOOLTIP_MAX_COLORS)
				pDC->SetTextColor(m_crColor[nParam]);
			break;
		case CMD_COLOR_BK:
			//Color of the background
			pDC->SetBkColor((COLORREF)nParam);
			pDC->SetBkMode(bCloseTag ? TRANSPARENT : OPAQUE);
			break;
		case CMD_COLOR_BK_INDEX:
			//Indexed color of the background
			if (nParam < PPTOOLTIP_MAX_COLORS)
			{
				pDC->SetBkColor(m_crColor[nParam]);
				pDC->SetBkMode(bCloseTag ? TRANSPARENT : OPAQUE);
			}
			break;
		case CMD_HORZ_LINE_PERCENT:
			//Horizontal line with percent length
			if (bCalculate)
			{
				percent.SetAt(nLine, percent.GetAt(nLine) + nParam);
				nParam = 0;
			}
			else nParam = ::MulDiv(rect.Width(), nParam, 100);
		case CMD_HORZ_LINE:
			//Horizontal line with absolute length
			//If text to output is exist
			if (!bCalculate)
				DrawHorzLine(pDC, ptCur.x, ptCur.x + nParam, ptCur.y + m_nHeightLines.GetAt(nLine) / 2);
			ptCur.x += nParam;
			break;
		case CMD_DRAW_IMAGE:
			if (!sParam.IsEmpty())
			{
				if (bCalculate)
				{
					szLine = DrawResource(sParam, pDC, ptCur, 0, szIcon, bCalculate);
					nLineHeight = max (nLineHeight, szLine.cy);
				}
				else
					szLine = DrawResource(sParam, pDC, ptCur, m_nHeightLines.GetAt(nLine), szIcon, bCalculate);

				ptCur.x += szLine.cx;
			}
			break;
		case CMD_DRAW_IMAGE_LIST:
			if (m_imgTooltip.m_hImageList != NULL)
			{
				if (bCalculate)
				{
					szLine = DrawIconFromImageList(pDC, ptCur, m_szImage, m_imgTooltip, nParam, bCalculate);
					nLineHeight = max (nLineHeight, szLine.cy);
				}
				else
				{
					szLine = DrawIconFromImageList(pDC, ptCur, m_szImage, m_imgTooltip, nParam, bCalculate);
				}
				// If in one line a few bitmap with different height, then store max height
				ptCur.x += szLine.cx; //m_szImage.cx;
			}
			break;
		case CMD_DRAW_BITMAP:
			if (nParam != 0)
			{
				if (bCalculate)
				{
					szLine = DrawBitmap(pDC, ptCur, 0, nParam, !sParam.IsEmpty(), nParam1, szIcon, bCalculate);
					nLineHeight = max (nLineHeight, szLine.cy);
				}
				else
				{
					szLine = DrawBitmap(pDC, ptCur, m_nHeightLines.GetAt(nLine), nParam, !sParam.IsEmpty(), nParam1, szIcon, bCalculate);
				}
				// If in one line a few bitmap with different height, then store max height
				ptCur.x += szLine.cx;
			}
		case CMD_DRAW_ICON:
			if (nParam != 0)
			{
				if (bCalculate)
				{
					szLine = DrawIcon(pDC, ptCur, 0, nParam, szIcon, bCalculate);
					nLineHeight = max (nLineHeight, szLine.cy);
				}
				else
				{
					szLine = DrawIcon(pDC, ptCur, m_nHeightLines.GetAt(nLine), nParam, szIcon, bCalculate);
				}
				// If in one line a few bitmap with different height, then store max height
				ptCur.x += szLine.cx;
			}
			break;
		case CMD_NEW_LINE:
			//New line
			if (!nParam)
				nParam = 1;
			if (bCalculate)
			{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区日产乱码| 日本一区二区三级电影在线观看| 欧美午夜电影网| 欧美三级日韩在线| 精品日韩欧美一区二区| 久久久久久97三级| 一个色综合av| 免费观看一级欧美片| 成人免费看的视频| 日本乱人伦aⅴ精品| 欧美一区永久视频免费观看| 国产亚洲精品精华液| 亚洲色图在线播放| 美女一区二区在线观看| 一本色道久久综合亚洲精品按摩| 欧美一区二区不卡视频| 日韩美女啊v在线免费观看| 亚洲美女一区二区三区| 一区二区三区在线视频观看58| 麻豆国产一区二区| 色综合久久久久综合99| 26uuu国产日韩综合| 亚洲五月六月丁香激情| 春色校园综合激情亚洲| 日韩精品一区二区三区四区| 亚洲精品免费在线播放| 国产麻豆精品在线| 国产白丝网站精品污在线入口| 欧美在线不卡视频| 国产欧美精品一区二区三区四区| 国产精品国产三级国产有无不卡 | 久久不见久久见免费视频7| 成人av在线资源网| 欧美精品一区二区三区蜜桃视频| 五月激情综合婷婷| 91麻豆免费视频| 日韩欧美色综合| 欧美日韩免费在线视频| 精品一区在线看| 91久久国产最好的精华液| 欧美一级午夜免费电影| 亚洲国产精品麻豆| 国产精品久久久久久久久快鸭 | 2021久久国产精品不只是精品| 成人一道本在线| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美特级限制片免费在线观看| 精品国产一区二区亚洲人成毛片| 欧美四级电影在线观看| 一区二区三区在线观看视频| 一本一道波多野结衣一区二区| 中文字幕亚洲一区二区av在线 | 韩国精品免费视频| 精品久久久久久综合日本欧美| 一区二区三区在线视频播放| 欧美色成人综合| 亚洲永久精品大片| 欧美主播一区二区三区| 亚洲成a人片在线不卡一二三区 | 欧美videofree性高清杂交| 三级亚洲高清视频| 在线成人免费视频| 老汉av免费一区二区三区| 欧美白人最猛性xxxxx69交| 韩国女主播一区二区三区| www久久精品| 成人免费高清在线| 亚洲另类在线制服丝袜| 欧美日韩国产免费| 久久9热精品视频| 中文字幕精品一区二区三区精品| 成人久久18免费网站麻豆| www成人在线观看| 国产成+人+日韩+欧美+亚洲| 亚洲图片激情小说| 91精品国产综合久久福利| 麻豆91免费观看| 中文字幕精品一区二区三区精品| 91网站最新网址| 性感美女极品91精品| 91精品国产91久久久久久最新毛片| 精品无码三级在线观看视频| 国产精品色在线| 成人午夜在线视频| 亚洲h在线观看| 日韩欧美的一区| 蜜桃精品视频在线| 日韩久久精品一区| 成人激情免费网站| 亚洲免费观看高清完整版在线观看熊 | 国产成a人亚洲| 亚洲乱码国产乱码精品精98午夜| 欧美日韩综合不卡| 国产一区在线视频| 亚洲天天做日日做天天谢日日欢| 欧美日韩国产美| 国产盗摄视频一区二区三区| 亚洲成av人片在www色猫咪| 亚洲精品美国一| 国产精品白丝av| 欧美国产乱子伦| 91传媒视频在线播放| 国产成人精品午夜视频免费| 午夜久久久久久久久久一区二区| 亚洲国产精品精华液2区45| 91精品国产免费| 在线亚洲一区二区| 成人听书哪个软件好| 日本亚洲电影天堂| 亚洲国产三级在线| 中文字幕一区三区| 2020国产精品自拍| 91精品国产综合久久小美女| 色哟哟一区二区| 久久se这里有精品| 亚洲久草在线视频| 亚洲国产精品国自产拍av| 91精品一区二区三区久久久久久| 国产欧美1区2区3区| 欧美精品亚洲一区二区在线播放| 亚洲码国产岛国毛片在线| 91.com在线观看| 波多野结衣中文一区| 国产在线视频一区二区| 麻豆91在线播放免费| 日本中文字幕一区二区视频| 亚洲超碰精品一区二区| 又紧又大又爽精品一区二区| 亚洲婷婷综合色高清在线| 日韩精品一区二区三区三区免费| 91激情五月电影| 欧美综合欧美视频| 欧美性色欧美a在线播放| 91福利在线免费观看| 日本高清不卡在线观看| 91激情五月电影| 在线免费观看一区| 欧洲精品视频在线观看| 在线免费观看日本欧美| 欧美午夜视频网站| 欧美四级电影网| 91精品欧美一区二区三区综合在 | 日本韩国欧美在线| 91麻豆国产福利在线观看| 91美女片黄在线观看91美女| 99视频在线精品| 一本色道综合亚洲| 欧美日韩极品在线观看一区| 欧美精品粉嫩高潮一区二区| 欧美日韩你懂得| 日本精品一区二区三区四区的功能| 欧美视频在线观看一区| 色综合久久久久网| 欧美乱妇一区二区三区不卡视频| 欧美男同性恋视频网站| 日韩欧美在线综合网| 久久综合狠狠综合久久综合88 | 欧美mv日韩mv| 中文字幕成人av| 樱花影视一区二区| 亚洲国产综合人成综合网站| 精品在线观看免费| 欧美日本视频在线| 国产精品欧美一区二区三区| 中文字幕一区二区三区精华液 | 亚洲青青青在线视频| 五月激情综合网| 高清免费成人av| 欧美日韩成人在线一区| 久久久综合网站| 亚洲午夜视频在线| 国内成人免费视频| 色综合天天综合在线视频| 日韩免费高清av| 水蜜桃久久夜色精品一区的特点| 99久久99久久久精品齐齐| 26uuu色噜噜精品一区| 免费观看91视频大全| 在线视频综合导航| 亚洲欧美一区二区在线观看| 久久爱www久久做| 日韩一区二区三区免费看| 久久综合色婷婷| 色综合天天综合给合国产| 欧美视频在线播放| 国产99久久久精品| 国产乱子轮精品视频| 美日韩一区二区三区| 国产真实乱子伦精品视频| 蜜臀av一区二区在线免费观看 | 久久欧美一区二区| 精品美女一区二区| 日韩中文字幕区一区有砖一区 | 成人免费看的视频| 精品国产伦一区二区三区免费 | 国产精品资源在线| 日韩一级成人av| 麻豆精品视频在线观看免费| 这里只有精品电影| 天堂va蜜桃一区二区三区漫画版 |