void CSpaceInvadersAppUi::InitShip()
{
	TInt x = ClientRect().Width() / 2 - ship_width / 2;
	TInt y = ClientRect().Height() - 50;
	iShip->SetX(x);
	iShip->SetY(y);
}
예제 #2
0
// ---------------------------------------------------------
// CSecModUIViewBase::DoActivateL(...)
// 
// ---------------------------------------------------------
//
void CSecModUIViewBase::DoActivateL(
   const TVwsViewId& aPrevViewId,TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
    {
    LOG_ENTERFN("CSecModUIViewBase::DoActivateL()");   
    if (KNullUid == iPrevViewId.iViewUid)
        {
        iPrevViewId = aPrevViewId;
        }
    SetTitlePaneL();
    AddNaviPaneLabelL();
                    
    if (!iContainer)
        {
        CreateContainerL();
        iContainer->SetMopParent(this);
        iContainer->ConstructL(ClientRect());
        iContainer->ListBox().SetListBoxObserver(this);
        AppUi()->AddToStackL(*this, iContainer);
        }         
   iContainer->ListBox().SetTopItemIndex( iTopItem );
   //the iCurrentPostion can be -1, if no keystore presents.
   if ( iCurrentPosition >= 0 )
       {
       iContainer->ListBox().SetCurrentItemIndex( iCurrentPosition ); 	
       } 
   iContainer->MakeVisible(ETrue);
   iContainer->SetRect(ClientRect());
   iContainer->ActivateL();
   
   
   LOG_LEAVEFN("CSecModUIViewBase::DoActivateL()");    
   }
예제 #3
0
파일: osmo4_ui.cpp 프로젝트: bigbensk/gpac
// -----------------------------------------------------------------------------
//  Called by the framework when the application status pane
//  size is changed.  Passes the new client rectangle to the
//  AppView
// -----------------------------------------------------------------------------
//
void COsmo4AppUi::HandleStatusPaneSizeChange()
{
	iAppView->SetRect( ClientRect() );
#ifndef GPAC_GUI_ONLY
	iPlaylist->SetRect( ClientRect() );
#endif
} 
void CSpaceInvadersAppUi::ConstructL()
{
	// Initialise app UI with standard value.
	BaseConstructL(CAknAppUi::EAknEnableSkin);

	// Create the highscore holder to use highscores
	CSpaceInvadersDocument* ptr = (CSpaceInvadersDocument*)Document();
	iHighscoreHolder            = ptr->Holder();

	TInt error;
	
	// Create the audioplayer
	TRAP(error, iAudioPlayer = CSpaceInvadersAudioPlayer::NewL());
	if( error )
	{
		Exit();
	}
	
	// Create the ship
	TRAP(error, iShip = CShipEngine::NewL(0, 0 ));
	if ( error )
	{
		Exit();
	}

	// Create view objects
	TRAP(error, iAppView = CSpaceInvadersAppView::NewL( ClientRect(),this,iShip,
			                                iHighscoreHolder));
	if ( error )
	{
		Exit();
	}
	
	iAppView->MakeVisible(EFalse);
	
	TRAP(error, iStartMenuView = CSpaceInvadersStartMenuAppView::
								 NewL(ClientRect(), this, iHighscoreHolder) );
	if ( error )
	{
		Exit();
	}
	iStartMenuView->MakeVisible(ETrue);
	
	TRAP(error, iHighscoreView = CSpaceInvadersHighscoreView::
								 NewL(ClientRect(), this, iHighscoreHolder) );
	if ( error )
	{
		Exit();
	}
	iHighscoreView->MakeVisible(EFalse);
	iCurrentView = iStartMenuView;
	
	AddToStackL( iCurrentView );

	// Hiding the status pane
	CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
	sp->MakeVisible(EFalse);

}
예제 #5
0
Rect TableWidget::ColumnRect( int column ) const
{
    int last_row = GetNumRows() -1;
    
    Rect R = CellRect( column, 0) | CellRect( column, last_row);
    Rect r = ClientRect( column, 0) | ClientRect( column, last_row);

    return Rect( r.GetX1(), R.GetY1(), r.GetW(), R.GetH() );
}
예제 #6
0
Rect TableWidget::RowRect( int row ) const
{
    int last_col = GetNumColumns() -1;
    
    Rect R = CellRect( 0, row) | CellRect( last_col, row);
    Rect r = ClientRect( 0, row) | ClientRect( last_col, row);

    return Rect( R.GetX1(), r.GetY1(), R.GetW(), r.GetH() );
}
예제 #7
0
// -----------------------------------------------------------------------
// Key Event Handler - Primarily to automate navigation through tab groups
// -----------------------------------------------------------------------
TKeyResponse CHindiDemoAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
  if (aType == EEventKey) 
  {
    if (iTabGroup == NULL)
    {
      return EKeyWasNotConsumed;
    } 
  }

  TInt active = iTabGroup->ActiveTabIndex();
  TInt count = iTabGroup->TabCount();

  switch (aKeyEvent.iCode) 
  {
    case EKeyLeftArrow:
      if (active > 0) 
      {
        // -----------------------------------------------------------------------
        // Change to usual layout
        // -----------------------------------------------------------------------
	TRect cr = ClientRect();
	if (cr.iTl.iY == Kqpn_height_status_pane_idle) 
        {
	  StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
	}

	active--;
	iTabGroup->SetActiveTabByIndex(active);
	ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
	return EKeyWasConsumed;
      }
      break;

    case EKeyRightArrow:
      if((active + 1) < count) 
      {
        TRect cr = ClientRect();  
        if (cr.iTl.iY == Kqpn_height_status_pane_idle) 
        {
	  StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
        }

        active++;
        iTabGroup->SetActiveTabByIndex(active);
        ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
        return EKeyWasConsumed;
      }
    break;

    default:
      break;
  }        

  return EKeyWasNotConsumed;
}
	void DoActivateL(
					 const TVwsViewId& aPrevViewId,TUid /*aCustomMessageId*/,
				const TDesC8& /*aCustomMessage*/)
	{
		CALLSTACKITEM_N(_CL("CDynamicSettingsViewImpl"), _CL("DoActivateL"));
		iIsActivated=ETrue;
		MActiveErrorReporter* rep=AppContext().GetActiveErrorReporter();
		if (rep) rep->SetInHandlableEvent(ETrue);
#ifdef __WINS__
		TInt dummy;
		TBreakItem b(GetContext(), dummy);
#endif
		iPreviousViewId = aPrevViewId;

		{
			CEikStatusPane *sp = StatusPane();
			// Fetch pointer to the default navi pane control
			CAknNavigationControlContainer* naviPane = ( CAknNavigationControlContainer * )
				sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
			naviPane->PushDefaultL(ETrue);
		}

		if (!iContainer)
			{
				iContainer = CBgContainer::NewL( this, ClientRect() );
				
				if (!iListbox) {
					iListbox = new (ELeave) CAknSettingStyleListBox();
					iListbox->ConstructL( iContainer, EAknListBoxSelectionList );
						//iListbox->SetMopParent( iContainer );
					iListbox->SetContainerWindowL( *iContainer );
					iListbox->CreateScrollBarFrameL( ETrue );
					iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, 
																		CEikScrollBarFrame::EAuto );
					iListbox->SetListBoxObserver( this );
					iSettingItemArray = new (ELeave) CAknSettingItemArray( 10, EFalse, 0);
					CTextListBoxModel* model = iListbox->Model();
					model->SetItemTextArray( iSettingItemArray );
					model->SetOwnershipType( ELbmDoesNotOwnItemArray );
				} 
			}
		
		UpdateListBoxL();
		
		iContainer->SetContentL( iListbox );

		AppUi()->AddToStackL( *this, iContainer );
		iContainer->SetRect(ClientRect());
		
		// 	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
		// 	CAknNavigationControlContainer *np = (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)); 
		// 	np->PushDefaultL();
	
		iContainer->ActivateL();
	}
