void CRecognizerContainer::ConstructL(const TRect& aRect, CAknView* View, TBool navi) { CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("ConstructL")); iView=View; iNavi=navi; iCurrentCodeArray=new RPointerArray<CCodeInfo>; iScreenMsgBuf = CEikonEnv::Static()->AllocReadResourceL(R_CODE_SCREEN_MSG); if (iNavi) { CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane(); CAknNavigationControlContainer *np = (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)); CLocalNotifyWindow* tp=CLocalNotifyWindow::Global(); np->PushDefaultL(ETrue); HBufC * t = iEikonEnv->AllocReadResourceL(R_CHOOSE_CODE); tp->SetTitleText(t); } else { // CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane(); CLocalNotifyWindow* tp=CLocalNotifyWindow::Global(); tp->SetTitleTextToDefaultL(); } CreateWindowL(); iStandByLabel = new (ELeave) CEikLabel; iStandByLabel->SetContainerWindowL(*this); iStandByLabel->SetTextL(_L("Camera Standby\nClick to resume")); iStandByLabel->SetAlignment(TGulAlignment(EHCenterVCenter)); iStandByLabel->SetExtent(TPoint(0,0), TSize(176,144)); SetRect(aRect); ActivateL(); }
void CFontSizeTestControl::Draw(const TRect& aRect) const { CWindowGc& gc = SystemGc(); gc.SetBrushColor(iBackgroundColor); // get the nearest font matching the desired height CFont* font = NULL; TFontSpec fontSpec; fontSpec.iTypeface.iName = KNokiaSeries60Font; fontSpec.iHeight = iFontSize; CWsScreenDevice* screen = CCoeEnv::Static()->ScreenDevice(); ASSERT(screen->GetNearestFontToDesignHeightInPixels(font, fontSpec) == KErrNone); iBidiText->WrapText(aRect.Width() - ESideBearingsAllowance, *font, NULL, EMaximumTextLines); // it's recommended to create the text drawer in the actual draw function XCoeTextDrawer textDrawer(TextDrawer()); textDrawer->SetMargins(iMargin); textDrawer->SetAlignment(TGulAlignment(EHCenterVCenter)); textDrawer->SetTextColor(KRgbBlack); textDrawer->SetLineGapInPixels(EGapBetweenTextLines); textDrawer.SetClipRect(aRect); textDrawer.DrawText(gc, *iBidiText, aRect, *font); // Release font, otherwise there are problems deleting iScreen (still holds references) screen->ReleaseFont(font); // Draw font 1 pixel larger or smaller next time. if (iIncreaseFontSize) { ++iFontSize; } else { if (iFontSize > 1) { --iFontSize; } } }