// ----------------------------------------------------------------------------- // CSIPExGameView::OfferKeyEventL // From CCoeControl. // ----------------------------------------------------------------------------- // TKeyResponse CSIPExGameView::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { if( aType == EEventKeyUp ) { switch( aKeyEvent.iScanCode ) { case EStdKeyLeftArrow: iEngine->CursorLeft(); DrawDeferred(); return EKeyWasConsumed; case EStdKeyRightArrow: iEngine->CursorRight(); DrawDeferred(); return EKeyWasConsumed; case EStdKeyDownArrow: case EStdKeyEnter: case EStdKeyDevice7: // FLOWTHROUGH iEngine->CursorPressed(); DrawDeferred(); return EKeyWasConsumed; default: return EKeyWasNotConsumed; } } return EKeyWasNotConsumed; }
void CHXSplayContainer::ChangeState(CHXSplayAppState::PlayerState newState) { TBuf<KBufLength> text; TBool focus = ETrue; switch(newState) { case CHXSplayAppState::ESplayPlaying : focus = EFalse; iCoeEnv->ReadResource(text, R_PLAYING_TEXT); break; case CHXSplayAppState::ESplayComplete : iCoeEnv->ReadResource(text, R_COMPLETE_TEXT); break; case CHXSplayAppState::ESplayFailed : iCoeEnv->ReadResource(text, R_FAILED_TEXT); break; default: iCoeEnv->ReadResource(text, R_BLANK_TEXT); break; }; // Update control focus m_pCmdLineWin->SetFocus(focus); // Update status text m_pPlaybackStatus->SetTextL(text); m_pPlaybackStatus->SetExtent(STATUS_POS, m_pPlaybackStatus->MinimumSize()); DrawDeferred(); }
void CTerminalContainer::SizeChanged() { GetTerminalRect(iTermRect); if ( iTerminal ) { iTerminal->SetRect(iTermRect); } DrawDeferred(); }
// Set data to the listbox. void CPhotoModeListBox::SetData() { iListbox->HandleItemRemovalL(); SetIconsArray(); CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(2); CleanupStack::PushL(listItems); TBuf<KArrayItemMaxLength> item; _LIT(KTab, "\t"); item.Copy(_L("0")); item.Append(KTab); item.Append(_L("Phone")); listItems->AppendL(item); item.Copy(_L("1")); item.Append(KTab); item.Append(_L("Memory")); listItems->AppendL(item); CleanupStack::Pop(listItems); CTextListBoxModel* model = iListbox->Model(); model->SetItemTextArray(listItems); // Set ListBox model responsible for deleting the listItems array model->SetOwnershipType(ELbmOwnsItemArray); iListbox->HandleItemAdditionL(); DrawDeferred(); }
TInt CFileSelectDialog::Show() { _LOG(_L("CFileSelectDialog::Show()")); TInt sel=0; CDesCArray* itemList = new (ELeave) CDesCArrayFlat(3); if (iCurrentPath.Compare(_L(""))!=0){if (iType==EFolder){iArray->InsertL(0,_L("Select folder"));}iArray->InsertL(0,_L("..."));} _LOGDATA(_L("Length of array: %d"),iArray->Count()); for (TInt i=0;i<iArray->Count();i++) { TBuf<255> ItemTxt; ItemTxt.Copy(_L("0\t")); ItemTxt.Append(iArray->MdcaPoint(i)); ItemTxt.Append(_L("\t\t")); itemList->AppendL(ItemTxt); _LOGDATA(_L("Item: %S"),&iArray->MdcaPoint(i)); } _LOG(_L("Will create dialog")); SetItemTextArray(itemList); ListBox()->HandleItemAdditionL(); Layout(); ListBox()->SetCurrentItemIndex(0); ListBox()->DrawNow(); DrawDeferred(); }
// Set data to the listbox. void CMessageListBox::SetData() { iListbox->HandleItemRemovalL(); SetIconsArray(); CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(2); CleanupStack::PushL(listItems); TBuf<KArrayItemMaxLength> item; _LIT(KTab, "\t"); item.Copy(_L("0")); item.Append(KTab); item.Append(*iEikonEnv->AllocReadResourceL(R_TAB_INBOX)); listItems->AppendL(item); item.Copy(_L("1")); item.Append(KTab); item.Append(*iEikonEnv->AllocReadResourceL(R_TAB_SENTITEMS)); listItems->AppendL(item); CleanupStack::Pop(listItems); CTextListBoxModel* model = iListbox->Model(); model->SetItemTextArray(listItems); // Set ListBox model responsible for deleting the listItems array model->SetOwnershipType(ELbmOwnsItemArray); iListbox->HandleItemAdditionL(); DrawDeferred(); }
// --------------------------------------------------------- // CCommonDialogsExContainer::ShowTextL // Show dynamic text; // --------------------------------------------------------- // void CCommonDialogsExContainer::ShowTextL( const TDesC& aText, const TDesC& aTextSub) { iLabel->SetTextL(aText); iToDoLabel->SetTextL(aTextSub); SizeChanged(); DrawDeferred(); }
void CTcContainer::Update( CTcTestRunner& aRunner ) { // Update "Value" labels SetLabelText( ETestCaseValue, aRunner.CurrentTestCaseName() ); SetLabelText( ERequestValue, aRunner.CurrentRequestName() ); // Force screen update NOW DrawDeferred(); CEikonEnv::Static()->WsSession().Flush(); }
// ----------------------------------------------------------------------------- // CLandmarksEditDialog::EditCategoriesL // // (other items were commented in a header). // ----------------------------------------------------------------------------- // void CLandmarksEditDialog::EditCategoriesL() { TInt res = CLandmarksCategoriesDialog::RunDialogL(*iLmCategoriesModel); if (res) { ConfigureCategoryFieldL(); DrawDeferred(); SetChangesPending(ETrue); } }
// --------------------------------------------------------------------------- // CWmDrmDlaBrowserContainer::HandleResourceChange // --------------------------------------------------------------------------- // void CWmDrmDlaBrowserContainer::HandleResourceChange( TInt aType ) { CCoeControl::HandleResourceChange( aType ); if ( aType == KEikDynamicLayoutVariantSwitch ) { SetRect( iView->ClientRect() ); DrawDeferred(); } }
// --------------------------------------------------------------------------- // From class CCoeControl. // CAknSignalPane::HandleResourceChange // Handles resource change events. // --------------------------------------------------------------------------- // EXPORT_C void CAknSignalPane::HandleResourceChange( TInt aType ) { CCoeControl::HandleResourceChange( aType ); if ( aType == KEikDynamicLayoutVariantSwitch ) { DrawDeferred(); } if ( aType == KEikColorResourceChange || aType == KAknsMessageSkinChange ) { if ( iSignalIconControl ) { iSignalIconControl->SetColorIndex( 0 ); // reset skin color } SizeChanged(); // Sizechanged updates the color DrawDeferred(); } }
void CRecognizerContainer::StopDisplay() { CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("StopDisplay")); if (owns_bitmap) delete iBitmap; iBitmap=0; delete iVCS; iVCS=0; delete iCurrentCodeInfo; iCurrentCodeInfo=0; iCurrentCodeArray->Reset(); iStandByLabel->MakeVisible(ETrue); DrawDeferred(); }
// --------------------------------------------------------- // CCertManUIContainerAuthority::HandleResourceChange // // --------------------------------------------------------- // void CSecModUIContainerBase::HandleResourceChange(TInt aType) { CCoeControl::HandleResourceChange(aType); if (aType == KEikDynamicLayoutVariantSwitch) { TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); SetRect(mainPaneRect); DrawDeferred(); } }
void CBuddycloudListComponent::RenderScreen() { // Draw skin AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(), iBgContext, this, *iBufferGc, TPoint(0,0), Rect(), KAknsDrawParamDefault); // Call list renderer RenderListItems(); // Activity dialog if(iShowMialog) { TBuf<256> aMialogLine1(iBuddycloudLogic->GetActivityStatus().Left(256)); TBuf<256> aMialogLine2; iBufferGc->SetClippingRect(iRect); if(aMialogLine1.Length() > 0) { // Draw Activity Status TInt aSearch = aMialogLine1.Locate('\n'); if(aSearch != KErrNotFound) { aMialogLine2.Copy(aMialogLine1); aMialogLine1.Delete(aSearch, aMialogLine1.Length()); aMialogLine2.Delete(0, (aSearch + 1)); // Redraw frame background & frame TInt aMialogHeight = (iSecondaryItalicFont->FontMaxHeight() * 2) + 4; TInt aLongestLine = (iSecondaryItalicFont->TextWidthInPixels(aMialogLine1) > iSecondaryItalicFont->TextWidthInPixels(aMialogLine2) ? iSecondaryItalicFont->TextWidthInPixels(aMialogLine1) : iSecondaryItalicFont->TextWidthInPixels(aMialogLine2)); TRect aFrame = TRect((iRect.Width() - aLongestLine - 35), (iRect.Height() - aMialogHeight), (iRect.Width() - 25), (iRect.Height() + 5)); AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(), iBgContext, this, *iBufferGc, aFrame.iTl, aFrame, KAknsDrawParamDefault); RenderItemFrame(aFrame); iBufferGc->SetPenColor(iColourTextSelected); iBufferGc->UseFont(iSecondaryItalicFont); iBufferGc->DrawText(iTextUtilities->BidiLogicalToVisualL(aMialogLine1), TPoint((iRect.Width() - aLongestLine - 31), (iRect.Height() - iSecondaryItalicFont->FontMaxHeight() - iSecondaryItalicFont->FontMaxDescent() - 2))); iBufferGc->DrawText(iTextUtilities->BidiLogicalToVisualL(aMialogLine2), TPoint((iRect.Width() - aLongestLine - 31), (iRect.Height() - iSecondaryItalicFont->FontMaxDescent() - 2))); iBufferGc->DiscardFont(); } else { TRect aFrame = TRect((iRect.Width() - iSecondaryItalicFont->TextWidthInPixels(aMialogLine1) - 35), (iRect.Height() - iSecondaryItalicFont->FontMaxHeight() - 4), (iRect.Width() - 25), (iRect.Height() + 5)); AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(), iBgContext, this, *iBufferGc, aFrame.iTl, aFrame, KAknsDrawParamDefault); RenderItemFrame(aFrame); iBufferGc->SetPenColor(iColourTextSelected); iBufferGc->UseFont(iSecondaryItalicFont); iBufferGc->DrawText(iTextUtilities->BidiLogicalToVisualL(aMialogLine1), TPoint((iRect.Width() - iSecondaryItalicFont->TextWidthInPixels(aMialogLine1) - 30), (iRect.Height() - iSecondaryItalicFont->FontMaxDescent() - 2))); iBufferGc->DiscardFont(); } } iBufferGc->CancelClippingRect(); } DrawDeferred(); }
// ----------------------------------------------------------------------------- // CSIPExGameView::HandlePointerEventL // From CCoeControl. Calculates the column of the game board where the pointer // event occured and moves the cursor according that information. // ----------------------------------------------------------------------------- // void CSIPExGameView::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { // Double-click if( aPointerEvent.iModifiers & EModifierDoubleClick ) { iEngine->CursorPressed(); DrawDeferred(); return; } // Cursor position switch( aPointerEvent.iType ) { case TPointerEvent::EButton1Up: { TInt block( iMidW + iBoxW ); TPoint point = aPointerEvent.iPosition; TInt x( point.iX ); if( x >= KLeft && x <= KRight && point.iY > KTop ) { for( TInt i=0; i < KBoxCountX; i++ ) { if( x < ( KLeft + block * ( i + 1 ) ) ) { iEngine->MoveCursorL( i ); DrawDeferred(); return; } } } } break; default: break; } }
// Framework calls this method, when SetFocus has been called for this control void CContactsSubScreenView::FocusChanged(TDrawNow /*aDrawNow*/) { // If the view is focused, set all it's components to be focused. if (IsFocused()) { iAppTitle->SetFocus(ETrue); iListbox->SetFocus(ETrue); } else { iAppTitle->SetFocus(EFalse); iListbox->SetFocus(EFalse); } DrawDeferred(); }
// Framework calls this method, when SetFocus has been called for this control void CPhotoModeListBox::FocusChanged(TDrawNow /*aDrawNow*/) { // If the view is focused, set all it's components to be focused. if (IsFocused()) { iAppTitle->SetFocus(ETrue); iListbox->SetFocus(ETrue); } else { iAppTitle->SetFocus(EFalse); iListbox->SetFocus(EFalse); } DrawDeferred(); }
// Set data to the listbox. void CContactsSubScreenView::SetData() { TBuf<50> titlename; TBuf<50> formatBuf; titlename.Copy(_L("")); formatBuf.Copy(_L("")); formatBuf.Append(*(iEikonEnv->AllocReadResourceL(R_STATUSTEXT_CONTACTS_UPLOADED))); titlename.Format(formatBuf, iContactsArray->MdcaCount()); iAppTitle->SetTextL(titlename, CCknAppTitle::EMainTitle); iListbox->HandleItemRemovalL(); CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(1); if(iContactsArray->MdcaCount() > 0) { listItems->Reset(); CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(iContactsArray->MdcaCount()); } CleanupStack::PushL(listItems); TBuf<500> item; for (TInt i = 0; i < iContactsArray->MdcaCount() ; i++) { item.Copy(_L("")); item.Append((*iContactsArray)[i]); item.Append(_L(",")); item.Append((*iMobileArray)[i]); listItems->AppendL(item); } CleanupStack::Pop(listItems); CTextListBoxModel* model = iListbox->Model(); model->SetItemTextArray(listItems); // Set ListBox model responsible for deleting the listItems array model->SetOwnershipType(ELbmOwnsItemArray); iListbox->HandleItemAdditionL(); DrawDeferred(); }
void COsmo4AppView::ShowHide(Bool show) { #ifndef GPAC_GUI_ONLY if (show) { MakeVisible(ETrue); if (m_term) { gf_term_set_option(m_term, GF_OPT_VISIBLE, 1); DrawDeferred(); } } else { MakeVisible(EFalse); if (m_term) gf_term_set_option(m_term, GF_OPT_VISIBLE, 0); } #else MakeVisible(ETrue); #endif }
// --------------------------------------------------------------------------- // CAknBatteryStrength::HandleResourceChange // --------------------------------------------------------------------------- // void CAknBatteryStrength::HandleResourceChange( TInt aType ) { if ( aType==KEikDynamicLayoutVariantSwitch || aType == KEikColorResourceChange || aType == KAknsMessageSkinChange) { DeleteBitmaps(); // SizeChanged reloads needed bitmaps SizeChanged(); if ( aType == KEikDynamicLayoutVariantSwitch ) { SetBatteryLevel( iBatteryLevel ); // refreshes battery level offsets } DrawDeferred(); } }
// --------------------------------------------------------------------------- // CAppMngr2ListContainer::HandleResourceChange() // --------------------------------------------------------------------------- // void CAppMngr2ListContainer::HandleResourceChange( TInt aType ) { CCoeControl::HandleResourceChange( aType ); if( aType == KAknsMessageSkinChange ) { TRAP_IGNORE( LoadIconsL() ); } if( aType == KEikDynamicLayoutVariantSwitch ) { TRect mainPaneRect; if( AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ) ) { SetRect( mainPaneRect ); } DrawDeferred(); } }
// --------------------------------------------------------------------------- // CAknSignalPane::DoTick // Callback function for signal state animation timer. // --------------------------------------------------------------------------- // TInt CAknSignalPane::DoTick() { if ( iExtension->CdmaSignalIconInUse() ) { // tick used for cdma animation iExtension->CdmaSignalAnimate(); iSignalIconControl->SetSignalIcon( iExtension->CdmaSignalIcon() ); iSignalIconControl->SetSignalIconMask( iExtension->CdmaSignalIcon() ); } else { // default tick blinks icon iSignalIconControl->SetDrawBlank( !iSignalIconControl->DrawBlank() ); } // Must be DrawDeferred (not DrawNow) so that we don't block // application thread in high load situations. DrawDeferred(); return ETrue; }
void CMusicPlayerContainer::HandleResourceChange(TInt aType) { CCoeControl::HandleResourceChange(aType); if(aType == KEikDynamicLayoutVariantSwitch) { TRect r(iMusicPlayerView->ClientRect()); if(r==iCurrentTheme->iMySize) return; //no point in going further, nothing will change (right?) LOG(ELogGeneral,1,"CMusicPlayerContainer::HandleResourceChange(): start"); iMusicPlayerView->iThemeManager->iImgEngine->CancelRequest(iCurrentTheme); LOG0("ImgRequest canceled"); iCurrentTheme->Deactivate(); LOG0("Deactivation succeeded"); #ifdef __TOUCH_ENABLED__ SetExtentToWholeScreen(); #else iMusicPlayerView->SetStatusPaneVisibility(); r=iMusicPlayerView->ClientRect(); LOG0("Setting new rect: %dx%d",r.Width(),r.Height()); SetRect(r); LOG0("SetRect succeeded"); #endif if(iMusicPlayerView->iTrack && iMusicPlayerView->iTrack->iMetadata.iFileDirEntry) { iCurrentTheme->SetMetadataL(iMusicPlayerView->iTrack->iMetadata,iMusicPlayerView->iPlaybackPosition); LOG0("SetMetadata succeeded"); }; LOG0("Will activate the new theme"); iCurrentTheme->ActivateL(); LOG0("Theme activated successfully"); DrawDeferred(); LOG(ELogGeneral,-1,"CMusicPlayerContainer::HandleResourceChange(): end"); }; }
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 } }
/** * Handle key events. */ TKeyResponse CCalendarManagerContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { // [[[ begin generated region: do not modify [Generated Contents] // ]]] end generated region [Generated Contents] if ( iFocusControl != NULL && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) { return EKeyWasConsumed; } if (aType == EEventKey) { switch (aKeyEvent.iCode) { case EKeyLeftArrow: g_CalendarClass->g_SelectDay--; break; case EKeyRightArrow: g_CalendarClass->g_SelectDay++; break; case EKeyUpArrow: g_CalendarClass->g_SelectDay -= 7; break; case EKeyDownArrow: g_CalendarClass->g_SelectDay += 7; break; default: break; } if (g_CalendarClass->g_SelectDay <= 0) { g_CalendarClass->g_SelectMonth--; if (g_CalendarClass->g_SelectMonth <= 0) { g_CalendarClass->g_SelectYear--; g_CalendarClass->g_SelectMonth = 12; g_CalendarClass->g_SelectDay = 31; } g_CalendarClass->GetFirstWeek(); g_CalendarClass->GetMaxDay(); g_CalendarClass->g_SelectDay = g_CalendarClass->g_MaxDay; g_CalendarClass->GetWeek(); } if (g_CalendarClass->g_SelectDay > g_CalendarClass->g_MaxDay) { g_CalendarClass->g_SelectMonth++; if (g_CalendarClass->g_SelectMonth > 12) { g_CalendarClass->g_SelectYear++; g_CalendarClass->g_SelectMonth = 1; g_CalendarClass->g_SelectDay = 1; } g_CalendarClass->GetFirstWeek(); g_CalendarClass->GetMaxDay(); g_CalendarClass->g_SelectDay = 1; g_CalendarClass->GetWeek(); } DrawDeferred(); } return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); }
void CSpaceInvadersAppView::NextTick() { iTickCounter++; TInt changeX = 0; TInt changeY = 0; TBool moveAliens = EFalse; if ( iTickCounter == 48 ) { if ( iAlienDirection == ERight ) { if ( iHorizontalMoves < iMaxHorizontalMoves ) { changeX = 20; iHorizontalMoves++; } else { changeY = 20; iAlienDirection = ELeft; iHorizontalMoves = 0; } } else { if ( iHorizontalMoves < iMaxHorizontalMoves ) { changeX = -20; iHorizontalMoves++; } else { changeY = 20; iAlienDirection = ERight; iHorizontalMoves = 0; } } iTickCounter = 0; iShotCounter++; moveAliens = ETrue; } // Checking for collisions between aliens and ship and shots and updating // the coordinates in one loop. for(TInt i = 0 ; i < iTotalAliens ; i++ ) { if ( iAlienArray[i] && iAlienArray[i]->HasFired() ) { if ( iShip->IntersectsWith(iAlienArray[i]->Shot()) ) { // Alien shot hits alien GameOver(); } else if ( iAlienArray[i]->Shot()->Y() + 5 < Rect().Height() ) { iAlienArray[i]->Shot()->SetY(iAlienArray[i]->Shot()->Y() + 5); } else { iAlienArray[i]->ShotExpired(); } DrawNow(); } else if ( iAlienArray[i] ) { if ( iShotCounter == 3 ) { iAlienArray[i]->ShotFired(); iShotCounter = 0; } } if ( iAlienArray[i] && iShip->HasFired() ) { if ( iAlienArray[i]->IntersectsWith(iShip->Shot())) { // Player's shot hits alien delete iAlienArray[i]; iAlienArray[i] = NULL; iShip->ShotExpired(); iRemainingAliens--; iHolder->SetActivePoints(iHolder->ActivePoints() + 10); if ( iRemainingAliens == 0 ) { // All the aliens have been destroyed GameOver(); } else { DrawNow(); } } } if ( iAlienArray[i] && iAlienArray[i]->IntersectsWith(iShip) ) { // Alien hits ship GameOver(); } else if ( iAlienArray[i] ) { if ( iAlienArray[i]->Y() + changeY + ship_height < Rect().Height() ) { iAlienArray[i]->SetX(iAlienArray[i]->X() + changeX); iAlienArray[i]->SetY(iAlienArray[i]->Y() + changeY); } else { // Game ends if the aliens reach the bottom of the screen GameOver(); } } } if ( iShip->HasFired() ) { if ( iShip->Shot()->Y() - 5 > 0 ) { iShip->Shot()->SetY(iShip->Shot()->Y() - 5 ); } else { iShip->ShotExpired(); } DrawDeferred(); } else if (moveAliens) { DrawDeferred(); } }
void CGuideContainer::ScalingDone() { //DrawNow(); DrawDeferred(); }
// ----------------------------------------------------------------------------- // CSupSplashScreenView::SizeChanged() // Called by framework when the view size is changed. // ----------------------------------------------------------------------------- // void CSupSplashScreenView::SizeChanged() { DrawDeferred(); }