WinapiExtension
 All Classes Files Functions Variables Typedefs Pages
Classes | Public Member Functions | List of all members
ListView Class Reference

Wrapper for list view controls. More...

#include <control.h>

Inheritance diagram for ListView:
Control IWindow

Classes

struct  ColumnData
 Used to get or set values of a list column. More...
 
struct  ItemData
 Used to get or set values of a list item. More...
 

Public Member Functions

 ListView (HWND hwnd=NULL)
 
int AppendColumn (const tstring &text, int format=LVCFMT_LEFT, int width=LVSCW_AUTOSIZE_USEHEADER)
 
int AppendItem (const tstring &text)
 
void AutoSizeColumns (int col=-1)
 
HWND BeginEdit (int index)
 
void DeleteColumn (int index)
 
void DeleteItem (int index)
 
void EndEdit ()
 
void EnsureVisible (int index, BOOL partialOk=FALSE)
 
COLORREF GetBkColor ()
 
void GetColumn (int index, ColumnData &data)
 
int GetColumnCount ()
 
int GetColumnWidth (int index)
 
HWND GetHeader ()
 
void GetItem (ItemData &data)
 
int GetItemCount ()
 
UINT GetItemState (int index, LPARAM stateMask)
 
tstring GetItemText (int index, int column=0)
 
COLORREF GetTextBkColor ()
 
COLORREF GetTextColor ()
 
int InsertColumn (int index, ColumnData &data)
 
int InsertColumn (int index, const tstring &text, int format=LVCFMT_LEFT, int width=LVSCW_AUTOSIZE_USEHEADER)
 
int InsertItem (ItemData &data)
 
int InsertItem (int index, const tstring &text)
 
BOOL IsItemSelected (int item)
 
void SelectItem (BOOL select, int item)
 
void SetBkColor (COLORREF color)
 
void SetColumn (int index, ColumnData &data)
 
void SetColumnWidth (int index, int width)
 
void SetItem (ItemData &data)
 
void SetItem (int index, int column, const tstring &text)
 
void SetItemCount (int count)
 
void SetItemState (int index, UINT state, UINT stateMask)
 
void SetItemText (const tstring &text, int index, int column=0)
 
void SetTextBkColor (COLORREF color)
 
void SetTextColor (COLORREF color)
 
void SortItems (PFNLVCOMPARE compare, LPARAM param)
 
- Public Member Functions inherited from Control
 Control (HWND hwnd=NULL)
 
HWND _InternalGetHandle ()
 
 operator HWND ()
 
Controloperator= (HWND hwnd)
 
- Public Member Functions inherited from IWindow
Rect ClientRect ()
 
void Destroy ()
 
void DragAcceptFiles (BOOL accept=TRUE)
 
void Enable (BOOL enable)
 
DWORD GetExStyle ()
 
HFONT GetFont ()
 
HICON GetIcon (BOOL bigIcon)
 
DWORD GetID ()
 
DWORD GetStyle ()
 
tstring GetText ()
 
BOOL Invalidate (const RECT *rect=NULL, BOOL eraseBkgnd=TRUE)
 
BOOL IsEnabled ()
 
BOOL IsVisible ()
 
void KillTimer (UINT_PTR timerID)
 
void ModifyStyle (DWORD add, DWORD remove)
 
void Move (int x, int y, BOOL redraw=TRUE)
 
void Move (const POINT &p, BOOL redraw=TRUE)
 
void Move (int x, int y, int width, int height, BOOL redraw=TRUE)
 
void Move (const POINT &p, const SIZE &s, BOOL redraw=TRUE)
 
void Move (const RECT &r, BOOL redraw=TRUE)
 
HWND ParentHandle ()
 
Rect RectOnParent ()
 
BOOL Redraw (const RECT *rect=NULL, HRGN region=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
HWND SetFocus ()
 
void SetFont (HFONT font, BOOL redraw=TRUE)
 
HICON SetIcon (HICON icon, BOOL bigIcon)
 
void SetRedraw (BOOL allowRedraw)
 
void SetText (const tstring &text)
 
UINT_PTR SetTimer (UINT_PTR timerID, UINT interval, TIMERPROC proc=NULL)
 
BOOL Show (int cmdShow)
 
Rect WindowRect ()
 

Additional Inherited Members

- Public Attributes inherited from Control
HWND handle
 

Detailed Description

Wrapper for list view controls.

Constructor & Destructor Documentation

ListView::ListView ( HWND  hwnd = NULL)
inline

Member Function Documentation

int ListView::AppendColumn ( const tstring text,
int  format = LVCFMT_LEFT,
int  width = LVSCW_AUTOSIZE_USEHEADER 
)
inline
int ListView::AppendItem ( const tstring text)
inline
void ListView::AutoSizeColumns ( int  col = -1)
inline

Automatically sets the required size of one or all columns.

HWND ListView::BeginEdit ( int  index)
inline

Begins inplace editing

void ListView::DeleteColumn ( int  index)
inline
void ListView::DeleteItem ( int  index)
inline
void ListView::EndEdit ( )
inline
void ListView::EnsureVisible ( int  index,
BOOL  partialOk = FALSE 
)
inline

Scroll to a specific index

COLORREF ListView::GetBkColor ( )
inline
void ListView::GetColumn ( int  index,
ColumnData data 
)
inline
int ListView::GetColumnCount ( )
inline
int ListView::GetColumnWidth ( int  index)
inline
HWND ListView::GetHeader ( )
inline
Returns
Handle of the header control (if this control is in report mode)
void ListView::GetItem ( ItemData data)
inline
Note
Don't forget to call ItemData::Item().
int ListView::GetItemCount ( )
inline
UINT ListView::GetItemState ( int  index,
LPARAM  stateMask 
)
inline
tstring ListView::GetItemText ( int  index,
int  column = 0 
)
inline
COLORREF ListView::GetTextBkColor ( )
inline
COLORREF ListView::GetTextColor ( )
inline
int ListView::InsertColumn ( int  index,
ColumnData data 
)
inline
int ListView::InsertColumn ( int  index,
const tstring text,
int  format = LVCFMT_LEFT,
int  width = LVSCW_AUTOSIZE_USEHEADER 
)
inline
int ListView::InsertItem ( ItemData data)
inline
Note
Don't forget to call ItemData::Item().
int ListView::InsertItem ( int  index,
const tstring text 
)
inline
BOOL ListView::IsItemSelected ( int  item)
inline
void ListView::SelectItem ( BOOL  select,
int  item 
)
inline
void ListView::SetBkColor ( COLORREF  color)
inline
void ListView::SetColumn ( int  index,
ColumnData data 
)
inline
void ListView::SetColumnWidth ( int  index,
int  width 
)
inline
Parameters
widthA fixed width, or a special value:
  • LVSCW_AUTOSIZE
  • LVSCW_AUTOSIZE_USEHEADER
void ListView::SetItem ( ItemData data)
inline
Note
Don't forget to call ItemData::Item().
void ListView::SetItem ( int  index,
int  column,
const tstring text 
)
inline
void ListView::SetItemCount ( int  count)
inline
void ListView::SetItemState ( int  index,
UINT  state,
UINT  stateMask 
)
inline
void ListView::SetItemText ( const tstring text,
int  index,
int  column = 0 
)
inline
void ListView::SetTextBkColor ( COLORREF  color)
inline
void ListView::SetTextColor ( COLORREF  color)
inline
void ListView::SortItems ( PFNLVCOMPARE  compare,
LPARAM  param 
)
inline

The documentation for this class was generated from the following file: