TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
ListBox Class Reference
Inheritance diagram for ListBox:
Window BaseWindow cIUnknownImpl< ni::iUnknown >

Detailed Description

List view control wrapper.

Public Member Functions

 ListBox ()
 
virtual ~ListBox ()
 
BOOL Create (DWORD dwStyle=WS_VISIBLE|WS_CHILD|LVS_REPORT, Window *pParent=NULL, LONG_PTR iID=0, DWORD dwExStyle=NULL, LPCTSTR lpWindowName=NULL)
 
void SetViewStyle (DWORD dwView)
 
bool InsertColumn (UINT iColIdx, const TCHAR *pszColumnHeading, int nFormat, INT iWidth=-1, INT aSubItem=-1)
 
int GetCount () const
 Get the number of item in the list box. More...
 
void ResetContent ()
 Reset the content of the list box. More...
 
int InsertItem (UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState, UINT nStateMask, int nImage, LPARAM lParam)
 
int InsertItem (const LVITEM *pItem)
 
int InsertItem (int nItem, LPCTSTR lpszItem)
 
int InsertItem (int nItem, LPCTSTR lpszItem, int nImage)
 
int InsertItem (int nItem, void *pData)
 
int DeleteItem (int index)
 Delete the item at the specified index. More...
 
int GetTextLen (int index) const
 
int GetText (int index, const TCHAR *lpszBuffer) const
 
int FindString (int indexStart, const TCHAR *lpszFind)
 
int FindItemData (int indexStart, void *data)
 
int SetSel (int fSelect, int index)
 
int SelItemRange (int fSelect, int first, int last)
 
int GetCurSel ()
 
int SetCurSel (int index)
 
int GetSel (int index) const
 
int GetSelCount () const
 
int GetTopIndex () const
 
int GetSelItems (int cItems, int *lpItems) const
 
int SetTopIndex (int indexTop)
 
void SetColumnWidth (int cxColumn)
 
int GetHorizontalExtent () const
 
void SetHorizontalExtent (int cxExtent)
 
int SetTabStops (int cTabs, int *lpTabs)
 
int GetItemRect (int index, RECT *lprc)
 
int SetCaretIndex (int index)
 
int GetCaretIndex () const
 
int FindStringExact (int indexStart, const TCHAR *lpszFind)
 
int SetItemHeight (int index, int cy)
 
int GetItemHeight (int index) const
 
int Dir (UINT attrs, const TCHAR *lpszFileSpec)
 
BOOL DeleteColumn (int nCol)
 
int GetColumnWidth (int nCol) const
 
int GetItemCount () const
 
BOOL DeleteAllItems ()
 
void SetItemCount (int nItems)
 
BOOL SortItems (PFNLVCOMPARE pfnCompare, DWORD_PTR dwData)
 
BOOL SetItemState (int nItem, LVITEM *pItem)
 
UINT GetItemState (int nItem, UINT nMask) const
 
BOOL SetItem (int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem, int nImage, UINT nState, UINT nStateMask, LPARAM lParam)
 
BOOL SetItem (int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem, int nImage, UINT nState, UINT nStateMask, LPARAM lParam, int nIndent)
 
BOOL SetItemState (int nItem, UINT nState, UINT nStateMask)
 
BOOL SetItemText (int nItem, int nSubItem, LPCTSTR lpszText)
 
ni::cString GetItemText (int nItem, int nSubItem) const
 
int GetItemText (int nItem, int nSubItem, LPTSTR lpszText, int nLen) const
 
BOOL SetItemData (int nItem, void *pData)
 
voidGetItemData (int nItem) const
 
HWND GetHeaderCtrl ()
 
- Public Member Functions inherited from Window
 Window ()
 
 Window (HWND hWnd, BOOL bDestroy)
 
virtual ~Window ()
 
virtual LRESULT WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 Internal window procedure. More...
 
virtual BOOL Create (DWORD dwStyle=WS_VISIBLE, DWORD dwExStyle=NULL, LPCTSTR lpClassName=WINUI_DEF_WND_CLS, LPCTSTR lpWindowName=NULL, BaseWindow *pParent=NULL, MENUOrID hMenu=(UINT) 0)
 Generic window creation function. More...
 