예제 #9
0
/*
------------------------------------------------------------------------------
------------------------------------------------------------------------------
*/
void CMovingBallAppUi::HandleStatusPaneSizeChange()
{
	if(iAppView)
	{
		iAppView->SetRect( ClientRect() );
	}
	
	if(iMySplashScreen)
	{
		iMySplashScreen->SetRect( ClientRect() );
	}
} 
예제 #10
0
파일: osmo4_ui.cpp 프로젝트: bigbensk/gpac
// -----------------------------------------------------------------------------
// Cosmo4AppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void COsmo4AppUi::ConstructL()
{
    // Initialise app UI with standard value.
    BaseConstructL(CAknAppUi::EAknEnableSkin);

    /*Create display*/
    iAppView = COsmo4AppView::NewL( ClientRect() );
	AddToStackL(iAppView);

	/*create playlist*/
#ifndef GPAC_GUI_ONLY
	iPlaylist = CPlaylist::NewL( ClientRect(), iAppView->GetUser() );

	iPlaylist->MakeVisible(EFalse);
#endif
	
	iAppView->MakeVisible(ETrue);
	view_mode = 0;

	m_title = NULL;

	//StatusPane ()->SwitchLayoutL ( R_AVKON_STATUS_PANE_LAYOUT_SMALL );

	nb_keys = 0;
	CaptureKeys(1);



	CCommandLineArguments *args = CCommandLineArguments::NewL();
#ifndef GPAC_GUI_ONLY
	if (args->Count() > 1) {
		TPtrC url = args->Arg(1);
#if defined(_UNICODE)
		char szURL[1024];
		u16 szURLUTF16[1024];
		size_t len;
		len = url.Size();
		memcpy(szURLUTF16, url.Ptr(), sizeof(u8)*len);
		szURLUTF16[len/2] = 0;
		const u16 *sptr = szURLUTF16;
		len = gf_utf8_wcstombs(szURL, 512, &sptr);
		if (len != (size_t) -1) {
			szURL[len] = 0;
			iAppView->Connect((const char *)szURL);
		}
#else
		iAppView->Connect((const char *)url.Ptr());
#endif
	}
#endif
	delete args;
}
예제 #11
0
void CHelloWorldBasicAppUi::ConstructL()
    {
    // Initialise app UI with standard value.
    BaseConstructL(CAknAppUi::EAknEnableSkin);

    // Create view object
    iAppView = CHelloWorldBasicAppView::NewL(ClientRect());
    
    iAppContainer = new (ELeave) CFileListContainer;
    iAppContainer->SetMopParent(this);
    iAppContainer->ConstructL(ClientRect());
    AddToStackL(iAppContainer);
    }
