Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    4

    Help, numbers showing in place of icons in listbox

    I am creating a CEikColumnListBox object from resource and appending iconarray to it . To my dismay while running I am getting a list with raw text array array output in the format
    0\t>\t\t\t\t.
    my code follows .
    Code:
    RESOURCE LISTBOX r_alert_listbox 
    { 
    	flags = EAknListBoxMarkableList;//EAknListBoxSelectionList;
    	array_id = r_alert_listbox_items; 
    }
    RESOURCE ARRAY r_alert_listbox_items 
    { 
    items = {
    		LBUF { txt = "0\t>\t\t\t\t";},
    		LBUF { txt = "0\t=\t\t\t\t"; },
    		LBUF { txt = "0\t<\t\t\t\t"; }
    		}; 
    }
    Code:
    // list box
    	TResourceReader reader; 	
    	iCoeEnv->CreateResourceReaderLC(reader, R_ALERT_LISTBOX);
    	ilist2= new (ELeave) CEikColumnListBox;
    	 ilist2->SetContainerWindowL(*this);
    	 ilist2->ConstructFromResourceL(reader);
    	 
    	 _LIT(KIconFile,"z:\\resource\\apps\\TextBoxDemo_0xEC98B44F.mbm");
    	 ilist2->Model()->SetOwnershipType(ELbmOwnsItemArray);	
    	 // construct icon array with granularity 3 
    	 CArrayPtr<CGulIcon>* iconList = new (ELeave) CAknIconArray(4);
    	 // push to stack 
    	 CleanupStack::PushL(iconList); 
    	 // Append graphic "radio" to icon list 
    	 iconList->AppendL( CEikonEnv::Static()->CreateIconL( KIconFile, EMbmTextboxdemo_0xec98b44fRadiobutton, EMbmTextboxdemo_0xec98b44fRadiobutton_mask) ); 
    	 // Append graphic "radio_visit" to icon list 
    	 iconList->AppendL( CEikonEnv::Static()->CreateIconL( KIconFile, EMbmTextboxdemo_0xec98b44fRadiobutton_visit, EMbmTextboxdemo_0xec98b44fRadiobutton_mask) );
    	 // Append graphic "radio_on" to icon list 
    	 iconList->AppendL( CEikonEnv::Static()->CreateIconL( KIconFile, EMbmTextboxdemo_0xec98b44fRadiobutton_visit, EMbmTextboxdemo_0xec98b44fRadiobutton_mask) );
    	 // Append graphic "radio_on_visit" to icon list 
    	 iconList->AppendL( CEikonEnv::Static()->CreateIconL( KIconFile, EMbmTextboxdemo_0xec98b44fRadiobutton_on_visit, EMbmTextboxdemo_0xec98b44fRadiobutton_mask) );
    	 // set icons array to list 
    	 ilist2->ItemDrawer()->ColumnData()->SetIconArray( iconList );
    	
    	 CleanupStack::Pop(); // iconList 
    	 // update listbox 
    	 ilist2->HandleItemAdditionL();
    	 
    	 ilist2->SetRect(TRect(2,55,200,120));
    	 ilist2->SetItemHeightL(20);
    	 ilist2->ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0,30);
    	 ilist2->ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1,30);
    
    	CleanupStack::PopAndDestroy();
    	ilist2->ActivateL();
    	
    	// Activate the window, which makes it ready to be drawn
    	ActivateL();

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Help, numbers showing in place of icons in listbox

    There is a problem with you list item format.
    LBUF { txt = "0\t>\t\t\t\t";},
    LBUF { txt = "0\t=\t\t\t\t"; },
    LBUF { txt = "0\t<\t\t\t\t"; }

    Please check the format styles.
    this is one type:
    item.Format(_L("%d\t%S\t%S\t%d"),accountManager->At(i).GetType(),&name,&p1,EAccountDisconnected+accountManager->State(i));

Similar Threads

  1. icons not showing in listbox
    By adamlah in forum Symbian
    Replies: 6
    Last Post: 2009-01-29, 10:54
  2. Can I place listbox in FORM?
    By aluzi in forum Symbian
    Replies: 0
    Last Post: 2008-03-29, 16:51
  3. How to place flash-made icons in S60 Theme Studio?
    By heylife in forum Streaming and Video
    Replies: 0
    Last Post: 2006-03-21, 13:06
  4. listbox with icons
    By betasuppe in forum Symbian User Interface
    Replies: 7
    Last Post: 2004-11-25, 09:19
  5. how to place background/backdrop on listbox
    By mickeyREN in forum Symbian
    Replies: 1
    Last Post: 2004-06-07, 04:28

Posting Permissions

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