예제 #1
0
/**
 * Draws the aHotKeys text into the graphics context aGc, in the rectangle aRect. By defalut the
 * text is right aligned.
 */
EXPORT_C void LafMenuPane::DrawHotKeyText(const MLafEnv& aLafEnv, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const TDesC& aHotKeysText, const TItemAttributes& aItemAttributes)
	{
	aGc.UseFont(AnnotationFont(aLafEnv));
// Left alignment
	aGc.DrawText(aHotKeysText, aRect, aItemAttributes.iBaseLine, CGraphicsContext::ELeft,KLafSpaceBetweenTextAndHotkey);
	aGc.UseFont(NormalFont(aLafEnv));
	}
예제 #2
0
/**
 * Prepares the graphics context aGc for drawing the items by setting the pen and brush.
 */
EXPORT_C void LafMenuPane::PrepareGcForDrawingItems(const MLafEnv& aLafEnv, const CCoeControl& aMenuPane, CWindowGc& aGc)
	{
	const CFont* font = NormalFont(aLafEnv);
	aGc.UseFont(font);
	aGc.SetPenColor(aLafEnv.ControlColor(EColorMenuPaneText, aMenuPane));
	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	aGc.SetBrushColor(aLafEnv.ControlColor(EColorMenuPaneBackground, aMenuPane));
	}
예제 #3
0
/*
** Get the current rendering style.  In other words, get the style
** that is currently on the top of the style stack.
*/
static HtmlStyle GetCurrentStyle(HtmlWidget *htmlPtr){
  HtmlStyle style;
  if( htmlPtr->styleStack ){
    style = htmlPtr->styleStack->style;
  }else{
    style.font = NormalFont(2);
    style.color = COLOR_Normal;
    style.bgcolor = COLOR_Background;
    style.subscript = 0;
    style.align = ALIGN_Left;
    style.flags = 0;
  }
  return style;
}
예제 #4
0
/**
 * Draws the left adornment to the graphics context aGc, in the rectangle aRect. The menu pane
 * flags determines the type of adornment to be drawn.
 */
EXPORT_C void LafMenuPane::DrawLeftAdornment(const MLafEnv& aLafEnv, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const TItemAttributes& aItemAttributes)
	{
// Brush the background of the rect.
	aGc.SetPenStyle(CGraphicsContext::ENullPen);
	aGc.DrawRect(aRect);
	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
	const TInt itemFlags = aItemAttributes.iFlags;
	if (itemFlags&EEikMenuItemSymbolOn)
		{
		if (itemFlags&EEikMenuItemCheckBox)
			{
			TRect rect = aRect;
			rect.iTl.iY += aItemAttributes.iBaseLine;
			TBuf<1> buf;
			buf.Append(TChar(ESymFontTick));
			aGc.UseFont(SymbolFont(aLafEnv));
			aGc.SetPenStyle(CGraphicsContext::ESolidPen);
			// as the tick is big, ignore KPreLeftAdornment and steal 1 pixels from left.
			aGc.DrawText(buf,TPoint(rect.iTl.iX-1, rect.iTl.iY));
			aGc.UseFont(NormalFont(aLafEnv));
			}
		else if (itemFlags&KLafMenuItemRadio)
			{
			TUid bmpUid(TUid::Uid(KLafUidEikonOptiVal));
			const CFbsBitmap* bitmap = aLafEnv.Bitmap(bmpUid);
			TSize bitsize = bitmap->SizeInPixels();
			TRect butRect(TPoint(0,0), TPoint(bitsize.iWidth,bitsize.iHeight));
			TInt yoffset = (aRect.Size().iHeight - bitsize.iHeight) / 2;
			TInt xoffset = KLafPreLeftAdornmentSpace;
			TPoint offset(xoffset,yoffset);
			if (aItemAttributes.iHighlightType == SLafMenuPane::EDrawHighlight)
				{
				bmpUid=TUid::Uid(KLafUidEikonOptihVal);
				bitmap = aLafEnv.Bitmap(bmpUid);
				}
			bmpUid=TUid::Uid(KLafUidEikonOptimVal);
			const CFbsBitmap* mask = aLafEnv.Bitmap(bmpUid);
			aGc.BitBltMasked((aRect.iTl+offset), bitmap, butRect, mask,ETrue);
			}
		}
	}
예제 #5
0
/**
 * Draws the cascade symbol into the graphics context aGc, in the rectangle aRect and sets
 * the pen color depending on whether the menu item is dimmed or focused.
 */
EXPORT_C void LafMenuPane::DrawRightAdornment(const MLafEnv& aLafEnv, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const TItemAttributes& aItemAttributes)
	{
	const TInt cascadeSize=Min(KLafRightAdornmentSpace,aItemAttributes.iHeight);

// Brush the background of the rect.
	aGc.SetPenStyle(CGraphicsContext::ENullPen);
	aGc.DrawRect(aRect);
	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
	if (aItemAttributes.iInternalFlags&EMenuIsRightAdornment)
		{
		//Sort out rect for cascade symbol
		TRect cascadeRect=TRect(TPoint(aRect.iBr.iX-cascadeSize-PostRightAdornmentSpace(),aItemAttributes.iHPosition),
					TSize(cascadeSize,aItemAttributes.iHeight));
		cascadeRect.iTl.iY+=((aItemAttributes.iHeight-cascadeSize)/2);
		cascadeRect.iBr.iY-=((aItemAttributes.iHeight-cascadeSize)/2);
		TBuf<1> cascade;
		cascade.Append(TChar(ESymFontMenuCascade));
		aGc.UseFont(SymbolFont(aLafEnv));
		aGc.DrawText(cascade,cascadeRect,cascadeRect.Height(),CGraphicsContext::ERight);
		aGc.UseFont(NormalFont(aLafEnv));
		}
	}