예제 #12
0
/*
 * Construct an object of CYPagesAppView Class.
 */
void CYPagesAppUi::ConstructL()
{
    BaseConstructL(EAknEnableSkin);
	
    iAppView = CYPagesAppView::NewL(ClientRect());
	iCoeEnv->ReadResource(iAppView->iDisplayText,R_EXAMPLE_TEXT);  
}
예제 #13
0
// ---------------------------------------------------------
// CApSettingsPlugin::HandleClientRectChange
// ---------------------------------------------------------
void CCertManUIPlugin::HandleClientRectChange()
{
    if ( iContainer )
    {
        iContainer->SetRect( ClientRect() );
    }
}
예제 #14
0
// ---------------------------------------------------------
// CSymTorrentFilesView::HandleViewRectChange()
// ---------------------------------------------------------
//
void CSymTorrentFilesView::HandleViewRectChange()
{
    if ( iFilesContainer )
    {
        iFilesContainer->SetRect( ClientRect() );
    }
}
예제 #15
0
// ---------------------------------------------------------------------------
// Symbian 2nd Constructor
// ---------------------------------------------------------------------------
//
void CBCTestSkinsView::ConstructL()
    {
    BaseConstructL( R_BCTESTSKINS_VIEW );

    iContainer = new( ELeave ) CBCTestSkinsContainer();
    iContainer->SetMopParent( this );
    iContainer->ConstructL( ClientRect() );
    AppUi()->AddToStackL( *this, iContainer );
    iContainer->MakeVisible( ETrue );

    iTestUtil = CBCTestUtil::NewL();

    // Add test case here.
    iTestUtil->AddTestCaseL( CBCTestDrawUtilsCase::NewL( iContainer ),
        _L("Test CBCTestDrawUtilsCase") );
    iTestUtil->AddTestCaseL( CBCTestEffectQueueCase::NewL( iContainer ),
        _L("Test CBCTestEffectQueueCase") );
    iTestUtil->AddTestCaseL( CBCTestBmpAnimCase::NewL( iContainer ),
        _L("Test CBCTestBmpAnimCase") );
    iTestUtil->AddTestCaseL( CBCTestUtilsCase::NewL( iContainer ),
        _L("Test CBCTestUtilsCase") );
    iTestUtil->AddTestCaseL( CBCTestEffectCmdCase::NewL( iContainer ),
        _L("Test CBCTestEffectCmdCase") );

    }
예제 #16
0
void CTestView::ConstructL() 
	{
	iControl=new(ELeave) CTestViewControl;
    iControl->ConstructL(ViewId());
	iControl->SetRect(ClientRect());
	AddToStackL(iControl);
	}