- Public Member Functions inherited from BaseWindow
 BaseWindow ()
 
 BaseWindow (HWND hWnd, BOOL bDestroy)
 
virtual ~BaseWindow ()
 
virtual BOOL Reshape (UINT iCX, UINT iCY)
 
HWND GetHWND () const
 
bool Attach (HWND hWnd, BOOL bDestroy)
 Attach object to an existing handle. More...
 
void Detach ()
 
bool AttachDlgItem (HWND hDlg, INT iItemID)
 
void CenterOnScreen ()
 
void AddStyle (DWORD dwStyle)
 
virtual void Destroy ()
 
virtual WINUI_INL BOOL IsCreated () const
 
virtual BOOL ShowWindow (int iCmdShow)
 
virtual BOOL SetWindowPos (HWND hWndAfter, int iX, int iY, int iCX, int iCY, UINT iFlags=SWP_NOZORDER)
 
virtual BOOL GetWindowRect (Rect &rcWnd)
 
virtual BOOL SetWindowRect (Rect rcWnd)
 
virtual BOOL GetClientRect (Rect &rcClient)
 
virtual LRESULT SendMessage (UINT Msg, WPARAM wParam, LPARAM lParam)
 
virtual BOOL PostMessage (UINT Msg, WPARAM wParam, LPARAM lParam)
 
virtual void SetParent (BaseWindow *pWnd)
 
virtual LONG GetTextLength () const
 
virtual void GetText (TCHAR *aszOut, ULONG nMaxChar) const
 
virtual void SetText (const TCHAR *aszStr)
 
virtual ni::cString GetText () const
 
virtual HDC GetDC ()
 
virtual void ReleaseDC (HDC hDC)
 
virtual HWND SetCapture ()
 
virtual BOOL ReleaseCapture () const
 
virtual BOOL UpdateWindow ()
 
virtual DWORD GetStyle () const
 
virtual DWORD GetExStyle () const
 
virtual LONG GetWindowLong (int nIndex) const
 
virtual LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
int GetWindowTextLength () const
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
HFONT GetFont () const
 
BOOL BringWindowToTop ()
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (Rect *pRect) const
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScreenToClient (Rect *pRect) const
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
BOOL ValidateRect (LPCRECT lpRect)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsVisible () const
 
BOOL IsEnabled () const
 
BOOL Enable (BOOL bEnable=TRUE)
 
HWND SetActiveWindow ()
 
HWND SetFocus ()
 
int GetScrollPos (int nBar) const
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
BOOL ScrollWindow (int xAmount, int yAmount, Rect *pRect=NULL, Rect *pClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, Rect *pRectScroll, Rect *pRectClip, HRGN hRgnUpdate, Rect *pRectUpdate, UINT uFlags)
 
int ScrollWindowEx (int dx, int dy, UINT uFlags, Rect *pRectScroll=NULL, Rect *pRectClip=NULL, HRGN hRgnUpdate=NULL, Rect *pRectUpdate=NULL)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL IsChild (HWND hWnd) const
 
BOOL FlashWindow (BOOL bInvert)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
int GetWindowRgn (HRGN hRgn)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetTopMost ()
 
- Public Member Functions inherited from cIUnknownImpl< ni::iUnknown >
 cIUnknownImpl ()
 
virtual tBool IsOK () const
 
virtual void Invalidate ()
 
virtual iUnknownQueryInterface (const ni::tUUID &aIID)
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32) const
 

Additional Inherited Members

- Public Types inherited from cIUnknownImpl< ni::iUnknown >
typedef cIUnknownImpl
< ni::iUnknown, FLAGS, T1, T2,
T3, T4 > 
BaseImpl
 
typedef ni::iUnknown Base0
 
typedef T1 Base1
 
typedef T2 Base2
 
typedef T3 Base3
 
typedef T4 Base4
 
- Protected Attributes inherited from BaseWindow
HWND m_hWnd
 
BOOL m_bDestroy
 

Constructor & Destructor Documentation

ListBox ( )
virtual ~ListBox ( )
virtual

Member Function Documentation

