예제 #1
0
파일: Container3.cpp 프로젝트: Tumunu/Mp
void CContainer3::InitiateDraw() const
{
	Window().Invalidate();
	ActivateGc();
	Window().BeginRedraw();

	DrawRequiredControls();

	Window().EndRedraw();
	DeactivateGc();
}
	virtual void StepDone() {
		++iDone;
		CWindowGc& gc = SystemGc();
		ActivateGc();

		TRgb front(216, 214, 214);
		TRect progress( TPoint(progress_left, progress_top), TSize(progress_width, progress_height) );
		progress.SetSize( TSize( progress_width * iDone/iSteps, progress_height ) );
		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		gc.SetBrushColor(front);
		progress.SetSize( TSize( progress_width * iDone/iSteps, progress_height ) );
		gc.DrawRect(progress);
		iEikonEnv->Flush();
		DeactivateGc();
	}
void CGuideContainer::CalculatePortraitLayout() 
{
#ifdef NAV2_CLIENT_SERIES60_V3
   ActivateGc();
   CWindowGc& gc = SystemGc();
   gc.Clear(iCurrStreetLabel->Rect());
   SetLabelExtent(iCurrStreetLabel, CURRSTREET_LABEL_POS, ETrue);
   gc.Clear(iNextStreetLabel->Rect());
   SetLabelExtent(iNextStreetLabel, NEXTSTREET_LABEL_POS, ETrue);
   gc.Clear(iDistanceLabel->Rect());
   SetLabelExtent(iDistanceLabel, DISTANCE_LABEL_POS);

   CEikLabel* instructionLabel = GetTalkingLabel();
   
   // Resets the Edwin control for the screen reader
   gc.Clear(instructionLabel->Rect());
   SetLabelExtent(instructionLabel, TEXT_INSTRUCTION_POS);
	
   DeactivateGc();
   if (iProgressBar) {
      iProgressBar->SetSizeAndPosition(TRect( WFLayoutUtils::
                                              CalculatePosUsingMainPane( PROGRESS_BAR_POS ), 
                                              WFLayoutUtils::
                                              CalculateSizeUsingMainPane( 40, 90 ) ) );
   } else {
      iProgressBar = 
         CGuideProgressBar::NewL(*this, 
                                 TRect( WFLayoutUtils::CalculatePosUsingMainPane( PROGRESS_BAR_POS ), 
                                        WFLayoutUtils::CalculateSizeUsingMainPane( 40, 90 ) ), 
                                 iView->GetMbmName(),  
                                 EMbmWficonsProgress_triangle_grey,
                                 EMbmWficonsProgress_triangle_blue,
                                 EMbmWficonsProgress_triangle_grey_mask,
                                 EMbmWficonsProgress_bar_grey,
                                 EMbmWficonsProgress_bar_blue,
                                 EMbmWficonsProgress_bar_grey_mask);
   }
   
   TRect rect = WFLayoutUtils::GetMainPaneRect();
   CreatePictureL(iGuidePicture, rect, GUIDE_PICTURE_POS, 100, 100);
   //    CreatePictureL(iNextTurnPicture, rect, NEXT_TURN_PICTURE_POS, 24, 24);
   //    CreatePictureL(iDetourPicture, rect, DETOUR_PICTURE_POS, 24, 24);
   SetImage(iNextTurnPicture,
            iGuidePicture->GetRect(),
            &TopRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iDetourPicture,
            iGuidePicture->GetRect(),
            &LowerLeft, 0.24, 0.24, 
            WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   SetImage(iSpeedCamPicture, 
            iGuidePicture->GetRect(),
            &LowerRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   iDetourPicture->SetShow(EFalse);
   iSpeedCamPicture->SetShow(EFalse);
   
   iDetourPicture->CreateIconL(iView->GetMbmName(), 
                               EMbmWficonsDetour_square, 
                               EMbmWficonsDetour_square_mask);
   iSpeedCamPicture->CreateIconL(iView->GetMbmName(), 
                                 EMbmWficonsSpeedcamera_square, 
                                 EMbmWficonsSpeedcamera_square);

   TRect exitRect = Center(iGuidePicture->GetRect(), 
                           TRect(TPoint(), 
                                 WFLayoutUtils::
                                 CalculateSizeUsingSize(iGuidePicture->GetSize(), 
                                                        0.26, 0.16)));

   if (iExitPicture) {
      iExitPicture->SetImageRect(exitRect);
   } else {
      iExitPicture = CImageHandler::NewL(exitRect);
   }
   iExitPicture->SetShow(EFalse);

   // XXX Temporary removed until the above lines are tested.
   // CreatePictureL(iExitPicture, rect, EXIT_PICTURE_POS, 26, 16);

#endif
}
void CGuideContainer::CalculateLandscapeLayout()
{
#ifdef NAV2_CLIENT_SERIES60_V3
   // Landscape mode!

   // Clear all labeltexts before setting the new extent,
   // by doing this we will get rid of the text in the
   // old positions.
   ActivateGc();
   CWindowGc& gc = SystemGc();
   gc.Clear(iCurrStreetLabel->Rect());
   SetLabelExtent(iCurrStreetLabel, 
                  CURR_STREET_LABEL_X_LS, 
                  CURR_STREET_LABEL_Y_LS, 
                  ETrue);
   gc.Clear(iNextStreetLabel->Rect());
   SetLabelExtent(iNextStreetLabel, 
                  NEXT_STREET_LABEL_X_LS, 
                  NEXT_STREET_LABEL_Y_LS, 
                  ETrue);
   gc.Clear(iDistanceLabel->Rect());
   SetLabelExtent(iDistanceLabel, 
                  DIST_STREET_LABEL_X_LS, 
                  DIST_STREET_LABEL_Y_LS);
   // Resets the Edwin control for the screen reader
   CEikLabel* instructionLabel = GetTalkingLabel();
   gc.Clear(instructionLabel->Rect());
   SetLabelExtent(instructionLabel, 
                  TEXT_INSTRUCTION_X_LS, 
                  TEXT_INSTRUCTION_Y_LS);
	
   DeactivateGc();
   if (iGuidePicture) {
      // Recalculate
      iGuidePicture->SetImageRect(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.1, 0.15),
                                        WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.45, 0.70)));
   } else {
      iGuidePicture = 
         CImageHandler::NewL(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.1, 0.15),
                                   WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.45, 0.70)));
   }
   if (iProgressBar) {
      iProgressBar->SetSizeAndPosition(TRect(WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.7, 0.15),
                                             WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.20, 0.6)));
   } else {
      iProgressBar = 
         CGuideProgressBar::NewL(*this, 
                                 TRect( WFLayoutUtils::CalculatePosUsingMainPaneFloat(0.7, 0.15), 
                                        WFLayoutUtils::CalculateSizeUsingMainPaneFloat(0.20, 0.6)), 
                                 iView->GetMbmName(),  
                                 EMbmWficonsProgress_triangle_grey,
                                 EMbmWficonsProgress_triangle_blue,
                                 EMbmWficonsProgress_triangle_grey_mask,
                                 EMbmWficonsProgress_bar_grey,
                                 EMbmWficonsProgress_bar_blue,
                                 EMbmWficonsProgress_bar_grey_mask);
   }

   SetImage(iNextTurnPicture,
            iGuidePicture->GetRect(),
            &TopRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iDetourPicture,
            iGuidePicture->GetRect(),
            &LowerLeft, 0.24, 0.24, 
            WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
   
   SetImage(iSpeedCamPicture,
            iGuidePicture->GetRect(),
            &LowerRight, 0.24, 0.24, 
            -WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
            -WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));

   iDetourPicture->SetShow(EFalse);
   iSpeedCamPicture->SetShow(EFalse);

   iDetourPicture->CreateIconL(iView->GetMbmName(), 
                               EMbmWficonsDetour_square, 
                               EMbmWficonsDetour_square_mask);
   iSpeedCamPicture->CreateIconL(iView->GetMbmName(), 
                                 EMbmWficonsSpeedcamera_square, 
                                 EMbmWficonsSpeedcamera_square);
   
   TRect exitRect = Center(iGuidePicture->GetRect(), 
                           TRect(TPoint(), 
                                 WFLayoutUtils::
                                 CalculateSizeUsingSize(iGuidePicture->GetSize(), 
                                                        0.26, 0.16)));
   if (iExitPicture) {
      iExitPicture->SetImageRect(exitRect);
   } else {
      iExitPicture = CImageHandler::NewL(exitRect);
   }
   iExitPicture->SetShow(EFalse);