예제 #17
0
void NCProgressWin::Paint( wal::GC& gc, const crect& paintRect )
{
	crect rect = ClientRect();
	int w = rect.Width();

	Draw3DButtonW2( gc, rect, 0x808080, false );
	rect.Dec();
	rect.Dec();
	w -= 2;

	if ( !( _num < _from || _to <= _from || w <= 0 ) )
	{
		int64_t size = _to - _from;
		int n = int( ( w * _num ) / size );

		crect r = rect;
		r.right = n;

		unsigned color = 0xA00000;
		unsigned bColor = ColorTone( color, -80 ), aColor = ColorTone( color, +80 );
		FillHorisont( gc, r, aColor, bColor );

		_lastWidth = w;
		_lastPos = n;
		rect.left += n;
	}

	unsigned color = 0xB0B0B0;
	unsigned bColor = ColorTone( color, +50 ), aColor = ColorTone( color, -50 );
	FillHorisont( gc, rect, aColor, bColor );

}
예제 #18
0
// ---------------------------------------------------------
// CSymTorrentStatusView::HandleViewRectChange()
// ---------------------------------------------------------
//
void CSymTorrentStatusView::HandleViewRectChange()
    {
    if ( iStatusContainer )
        {
        iStatusContainer->SetRect( ClientRect() );
        }
    }
예제 #19
0
void 
CVicinityView::DoActivateL(const TVwsViewId& aPrevViewId,
                           TUid aCustomMessageId,
                           const TDesC8& aCustomMessage) 
{
   iWayFinderUI->GetNavigationDecorator()->MakeScrollButtonVisible( ETrue );
   if (!iContainer) {
      iContainer = new (ELeave) CVicinityContainer;
      iContainer->SetMopParent(this);
      iContainer->ConstructL(ClientRect(), 
                             this,
                             iWayFinderUI,
                             iMapView);
      if( iGpsPos.lat != MAX_INT32 ) {
         iContainer->setGpsPos( iGpsPos,
                                (int) iHeading360 );
      }
      iContainer->SetDetailFetcher(m_detailFetcher);
      iContainer->SetFavoriteFetcher(m_favoriteFetcher);
      AppUi()->AddToStackL(* this, iContainer);
   }


   /* Special case for fixed point vicinity information */
   if(!iWayFinderUI->IsGpsConnected()) {
      iContainer->ForceUpdate();
   }
   
}
예제 #20
0
// ---------------------------------------------------------
// CMailIdView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CMailIdView::HandleClientRectChange()
    {
    if ( iContainer )
        {
        iContainer->SetRect( ClientRect() );
        }
    }
예제 #21
0
// ---------------------------------------------------------
// CFindBoxView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CFindBoxView::HandleClientRectChange()
    {
    if ( iContainer )
        {
        iContainer->SetRect( ClientRect() );
        }
    }
예제 #22
0
void CFileBrowseAppUi::ConstructL()
  {
  CAknAppUi::BaseConstructL(EAknEnableSkin);
  iBaseView = CFileBrowseBaseView::NewL(ClientRect());
  iBaseView->SetMopParent(this);
  AddToStackL(iBaseView);
  }
예제 #23
0
/*
 * Function to handle the change of layout.
 */
