Пример #1
0
// ---------------------------------------------------------
// CSymellaSearchContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CSymellaSearchContainer::ConstructL(const TRect& aRect)
{
    CreateWindowL();

    iListBox = new (ELeave) CAknSingleNumberStyleListBox();
	iListBox->SetMopParent(this);
	iListBox->ConstructL(this,EAknListBoxSelectionList);
	iListBox->SetContainerWindowL(*this);
	
	TPtrC8 searcString8 = CTR->SearchString();
	
	if (CTR->SearchString() != KNullDesC8)
	{
		HBufC* searchString = HBufC::NewLC(searcString8.Length() + 30);
		TPtr searchStringPtr (searchString->Des());
		searchStringPtr.Copy(searcString8);
		searchStringPtr.Insert(0, _L("(searching for \""));
		searchStringPtr.Append(_L("\")"));
		iListBox->View()->SetListEmptyTextL(searchStringPtr);
		CleanupStack::PopAndDestroy(); // searchString		
	}
	else
		iListBox->View()->SetListEmptyTextL(_L("(no active search)"));

	iListBox->CreateScrollBarFrameL();
	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
		CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
		

	CreateFindBoxL();

    SetRect(aRect);
    ActivateL();
}
Пример #2
0
void CSymellaSearchContainer::CreateFindBoxL()
{
	DeleteFindBox();
	
		// Sets style of findbox.
    CAknSearchField::TSearchFieldStyle style( 
        CAknSearchField::ESearch );
    style = CAknSearchField::EPopup;   
    /*if ( flagsOfPopup )
    {
    	style = CAknSearchField::EPopup;
    }*/

    // Creates FindBox.
    iFindBox = CreateFindBoxL( iListBox, iListBox->Model(), style );

    //if ( iFindBox && style == CAknSearchField::EPopup )
    //{
	    // Popup findbox is not shown when listbox display initial.
	//    iFindBox->MakeVisible( EFalse );
    //}
//	iFindBox->SetFocus(ETrue);
	iFindBox->MakeVisible(EFalse);
	
//	iFindBox->ActivateL();
	
}
void CManualSmsListContainer::CreateListBox()
{
	CreateWindowL();		

	iListBox = new (ELeave) CAknDoubleGraphicStyleListBox;

	iListBox->SetContainerWindowL( *this );
	iListBox->ConstructL( this, EAknListBoxMultiselectionList);

	// Create the scroll indicator
	iListBox->CreateScrollBarFrameL(ETrue);
	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

	iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray );

	// Sets style of findbox.
    CAknSearchField::TSearchFieldStyle style(CAknSearchField::ESearch );
    
	// Creates FindBox.
    iFindBox = CreateFindBoxL( iListBox, iListBox->Model(), style );
}