×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Location
    India
    Posts
    184

    How to Use CAknSliderSettingPage class for creating dynamic slider

    Hello
    I am trying to create Slider whose range we can deside dynamically. for that purpose i am using CAknSliderSettingPage this class. but i do not know how to use this class.
    so please any one can tell me that how to use this class.


    Thanxxxx

  2. #2
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,266

    Re: How to Use CAknSliderSettingPage class for creating dynamic slider

    Quote Originally Posted by pranay_preet View Post
    Hello
    I am trying to create Slider whose range we can deside dynamically. for that purpose i am using CAknSliderSettingPage this class. but i do not know how to use this class.
    so please any one can tell me that how to use this class.


    Thanxxxx
    Hi,

    Verified on S60 3rd Edition FP2 emulator

    Code:
    // YouRssFile.rss
    ...
    // begin by chen
    #define qtn_my_slider_item_title "Test"
    #define STRING_r_minimum "Min"
    #define STRING_r_maximum "Max"
    
    // "S60 slider incomplete resource causes out of memory failure"
    // http://discussion.forum.nokia.com/forum/showthread.php?t=108981
    RESOURCE AVKON_SETTING_PAGE r_my_slider_item_setting_page
    {
    label = qtn_my_slider_item_title;
    type = EAknCtSlider;
    editor_resource_id = r_my_slider_item_slider;
    }
    
    RESOURCE SLIDER r_my_slider_item_slider
    {
    layout = EAknSettingsItemSliderLayout;
    minvalue = 0;
    maxvalue = 10;
    step = 1;
    valuetype = EAknSliderValueBareFigure;
    minlabel = STRING_r_minimum;
    maxlabel = STRING_r_maximum;
    }
    // end by chen
    ...
    Code:
    // .cpp
    ...
    // begin by chen
    #include <YourRssFile.rsg>
    #include <AknSliderSettingPage.h>
    // end by chen
    ...
    // begin by chen
    TInt value = 0;
    CAknSliderSettingPage* ssp = new(ELeave) CAknSliderSettingPage(R_MY_SLIDER_ITEM_SETTING_PAGE, value);
    CleanupStack::PushL(ssp);
    ssp->ConstructL();
    CleanupStack::Pop(ssp);
    // begin, change the slider range programically
    CAknSlider* slider = ssp->SliderControl();
    if(slider!=NULL)
    	{
    	slider->SetRange(0,100);
    	}
    // end
    TBool ret = ssp->ExecuteLD();
    if(ret)
    	{
            // value is the slider value
    	// do someting to handle it
    	}
    // end by chen 
    ...
    Ziteng Chen

  3. #3
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,266

    Re: How to Use CAknSliderSettingPage class for creating dynamic slider

    Hi,

    The full example,

    "HelloWorld(SliderSettingPage).zip"
    http://wiki.forum.nokia.com/index.ph...ingPage%29.zip

    Regards

    Ziteng Chen

Similar Threads

  1. Should the class be an R class or a T class?
    By AshramArzephucque in forum Symbian
    Replies: 3
    Last Post: 2007-11-26, 19:37
  2. Container Class needs help
    By vinayashrestha in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-11-14, 12:54
  3. Replies: 2
    Last Post: 2007-03-14, 17:15
  4. definition of class method outside class body?
    By advocatee in forum Symbian
    Replies: 2
    Last Post: 2003-07-02, 07:09
  5. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •