×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:How to Use CAknSliderSettingPage for creating dynamic slider

From Nokia Developer Wiki
Jump to: navigation, search
chenziteng (Talk | contribs)
(Created page with 'Class CAknSliderSettingPage provides functionality to create slider setting page on S60 3rd Edition phones and you can implement it in your application as follows.<br> '''RSS Fi…')
 
jimgilmour1 (Talk | contribs)
m (minor formating)
Line 30: Line 30:
 
}
 
}
 
// end by chen
 
// end by chen
...
+
//...
 
</code>
 
</code>
  
Line 37: Line 37:
 
// .cpp
 
// .cpp
  
<code>
+
<code cpp>
 
...
 
...
 
// begin by chen
 
// begin by chen
Line 43: Line 43:
 
#include <AknSliderSettingPage.h> // CAknSliderSettingPage
 
#include <AknSliderSettingPage.h> // CAknSliderSettingPage
 
// end by chen
 
// end by chen
...
+
//...
 
// begin by chen
 
// begin by chen
 
TInt value = 0;
 
TInt value = 0;

Revision as of 15:58, 28 September 2009

Class CAknSliderSettingPage provides functionality to create slider setting page on S60 3rd Edition phones and you can implement it in your application as follows.

RSS File:

// 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
//...

cpp file.

// .cpp

...
// begin by chen
#include <YourRssFile.rsg> // R_MY_SLIDER_ITEM_SETTING_PAGE
#include <AknSliderSettingPage.h> // CAknSliderSettingPage
// 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
...

Source Code:

Full example: HelloWorld(SliderSettingPage).zip

Screenshots:

CAknSliderSettingPage.PNG

76 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×