#include "wx/textctrl.h"
#include "wx/dynarray.h"
+#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
+class wxMSWListItemData;
+
+// define this symbol to indicate the availability of SetColumnsOrder() and
+// related functions
+#define wxHAS_LISTCTRL_COLUMN_ORDER
/*
The wxListCtrl can show lists of items in four different modes:
*/
-class WXDLLEXPORT wxListCtrl: public wxControl
+class WXDLLIMPEXP_CORE wxListCtrl: public wxControl
{
public:
/*
bool SetItemColumnImage(long item, long column, int image);
// Gets the item text
- wxString GetItemText(long item) const;
+ wxString GetItemText(long item, int col = 0) const;
// Sets the item text
void SetItemText(long item, const wxString& str);
void ClearAll();
// Edit the label
- wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl));
+ wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
// End label editing, optionally cancelling the edit
bool EndEditLabel(bool cancel);
// or zero if the two items are equivalent.
// data is arbitrary data to be passed to the sort function.
- bool SortItems(wxListCtrlCompare fn, long data);
+ bool SortItems(wxListCtrlCompare fn, wxIntPtr data);
// IMPLEMENTATION
virtual bool MSWCommand(WXUINT param, WXWORD id);
// free memory taken by all internal data
void FreeAllInternalData();
+ // get the internal data object for this item (may return NULL)
+ wxMSWListItemData *MSWGetItemData(long item) const;
+
// get the item attribute, either by quering it for virtual control, or by
// returning the one previously set using setter methods for a normal one
- wxListItemAttr *DoGetItemAttr(long item) const;
+ wxListItemAttr *DoGetItemColumnAttr(long item, long column) const;
wxTextCtrl* m_textCtrl; // The control used for editing a label
// keep track of inserted/deleted columns
long m_count; // Keep track of item count to save calls to
// ListView_GetItemCount
- bool m_ignoreChangeMessages;
- // true if we have any internal data (user data & attributes)
- bool m_AnyInternalData;
+ // all wxMSWListItemData objects we use
+ wxVector<wxMSWListItemData *> m_internalData;
// true if we have any items with custom attributes
bool m_hasAnyAttr;
// return the attribute for the item (may return NULL if none)
virtual wxListItemAttr *OnGetItemAttr(long item) const;
+ // return the attribute for the given item and column (may return NULL if none)
+ virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
+ {
+ return OnGetItemAttr(item);
+ }
+
private:
// process NM_CUSTOMDRAW notification message
WXLPARAM OnCustomDraw(WXLPARAM lParam);
+ // set the extended styles for the control (used by Create() and
+ // UpdateStyle()), only should be called if InReportView()
+ void MSWSetExListStyles();
+
+ // initialize the (already created) m_textCtrl with the associated HWND
+ void InitEditControl(WXHWND hWnd);
+
+ // destroy m_textCtrl if it's currently valid and reset it to NULL
+ void DeleteEditControl();
+
+
DECLARE_DYNAMIC_CLASS(wxListCtrl)
DECLARE_EVENT_TABLE()
- DECLARE_NO_COPY_CLASS(wxListCtrl)
+ wxDECLARE_NO_COPY_CLASS(wxListCtrl);
};
#endif // _WX_LISTCTRL_H_