X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06cd40a8b92bb3836ba90aa9475daa0546d44c84..1f0acb435592470b421b80df854fbbb08cd2853f:/include/wx/generic/listctrl.h diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 6fb3200156..f2db368a54 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -11,6 +11,7 @@ #ifndef _WX_GENERIC_LISTCTRL_H_ #define _WX_GENERIC_LISTCTRL_H_ +#include "wx/scrolwin.h" #include "wx/textctrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; @@ -19,11 +20,6 @@ class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_CORE wxDropTarget; #endif -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - - //----------------------------------------------------------------------------- // internal classes //----------------------------------------------------------------------------- @@ -44,21 +40,21 @@ public: { Init(); } - + wxGenericListCtrl( wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - const wxString &name = wxListCtrlNameStr) + const wxString &name = wxListCtrlNameStr) : wxScrollHelper(this) { Create(parent, winid, pos, size, style, validator, name); } - + virtual ~wxGenericListCtrl(); - + void Init(); bool Create( wxWindow *parent, @@ -83,7 +79,7 @@ public: bool SetItemState( long item, long state, long stateMask); bool SetItemImage( long item, int image, int selImage = -1 ); bool SetItemColumnImage( long item, long column, int image ); - wxString GetItemText( long item ) const; + wxString GetItemText( long item, int col = 0 ) const; void SetItemText( long item, const wxString& str ); wxUIntPtr GetItemData( long item ) const; bool SetItemPtrData(long item, wxUIntPtr data); @@ -125,7 +121,7 @@ public: void SetItemCount(long count); wxTextCtrl *EditLabel(long item, - wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); + wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl)); wxTextCtrl* GetEditControl() const; void Edit( long item ) { EditLabel(item); } @@ -142,10 +138,7 @@ public: long InsertColumn( long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT, int width = -1 ); bool ScrollList( int dx, int dy ); - bool SortItems( wxListCtrlCompare fn, long data ); - bool Update( long item ); - // Must provide overload to avoid hiding it (and warnings about it) - virtual void Update() { wxControl::Update(); } + bool SortItems( wxListCtrlCompare fn, wxIntPtr data ); // are we in report mode? bool InReportView() const { return HasFlag(wxLC_REPORT); } @@ -166,6 +159,10 @@ public: wxDEPRECATED( int GetItemSpacing( bool isSmall ) const ); #endif // WXWIN_COMPATIBILITY_2_6 + + // overridden base class virtuals + // ------------------------------ + virtual wxVisualAttributes GetDefaultAttributes() const { return GetClassDefaultAttributes(GetWindowVariant()); @@ -174,9 +171,15 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + virtual void Update(); + + // implementation only from now on // ------------------------------- + // generic version extension, don't use in portable code + bool Update( long item ); + void OnInternalIdle( ); // We have to hand down a few functions @@ -209,7 +212,6 @@ public: m_ownsImageListState; wxListHeaderWindow *m_headerWin; wxListMainWindow *m_mainWin; - wxCoord m_headerHeight; protected: virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); @@ -219,7 +221,7 @@ protected: virtual void DoClientToScreen( int *x, int *y ) const; virtual void DoScreenToClient( int *x, int *y ) const; - virtual wxSize DoGetBestSize() const; + virtual wxSize DoGetBestClientSize() const; // return the text for the given column of the given item virtual wxString OnGetItemText(long item, long column) const; @@ -240,16 +242,18 @@ protected: virtual wxBorder GetDefaultBorder() const; + virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size); + private: void CreateOrDestroyHeaderWindowAsNeeded(); void OnScroll( wxScrollWinEvent& event ); void OnSize( wxSizeEvent &event ); - virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size); // we need to return a special WM_GETDLGCODE value to process just the // arrows but let the other navigation characters through -#ifdef __WXMSW__ - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); +#if defined(__WXMSW__) && !defined(__WXWINCE__) && !defined(__WXUNIVERSAL__) + virtual WXLRESULT + MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); #endif // __WXMSW__ WX_FORWARD_TO_SCROLL_HELPER() @@ -280,7 +284,7 @@ public: : wxGenericListCtrl(parent, winid, pos, size, style, validator, name) { } - + }; #endif // !__WXMSW__ || __WXUNIVERSAL__