当前位置: 首页>>代码示例>>C++>>正文


C++ CWindowGc::SetUnderlineStyle方法代码示例

本文整理汇总了C++中CWindowGc::SetUnderlineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::SetUnderlineStyle方法的具体用法?C++ CWindowGc::SetUnderlineStyle怎么用?C++ CWindowGc::SetUnderlineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWindowGc的用法示例。


在下文中一共展示了CWindowGc::SetUnderlineStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawCurrentDay

void CCalendarManagerContainer::DrawCurrentDay(CWindowGc& gc, MAknsSkinInstance* p_BgSkin, const TRgb& p_Default_Select_Color, const CFont& p_Font) const
	{
	TInt i_Col = (g_CalendarClass->g_SelectDay + g_CalendarClass->g_FirstWeek - 1) % 7 + 2;
	TInt i_Row = (g_CalendarClass->g_SelectDay + g_CalendarClass->g_FirstWeek - 1) / 7 + 1;
	
	TInt i_Pos_X = (i_Col - 1) * g_Space_X + i_Col - 1;
	TInt i_Pos_Y = (i_Row - 1) * g_Space_Y + (i_Row - 1) * 2 + g_Pos_Y;
		
	TRect i_OuterRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X + 1, i_Pos_Y + g_Space_Y + 2);
	i_OuterRect.Shrink(2, 2);
	TRect i_InnerRect(i_OuterRect);
	i_InnerRect.Shrink(4, 4);
	
	AknsDrawUtils::DrawFrame(p_BgSkin, gc, i_OuterRect, i_InnerRect, KAknsIIDQsnFrList, KAknsIIDQsnFrListCenter);
	
	gc.SetPenColor(p_Default_Select_Color);
	TBuf<5> i_Num;
	i_Num.AppendNum(g_CalendarClass->g_SelectDay);	
	
	if (g_CalendarClass->g_SelectYear == g_CalendarClass->g_Year && g_CalendarClass->g_SelectMonth == g_CalendarClass->g_Month && g_CalendarClass->g_SelectDay == g_CalendarClass->g_Day)		
		gc.SetUnderlineStyle(EUnderlineOn);		
	else				
		gc.SetUnderlineStyle(EUnderlineOff);
				
	gc.DrawText(i_Num, TRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X, i_Pos_Y + g_Space_Y), (g_Space_Y - p_Font.HeightInPixels()) / 2 + p_Font.HeightInPixels() + 1, CGraphicsContext::ECenter, 0);	
	}
开发者ID:hihua,项目名称:hihuacode,代码行数:26,代码来源:CalendarManagerContainer.cpp

示例2: DrawWeek

void CCalendarManagerContainer::DrawWeek(CWindowGc& gc, const TRect& aRect, const TRgb& p_Default_Font_Color1, const CFont& p_Font) const
	{
	gc.SetPenColor(p_Default_Font_Color1);
	gc.SetUnderlineStyle(EUnderlineOff);
	
	TInt i_Pos_X = 0;
	TInt i_Pos_Y = g_Pos_Y;
	
	for (TInt i = 0;i < sizeof(g_CalendarClass->g_Week) / sizeof(TInt);i++)
		{
		TBuf<10> i_Num;
		i_Num.AppendNum(g_CalendarClass->g_Week[i]);
		
		gc.DrawText(i_Num, TRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X, i_Pos_Y + g_Space_Y), (g_Space_Y - p_Font.HeightInPixels()) / 2 + p_Font.HeightInPixels() + 1, CGraphicsContext::ECenter, 0);
		i_Pos_Y += g_Space_Y + 2;
		}					
	}
开发者ID:hihua,项目名称:hihuacode,代码行数:17,代码来源:CalendarManagerContainer.cpp

示例3: DrawDay

void CCalendarManagerContainer::DrawDay(CWindowGc& gc, const TRect& aRect, const TRgb& p_Default_Font_Color1, const TRgb& p_Default_Font_Color2, const CFont& p_Font) const
	{
	gc.SetPenColor(p_Default_Font_Color1);
	
	TInt i_Total = 0;
	TInt i_WeekPos = g_CalendarClass->g_FirstWeek;	
	//TInt i_Pos_X = g_Space_X * (i_WeekPos + 1) + i_WeekPos + 1;
	//TInt i_Pos_Y = g_Pos_Y;
	
	TInt i_Pos_X = g_Space_X + 1;
	TInt i_Pos_Y = g_Pos_Y;
	
	if (i_WeekPos != 7)
		{
		gc.SetPenColor(p_Default_Font_Color2);
		for (TInt i = g_CalendarClass->g_MaxDay_PreMonth - i_WeekPos + 1;i <= g_CalendarClass->g_MaxDay_PreMonth;i++)
			{
			TBuf<5> i_Num;
			i_Num.AppendNum(i);
			
			gc.DrawText(i_Num, TRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X, i_Pos_Y + g_Space_Y), (g_Space_Y - p_Font.HeightInPixels()) / 2 + p_Font.HeightInPixels() + 1, CGraphicsContext::ECenter, 0);
			
			i_Pos_X += g_Space_X + 1;
			i_Total++;
			}
		}
	
	i_Pos_X = g_Space_X * (i_WeekPos + 1) + i_WeekPos + 1;
	
	for (TInt i = 1; i <= g_CalendarClass->g_MaxDay; i++)
		{
		TBuf<5> i_Num;
		i_Num.AppendNum(i);
		
		if (i_WeekPos == 0)
			gc.SetPenColor(KRgbRed);
		else
			gc.SetPenColor(p_Default_Font_Color1);
			
		if (g_CalendarClass->g_SelectYear == g_CalendarClass->g_Year && g_CalendarClass->g_SelectMonth == g_CalendarClass->g_Month && i == g_CalendarClass->g_Day)			
			gc.SetUnderlineStyle(EUnderlineOn);		
		else			
			gc.SetUnderlineStyle(EUnderlineOff);			
		
		gc.DrawText(i_Num, TRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X, i_Pos_Y + g_Space_Y), (g_Space_Y - p_Font.HeightInPixels()) / 2 + p_Font.HeightInPixels() + 1, CGraphicsContext::ECenter, 0);
				
		i_WeekPos++;		
		if (i_WeekPos >= 7)
			{
			i_WeekPos = 0;			
			i_Pos_Y += g_Space_Y + 2;			
			}				
		
		i_Pos_X = g_Space_X * (i_WeekPos + 1) + i_WeekPos + 1;
		i_Total++;
		}
	
	TInt j = 1;
	gc.SetPenColor(p_Default_Font_Color2);
	for (TInt i = i_Total + 1;i <= 42;i++)
		{
		TBuf<5> i_Num;
		i_Num.AppendNum(j);
		
		gc.DrawText(i_Num, TRect(i_Pos_X, i_Pos_Y, i_Pos_X + g_Space_X, i_Pos_Y + g_Space_Y), (g_Space_Y - p_Font.HeightInPixels()) / 2 + p_Font.HeightInPixels() + 1, CGraphicsContext::ECenter, 0);
		
		i_WeekPos++;		
		if (i_WeekPos >= 7)
			{
			i_WeekPos = 0;			
			i_Pos_Y += g_Space_Y + 2;
			}
			
		i_Pos_X = g_Space_X * (i_WeekPos + 1) + i_WeekPos + 1;		
		j++;
		}
	}
开发者ID:hihua,项目名称:hihuacode,代码行数:77,代码来源:CalendarManagerContainer.cpp


注:本文中的CWindowGc::SetUnderlineStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。