#endif
}
// -----------------------------------------------------------------------------
// CTestTitlePaneControl::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestTitlePaneControl::DoDeactivateGc()
    {
    DeactivateGc();
    }
// -----------------------------------------------------------------------------
// CTestDOMGridsContainer::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestDOMGridsContainer::DoDeactivateGc()
    {
    DeactivateGc();
    }
void CSysApShutdownImage::ShowShutdownImageL(TInt aBitmapId)
    {
    TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL:start" ) ) );
    
    TInt err ( 0 );
    TRect rect(iCoeEnv->ScreenDevice()->SizeInPixels());
    SetRect(rect);
    TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SetRect --Minus one" ) ) );
    ActivateL();

    TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ActivateL --Zero" ) ) );

    if ( aBitmapId )
        {
        _LIT( KDirAndFile, "z:qgn_sysap_screen.svg" );
        TParse* fp = new (ELeave) TParse();
        CleanupStack::PushL(fp);
        fp->Set( KDirAndFile, &KDC_APP_BITMAP_DIR, NULL );
        TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL shutdown image: %S" ), &(fp->FullName())) );
        RFs fs;

        err = fs.Connect();
        if ( err == KErrNone )
            {
            CleanupClosePushL(fs);
            TFindFile findFile( fs );
            err = findFile.FindByPath( fp->FullName(), NULL );

            if ( err != KErrNone )
                {
                TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL: shutdown image not found, err=%d"), err ) );
                }
            else
                {
                delete iBitmap;
                iBitmap = NULL;
                // Ownership of bitmap is transferred to CSysApShutdownImage in CreateIconL
                iBitmap = ReadSVGL(fp->FullName());
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ReadSVGL --First" ) ) );
                TInt xDelta=0; // for x coordinates
                TInt yDelta=0; // for y coordinates
                TSize bmpSizeInPixels = iBitmap->SizeInPixels();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SizeInPixels --Second" ) ) );
                //center image to the center of the screen
                TRect rect = Rect();
                xDelta=( rect.Width() - bmpSizeInPixels.iWidth ) / 2;
                yDelta=( rect.Height() - bmpSizeInPixels.iHeight ) / 2;
                TPoint pos = TPoint( xDelta , yDelta ); // displacement vector
                //pos += rect.iTl; // bitmap top left corner position
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:TPoint --Three" ) ) );
                CWindowGc& gc = SystemGc();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:SystemGc --Four" ) ) );
                ActivateGc();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:ActivateGc --Five" ) ) );
                Window().Invalidate( rect );
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:Invalidate --Six" ) ) );
                Window().BeginRedraw( rect );
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:BeginRedraw --Seven" ) ) );
                gc.Clear();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.Clear --Eight" ) ) );
                gc.BitBlt( pos, iBitmap ); // CWindowGc member function
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.BitBlt --Nine" ) ) );
                Window().EndRedraw();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.EndRedraw --Ten" ) ) );
                DeactivateGc();
                TRACES( RDebug::Print(_L("CSysApShutdownImage::After:gc.DeactivateGc --Eleven" ) ) );
                ControlEnv()->WsSession().Flush(); // force draw of the context
                TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL:end" ) ) );
                }
            }

        CleanupStack::PopAndDestroy(2); //fp, fs
        }
    else
        {
#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION
        DrawDeferred();
#else // RD_STARTUP_ANIMATION_CUSTOMIZATION
        TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL - Bitmap not defined, blank screen only" ) ) );
        CWindowGc& gc = SystemGc();
        ActivateGc();
        Window().Invalidate();
        Window().BeginRedraw();
        gc.SetBrushColor(KRgbWhite);
        gc.Clear();
        Window().EndRedraw();
        DeactivateGc();
        ControlEnv()->WsSession().Flush(); // force draw of the context
#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
        }
    }
// -----------------------------------------------------------------------------
// CTestSettingPage::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestSettingPage::DoDeactivateGc() const
    {
    DeactivateGc();
    }
// -----------------------------------------------------------------------------
// CTestParentControl::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestParentControl::DoDeactivateGc()
    {
    DeactivateGc();
    }
// -----------------------------------------------------------------------------
// CTestDOMListsEffectsContainer::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestDOMListsEffectsContainer::DoDeactivateGc()
    {
    DeactivateGc();
    }
// -----------------------------------------------------------------------------
// CTestTextScrollerContainer::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CTestTextScrollerContainer::DoDeactivateGc()
    {
    DeactivateGc();
    }
// -----------------------------------------------------------------------------
// CAknPopupFormExt::DoDeactivateGc
// -----------------------------------------------------------------------------
//
void CAknPopupFormExt::DoDeactivateGc()
    {
    DeactivateGc();
    }