Print Page | Close Window

CXTEditListBox (v13.4.2)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17681
Printed Date: 17 November 2024 at 12:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTEditListBox (v13.4.2)
Posted By: Michl
Subject: CXTEditListBox (v13.4.2)
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: Michl
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net