OK here is my try...
Code:
void CtestGuiAppView::ConstructL(const TRect& aRect)
{
// Create a window for this application view
CreateWindowL();
// Instantiate the control
iInputBox = new (ELeave)CEikEdwin;
iInputBox->SetContainerWindowL(*this);
// Create a resource reader
TResourceReader reader;
iCoeEnv->CreateResourceReaderLC(reader, R_INPUTBOX);
iInputBox->ConstructFromResourceL(reader);
CleanupStack::PopAndDestroy();
iInputBox->SetFocus(ETrue);
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();
}
where iInputBox is a *CEikEdwin.
the resource
Code:
RESOURCE EDWIN r_inputbox
{
maxlength = 511;
flags = EEikEdwinWidthInPixels;
avkon_flags = EAknEditorFlagNoT9;
default_case = EAknEditorLowerCase;
allowed_case_modes = EAknEditorUpperCase | EAknEditorLowerCase;
allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode;
default_input_mode = EAknEditorTextInputMode;
special_character_table = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG;
}
here's my OfferKeyEventL function
Code:
TKeyResponse CtestGuiAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,
TEventCode aType)
{
if (iInputBox)
{
return iInputBox->OfferKeyEventL(aKeyEvent, aType);
}
else
{
return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
}
}
It is causing panic EIKON-EDWIN 5