WEB开发网
开发学院手机开发Symbian 开发 Symbian CAknSettingItemList使用心得 阅读

Symbian CAknSettingItemList使用心得

 2010-09-06 08:11:00 来源:WEB开发网   
核心提示:中除当前值(%U所对应的值)不显示外,其他内容都会显示,Symbian CAknSettingItemList使用心得(2),5, Slider setting item中,显示当前值而不显示滑动条的方法:class CExtendedSliderSettingItem : public CAknSliderSetti
中除当前值(%U所对应的值)不显示外,其他内容都会显示。

5, Slider setting item中,显示当前值而不显示滑动条的方法:

class CExtendedSliderSettingItem : public CAknSliderSettingItem

{

public:

const TDesC& SettingTextL()

{

LoadL();

iData.Format(_L("Current valud: %d"), InternalSliderValue());

return iData;

}

CFbsBitmap* CreateBitmapL()

{

return NULL;

}

private:

TBuf<128> iData;

};

6, 动态设置CAknEnumeratedTextPopupSettingItem的内容

在CAknEnumeratedTextPopupSettingItem继承类的EditItemL中,

virtual void EditItemL(TBool bCalledFromMenu)

{

CAknEnumeratedText* enumeratedText = NULL;

CArrayPtr * enumeratedTextArray = EnumeratedTextArray();

HBufC* selectionText = _L("Selection1").AllocLC();

enumeratedText = new ( ELeave) CAknEnumeratedText(0, selectionText);

CleanupStack::PushL( enumeratedText);

enumeratedTextArray->AppendL( enumeratedText);

HandleTextArrayUpdateL();

CAknEnumeratedTextPopupSettingItem::EditItemL(bCalledFromMenu));

}

7, 监控Setting page关闭时点击的是OK还是Cancel:

void HandleSettingPageEventL(CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)

{

if(aEventType == MAknSettingPageObserver::EEventSettingChanged)

{

//Setting is changed

}

else if(aEventType == MAknSettingPageObserver::EEventSettingOked)

{

//OK button is changed

}

else if(aEventType == MAknSettingPageObserver::EEventSettingCancelled)

{

//Cancel button is changed

}

UpdateListBoxTextL();

}

Tags:Symbian CAknSettingItemList 使用

编辑录入:coldstar [复制链接] [打 印]
赞助商链接