hi,
I am working with UIQ 2.1. When i used a CEIkEdwin object for creating textbox, i can't type anything. I am afraid, key press is not being received. But when i used the same code for series 60 it worked. I am wondering why is it so?
regards,
binu baby kurian
editor=new(ELeave) CEikEdwin();
CleanupStack::PushL(editor);
editor->ConstructL(0,20,0,20);
editor->SetContainerWindowL(*this);
editor->SetObserver(this);
editor->SetExtent(TPoint(0,0),TSize(180,18));
editor->SetFocus(ETrue,EDrawNow);
CleanupStack::Pop();//editor
Can anyone tell what else do i need to implement to type in my text box.
You've probabliy forgotten to implement the ComponentControl()- and CountComponentControls()-methods as should always be done using a compound control? And do not forget to handle focus if you have more than just one control...
afterwards, you can use
editor->GetText(aBuffer);
to read text from the textfield
First of all: Never use standard-constructor for creating new controls! Do it in the second-phase constructor
//----------------------------------------------------
// Constructor for the view.
//----------------------------------------------------
//
CSimpleAppView::CSimpleAppView()
{
iLabel = NULL;
iText1 = NULL;
}
//----------------------------------------------------
// Second-phase Constructor
//----------------------------------------------------
//
void CSimpleAppView::ConstructL(const TRect& aRect)
{
// Control is a window owning control
CreateWindowL();
iText1 = new (ELeave) CEikEdwin;
iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL(*this);
iLabel->SetTextL(_L("Enter Password"));
iLabel->SetExtent(TPoint(10,85),iLabel->MinimumSize());