X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e179bd6537b8e3d7543d23db3b6735ea7effe159..284b4c8866ab36694b6ec2a308690bba4db4fed2:/include/wx/generic/listctrl.h diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 61a4c3d1fa..32f7e7098d 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -71,7 +71,7 @@ typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData); #define wxLC_AUTOARRANGE 0x0100 // not supported in wxGLC #define wxLC_USER_TEXT 0x0200 // not supported in wxGLC (how does it work?) #define wxLC_EDIT_LABELS 0x0400 -#define wxLC_NO_HEADER 0x0800 // not supported in wxGLC +#define wxLC_NO_HEADER 0x0800 #define wxLC_NO_SORT_HEADER 0x1000 // not supported in wxGLC #define wxLC_SINGLE_SEL 0x2000 #define wxLC_SORT_ASCENDING 0x4000 @@ -187,58 +187,16 @@ class WXDLLEXPORT wxListItem: public wxObject int m_format; // left, right, centre int m_width; // width of column - wxListItem(void); + wxListItem(); }; -//----------------------------------------------------------------------------- -// wxListEvent -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxListEvent: public wxNotifyEvent -{ - DECLARE_DYNAMIC_CLASS(wxListEvent) - - 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; -}; - -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - -#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) { wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, -#define EVT_LIST_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn, (wxObject *) NULL }, - //----------------------------------------------------------------------------- // wxListItemData (internal) //----------------------------------------------------------------------------- class WXDLLEXPORT wxListItemData : public wxObject { - DECLARE_DYNAMIC_CLASS(wxListItemData); - - public: +public: wxString m_text; int m_image; long m_data; @@ -246,8 +204,8 @@ class WXDLLEXPORT wxListItemData : public wxObject int m_width,m_height; wxColour *m_colour; - public: - wxListItemData(void); +public: + wxListItemData(); wxListItemData( const wxListItem &info ); void SetItem( const wxListItem &info ); void SetText( const wxString &s ); @@ -256,17 +214,20 @@ class WXDLLEXPORT wxListItemData : public wxObject void SetPosition( int x, int y ); void SetSize( int width, int height ); void SetColour( wxColour *col ); - bool HasImage(void) const; - bool HasText(void) const; + bool HasImage() const; + bool HasText() const; bool IsHit( int x, int y ) const; void GetText( wxString &s ); int GetX( void ) const; int GetY( void ) const; - int GetWidth(void) const; - int GetHeight(void) const; - int GetImage(void) const; + int GetWidth() const; + int GetHeight() const; + int GetImage() const; void GetItem( wxListItem &info ); - wxColour *GetColour(void); + wxColour *GetColour(); + +private: + DECLARE_DYNAMIC_CLASS(wxListItemData); }; //----------------------------------------------------------------------------- @@ -287,21 +248,21 @@ class WXDLLEXPORT wxListHeaderData : public wxObject int m_height; public: - wxListHeaderData(void); + wxListHeaderData(); wxListHeaderData( const wxListItem &info ); void SetItem( const wxListItem &item ); void SetPosition( int x, int y ); void SetWidth( int w ); void SetFormat( int format ); void SetHeight( int h ); - bool HasImage(void) const; - bool HasText(void) const; + bool HasImage() const; + bool HasText() const; bool IsHit( int x, int y ) const; void GetItem( wxListItem &item ); void GetText( wxString &s ); - int GetImage(void) const; - int GetWidth(void) const; - int GetFormat(void) const; + int GetImage() const; + int GetWidth() const; + int GetFormat() const; }; //----------------------------------------------------------------------------- @@ -314,10 +275,10 @@ class WXDLLEXPORT wxListLineData : public wxObject public: wxList m_items; - wxRect m_bound_all; - wxRect m_bound_label; - wxRect m_bound_icon; - wxRect m_bound_hilight; + wxRect m_bound_all; + wxRect m_bound_label; + wxRect m_bound_icon; + wxRect m_bound_hilight; int m_mode; bool m_hilighted; wxBrush *m_hilightBrush; @@ -327,7 +288,7 @@ class WXDLLEXPORT wxListLineData : public wxObject void DoDraw( wxDC *dc, bool hilight, bool paintBG ); public: - wxListLineData( void ) {}; + wxListLineData() {}; wxListLineData( wxListMainWindow *owner, int mode, wxBrush *hilightBrush ); void CalculateSize( wxDC *dc, int spacing ); void SetPosition( wxDC *dc, int x, int y, int window_width ); @@ -344,11 +305,11 @@ class WXDLLEXPORT wxListLineData : public wxObject int GetImage( int index ); void GetRect( wxRect &rect ); void Hilight( bool on ); - void ReverseHilight( void ); + void ReverseHilight(); void DrawRubberBand( wxDC *dc, bool on ); void Draw( wxDC *dc ); bool IsInRect( int x, int y, const wxRect &rect ); - bool IsHilighted( void ); + bool IsHilighted(); void AssignRect( wxRect &dest, int x, int y, int width, int height ); void AssignRect( wxRect &dest, const wxRect &source ); }; @@ -371,8 +332,8 @@ class WXDLLEXPORT wxListHeaderWindow : public wxWindow int m_currentX; public: - wxListHeaderWindow( void ); - ~wxListHeaderWindow( void ); + wxListHeaderWindow(); + ~wxListHeaderWindow(); wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = 0, const wxString &name = "columntitles" ); @@ -411,9 +372,10 @@ class WXDLLEXPORT wxListTextCtrl: public wxTextCtrl bool *m_accept; wxString *m_res; wxListMainWindow *m_owner; + wxString m_startValue; public: - wxListTextCtrl(void) {}; + wxListTextCtrl() {}; wxListTextCtrl( wxWindow *parent, const wxWindowID id, bool *accept, wxString *res, wxListMainWindow *owner, const wxString &value = "", @@ -457,6 +419,7 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow wxString m_renameRes; bool m_isCreated; int m_dragCount; + wxPoint m_dragStart; public: wxListMainWindow(); @@ -474,7 +437,8 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow void DeselectLine( wxListLineData *line ); void DeleteLine( wxListLineData *line ); - void Edit( long item ); + void EditLabel( long item ); + void Edit( long item ) { EditLabel(item); } // deprecated void OnRenameTimer(); void OnRenameAccept();