Problem with phone and find box.
| Wed, 2007-02-14 13:40 | |
|
|
Hi all, I have this code: Code: void CBestSalesContainerLocClientes::ConstructL(const TRect& aRect) { CreateWindowL(); //TBuf<KBufLength> text; _LIT(KDbCreateDb,"BestSales.db"); _LIT(KCEpoc32exData,"C:\\epoc32ex\\data\\"); // The database is contained in a permanent file store: // "C:\epoc32ex\data\BestSales.db" TParse name; TInt fsret = fsSession.Connect(); // start a file session if (fsret != KErrNone){ User::Leave(fsret); } fsSession.MkDirAll(KCEpoc32exData); fsSession.Parse(KDbCreateDb,KCEpoc32exData,name); // iListBox = new ( ELeave ) CAknSingleGraphicStyleListBox( ); iListBox->ConstructL( this , 0 ); iListBox->SetContainerWindowL( *this ); Verifica(name.FullName()); CEikScrollBarFrame* scrollBar = iListBox->CreateScrollBarFrameL(); iListBox->SetRect(aRect.Size()); iListBox->CreateScrollBarFrameL(ETrue); iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto); iListBox->SetFocus(ETrue); iListBox->ActivateL(); iFindBox = CreateFindBoxL(iListBox, iListBox->Model(), CAknSearchField::EPopup); if ( iFindBox ) { iFindBox->MakeVisible( EFalse ); iFindBox->ActivateL(); // activate Find box. iFindBox->SetFocus( ETrue ); } SetRect(aRect); ActivateL(); } This works correctly in the emulator, but when i put it in the phone, i cant open the program. I comment this lines and the program works fine in the phone: Code: /*iFindBox = CreateFindBoxL(iListBox, iListBox->Model(), CAknSearchField::EPopup); if ( iFindBox ) { iFindBox->MakeVisible( EFalse ); iFindBox->ActivateL(); // activate Find box. iFindBox->SetFocus( ETrue ); }*/ What is wrong with the FindBox? Thanks. Developer for PalmOS and Symbian. |






Forum posts: 135
iFindBox = CreateFindBoxL(iListBox, iListBox->Model(), CAknSearchField::EFixed);
if ( iFindBox )
{
iFindBox->MakeVisible( EFalse );
iFindBox->ActivateL(); // activate Find box.
iFindBox->SetFocus( ETrue );
}
I use 'EFixed' and works fine. But i have other problem now... If i put 'MakeVisible( ETrue )', when I go to the screen, seens to be there the List, but what I got is like a big find box and I cant see the List.
Developer for PalmOS and Symbian.
by Serginho
Forum posts: 135
Developer for PalmOS and Symbian.
by Serginho
Forum posts: 135
** ConstructL **
CAknSearchField::TSearchFieldStyle style(CAknSearchField::ESearch );
iFindBox = CreateFindBoxL( iListBox, iListBox->Model(), style );
iFindBox->MakeVisible( ETrue );
** CreateFindBoxL **
CAknSearchField* findbox = NULL;
if ( aListBox && aModel )
{
CAknFilteredTextListBoxModel* model = STATIC_CAST( CAknFilteredTextListBoxModel*, aModel );
findbox = CAknSearchField::NewL( *this, aStyle, NULL, 30 );
CleanupStack::PushL(findbox);
model->CreateFilterL( aListBox, findbox );
CleanupStack::Pop(findbox); // findbox
}
return findbox;
** SizeChanged **
if (iFindBox) { SizeChangedForFindBox(); }
TRect lb_rect=Rect();
if ( iListBox )
{
if ( iFindBox )
{
lb_rect.Resize(0, -27);
}
else
{
lb_rect.Resize(0, 0);
}
lb_rect.Move(0, 0);
iListBox->SetRect(lb_rect);
}
if (iFindBox)
{
TRect edit_rect=Rect();
edit_rect.SetHeight(28);
edit_rect.Move(0, lb_rect.Height());
iFindBox->SetRect(edit_rect);
iFindBox->MakeVisible(ETrue);
iFindBox->SetFocus(ETrue);
}
** SizeChangedForFindBox **
if ( iListBox && iFindBox )
{
TInt findWindowResourceId( R_AVKON_FIND_PANE );
TInt listAreaResourceId( R_AVKON_LIST_GEN_PANE_X );
TInt findWindowParentId( R_AVKON_MAIN_PANE_PARENT_NONE );
TBool flagsOfPopup( ETrue );
}
now its working fine!!!
Developer for PalmOS and Symbian.
by Serginho