videoplayback/videoplaybackcontrols/src/mpxvideoplaybackbuttonbar.cpp
branchRCL_3
changeset 6 7d91903f795f
parent 0 96612d01cf9f
child 13 112a725ff2c2
equal deleted inserted replaced
2:dec420019252 6:7d91903f795f
    13 *
    13 *
    14 * Description: Button bar control
    14 * Description: Button bar control
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 14 %
    18 // Version : %version: 15 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <eikenv.h>
    23 #include <eikenv.h>
   142     // Create 3 buttons
   142     // Create 3 buttons
   143     //
   143     //
   144     for ( TInt i = 0 ; i < EMPXButtonCount -1 ; i++ )
   144     for ( TInt i = 0 ; i < EMPXButtonCount -1 ; i++ )
   145     {
   145     {
   146         CMPXVideoPlaybackButton* button =
   146         CMPXVideoPlaybackButton* button =
   147             CMPXVideoPlaybackButton::NewL(
   147             CMPXVideoPlaybackButton::NewL( iController,
   148                     TRect( leftOffset, iconSize * i, leftOffset + iconSize, iconSize * ( i + 1 ) ),
   148                     TRect( leftOffset, iconSize * i, leftOffset + iconSize, iconSize * ( i + 1 ) ),
   149                     iconsPath );
   149                     iconsPath );
   150 
   150 
   151         CleanupStack::PushL( button );
   151         CleanupStack::PushL( button );
   152         iButtons.AppendL( button );
   152         iButtons.AppendL( button );
   155 
   155 
   156     //
   156     //
   157     // create pause button in same rect as paly button's
   157     // create pause button in same rect as paly button's
   158     //
   158     //
   159     CMPXVideoPlaybackButton* button =
   159     CMPXVideoPlaybackButton* button =
   160         CMPXVideoPlaybackButton::NewL( iButtons[EMPXButtonPlay]->Rect(), iconsPath );
   160         CMPXVideoPlaybackButton::NewL( iController, iButtons[EMPXButtonPlay]->Rect(), iconsPath );
   161 
   161 
   162     CleanupStack::PushL( button );
   162     CleanupStack::PushL( button );
   163     iButtons.AppendL( button );
   163     iButtons.AppendL( button );
   164     CleanupStack::Pop( button );
   164     CleanupStack::Pop( button );
   165 
   165 
   561     MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::Draw()"));
   561     MPX_DEBUG(_L("CMPXVideoPlaybackButtonBar::Draw()"));
   562 
   562 
   563     CWindowGc& gc = SystemGc();
   563     CWindowGc& gc = SystemGc();
   564     gc.SetClippingRect( aRect );
   564     gc.SetClippingRect( aRect );
   565 
   565 
   566     if ( Window().DisplayMode() == EColor16MAP )
   566     if ( iController->SetBackgroundBlack() )
   567     {
   567     {
   568         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   568         if ( Window().DisplayMode() == EColor16MAP )
   569         gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
   569         {
   570         gc.Clear( aRect );
   570             gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   571     }
   571             gc.SetBrushColor( TRgb::Color16MAP( 255 ) );
   572     else if ( Window().DisplayMode() == EColor16MA )
   572             gc.Clear( aRect );
   573     {
   573         }
   574         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
   574         else if ( Window().DisplayMode() == EColor16MA )
   575         gc.SetBrushColor( TRgb::Color16MA( 0 ) );
   575         {
   576         gc.Clear( aRect );
   576             gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
       
   577             gc.SetBrushColor( TRgb::Color16MA( 0 ) );
       
   578             gc.Clear( aRect );
       
   579         }
   577     }
   580     }
   578     else
   581     else
   579     {
   582     {
   580         // draw a solid background so that the entire progress
   583         // draw a solid background so that the entire progress
   581         // bar is shown not just the area representing the
   584         // bar is shown not just the area representing the