X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b19f2e4e191e43d9504cde5c789daf0a441662db..687b91d266990129fbbb8c21d92fa4298b458352:/include/wx/mac/carbon/listctrl.h diff --git a/include/wx/mac/carbon/listctrl.h b/include/wx/mac/carbon/listctrl.h index d77061e7c5..0b62528075 100644 --- a/include/wx/mac/carbon/listctrl.h +++ b/include/wx/mac/carbon/listctrl.h @@ -12,16 +12,12 @@ #ifndef _WX_LISTCTRL_H_ #define _WX_LISTCTRL_H_ -#include "wx/control.h" -#include "wx/event.h" -#include "wx/imaglist.h" #include "wx/generic/listctrl.h" class wxMacDataBrowserListCtrlControl; class wxMacListControl; -// type of compare function for wxListCtrl sort operation -typedef int (*wxListCtrlCompare)(long item1, long item2, long sortData); +WX_DECLARE_EXPORTED_LIST(wxListItem, wxColumnList); class WXDLLEXPORT wxListCtrl: public wxControl { @@ -312,23 +308,48 @@ class WXDLLEXPORT wxListCtrl: public wxControl void Command(wxCommandEvent& event) { ProcessCommand(event); }; + wxListCtrlCompare GetCompareFunc() { return m_compareFunc; }; + long GetCompareFuncData() { return m_compareFuncData; }; + + + // public overrides needed for pimpl approach + virtual bool SetFont(const wxFont& font); + virtual bool SetForegroundColour(const wxColour& colour); + virtual bool SetBackgroundColour(const wxColour& colour); + virtual wxColour GetBackgroundColour(); + + // with CG, we need to get the context from an kEventControlDraw event + // unfortunately, the DataBrowser callbacks don't provide the context + // and we need it, so we need to set/remove it before and after draw + // events so we can access it in the callbacks. + void MacSetDrawingContext(void* context) { m_cgContext = context; } + void* MacGetDrawingContext() { return m_cgContext; } + protected: - // overrides needed for pimpl approach + // protected overrides needed for pimpl approach virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); + int width, int height, + int sizeFlags = wxSIZE_AUTO); // common part of all ctors void Init(); wxGenericListCtrl* m_genericImpl; // allow use of the generic impl. wxMacDataBrowserListCtrlControl* m_dbImpl; - + void* m_macListCtrlEventHandler; + void* m_cgContext; + wxListCtrlCompare m_compareFunc; + long m_compareFuncData; + 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) + wxColumnList m_colsInfo; // for storing info about each column + wxColour m_textColor; + wxColour m_bgColor; + // keep track of whether or not we should delete the image list ourselves. bool m_ownsImageListNormal, m_ownsImageListSmall, @@ -343,7 +364,5 @@ protected: int m_count; // for virtual lists, store item count }; -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - #endif // _WX_LISTCTRL_H_