37 // ------------------------------------------------------------------------------------------------- |
37 // ------------------------------------------------------------------------------------------------- |
38 // CMPXVideoPlaybackButton::ConstructL() |
38 // CMPXVideoPlaybackButton::ConstructL() |
39 // Symbian 2nd phase constructor can leave. |
39 // Symbian 2nd phase constructor can leave. |
40 // ------------------------------------------------------------------------------------------------- |
40 // ------------------------------------------------------------------------------------------------- |
41 // |
41 // |
42 void CMPXVideoPlaybackButton::ConstructL( TRect aRect, const TDesC &aIconPath ) |
42 void CMPXVideoPlaybackButton::ConstructL( CMPXVideoPlaybackControlsController* aController, |
|
43 TRect aRect, const TDesC &aIconPath ) |
43 { |
44 { |
44 MPX_DEBUG(_L("CMPXVideoPlaybackButton::ConstructL()")); |
45 MPX_DEBUG(_L("CMPXVideoPlaybackButton::ConstructL()")); |
45 |
46 |
46 iIConPath = aIconPath.AllocL(); |
47 iIConPath = aIconPath.AllocL(); |
|
48 iController = aController; |
47 |
49 |
48 SetRect( aRect ); |
50 SetRect( aRect ); |
49 } |
51 } |
50 |
52 |
51 // ------------------------------------------------------------------------------------------------- |
53 // ------------------------------------------------------------------------------------------------- |
52 // CMPXVideoPlaybackButton::NewL() |
54 // CMPXVideoPlaybackButton::NewL() |
53 // Two-phased constructor. |
55 // Two-phased constructor. |
54 // ------------------------------------------------------------------------------------------------- |
56 // ------------------------------------------------------------------------------------------------- |
55 // |
57 // |
56 CMPXVideoPlaybackButton* CMPXVideoPlaybackButton::NewL( TRect aRect, const TDesC &aIconPath) |
58 CMPXVideoPlaybackButton* CMPXVideoPlaybackButton::NewL( CMPXVideoPlaybackControlsController* aController, |
|
59 TRect aRect, const TDesC &aIconPath) |
57 { |
60 { |
58 MPX_DEBUG(_L("CMPXVideoPlaybackButton::NewL()")); |
61 MPX_DEBUG(_L("CMPXVideoPlaybackButton::NewL()")); |
59 |
62 |
60 CMPXVideoPlaybackButton* self = new ( ELeave ) CMPXVideoPlaybackButton(); |
63 CMPXVideoPlaybackButton* self = new ( ELeave ) CMPXVideoPlaybackButton(); |
61 |
64 |
62 CleanupStack::PushL( self ); |
65 CleanupStack::PushL( self ); |
63 self->ConstructL( aRect, aIconPath ); |
66 self->ConstructL( aController, aRect, aIconPath ); |
64 CleanupStack::Pop(); |
67 CleanupStack::Pop(); |
65 return self; |
68 return self; |
66 } |
69 } |
67 |
70 |
68 // ------------------------------------------------------------------------------------------------- |
71 // ------------------------------------------------------------------------------------------------- |
191 MPX_DEBUG(_L("CMPXVideoPlaybackButton::Draw()")); |
194 MPX_DEBUG(_L("CMPXVideoPlaybackButton::Draw()")); |
192 |
195 |
193 CWindowGc& gc = SystemGc(); |
196 CWindowGc& gc = SystemGc(); |
194 gc.SetClippingRect( aRect ); |
197 gc.SetClippingRect( aRect ); |
195 |
198 |
196 if ( Window().DisplayMode() == EColor16MAP ) |
199 if ( iController->SetBackgroundBlack() ) |
197 { |
200 { |
198 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
201 if ( Window().DisplayMode() == EColor16MAP ) |
199 gc.SetBrushColor( TRgb::Color16MAP( 255 ) ); |
202 { |
200 gc.Clear( aRect ); |
203 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
201 } |
204 gc.SetBrushColor( TRgb::Color16MAP( 255 ) ); |
202 else if ( Window().DisplayMode() == EColor16MA ) |
205 gc.Clear( aRect ); |
203 { |
206 } |
204 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
207 else if ( Window().DisplayMode() == EColor16MA ) |
205 gc.SetBrushColor( TRgb::Color16MA( 0 ) ); |
208 { |
206 gc.Clear( aRect ); |
209 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
210 gc.SetBrushColor( TRgb::Color16MA( 0 ) ); |
|
211 gc.Clear( aRect ); |
|
212 } |
207 } |
213 } |
208 else |
214 else |
209 { |
215 { |
210 // draw a solid background so that the entire progress |
216 // draw a solid background so that the entire progress |
211 // bar is shown not just the area representing the |
217 // bar is shown not just the area representing the |