BOOL Create ( DWORD  dwStyle = WS_VISIBLE | WS_CHILD | LVS_REPORT,
Window pParent = NULL,
LONG_PTR  iID = 0,
DWORD  dwExStyle = NULL,
LPCTSTR  lpWindowName = NULL 
)
void SetViewStyle ( DWORD  dwView)
bool InsertColumn ( UINT  iColIdx,
const TCHAR *  pszColumnHeading,
int  nFormat,
INT  iWidth = -1,
INT  aSubItem = -1 
)
int GetCount ( ) const

Get the number of item in the list box.

Returns
is the number of items in the list box, or LB_ERR if an error occurs.
void ResetContent ( )

Reset the content of the list box.

int InsertItem ( UINT  nMask,
int  nItem,
LPCTSTR  lpszItem,
UINT  nState,
UINT  nStateMask,
int  nImage,
LPARAM  lParam 
)
int InsertItem ( const LVITEM *  pItem)
int InsertItem ( int  nItem,
LPCTSTR  lpszItem 
)
int InsertItem ( int  nItem,
LPCTSTR  lpszItem,
int  nImage 
)
int InsertItem ( int  nItem,
void pData 
)
int DeleteItem ( int  index)

Delete the item at the specified index.

Returns
The return value is a count of the strings remaining in the list. The return value is LB_ERR if the index is greater than the number of items in the list.
int GetTextLen ( int  index) const
int GetText ( int  index,
const TCHAR *  lpszBuffer 
) const
int FindString ( int  indexStart,
const TCHAR *  lpszFind 
)
int FindItemData ( int  indexStart,
void data 
)
int SetSel ( int  fSelect,
int  index 
)
int SelItemRange ( int  fSelect,
int  first,
int  last 
)
int GetCurSel ( )
int SetCurSel ( int  index)
int GetSel ( int  index) const
int GetSelCount ( ) const
int GetTopIndex ( ) const
int GetSelItems ( int  cItems,
int *  lpItems 
) const
int SetTopIndex ( int  indexTop)
void SetColumnWidth ( int  cxColumn)
int GetHorizontalExtent ( ) const
void SetHorizontalExtent ( int  cxExtent)
int SetTabStops ( int  cTabs,
int *  lpTabs 
)
int GetItemRect ( int  index,
RECT *  lprc 
)
int SetCaretIndex ( int  index)
int GetCaretIndex ( ) const
int FindStringExact ( int  indexStart,
const TCHAR *  lpszFind 
)
int SetItemHeight ( int  index,
int  cy 
)
int GetItemHeight ( int  index) const
int Dir ( UINT  attrs,
const TCHAR *  lpszFileSpec 
)
BOOL DeleteColumn ( int  nCol)
int GetColumnWidth ( int  nCol) const
int GetItemCount ( ) const
BOOL DeleteAllItems ( )
void SetItemCount ( int  nItems)
BOOL SortItems ( PFNLVCOMPARE  pfnCompare,
DWORD_PTR  dwData 
)
BOOL SetItemState ( int  nItem,
LVITEM *  pItem 
)
UINT GetItemState ( int  nItem,
UINT  nMask 
) const
BOOL SetItem ( int  nItem,
int  nSubItem,
UINT  nMask,
LPCTSTR  lpszItem,
int  nImage,
UINT  nState,
UINT  nStateMask,
LPARAM  lParam 
)
BOOL SetItem ( int  nItem,
int  nSubItem,
UINT  nMask,
LPCTSTR  lpszItem,
int  nImage,
UINT  nState,
UINT  nStateMask,
LPARAM  lParam,
int  nIndent 
)
BOOL SetItemState ( int  nItem,
UINT  nState,
UINT  nStateMask 
)
BOOL SetItemText ( int  nItem,
int  nSubItem,
LPCTSTR  lpszText 
)
ni::cString GetItemText ( int  nItem,
int  nSubItem 
) const
int GetItemText ( int  nItem,
int  nSubItem,
LPTSTR  lpszText,
int  nLen 
) const
BOOL SetItemData ( int  nItem,
void pData 
)
void* GetItemData ( int  nItem) const
HWND GetHeaderCtrl ( )