Nokia N97 SDK
Example Applications Guide

DynamicSettingListSlider.cpp

00001 /*
00002 * ============================================================================
00003 *  Name     : CDynamicSettingListSlider from CDynamicSettingListSlider.cpp
00004 *  Part of  : Dynamic Setting List
00005 *  Created  : 09/21/2005 by Forum Nokia
00006 *  Version  : 1.0
00007 *
00008 *  Copyright (c) 2005 - 2007 Nokia Corporation.
00009 *  This material, including documentation and any related
00010 *  computer programs, is protected by copyright controlled by
00011 *  Nokia Corporation.
00012 * ============================================================================
00013 */
00014 
00015 // INCLUDE FILES
00016 #include "DynamicSettingListSlider.h"
00017 #include <aknslidersettingpage.h>
00018 
00019 // ================= MEMBER FUNCTIONS =======================
00020 
00021 // Constructor
00022 CDynamicSettingListSlider::CDynamicSettingListSlider( TInt aIdentifier, TInt& aSliderValue )
00023         : CAknSliderSettingItem(aIdentifier, aSliderValue)
00024         {
00025 
00026         }
00027 
00028 // ----------------------------------------------------
00029 // CDynamicSettingListAppView::CreateAndExecuteSettingPageL()
00030 // Creates and executes a slider setting page.
00031 // ----------------------------------------------------
00032 //
00033 void CDynamicSettingListSlider::CreateAndExecuteSettingPageL()
00034         {
00035         CAknSettingPage* dlg = CreateSettingPageL();
00036 
00037         SetSettingPage( dlg );
00038         SettingPage()->SetSettingPageObserver(this);
00039 
00040         // This has to be called so that slider setting page will work correctly in
00041         // all environments (WINS UDEB, GCCE UREL, etc):
00042     // CAknSliderSettingItem has a  fault that occurs at least in S60 2nd
00043     // Edition emulator debug builds and in 3rd Edition gcce builds. This fault
00044     // prevents creating CAknSliderSettingItem dynamically. A workaround is
00045     // to create a proprietary slider setting item and inherit it from
00046     // CAknSliderSettingItem (see CDynamicSettingListSlider.h). Then override
00047     // CAknSliderSettingItem::CreateAndExecuteSettingPageL
00048     // and use the solution pointed out in
00049     // CDynamicSettingListSlider::CreateAndExecuteSettingPageL.
00050 
00051         SettingPage()->SetSettingTextL(SettingName());
00052 
00053         SettingPage()->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
00054         SetSettingPage(0);
00055         }
00056 
00057 // End of file

© Nokia 2009

Back to top