1 /* |
1 /* |
2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
170 EXPORT_C void CAknTransparentCameraSettingPage::ConstructL() |
171 EXPORT_C void CAknTransparentCameraSettingPage::ConstructL() |
171 { |
172 { |
172 BaseConstructL( KAknSettingPageNoEmbeddedSoftKeys ); |
173 BaseConstructL( KAknSettingPageNoEmbeddedSoftKeys ); |
173 |
174 |
174 SetDrawBackground(EFalse); // Enable transparent drawing |
175 SetDrawBackground(EFalse); // Enable transparent drawing |
175 if( CAknEnv::Static()->TransparencyEnabled() ) |
|
176 { |
|
177 // try to enable window transparency |
|
178 if ( Window().SetTransparencyAlphaChannel() == KErrNone ) |
|
179 { |
|
180 Window().SetRequiredDisplayMode( EColor16MA ); |
|
181 Window().SetBackgroundColor( ~0 ); |
|
182 } |
|
183 } |
|
184 |
176 |
185 GenerateInternalArrayAndGiveToListBoxL(); |
177 GenerateInternalArrayAndGiveToListBoxL(); |
186 |
178 |
187 iExtension = CAknTransparentCameraSettingPageExtension::NewL( *this ); |
179 iExtension = CAknTransparentCameraSettingPageExtension::NewL( *this ); |
188 |
180 |
223 |
215 |
224 listBox->SetListBoxObserver(this); |
216 listBox->SetListBoxObserver(this); |
225 |
217 |
226 // Set the current "pushed in" indication |
218 // Set the current "pushed in" indication |
227 if ( iCurrentSelectionIndex != -1 ) |
219 if ( iCurrentSelectionIndex != -1 ) |
228 { |
220 listBox->View()->SelectItemL( iCurrentSelectionIndex ); |
229 // |
|
230 // SelectItemL make the view item drawn by default, SetDisableRedraw can remove flick |
|
231 // |
|
232 TBool bRedrawDisabled = listBox->View()->RedrawDisabled(); |
|
233 listBox->View()->SetDisableRedraw( ETrue ); |
|
234 |
|
235 listBox->View()->SelectItemL( iCurrentSelectionIndex ); |
|
236 listBox->View()->SetDisableRedraw( bRedrawDisabled ); |
|
237 } |
|
238 |
221 |
239 // Set the scroller indication off |
222 // Set the scroller indication off |
240 listBox->CreateScrollBarFrameL(ETrue); |
223 listBox->CreateScrollBarFrameL(ETrue); |
241 listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOff); |
224 listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOff); |
242 |
225 |
243 // Need to do this to set up the scroll bar model |
226 // Need to do this to set up the scroll bar model |
244 listBox->UpdateScrollBarsL(); |
227 listBox->UpdateScrollBarsL(); |
245 |
228 |
246 if(!IsBackgroundDrawingEnabled()) |
229 if(!IsBackgroundDrawingEnabled()) |
247 { |
230 listBox->ScrollBarFrame()->DrawBackground(EFalse, EFalse); |
248 listBox->ScrollBarFrame()->DrawBackground(EFalse, EFalse); |
|
249 } |
|
250 |
231 |
251 |
232 |
252 // Force a size changed |
233 // Force a size changed |
253 SizeChanged(); |
234 SizeChanged(); |
254 |
235 |
356 HideMenu(); |
337 HideMenu(); |
357 |
338 |
358 // Respond to softkey events |
339 // Respond to softkey events |
359 switch (aCommandId) |
340 switch (aCommandId) |
360 { |
341 { |
361 case EAknSoftkeySelect: |
|
362 { |
|
363 if ( EnableSingleClickHighlight( aCommandId ) ) |
|
364 { |
|
365 break; |
|
366 } |
|
367 // no single click mode was enabled, fall through |
|
368 } |
|
369 case EAknSoftkeyOk: |
342 case EAknSoftkeyOk: |
370 case EAknSoftkeyDone: |
343 case EAknSoftkeySelect: |
|
344 case EAknSoftkeyDone: |
371 SelectCurrentItemL(); // has non-trivial implemenations in listbox type |
345 SelectCurrentItemL(); // has non-trivial implemenations in listbox type |
372 // controls to put the selection on the current item |
346 // controls to put the selection on the current item |
373 AttemptExitL(ETrue); |
347 AttemptExitL(ETrue); |
374 break; |
348 break; |
375 case EAknSoftkeyBack: |
349 case EAknSoftkeyBack: |
407 // it must be reverted back to represent the same item as |
381 // it must be reverted back to represent the same item as |
408 // the current selection in the setting page. |
382 // the current selection in the setting page. |
409 // Only in single click enabled applications. |
383 // Only in single click enabled applications. |
410 if ( iExtension && |
384 if ( iExtension && |
411 iExtension->iFlags.IsSet( |
385 iExtension->iFlags.IsSet( |
412 CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) && |
386 CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) ) |
413 iCurrentSelectionIndex >= 0 && |
|
414 iCurrentSelectionIndex < ListBoxControl()->Model()->NumberOfItems() ) |
|
415 { |
387 { |
416 ListBoxControl()->View()->SetCurrentItemIndex( |
388 ListBoxControl()->View()->SetCurrentItemIndex( |
417 iCurrentSelectionIndex ); |
389 iCurrentSelectionIndex ); |
418 } |
390 } |
419 break; |
391 break; |