Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTEditListBox (v13.4.2)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTEditListBox (v13.4.2)

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: CXTEditListBox (v13.4.2)
    Posted: 15 December 2010 at 5:12am
Hello

This control works fine until you create this control with flag LBS_EXTENDEDSEL!

Is this known?
In this case, this flag should be removed in Create(...). So it will be more clearly that this flag is not supported.

If it a unknown problem:
- You cannot move items more than 2 levels up or down.
- If you use it with flag LBS_XT_BROWSE, following code is executed

void CXTEditListBox::OnItemBrowse()
{
    m_nIndex = GetCurSel(); // Current index.
    int nNewIndex = m_nIndex + 1; // New index.

    // If there is a valid selection made, and the
    // selection is not the last item and...
    if ((m_nIndex != LB_ERR) && (nNewIndex < GetCount()))
    {
        // Save the string for the current
        // selection.
        CString strCurItem;
        GetText(m_nIndex, strCurItem);

        // Save any item data.
        DWORD_PTR dwCurData = GetItemData(m_nIndex);

        // Remove both the new and current
        // index items...
        DeleteString(m_nIndex);

        // then swap and re-insert them into
        // the list box.
        InsertString(nNewIndex, strCurItem);

        // Restore any item data.
        SetItemData(nNewIndex, dwCurData);

        // Select the item at the new index.
        SetCurSel(nNewIndex);
    }
    // Set the focus back to the listbox.
    SetFocus();

    CWnd* pOwner = GetOwner();
    ASSERT(pOwner);

    // Send notification to owner.
    if (pOwner) pOwner->SendMessage( WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(),
        LBN_XT_ONBROWSE), (LPARAM)m_hWnd );
}

What should this code doing?? It is not necessary to swap items. In normal mode, this code don't reach.

Regards
Michael
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2010 at 3:28am
Yes, Multiple Selection is not supoprted.

"You cannot move items more than 2 levels up or down" Can't reproduce it with our sample. do you see it with it ?

checking  LBS_XT_BROWSE thing
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2010 at 4:21am
Sorry, you misunderstood me.

My described bugs raised in multiple selection mode. But this is not support how you write.
Single mode works fine.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.187 seconds.