X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdc72a22686ac141e9bc4559a1171d017fdcb094..9c0f7642cccc72a0240b87814757debaadd3d44d:/include/wx/generic/listctrl.h diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index cd0ced7b50..e6e931b290 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -63,10 +63,13 @@ public: long m_data; int m_xpos,m_ypos; int m_width,m_height; - wxColour *m_colour; + + wxListItemAttr *m_attr; public: wxListItemData(); + ~wxListItemData() { delete m_attr; } + wxListItemData( const wxListItem &info ); void SetItem( const wxListItem &info ); void SetText( const wxString &s ); @@ -74,18 +77,19 @@ public: void SetData( long data ); void SetPosition( int x, int y ); void SetSize( int width, int height ); - void SetColour( wxColour *col ); bool HasImage() const; bool HasText() const; bool IsHit( int x, int y ) const; void GetText( wxString &s ); + const wxString& GetText() { return m_text; } int GetX( void ) const; int GetY( void ) const; int GetWidth() const; int GetHeight() const; int GetImage() const; - void GetItem( wxListItem &info ); - wxColour *GetColour(); + void GetItem( wxListItem &info ) const; + + wxListItemAttr *GetAttributes() const { return m_attr; } private: DECLARE_DYNAMIC_CLASS(wxListItemData); @@ -174,6 +178,11 @@ public: void AssignRect( wxRect &dest, const wxRect &source ); private: + void SetAttributes(wxDC *dc, + const wxListItemAttr *attr, + const wxColour& colText, const wxFont& font, + bool hilight); + DECLARE_DYNAMIC_CLASS(wxListLineData); }; @@ -241,9 +250,8 @@ public: bool *accept, wxString *res, wxListMainWindow *owner, const wxString &value = "", const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, -#if wxUSE_VALIDATORS - int style = 0, const wxValidator& validator = wxDefaultValidator, -#endif + int style = 0, + const wxValidator& validator = wxDefaultValidator, const wxString &name = "wxListTextCtrlText" ); void OnChar( wxKeyEvent &event ); void OnKillFocus( wxFocusEvent &event ); @@ -313,8 +321,8 @@ public: void OnSetFocus( wxFocusEvent &event ); void OnKillFocus( wxFocusEvent &event ); void OnSize( wxSizeEvent &event ); - void OnScroll(wxScrollWinEvent& event) ; - + void OnScroll(wxScrollWinEvent& event) ; + void DrawImage( int index, wxDC *dc, int x, int y ); void GetImageSize( int index, int &width, int &height ); int GetIndexOfLine( const wxListLineData *line ); @@ -369,23 +377,25 @@ class WXDLLEXPORT wxListCtrl: public wxControl { public: wxListCtrl(); - wxListCtrl( wxWindow *parent, wxWindowID id = -1, - const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, -#if wxUSE_VALIDATORS - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, -#endif - const wxString &name = "listctrl" ) + wxListCtrl( wxWindow *parent, + wxWindowID id = -1, + const wxPoint &pos = wxDefaultPosition, + const wxSize &size = wxDefaultSize, + long style = wxLC_ICON, + const wxValidator& validator = wxDefaultValidator, + const wxString &name = "listctrl" ) { Create(parent, id, pos, size, style, validator, name); } ~wxListCtrl(); - bool Create( wxWindow *parent, wxWindowID id = -1, - const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, -#if wxUSE_VALIDATORS - long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, -#endif - const wxString &name = "listctrl" ); + bool Create( wxWindow *parent, + wxWindowID id = -1, + const wxPoint &pos = wxDefaultPosition, + const wxSize &size = wxDefaultSize, + long style = wxLC_ICON, + const wxValidator& validator = wxDefaultValidator, + const wxString &name = "listctrl" ); bool GetColumn( int col, wxListItem& item ) const; bool SetColumn( int col, wxListItem& item ); @@ -411,8 +421,8 @@ public: void SetItemSpacing( int spacing, bool isSmall = FALSE ); int GetItemSpacing( bool isSmall ) const; int GetSelectedItemCount() const; -// wxColour GetTextColour() const; // wxGLC has colours for every Item (see wxListItem) -// void SetTextColour(const wxColour& col); + wxColour GetTextColour() const; + void SetTextColour(const wxColour& col); long GetTopItem() const; void SetSingleStyle( long style, bool add = TRUE ) ;