imageeditor/plugins/DrawPlugin/src/CImageLabel.cpp
changeset 10 e7871f3699e6
parent 8 18b321db4884
equal deleted inserted replaced
9:a5c0fe6456b2 10:e7871f3699e6
   272 // ---------------------------------------------------------------------------
   272 // ---------------------------------------------------------------------------
   273 //
   273 //
   274 void CImageLabel::CalculateImagePoint()
   274 void CImageLabel::CalculateImagePoint()
   275 	{
   275 	{
   276 	// landscape 
   276 	// landscape 
   277 	if (iLabelLayout == ELabelHorizontal)
   277 	if (iLabelLayout == ELabelVertical)
   278 		{
   278 		{
   279 		iImageStartPoint.iX = Rect().iTl.iX + 2;
   279 		iImageStartPoint.iX = Rect().iTl.iX + 2;
   280 		iImageStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX)
   280 		iImageStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX)
   281 				+ 2;
   281 				+ 2;
   282 		}
   282 		}
   283 	//portrait
   283 	//portrait
   284 	else if (iLabelLayout == ELabelVertical)
   284 	else if (iLabelLayout ==ELabelHorizontal )
   285 		{
   285 		{
   286 		iImageStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY - Rect().iTl.iY)
   286 		iImageStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY - Rect().iTl.iY)
   287 				+ 2;
   287 				+ 2;
   288 		iImageStartPoint.iY = Rect().iTl.iY + 2;
   288 		iImageStartPoint.iY = Rect().iTl.iY + 2;
   289 		}
   289 		}
   294 // ---------------------------------------------------------------------------
   294 // ---------------------------------------------------------------------------
   295 //
   295 //
   296 void CImageLabel::CalculateBoundingRectStartPoint()
   296 void CImageLabel::CalculateBoundingRectStartPoint()
   297 	{
   297 	{
   298 	// landscape 
   298 	// landscape 
   299 	if (iLabelLayout == ELabelHorizontal)
   299 	if (iLabelLayout == ELabelVertical)
   300 		{
   300 		{
   301 		iBoundingRectStartPoint.iX = Rect().iTl.iX + 1;
   301 		iBoundingRectStartPoint.iX = Rect().iTl.iX + 1;
   302 		iBoundingRectStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX
   302 		iBoundingRectStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX
   303 				- Rect().iTl.iX) + 1;
   303 				- Rect().iTl.iX) + 1;
   304 		}
   304 		}
   305 	//portrait
   305 	//portrait
   306 	else if (iLabelLayout == ELabelVertical)
   306 	else if (iLabelLayout == ELabelHorizontal)
   307 		{
   307 		{
   308 		iBoundingRectStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY
   308 		iBoundingRectStartPoint.iX = Rect().iBr.iX - (Rect().iBr.iY
   309 				- Rect().iTl.iY) + 1;
   309 				- Rect().iTl.iY) + 1;
   310 		iBoundingRectStartPoint.iY = Rect().iTl.iY + 1;
   310 		iBoundingRectStartPoint.iY = Rect().iTl.iY + 1;
   311 		}
   311 		}
   317 // ---------------------------------------------------------------------------
   317 // ---------------------------------------------------------------------------
   318 //
   318 //
   319 void CImageLabel::CalculateTooltipPoint()
   319 void CImageLabel::CalculateTooltipPoint()
   320 	{
   320 	{
   321 	// landscape 
   321 	// landscape 
   322 	if (iLabelLayout == ELabelHorizontal)
   322 	if (iLabelLayout == ELabelVertical)
   323 		{
   323 		{
   324 		CFont* pFont = NULL;
   324 		CFont* pFont = NULL;
   325 		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
   325 		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
   326 		fontSpec.iHeight *= 0.535;
   326 		fontSpec.iHeight *= 0.535;
   327 		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
   327 		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
   329 		iCoeEnv->ScreenDevice()->ReleaseFont(pFont);
   329 		iCoeEnv->ScreenDevice()->ReleaseFont(pFont);
   330 
   330 
   331 		iTooltipStartPoint.iX = Rect().iTl.iX
   331 		iTooltipStartPoint.iX = Rect().iTl.iX
   332 				+ (Rect().Width() - tooltipLength) / 2;
   332 				+ (Rect().Width() - tooltipLength) / 2;
   333 		iTooltipStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX);
   333 		iTooltipStartPoint.iY = Rect().iBr.iY - (Rect().iBr.iX - Rect().iTl.iX);
   334 		}
   334 		} 
   335 	//portrait
   335 	//portrait
   336 	else if (iLabelLayout == ELabelVertical)
   336 	else if (iLabelLayout ==ELabelHorizontal )
   337 		{
   337 		{
   338 		CFont* pFont = NULL;
   338 		CFont* pFont = NULL;
   339 		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
   339 		TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
   340 		fontSpec.iHeight *= 0.535;
   340 		fontSpec.iHeight *= 0.535;
   341 		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
   341 		iCoeEnv->ScreenDevice()->GetNearestFontInTwips(pFont, fontSpec);
   355 //
   355 //
   356 
   356 
   357 void CImageLabel::CalculateZones()
   357 void CImageLabel::CalculateZones()
   358 	{
   358 	{
   359 	// landscape 
   359 	// landscape 
   360 	if (iLabelLayout == ELabelHorizontal)
   360 	if (iLabelLayout == ELabelVertical)
   361 		{
   361 		{
   362 		iBoundingSize.iHeight = Rect().iBr.iX - Rect().iTl.iX - 2;
   362 		iBoundingSize.iHeight = Rect().iBr.iX - Rect().iTl.iX - 2;
   363 		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
   363 		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
   364 
   364 
   365 		iImageSize.iHeight = iBoundingSize.iHeight - 4;
   365 		iImageSize.iHeight = iBoundingSize.iHeight - 4;
   366 		iImageSize.iWidth = iBoundingSize.iWidth - 4;
   366 		iImageSize.iWidth = iBoundingSize.iWidth - 4;
   367 		}
   367 		}
   368 	//portrait
   368 	//portrait
   369 	else if (iLabelLayout == ELabelVertical)
   369 	else if (iLabelLayout ==ELabelHorizontal)
   370 		{
   370 		{
   371 		iBoundingSize.iHeight = Rect().iBr.iY - Rect().iTl.iY - 2;
   371 		iBoundingSize.iHeight = Rect().iBr.iY - Rect().iTl.iY - 2;
   372 		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
   372 		iBoundingSize.iWidth = iBoundingSize.iHeight - 2;
   373 
   373 
   374 		iImageSize.iHeight = iBoundingSize.iHeight - 4;
   374 		iImageSize.iHeight = iBoundingSize.iHeight - 4;