- MyListCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos,
- const wxSize& size, long style):
- wxListCtrl(parent, id, pos, size, style)
- {
- }
-
- void OnBeginDrag(wxListEvent& event);
- void OnBeginRDrag(wxListEvent& event);
- void OnBeginLabelEdit(wxListEvent& event);
- void OnEndLabelEdit(wxListEvent& event);
- void OnDeleteItem(wxListEvent& event);
- void OnGetInfo(wxListEvent& event);
- void OnSetInfo(wxListEvent& event);
- void OnSelected(wxListEvent& event);
- void OnDeselected(wxListEvent& event);
- void OnKeyDown(wxListEvent& event);
-
- DECLARE_EVENT_TABLE()
+ MyListCtrl(wxWindow *parent,
+ const wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style)
+ : wxListCtrl(parent, id, pos, size, style),
+ m_attr(*wxBLUE, *wxLIGHT_GREY, wxNullFont)
+ {
+ m_updated = -1;
+
+#ifdef __POCKETPC__
+ EnableContextMenu();
+#endif
+ }
+
+ // add one item to the listctrl in report mode
+ void InsertItemInReportView(int i);
+
+ void OnColClick(wxListEvent& event);
+ void OnColRightClick(wxListEvent& event);
+ void OnColBeginDrag(wxListEvent& event);
+ void OnColDragging(wxListEvent& event);
+ void OnColEndDrag(wxListEvent& event);
+ void OnBeginDrag(wxListEvent& event);
+ void OnBeginRDrag(wxListEvent& event);
+ void OnBeginLabelEdit(wxListEvent& event);
+ void OnEndLabelEdit(wxListEvent& event);
+ void OnDeleteItem(wxListEvent& event);
+ void OnDeleteAllItems(wxListEvent& event);
+ void OnSelected(wxListEvent& event);
+ void OnDeselected(wxListEvent& event);
+ void OnListKeyDown(wxListEvent& event);
+ void OnActivated(wxListEvent& event);
+ void OnFocused(wxListEvent& event);
+ void OnCacheHint(wxListEvent& event);
+
+ void OnChar(wxKeyEvent& event);
+
+#if USE_CONTEXT_MENU
+ void OnContextMenu(wxContextMenuEvent& event);
+#endif
+
+ void OnRightClick(wxMouseEvent& event);
+
+private:
+ void ShowContextMenu(const wxPoint& pos);
+ wxLog *m_logOld;
+ void SetColumnImage(int col, int image);
+
+ void LogEvent(const wxListEvent& event, const wxChar *eventName);
+ void LogColEvent(const wxListEvent& event, const wxChar *eventName);
+
+ virtual wxString OnGetItemText(long item, long column) const;
+ virtual int OnGetItemColumnImage(long item, long column) const;
+ virtual wxListItemAttr *OnGetItemAttr(long item) const;
+
+ wxListItemAttr m_attr;
+
+ long m_updated;
+
+
+ DECLARE_NO_COPY_CLASS(MyListCtrl)
+ DECLARE_EVENT_TABLE()