X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e2f308461d54c1a8df63feff4a652c56f993801..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/osx/listctrl.h?ds=sidebyside diff --git a/include/wx/osx/listctrl.h b/include/wx/osx/listctrl.h index 7c3b67cbdf..eb6b50b4a9 100644 --- a/include/wx/osx/listctrl.h +++ b/include/wx/osx/listctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listctrl.h +// Name: wx/osx/listctrl.h // Purpose: wxListCtrl class // Author: Stefan Csomor // Modified by: @@ -23,7 +23,7 @@ class wxListCtrlRenameTimer; WX_DECLARE_EXPORTED_LIST(wxListItem, wxColumnList); -class WXDLLIMPEXP_CORE wxListCtrl: public wxControl +class WXDLLIMPEXP_CORE wxListCtrl: public wxListCtrlBase { DECLARE_DYNAMIC_CLASS(wxListCtrl) public: @@ -63,8 +63,7 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl bool GetColumn(int col, wxListItem& item) const; // Sets information about this column - // TODO: NOT const to be compatible with wxGenericListCtrl API - bool SetColumn(int col, wxListItem& item) ; + bool SetColumn(int col, const wxListItem& item) ; // Gets the column width int GetColumnWidth(int col) const; @@ -103,7 +102,7 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl 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) ; @@ -160,11 +159,6 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl // list or report view long GetTopItem() const ; - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - // Add or remove a single window style void SetSingleStyle(long style, bool add = true) ; @@ -217,7 +211,7 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl 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); @@ -257,12 +251,6 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl // Insert an image/string item long InsertItem(long index, const wxString& label, int imageIndex); - // For list view mode (only), inserts a column. - long InsertColumn(long col, wxListItem& info); - - long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT, - int width = -1); - // Scrolls the list control. If in icon, small icon or report view mode, // x specifies the number of pixels to scroll. If in list view mode, x // specifies the number of columns to scroll. @@ -281,7 +269,7 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl // or zero if the two items are equivalent. // data is arbitrary data to be passed to the sort function. - bool SortItems(wxListCtrlCompare fn, wxUIntPtr data); + bool SortItems(wxListCtrlCompare fn, wxIntPtr data); wxMacDataBrowserListCtrlControl* GetListPeer() const; @@ -303,9 +291,6 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl // return the icon for the given item and column. virtual int OnGetItemColumnImage(long item, long column) const; - // return the attribute for the item (may return NULL if none) - virtual wxListItemAttr *OnGetItemAttr(long item) const; - /* Why should we need this function? Leave for now. * We might need it because item data may have changed, * but the display needs refreshing (in string callback mode) @@ -314,10 +299,10 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl bool Update(long item); */ - void Command(wxCommandEvent& event) { ProcessCommand(event); }; + void Command(wxCommandEvent& event) { ProcessCommand(event); } - wxListCtrlCompare GetCompareFunc() { return m_compareFunc; }; - wxUIntPtr GetCompareFuncData() { return m_compareFuncData; }; + wxListCtrlCompare GetCompareFunc() { return m_compareFunc; } + wxIntPtr GetCompareFuncData() { return m_compareFuncData; } // public overrides needed for pimpl approach @@ -326,6 +311,10 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl virtual bool SetBackgroundColour(const wxColour& colour); virtual wxColour GetBackgroundColour() const; + virtual void Freeze (); + virtual void Thaw (); + virtual void Update (); + // functions for editing/timer void OnRenameTimer(); bool OnRenameAccept(long itemEdit, const wxString& value); @@ -372,14 +361,14 @@ class WXDLLIMPEXP_CORE wxListCtrl: public wxControl GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); protected: + // Implement base class pure virtual methods. + long DoInsertColumn(long col, const wxListItem& info); // protected overrides needed for pimpl approach virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - virtual wxSize DoGetBestSize() const; - long m_current; wxListCtrlTextCtrlWrapper *m_textctrlWrapper; wxListCtrlRenameTimer *m_renameTimer; @@ -391,7 +380,7 @@ protected: void* m_macListCtrlEventHandler; void* m_cgContext; wxListCtrlCompare m_compareFunc; - wxUIntPtr m_compareFuncData; + wxIntPtr m_compareFuncData; wxTextCtrl* m_textCtrl; // The control used for editing a label wxImageList * m_imageListNormal; // The image list for normal icons @@ -416,7 +405,6 @@ protected: private: int CalcColumnAutoWidth(int col) const; - DECLARE_EVENT_TABLE() }; #endif