×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    2

    Problem with CAknDoubleStyleListBox with a CAknSearchField

    I am writing a project with Carbide 1.3 and Symbian series 60 3rd edition. I am using the carbide's ui designer.

    I have several problems with a view in which i have a listbox (CAknDoubleStyleListBox) with a search field (CAknSearchField).

    First problem is that Carbide create the search field in that way

    CAknSearchField* searchField =
    CAknSearchField::NewL( *this, CAknSearchField::EPopup, 0, 40 );

    and i only can write numbers in the search field (i need write characters)

    I have read in some lists that the problem is the "EPopup", and it looks like true, because if i declared it like "ESearch" i can write characters, but now the search field doesn't
    appear in the view (i can make searchs, but i cannot see the characters that i am writing)

    I don't like that i cannot (or i don't know how to) change this property from ui designer

    Also i had to change the SizeChanged method because i cannot use the function

    AknFind::HandlePopupFindSizeChanged( this, iListBox, iListBoxSearchField );

    i must to use

    AknFind::HandleFixedFindSizeChanged( this, (CAknColumnListBox*)iListBox, iListBoxSearchField );

    but this neither solve my problem.

    I have also see that the problem could be in the InitializeControls when carbide writes me


    iListBox->SetFocus( ETrue );
    iFocusControl = iListBox;

    Somebody says that they solved the problem writing those lines

    iListBoxSearchField->SetFocus(ETrue, EDrawNow) ;
    iFocusControl = iListBoxSearchField;

    so, giving the focus to the search field. This solution also looks like the good one, but it gives me panics when i go for the second time to a view with the listbox and the search field. The aplication hangs up and exit, but no message is generated.

    The really problem is that everything works fine if i use a single listbox, but i must use a listbox with two lines of text. So, i really don't know how to solved this problem in the better way (without modifiyng code that carbide writes between:

    // [[[ begin generated function: do not modify and // ]]] end generated function

    Is possible solved this from the ui designer?
    How can i solved it?

    Thank you in advance
    Juan Ramon

  2. #2
    Registered User
    Join Date
    May 2006
    Location
    Germany
    Posts
    598

    Re: Problem with CAknDoubleStyleListBox with a CAknSearchField

    Same kind of nightmare for me.
    Avkon architecture is a joke. It all evolved from Eikon ER5 when there was no need back in 2002 to base S60 Avkon on Eikon.
    There you go I'm bitching again ;)

  3. #3
    Registered User
    Join Date
    May 2006
    Location
    Germany
    Posts
    598

    Re: Problem with CAknDoubleStyleListBox with a CAknSearchField

    Here is a workaround:
    Code:
    void CPanicObsViewInfo::SizeChanged()
    	{
    	CCoeControl::SizeChanged();
    	LayoutControls();
    	// [[[ begin generated region: do not modify [Generated Contents]				
    	AknFind::HandlePopupFindSizeChanged( this, iListBox, iListBoxSearchField );	
    	// ]]] end generated region [Generated Contents]
    	
     	//Some silly trick to be able to have a fixed search field with non CAknColumnListBox
    	TRAPD(ignore,
    		CAknSingleGraphicStyleListBox* dummy = new( ELeave ) CAknSingleGraphicStyleListBox();
    		dummy->ConstructL(this,EAknListBoxSelectionList);	
    		AknFind::HandleFixedFindSizeChanged( this, dummy, iListBoxSearchField );
    		delete dummy;		
    		//Fix the empty space between listbox and search field
    		TRect lbRect=iListBox->Rect();
    		lbRect.iBr.iY=iListBoxSearchField->Position().iY;
    		iListBox->SetRect(lbRect);		
    		);
    	}
    Also make sure to set the focus to your search field. Be happy jjig you got your solution 18 months later... never desperate ;)

Similar Threads

  1. Problem inserting items into CAknDoubleStyleListBox
    By doesitmatter in forum Symbian
    Replies: 4
    Last Post: 2007-12-27, 21:42
  2. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  3. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

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