- in Win95, you can be called back to supply other information
besides text, such as state information. This saves no memory
and is probably superfluous to requirements.
- - discover why SetWindowLong doesn't properly change the
- style, requiring RecreateWindow instead.
- testing of whole API, extending current sample.
};
// type of compare function for wxListCtrl sort operation
-typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData);
+typedef int (CALLBACK *wxListCtrlCompare)(long item1, long item2, long sortData);
class WXDLLEXPORT wxListCtrl: public wxControl
{
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
- // Recreate window - seems to be necessary when changing a style.
- void RecreateWindow();
+ // bring the control in sync with current m_windowStyle value
+ void UpdateStyle();
// Add to pool: necessary because Windows needs to have a string
// still exist across 3 callbacks.
- char *AddPool(const wxString& str);
+ wxChar *AddPool(const wxString& str);
protected:
wxTextCtrl* m_textCtrl; // The control used for editing a label
int m_colCount; // Windows doesn't have GetColumnCount so must
// keep track of inserted/deleted columns
+private:
+ bool DoCreateControl(int x, int y, int w, int h);
};
-class WXDLLEXPORT wxListEvent : public wxNotifyEvent
-{
-public:
- wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
-
- int m_code;
- long m_itemIndex;
- long m_oldItemIndex;
- int m_col;
- bool m_cancelled;
- wxPoint m_pointDrag;
-
- wxListItem m_item;
-
- DECLARE_DYNAMIC_CLASS(wxListEvent)
-};
-
-typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
-
-#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, NULL },
-#define EVT_LIST_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL },
-
#endif
// _WX_LISTCTRL_H_