Discussion Board
CEikEdwin onto the screen
2004-07-13, 08:30
#1
Registered User
I am trying to create a simple view with two CEikEdwins
I am having trouble displaying the two CEikEdwins on the screen.
After constructing the two edwins, how do I display them on the screen?
I am creating the edwins using this:
//Topic edwin
CEikEdwin* editor = new(ELeave) CEikEdwin();
CleanupStack::PushL(editor);
editor->SetContainerWindowL(*this);
editor->ConstructL();
editor->SetObserver(this);
editor->SetBorder(TGulBorder::ESingleBlack);
CleanupStack::Pop();//editor
iChatControls->AppendL(editor);
//Entry edwin
CEikEdwin* editor2 = new(ELeave) CEikEdwin();
CleanupStack::PushL(editor2);
editor2->SetContainerWindowL(*this);
editor2->ConstructL();
editor2->SetObserver(this);
editor2->SetBorder(TGulBorder::ESingleGray);
CleanupStack::Pop();//editor2
iChatControls->AppendL(editor2);
iFocusedChatControl = iChatControls->At(ETopicInputControl);
//Set the values, height and width, for the controls
SetHeightAndWidthL();
PS: I have referred to the Chat example, but it is too complicated and makes use of different views and everything. I just want one view and want to know how i can display the Edwin onto the screen?
Thanks a lot!!
Kindly help!!!
Nokia Developer Expert
you could try editor example, maybe it is easier.
Anyway just check that you set non-overlapping rects for the edwins and that you do all normal stuff for the container. i.e:
CreateWindowL();
SetRect(aRect);
ActivateL();
and that you return the right number of components and their pointers also from the container.
yucca
Registered User
Hi Yucca,
What are the things I need to do to make sure the controls are displayed on the screen?
Right now these are the things I am doing:
In the view constructor
================
CGameViewBaseControl::ConstructL(aRect);
CreateWindowL();
SetRect(aRect);
iChatControls = new CArrayPtrFlat<CCoeControl>(1); iFocusedChatControl = NULL;
ConstructControlsL();
/******************************************
Method to construct control components
******************************************/
void CGameViewChatControl::ConstructControlsL()
{
//Topic edwin
CEikEdwin* editor = new(ELeave) CEikEdwin();
CleanupStack::PushL(editor);
editor->SetContainerWindowL(*this);
editor->ConstructL();
editor->SetObserver(this);
editor->SetBorder(TGulBorder::ESingleBlack);
CleanupStack::Pop();//editor
iChatControls->AppendL(editor);
//Entry edwin
CEikEdwin* editor2 = new(ELeave) CEikEdwin();
CleanupStack::PushL(editor2);
editor2->SetContainerWindowL(*this);
editor2->ConstructL();
editor2->SetObserver(this);
editor2->SetBorder(TGulBorder::ESingleGray);
CleanupStack::Pop();//editor2
iChatControls->AppendL(editor2);
iFocusedChatControl = iChatControls->At(ETopicInputControl);
//Set the values, height and width, for the controls
iTopicWidthInPercent = ..
iTopicHeightInPercent = ..
iEntryWidthInPercent = ..
iEntryHeightInPercent = ..
iSpacingInPercent = ..
}
Then in the Draw() function of the view:
//Layout the controls
iChatControls->At(ETopicInputControl)->SetExtent(topicOrigo,topicSize);
iChatControls->At(EEntryInputControl)->SetExtent(entryOrigo,entrySize);
I do make sure the two areas and exclusive and not coincide.
=========================================
Inspite of doing this, I cant see the controls on the screen.
Thanks a lot!
Me
Nokia Developer Expert
you need to read the last line of the previous post also.
So have you implemented the CountComponentControls() & ComponentControl() functions.
yucca
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules