初学者遇到的小问题,请执教

conte 2008-04-23 09:15:08

刚开始symbian ,用carbide c++ 和 s60 2nd fp3,helloworld示例程序,

想在container中增加一个编辑框,代码如下:

RSS:

RESOURCE EDWIN r_plaintexteditor_test{
width =20;
lines = 1;
maxlength = 64;
flags=EEikEdwinWidthInPixels;
avkon_flags=EAknEditorFlagNoT9;
default_case=EAknEditorLowerCase;
allowed_case_modes=EAknEditorLowerCase|EAknEditorUpperCase;
numeric_keymap=EAknEditorPlainNumberModeKeymap;
allowed_input_modes=EAknEditorTextInputMode;
default_input_mode=EAknEditorTextInputMode;
}

container类中:

void ChelloContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL( *this );
iLabel->SetTextL( _L("Example View") );

iToDoLabel = new (ELeave) CEikLabel;
iToDoLabel->SetContainerWindowL( *this );
iToDoLabel->SetTextL( _L("Add Your controls\n here") );


ieditor=new (ELeave) CEikEdwin;
ieditor->SetContainerWindowL(*this);

TResourceReader reader;
iCoeEnv->CreateResourceReaderLC(reader,R_PLAINTEXTEDITOR_TEST);
ieditor->ConstructFromResourceL(reader);
CleanupStack::PopAndDestroy();


ieditor->SetFocus(ETrue);


SetRect(aRect);
ActivateL();
}


void ChelloContainer::SizeChanged()
{
// TODO: Add here control resize code etc.
iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
iToDoLabel->SetExtent( TPoint(10,100), iToDoLabel->MinimumSize() );
ieditor->SetExtent( TPoint(10,40), ieditor->MinimumSize() );

}

红色部分代码是我加的,运行正常但是没显示编辑框,这个问题应该很简单,见笑了
请指教,不胜感激

...全文
143 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
这个简单啊,网上搜一下就得到答案了.
Atoric 2008-04-23
  • 打赏
  • 举报
回复
检查:
CountComponentControls()
ComponentControl(TInt index)

3,119

社区成员

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

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