// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "listctrl.h"
- #pragma implementation "listctrlbase.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(NMLVFINDITEM)
#define HAVE_NMLVFINDITEM 1
#elif defined(__DMC__) || defined(NM_FINDITEM)
- #define HAVE_NM_FINDITEM 1
+ #define HAVE_NMLVFINDITEM 1
+ #define NMLVFINDITEM NM_FINDITEM
#endif
// ----------------------------------------------------------------------------
return col;
}
+void wxListCtrl::SetItemFont( long item, const wxFont &f )
+{
+ wxListItem info;
+ info.m_itemId = item;
+ info.SetFont( f );
+ SetItem( info );
+}
+
+wxFont wxListCtrl::GetItemFont( long item ) const
+{
+ wxFont f;
+ wxListItemInternalData *data = wxGetInternalData(this, item);
+ if ( data && data->attr )
+ f = data->attr->GetFont();
+
+ return f;
+}
+
// Gets the number of selected items in the list control
int wxListCtrl::GetSelectedItemCount() const
{
}
break;
-#if HAVE_NMLVFINDITEM || HAVE_NM_FINDITEM
+#ifdef HAVE_NMLVFINDITEM
case LVN_ODFINDITEM:
// this message is only used with the virtual list control but
// even there we don't want to always use it: in a control with
// application waiting while it performs linear search
if ( IsVirtual() && GetItemCount() <= 1000 )
{
-#if HAVE_NMLVFINDITEM
NMLVFINDITEM* pFindInfo = (NMLVFINDITEM*)lParam;
-#else
- NM_FINDITEM* pFindInfo = (NM_FINDITEM*)lParam;
-#endif
// no match by default
*result = -1;
processed = false;
}
break;
-#endif // HAVE_NMLVFINDITEM || HAVE_NM_FINDITEM
+#endif // HAVE_NMLVFINDITEM
case LVN_GETDISPINFO:
if ( IsVirtual() )
case LVN_ENDLABELEDITA:
case LVN_ENDLABELEDITW:
- // logic here is inversed compared to all the other messages
+ // logic here is inverted compared to all the other messages
*result = event.IsAllowed();
// don't keep a stale wxTextCtrl around
//
// we don't use LVCFMT_COL_HAS_IMAGES because it doesn't seem to
// make any difference in my tests -- but maybe we should?
- lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
+ if ( item.m_image != -1 )
+ lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
lvCol.iImage = item.m_image;
}