Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor mark_williams's Avatar
    Join Date
    Mar 2003
    Posts
    59
    I'd like to remove the selection highlight for a listbox when the control loses focus, and switch it back on when focus returns. I've tried lots of different ways with little success. The following code works for switching the selection off, but doesn't work for switching it back on.

    The problem seems to be that something resets EDisableHighlight after I've unset it.

    void CContainer::FocusChanged(TDrawNow aDrawNow)
    {
    CCoeControl::FocusChanged(aDrawNow);

    TInt flags(iListBox->ItemDrawer()->Flags());
    if(IsFocused())
    {
    TInt mask(-1);
    mask ^= CListItemDrawer::EDisableHighlight;
    flags &= mask;
    }
    else
    {
    iListBox->SetFocus(EFalse);
    flags |= CListItemDrawer::EDisableHighlight;
    }
    iListBox->ItemDrawer()->SetFlags(flags);
    iListBox->DrawNow();
    }

    Does anyone have any suggestions?

    Thanks, Mark.

  2. #2
    Registered User praveenvlm's Avatar
    Join Date
    Sep 2007
    Posts
    21
    Try This code it will Works for both Cases
    void Container::FocusChanged(CAknColumnListBox* aListBox)
    {
    if(aListBox){
    TInt flags(aListBox->ItemDrawer()->Flags());
    flags |= CListItemDrawer::EDisableHighlight;
    if(aListBox->IsFocused()){
    aListBox->ItemDrawer()->ClearFlags(flags);
    }
    else{
    aListBox->ItemDrawer()->SetFlags(flags);
    }
    aListBox->DrawNow();
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved