Symbian 如何创建编辑框
2010-04-20 15:55:00 来源:WEB开发网#include <eikrted.h>
class CTestEditContainer : public CCoeControl
{
… …
void CreateEditor();
CEikRichTextEditor* iRichTextEditor;
… …
};
CTestEditContainer::CTestEditContainer()
{
// [[[ begin generated region: do not modify [Generated Contents]
// ]]] end generated region [Generated Contents]
iRichTextEditor = NULL;
}
CTestEditContainer::~CTestEditContainer()
{
// [[[ begin generated region: do not modify [Generated Contents]
// ]]] end generated region [Generated Contents]
if (iRichTextEditor)
{
delete iRichTextEditor;
iRichTextEditor = NULL;
}
}
TInt CTestEditContainer::CountComponentControls() const
{
return ( int ) 1;
}
CCoeControl* CTestEditContainer::ComponentControl( TInt aIndex ) const
{
// [[[ begin generated region: do not modify [Generated Contents]
switch ( aIndex )
{
case 0:
return iRichTextEditor;
}
// ]]] end generated region [Generated Contents]
// handle any user controls here…
return NULL;
}
void CTestEditContainer::SizeChanged()
{
CCoeControl::SizeChanged();
LayoutControls();
// [[[ begin generated region: do not modify [Generated Contents]
iRichTextEditor->SetExtent(TPoint(5,5),iSize.operator -(TSize(10,10)));
// ]]] end generated region [Generated Contents]
}
TKeyResponse CTestEditContainer::OfferKeyEventL(
const TKeyEvent& aKeyEvent,
TEventCode aType )
{
// [[[ begin generated region: do not modify [Generated Contents]
更多精彩
赞助商链接