X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/378ad9574df7d0b777bfb84613f5eda0bbaa18ec..7ef3ab50e9705c2724f74ef4fb275030d6fbe589:/src/os2/listctrl.cpp diff --git a/src/os2/listctrl.cpp b/src/os2/listctrl.cpp index 99a792abe0..9afea42f73 100644 --- a/src/os2/listctrl.cpp +++ b/src/os2/listctrl.cpp @@ -6,7 +6,7 @@ // Created: 01/21/03 // RCS-ID: $Id$ // Copyright: (c) David Webster -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,11 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "listctrl.h" - #pragma implementation "listctrlbase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -69,11 +64,11 @@ // how many records the view will have, initially, and how many columns // the detail view of the container will have, as the container represents // a known data block. Thus the OS/2 PM CV_DETAIL view, i.e. -// the wxWindows wxLC_REPORT view, relies on STATIC structure for its +// the wxWidgets wxLC_REPORT view, relies on STATIC structure for its // columnar data. It gets the data to display by telling it the specific // offset of the field in the struct containing the displayable data. That // data has be of OS/2 Types, PSZ (char string), CDATE or CTIME format. -// wxWindows is dynamic in nature, however. We insert columns, one at a +// wxWidgets is dynamic in nature, however. We insert columns, one at a // time and do not know how many until the app is done inserting them. So // for OS/2 I have to set a max allowable since they are fixed. We return // an error to the app if they include more than we can handle. @@ -116,7 +111,7 @@ typedef struct _MYRECORD // // Solution: // Under MSW the only way to associate data with a -// List item independant of its position in the list is to store a pointer +// List item independent of its position in the list is to store a pointer // to it in its lParam attribute. However user programs are already using // this (via the SetItemData() GetItemData() calls). // @@ -1548,14 +1543,24 @@ bool wxListCtrl::SetItemImage ( long lItem , int nImage , int WXUNUSED(nSelImage)) +{ + return SetItemColumnInfo(lItem, 0, nImage); +} // end of wxListCtrl::SetItemImage + +// Sets the item image +bool wxListCtrl::SetItemColumnImage ( + long lItem +, long lColumn +, int nImage { wxListItem vInfo; vInfo.m_mask = wxLIST_MASK_IMAGE; vInfo.m_image = nImage; vInfo.m_itemId = lItem; + vInfo.m_col = lColumn; return SetItem(vInfo); -} // end of wxListCtrl::SetItemImage +} // end of wxListCtrl::SetItemColumnImage // Gets the item text wxString wxListCtrl::GetItemText ( @@ -2723,6 +2728,17 @@ int wxListCtrl::OnGetItemImage ( return -1; } // end of wxListCtrl::OnGetItemImage +int wxListCtrl::OnGetItemColumnImage ( + long lItem, + long lColumn +) const +{ + if (!lColumn) + return OnGetItemImage(lItem); + + return -1; +} // end of wxListCtrl::OnGetItemColumnImage + wxListItemAttr* wxListCtrl::OnGetItemAttr ( long WXUNUSED_UNLESS_DEBUG(lItem) ) const