×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    5

    Yucca!-Hide Listbox not working with MakeVisible(EFalse)

    Hi
    I am trying to trying to hide a list box of CAknSingleLargeStyleListBox type once an item in the list is selected and activate a new listbox of a different type. However when i hide the listbox by using MakeVisible(EFalse) the listbox looses focus as expected but unfortunately the listbox does not get erased from the screen but rather just becomes transparent and remains in the background. iwant to know how to clear the screen once the listbox is made invisible so that the contents of the lisbox are no more visible. I do not want to destroy the listbox and its content because i want to reuse it again later in the program.

    void CMyCallGuiContainer::Draw(const TRect& aRect)
    {
    CWindowGc& gc = SystemGc();
    if(ClearBack==1)
    {
    gc.Clear();

    }
    gc.Clear();
    ClearBack=0;

    gc.SetPenStyle( CGraphicsContext::ENullPen );
    gc.DrawRect( aRect );
    }

    void CMyCallGuiContainer::HandleListBoxEventL(CEikListBox* listBox, TListBoxEvent eventType)
    {
    _LIT(msg,"EEventEnterKeyPressed %d");
    TBuf<50> imsg;


    switch (eventType)
    {
    case EEventEnterKeyPressed :
    {
    CEikColumnListBox *ListBoxptr=(CEikColumnListBox *)listBox;

    iEikonEnv->InfoMsg(_L("Same"));
    MainListHandle(listBox,eventType);


    }
    break;
    };
    }

    void CMyCallGuiContainer::MainListHandle(CEikListBox* listBox, TListBoxEvent eventType)
    {

    TInt ctr;
    ctr=listBox->CurrentItemIndex();

    if(ctr==0)
    {
    listBox->MakeVisible(EFalse);

    ClearBack=1;
    listBox->DrawDeferred();
    listBox->DrawNow();
    DrawNow();
    //iAvkonAppUi->DrawNow();
    //DrawDeferred();
    }

    }
    Last edited by Salvesh; 2005-02-03 at 08:02.

  2. #2
    Registered User
    Join Date
    Feb 2005
    Posts
    5

    Yucca Still looking for a solution

    Hi
    Im still looking for a solution to the problem posted above

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166
    hmmm. So you basically want to switch the listboxes on fly.

    So, I would basically just have a CCoeControl pointer in the class that has the right pointer to the currently active listbox. And then just set it right when needed and call Drawnow.

    then in your Count controls function I would return one for the count of listboxes & component control function I would return the CCoeControl pointer , so the right listbox should then get drawn correctly.

    try it out, maybe it'll work.

    yucca

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    5

    The real Problem

    Hi yucca
    Thank you for your response.
    Actually i do have some idea as to how to change the listbox dynamically. But the real problem I am facing is that when I try to hide the previous listbox using MakeVisible(EFalse) the listbox does loose focus as expected but somehow it does not get cleared from the screen even after calling DrawNow with gc.Clear() in it(as seen in my code above). what i feel is that gc.clear only clears the objects like lines and text drawn with the system gc(graphics context) however things drawn in listbox by default (like icons, text,highlight and so on)within the listbox controll do not get cleared, even after calling iListBox->DrawNow(). I dont know how to upload a file otherwise i could send you the sis file so that you could see exactly what i mean.
    Last edited by Salvesh; 2005-02-05 at 07:00.

Posting Permissions

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