I create a LISTBOX control in container, but listbox does not appear!
I write code in my "CTestAppView"(inherit from "CCoeControl") ConstructL() funtion:
[CODE] // Create a window for this application view
CreateWindowL();
iListBox = new ( ELeave ) CAknSingleStyleListBox;
iListBox->SetContainerWindowL( *this );
{
TResourceReader reader;
iEikonEnv->CreateResourceReaderLC( reader, R_MY_LIST_BOX );
iListBox->ConstructFromResourceL( reader );
CleanupStack::PopAndDestroy(); // reader internal state
}
// the listbox owns the items in the list and will free them
iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
iListBox->SetFocus( ETrue );
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();[/CODE]
Run this program, the UI is blank white, the listbox created but I can't see it.....
Re: I create a LISTBOX control in container, but listbox does not appear!
Hi Aluzi,
Have you implemented
CountComponentControls() and ComponentControl(TInt aIndex) methods in your container class?
Regards,
Kavit.
Re: I create a LISTBOX control in container, but listbox does not appear!
Hi please go througth below link,
[U][url]http://wiki.forum.nokia.com/index.php/Listbox_creation_using_resource[/url][/U]
Re: I create a LISTBOX control in container, but listbox does not appear!
Hi,
Have you implemented virtual functions deriving from CCoeControl SizeChanged(),CountComponentControls() and ComponentControl() properly? Just check the listbox related documents in SDK doc. And lot of examples in forum nokia related to listbox, just go through it.
Regards,
Eswar
Re: I create a LISTBOX control in container, but listbox does not appear!
Hi,
pls go through the following link..
[url]http://wiki.forum.nokia.com/index.php/Listbox_creation_using_resource[/url]
By,
Chandra.
Re: I create a LISTBOX control in container, but listbox does not appear!
[QUOTE=aluzi;402272]I write code in my "CTestAppView"(inherit from "CCoeControl") ConstructL() funtion:
[CODE] // Create a window for this application view
CreateWindowL();
iListBox = new ( ELeave ) CAknSingleStyleListBox;
iListBox->SetContainerWindowL( *this );
{
TResourceReader reader;
iEikonEnv->CreateResourceReaderLC( reader, R_MY_LIST_BOX );
iListBox->ConstructFromResourceL( reader );
CleanupStack::PopAndDestroy(); // reader internal state
}
// the listbox owns the items in the list and will free them
iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );
iListBox->SetFocus( ETrue );
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();[/CODE]
Run this program, the UI is blank white, the listbox created but I can't see it.....[/QUOTE]
Hi use this in SizeChanged()
{
iListBox->SetExtent(TPoint(0,0), iListBox->MinimumSize() );
}
May be helpfull for u.
regards
Md.kashif
Re: I create a LISTBOX control in container, but listbox does not appear!
Hi ,
if you are using SetExtent
[HTML]
iListBox = new(ELeave) CAknSingleNumberStyleListBox();
iListBox->ConstructL(this);
iListBox->SetContainerWindowL(*this);
const TPoint aPoint(0,0);
const TSize aSize(180,160);
iListBox->SetExtent(aPoint,aSize);
[/HTML]
Regards,
Parag Purkar
Re: I create a LISTBOX control in container, but listbox does not appear!
[QUOTE=parag_purkar;402896]Hi ,
1)Check for Item format of list box.
e.g
[HTML] _LIT(KListItemFormat,"%d\t%s\t\t");[/HTML]
2)if you are using SetExtent
[HTML]
iListBox = new(ELeave) CAknSingleNumberStyleListBox();
iListBox->ConstructL(this);
iListBox->SetContainerWindowL(*this);
const TPoint aPoint(0,0);
const TSize aSize(180,160);
iListBox->SetExtent(aPoint,aSize);
[/HTML]
Regards,
Parag Purkar[/QUOTE]
hi Parag when in this thread use only CAknSingleStyleListBox, why u told format of CAknSingleNumberStyleListBox().Here no need for this format
_LIT(KListItemFormat,"%d\t%s\t\t");
Regards
Md.kashif
Re: I create a LISTBOX control in container, but listbox does not appear!
Yes Kashif you are correct I made correction in my post