LVIF_STATE of wxListCtrl in MSW

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
liuyug
Experienced Solver
Experienced Solver
Posts: 53
Joined: Wed Jul 09, 2008 4:32 am

LVIF_STATE of wxListCtrl in MSW

Post by liuyug » Wed Jan 13, 2010 3:27 am

Hi,

I would like request to implement LVIF_STATE section.

wxMSW-2.8.10\src\msw\listctrl.cpp:

Code: Select all

            case LVN_GETDISPINFO:
                if ( IsVirtual() )
                {
                    LV_DISPINFO *info = (LV_DISPINFO *)lParam;

                    LV_ITEM& lvi = info->item;
                    long item = lvi.iItem;

                    if ( lvi.mask & LVIF_TEXT )
                    {
                        wxString text = OnGetItemText(item, lvi.iSubItem);
                        wxStrncpy(lvi.pszText, text, lvi.cchTextMax - 1);
                        lvi.pszText[lvi.cchTextMax - 1] = _T('\0');
                    }

                    // see comment at the end of wxListCtrl::GetColumn()
#ifdef NM_CUSTOMDRAW
                    if ( lvi.mask & LVIF_IMAGE )
                    {
                        lvi.iImage = OnGetItemColumnImage(item, lvi.iSubItem);
                    }
#endif // NM_CUSTOMDRAW

                    // even though we never use LVM_SETCALLBACKMASK, we still
                    // can get messages with LVIF_STATE in lvi.mask under Vista
                    if ( lvi.mask & LVIF_STATE )
                    {
                        // we don't have anything to return from here...
                        lvi.stateMask = 0;
                    }
add these lines, such as...

Code: Select all

                    if ( lvi.mask & LVIF_STATE )
                    {
                        // we don't have anything to return from here...
                        lvi.state = OnGetItemState(item);
                        lvi.stateMask = OnGetItemStateMask(item);
                    }



Post Reply