×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    39

    Red face How to add CEikTextListBox to the application default Container ??

    Hi,

    When creating the project, I chose the "GUI Application with UI Designer" and "An empty container", the name for empty container is "CTestAppContainer"

    Now I want dynamically adding "CEikTextListBox" into that "CTestAppContainer", but don't know how to do it, please help to give me a guide or some examples.

    Below code is for testing, but don't work,
    The iTestAppContainer still shows nothing after executed the code.

    Code:
    /** 
     * Handle the selected event.
     * @param aCommand the command id invoked
     * @return ETrue if the command was handled, EFalse if not
     */
    TBool CTestAppContainerView::HandleTestMenuItemSelectedL( TInt aCommand )
    	{
    	// Create CEikTextListBox instance, list
    	CEikTextListBox* list = new (ELeave) CAknSinglePopupMenuStyleListBox;
    
    	// Initialize listbox.
    	list->ConstructL(iTestAppContainer, CEikListBox::ELeftDownInViewRect);
    
    	list->CreateScrollBarFrameL(ETrue);
    	list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto,
    			CEikScrollBarFrame::EAuto);
    	MDesCArray* textArray = list->Model()->ItemTextArray();
    	CDesCArray* itemList = static_cast<CDesCArray*> (textArray);
    
    	// Set listitems.
    	list->Model()->SetOwnershipType(ELbmOwnsItemArray);
    
    	for (TInt i = 0; i < 5; i++)
    		{
    		itemList->AppendL(_L("123456"));
    		list->HandleItemAdditionL();
    		iTestAppContainer->DrawNow();
    		}
    
            iTestAppContainer->DrawNow();
    	
    	return ETrue;
    	}
    Please notice that "iTestAppContainer" is defined in the CTestAppContainerView

    Code:
    private:
    	// [[[ begin generated region: do not modify [Generated Instance Variables]
    	CTestAppContainer* iTestAppContainer;
    	// ]]] end generated region [Generated Instance Variables]

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to add CEikTextListBox to the application default Container ??

    please check our wiki for example codes. In general you would be having all compound containers code inside the container, and in the view only handle the container, not any stuff that is inside the container. Also the drawing would also be handled inside the container.

  3. #3
    Registered User
    Join Date
    Apr 2012
    Posts
    39

    Re: How to add CEikTextListBox to the application default Container ??

    Quote Originally Posted by symbianyucca View Post
    please check our wiki for example codes. In general you would be having all compound containers code inside the container, and in the view only handle the container, not any stuff that is inside the container. Also the drawing would also be handled inside the container.
    Do you mean that it is impossible for adding control dynamically ??

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to add CEikTextListBox to the application default Container ??

    Nope, but you should handle the control inside the window owning control you are thinking of using it in, it would make the actual handling do much easier.

Similar Threads

  1. Implement background on application container
    By nishadamit09@gmail.com in forum Symbian User Interface
    Replies: 3
    Last Post: 2012-01-27, 12:04
  2. Replies: 2
    Last Post: 2011-05-18, 00:19
  3. Default theme as a background for Container
    By jameskittu in forum Symbian
    Replies: 1
    Last Post: 2010-03-23, 12:30
  4. Refresh default backround in Container
    By pavel_turbin in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2009-10-17, 16:50
  5. Exit an application from the container itself
    By himsymbian in forum Symbian
    Replies: 4
    Last Post: 2009-01-16, 12:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×