Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Label doesn't appear on the screen!

1 replies · 1,437 views · Started 15 October 2004

Hi all,

I need a label and a textbox on the screen. And I have the following code :

myLabel = new (ELeave) CEikLabel();
myLabel->SetContainerWindowL(*this);
myLabel->SetPosition(KLabelPosition2);
myLabel->SetTextL(_L("Please enter the number :"😉);

myEdwin = new (ELeave) CEikEdwin();
myEdwin->ConstructL(EEikEdwinNoWrap, 10, 15, 1);
myEdwin->SetContainerWindowL(*this);
myEdwin->SetPosition(KLabelPosition);
myEdwin->SetBorder(TGulBorder::ESingleBlack);
_LIT(message, "Add tel no here"😉;
myEdwin->SetTextL(&message);
myEdwin->SetCursorPosL(0,ETrue);

But myLabel doesn't appear on the screen, just textbox message is shown. Furthermore, borders of the textbox can't be seen. Any ideas?

Thanks in advance...

you need to also implement these functions. read their description in the docs for CCoeControl

// -----------------------------------------------------------------------
// Returns the number of controls in the control group.
// -----------------------------------------------------------------------
TInt YourCLass::CountComponentControls() const
{ _l
return iCtrlArray.Count();
; _l}

// -----------------------------------------------------------------------
// Returns the component control identified by the given index
// -----------------------------------------------------------------------
CCoeControl* YourCLass::ComponentControl(TInt aIndex) const
{ _l
return (CCoeControl*)iCtrlArray[aIndex];
; _l}

in InitComponentsL()
add this:

iCtrlArray.Append( iEikLabel2 );

where iCtrlArray is a private class member of type:

RPointerArray<CCoeControl> iCtrlArray;

hope it helps

this code is generated code from CBuilderX when creating a compund control.
And it works for me.

ckumanli wrote:Hi all,

I need a label and a textbox on the screen. And I have the following code :

myLabel = new (ELeave) CEikLabel();
myLabel->SetContainerWindowL(*this);
myLabel->SetPosition(KLabelPosition2);
myLabel->SetTextL(_L("Please enter the number :"😉);

myEdwin = new (ELeave) CEikEdwin();
myEdwin->ConstructL(EEikEdwinNoWrap, 10, 15, 1);
myEdwin->SetContainerWindowL(*this);
myEdwin->SetPosition(KLabelPosition);
myEdwin->SetBorder(TGulBorder::ESingleBlack);
_LIT(message, "Add tel no here"😉;
myEdwin->SetTextL(&message);
myEdwin->SetCursorPosL(0,ETrue);

But myLabel doesn't appear on the screen, just textbox message is shown. Furthermore, borders of the textbox can't be seen. Any ideas?

Thanks in advance...