void CYPagesAppUi::HandleResourceChangeL( TInt aType )
{
    CAknAppUi::HandleResourceChangeL( aType );
    if ( aType==KEikDynamicLayoutVariantSwitch ) {
        iAppView->SetRect( ClientRect() );
    }
}
예제 #24
0
void
CVicinityView::HandleClientRectChange() 
{
   if (iContainer) {
      iContainer->SetRect(ClientRect());
   }
}
예제 #25
0
void NCNumberWin::Paint( wal::GC& gc, const crect& paintRect )
{
	crect rect = ClientRect();
	gc.SetFillColor( UiGetColor( uiBackground, 0, 0, 0xFFFFFF ) );
	gc.FillRect( rect );
	gc.SetTextColor( UiGetColor( uiColor, 0, 0, 0 ) );
	gc.Set( GetFont() );

	unicode_t c[32];
	unicode_t buf[32];
	unicode_t* s = buf;

	int64_t n = _num;
	bool minus = n < 0;

	if ( minus ) { n = -n; }

	int i = 0;

	for ( ; n > 0; i++, n /= 10 ) { c[i] = char( n % 10 ) + '0'; }

	if ( minus ) { *s = '-'; s++; }

	if ( i == 0 ) {*s = '0'; s++; };

	for ( i--; i >= 0; i-- ) { *( s++ ) = c[i]; }

	*s = 0;

	gc.TextOut( 0, 0, buf );
}
예제 #26
0
파일: SplashView.cpp 프로젝트: Tumunu/Mp
void CSplashView::HandleClientRectChange()
{
	if ( iContainer )
	{
		iContainer->SetRect( ClientRect() );
	}
}
예제 #27
0
// Draws the 'x' close button in regular state or onhover state
// Tries to mimic visual style of Chrome tab close button
static void DrawCloseButton(HDC hdc, LabelWithCloseWnd *w) {
    Graphics g(hdc);
    g.SetCompositingQuality(CompositingQualityHighQuality);
    g.SetSmoothingMode(SmoothingModeAntiAlias);
    g.SetPageUnit(UnitPixel);
    // GDI+ doesn't pick up the window's orientation through the device context,
    // so we have to explicitly mirror all rendering horizontally
    if (IsRtl(w->hwnd)) {
        g.ScaleTransform(-1, 1);
        g.TranslateTransform((REAL)ClientRect(w->hwnd).dx, 0, MatrixOrderAppend);
    }

    Color c;
    RectI &r = w->closeBtnPos;

    // in onhover state, background is a red-ish circle
    bool onHover = IsMouseOverClose(w);
    if (onHover) {
        c.SetFromCOLORREF(COL_CLOSE_HOVER_BG);
        SolidBrush b(c);
        g.FillEllipse(&b, r.x, r.y, r.dx - 2, r.dy - 2);
    }

    // draw 'x'
    c.SetFromCOLORREF(onHover ? COL_CLOSE_X_HOVER : COL_CLOSE_X);
    g.TranslateTransform((float)r.x, (float)r.y);
    Pen p(c, 2);
    if (onHover) {
        g.DrawLine(&p, Point(4, 4), Point(r.dx - 6, r.dy - 6));
        g.DrawLine(&p, Point(r.dx - 6, 4), Point(4, r.dy - 6));
    } else {
        g.DrawLine(&p, Point(4, 5), Point(r.dx - 6, r.dy - 5));
        g.DrawLine(&p, Point(r.dx - 6, 5), Point(4, r.dy - 5));
    }
}
예제 #28
0
//             The second phase constructor of the application UI class.
//             The application UI creates and owns the one and only view.
// 
void CTgb18030AppUi::ConstructL()
    {
				// BaseConstructL() completes the UI framework's
	           // construction of the App UI.
    BaseConstructL();
	iAppView = CTgb18030AppView::NewL(ClientRect());
	}
예제 #29
0
// ---------------------------------------------------------
// CSymTorrentStatusView::DoActivateL(...)
// 
// ---------------------------------------------------------
//
void CSymTorrentStatusView::DoActivateL(
   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
   const TDesC8& /*aCustomMessage*/)
{
    static_cast<CSymTorrentAppUi*>(AppUi())->SetCurrentViewId(ESymTorrentStatusView);
    
	if (!iStatusContainer)
	{        
	    iStatusContainer = new (ELeave) CSymTorrentStatusContainer;
	    iStatusContainer->SetMopParent(this);
	    iStatusContainer->ConstructL( ClientRect(), iAppUi, iTorrentMgr );
	    AppUi()->AddToStackL( *this, iStatusContainer );
	    
        if (PREFERENCES->RightSoftkeyMode() == ESTSoftkeyHide)
        {
    		Cba()->SetCommandL(2, ESymTorrentCmdHide, KLitHideButtonText);        	
			Cba()->DrawDeferred(); 	
        }
        else         	
    	{
    		Cba()->SetCommandL(2, EAknSoftkeyExit, KLitExitButtonText);        	
			Cba()->DrawDeferred();
    	}
		
		iTorrentMgr->SetEngineStateObserverL(iStatusContainer);
	}
        
   static_cast<CSymTorrentAppUi*>(AppUi())->TitlePane()->SetTextToDefaultL();
}
예제 #30
0
// ---------------------------------------------------------
// CSymellaSettingsView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CSymellaSettingsView::HandleViewRectChange()
    {
    if ( iContainer )
        {
        iContainer->SetRect( ClientRect() );
        }
    }