×
Namespaces

Variants
Actions

判断当前S60程序下的编辑状态

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台:
Symbian

文章
huwell 在 21 Jan 2008 创建
最后由 hamishwillee 在 08 May 2013 编辑
  • 开发伙伴平台:

S60 3rd Edition


  • 详细描述

S60应用程序可以获得当前的编辑状态,这些信息作为指示图标显示在状态栏上,某些程序可以自己指定当前的编辑状态,如在他们自己的状态栏中显示,下列是操控这些状态的示例代码:


我们通过使用CAknEnv类获得当前编辑状态指示:

//------------------------------------------------------------------------------
 
struct S_uid: public TUid
 
{
 
S_uid(int i){ iUid = i; }
 
};
 
//Get a reference the indicator container using the CAKnEnv class.
 
MAknEditingStateIndicator *ei = CAknEnv::Static()->EditingStateIndicator();
 
CAknIndicatorContainer *ic = ei->IndicatorContainer();
 
//Check which editing state is active
 
if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorT9)))
 
{
 
// T9 Mode
 
...
 
}
 
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery)))
 
{
 
// Pen Mode
 
...
 
}
 
 
 
const char *cp;
 
if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase)))
 
{
 
// Lower case alphabet mode
 
...
 
}
 
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase)))
 
{
 
// Upper case alphabet mode
 
...
 
}
 
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase)))
 
{
 
// Text Auto-case mode (Abc)
 
...
 
}
 
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase)))
 
{
 
// Numeric mode
 
...
 
}
 
//------------------------------------------------------------------------------
This page was last modified on 8 May 2013, at 03:04.
32 page views in the last 30 days.
×