86 { |
86 { |
87 CreateWindowL(); |
87 CreateWindowL(); |
88 |
88 |
89 // Instantiate a listbox for the channel list |
89 // Instantiate a listbox for the channel list |
90 iChannelList = new ( ELeave ) CAknDoubleNumberStyleListBox(); |
90 iChannelList = new ( ELeave ) CAknDoubleNumberStyleListBox(); |
91 iControls.Append( iChannelList ); |
|
92 iChannelList->SetContainerWindowL( *this ); |
91 iChannelList->SetContainerWindowL( *this ); |
93 iChannelList->SetListBoxObserver( this ); |
92 iChannelList->SetListBoxObserver( this ); |
94 iChannelList->ConstructL( this, CEikListBox::ELoopScrolling | EAknListBoxSelectionList ); // Looped list |
93 iChannelList->ConstructL( this, CEikListBox::ELoopScrolling | EAknListBoxSelectionList ); // Looped list |
95 iChannelList->SetRect( aRect ); // Set boundaries for listbox |
94 iChannelList->SetRect( aRect ); // Set boundaries for listbox |
96 // Create scrollbars |
95 // Create scrollbars |
558 // Return the number of controls in the window owned by this container |
556 // Return the number of controls in the window owned by this container |
559 // --------------------------------------------------------- |
557 // --------------------------------------------------------- |
560 // |
558 // |
561 TInt CFMRadioChannelListContainer::CountComponentControls() const |
559 TInt CFMRadioChannelListContainer::CountComponentControls() const |
562 { |
560 { |
563 return iControls.Count(); |
561 return 1; |
564 } |
562 } |
565 |
563 |
566 // --------------------------------------------------------- |
564 // --------------------------------------------------------- |
567 // CFMRadioChannelListContainer::ComponentControl |
565 // CFMRadioChannelListContainer::ComponentControl |
568 // Return the control corresponding to the specified index |
566 // Return the control corresponding to the specified index |
569 // --------------------------------------------------------- |
567 // --------------------------------------------------------- |
570 // |
568 // |
571 CCoeControl* CFMRadioChannelListContainer::ComponentControl( TInt aIndex ) const |
569 CCoeControl* CFMRadioChannelListContainer::ComponentControl( TInt aIndex ) const |
572 { |
570 { |
573 return STATIC_CAST( CCoeControl *,iControls[aIndex] ); |
571 CCoeControl* control = NULL; |
|
572 |
|
573 switch ( aIndex ) |
|
574 { |
|
575 case 0: |
|
576 { |
|
577 control = iChannelList; |
|
578 break; |
|
579 } |
|
580 default: |
|
581 { |
|
582 break; |
|
583 } |
|
584 } |
|
585 |
|
586 return control; |
574 } |
587 } |
575 |
588 |
576 // --------------------------------------------------------- |
589 // --------------------------------------------------------- |
577 // CFMRadioChannelListContainer::OfferKeyEventL |
590 // CFMRadioChannelListContainer::OfferKeyEventL |
578 // Allow the channel list to process key events |
591 // Allow the channel list to process key events |