X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..ce3ed50dbe32d118321082db84c3a9abb047d5b7:/include/wx/msw/listctrl.h?ds=sidebyside diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index 95f7a89956..863f46b01c 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -5,12 +5,12 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __LISTCTRLH__ -#define __LISTCTRLH__ +#ifndef _WX_LISTCTRL_H_ +#define _WX_LISTCTRL_H_ #ifdef __GNUG__ #pragma interface "listctrl.h" @@ -225,7 +225,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl int GetCountPerPage(void) const; // Gets the edit control for editing labels. - wxTextCtrl& GetEditControl(void) const; + wxTextCtrl* GetEditControl(void) const; // Gets information about the item bool GetItem(wxListItem& info) const ; @@ -258,7 +258,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl bool SetItemData(long item, long data) ; // Gets the item rectangle - bool GetItemRect(long item, wxRectangle& rect, int code = wxLIST_RECT_BOUNDS) const ; + bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ; // Gets the item position bool GetItemPosition(long item, wxPoint& pos) const ; @@ -341,8 +341,11 @@ class WXDLLEXPORT wxListCtrl: public wxControl // Clears items, and columns if there are any. void ClearAll(void); - // Edits a label - wxTextCtrl& Edit(long item) ; + // Edit the label + wxTextCtrl* EditLabel(long item, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); + + // End label editing, optionally cancelling the edit + bool EndEditLabel(bool cancel); // Ensures this item is visible bool EnsureVisible(long item) ; @@ -415,8 +418,8 @@ class WXDLLEXPORT wxListCtrl: public wxControl void Command(wxCommandEvent& event) { ProcessCommand(event); }; // IMPLEMENTATION - bool MSWCommand(WXUINT param, WXWORD id); - bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam); + virtual bool MSWCommand(WXUINT param, WXWORD id); + virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result); // Recreate window - seems to be necessary when changing a style. void RecreateWindow(void); @@ -426,7 +429,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl char *AddPool(const wxString& str); protected: - wxTextCtrl m_textCtrl; // The control used for editing a label + wxTextCtrl* m_textCtrl; // The control used for editing a label wxImageList * m_imageListNormal; // The image list for normal icons wxImageList * m_imageListSmall; // The image list for small icons wxImageList * m_imageListState; // The image list state icons (not implemented yet) @@ -439,11 +442,9 @@ protected: }; -class WXDLLEXPORT wxListEvent: public wxCommandEvent +class WXDLLEXPORT wxListEvent : public wxNotifyEvent { - DECLARE_DYNAMIC_CLASS(wxListEvent) - - public: +public: wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); int m_code; @@ -454,6 +455,8 @@ class WXDLLEXPORT wxListEvent: public wxCommandEvent wxPoint m_pointDrag; wxListItem m_item; + + DECLARE_DYNAMIC_CLASS(wxListEvent) }; typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); @@ -471,6 +474,7 @@ typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); #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 - // __LISTCTRLH__ + // _WX_LISTCTRL_H_