初学者遇到的小问题,请执教
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() );
}
红色部分代码是我加的,运行正常但是没显示编辑框,这个问题应该很简单,见笑了
请指教,不胜感激