用CEikSecretEditor输入密码问题!

vigoqiu 2010-01-25 02:31:16
为什么一按键,编辑框的文字马上就变成*号了?我想要的效果是短暂显示用户输入的字符,然后转变成(*)星号。

构造是这样的:
TResourceReader reader;
iCoeEnv->CreateResourceReaderLC( reader, R_MINGYOU_EDWIN_REMARK );
iPassWord = new ( ELeave )CAknNumericSecretEditor;
iPassWord->SetContainerWindowL( *this );
iPassWord->ConstructFromResourceL( reader );
iPassWord->RevealSecretText(ETrue);
iPassWord->SetExtent( TPoint( 20, 100 ), TSize( 115, 20 ) ); //定义位置和大小
//iPassWord->SetTextL()
iPassWord->SetMaxLength( 16 );
iPassWord->SetFocusing( ETrue );
CleanupStack::PopAndDestroy(); // Resource reader ComponentControl


OfferKeyEventL也处理了:

return iPassWord->OfferKeyEventL(aKeyEvent,aType);



是不是哪里不对?请大家帮忙。
...全文
259 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenziteng 2010-02-09
  • 打赏
  • 举报
回复
Hi,

加行给密码框设置焦点的语句就没问题了。

"CEikSecretEditor密码输入框该怎样设?"
http://discussion.forum.nokia.com/forum/showthread.php?t=191700

Regards

Ziteng Chen
vigoqiu 2010-01-26
  • 打赏
  • 举报
回复
建了一个空白的工程,添加了CEikSecretEditor,问题有所改善,现在是输入内容能短暂显示,然后转变成(*)星号,但就只能输入数字,不能输入字母,很简单,就几行代码,哪位达人帮我看下啊?!!!!!


//CEikSecretEditor创建的代码。

void CeditorAppView::ConstructL(const TRect& aRect)
{
// Create a window for this application view
CreateWindowL();


TResourceReader reader;
iCoeEnv->CreateResourceReaderLC( reader, R_PASSWORD_EDWIN );
iPassWord = new ( ELeave ) CEikSecretEditor;
iPassWord->SetDefaultInputMode(EAknEditorSecretAlphaInputMode);
iPassWord->SetContainerWindowL( *this );
iPassWord->ConstructFromResourceL( reader );
iPassWord->SetExtent( TPoint( 20, 100 ), TSize( 115, 30 ) );
iPassWord->SetMaxLength( 6 );
CleanupStack::PopAndDestroy(); // Resource reader ComponentControl

SetRect(aRect);

// Activate the window, which makes it ready to be drawn
ActivateL();
}




//资源
RESOURCE SECRETED r_password_edwin
{
num_letters = 5;
}

//消息处理
TKeyResponse CeditorAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{

return iPassWord->OfferKeyEventL(aKeyEvent,aType);

}


//AppUi构造

void CeditorAppUi::ConstructL()
{
// Initialise app UI with standard value.
BaseConstructL(CAknAppUi::EAknEnableSkin);

// Create view object
//iAppView = CeditorAppView::NewL(ClientRect());
iAppView = CeditorAppView::NewL(TRect(0,0,240,320));
AddToStackL(iAppView);
}

3,119

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