5#include <proxy/SPanelProxy.h>
6#include <interface/SCtrl-i.h>
38class SOUI_EXP
SListBox :
public TPanelProxy<IListBox> {
40 DEF_SOBJECT(
SPanel, L
"listbox")
57 STDMETHOD_(
int,
GetCount)(THIS) SCONST OVERRIDE;
63 STDMETHOD_(
int,
GetCurSel)(THIS) SCONST OVERRIDE;
71 STDMETHOD_(BOOL,
SetCurSel)(THIS_
int nIndex, BOOL bNotifyChange = FALSE) OVERRIDE;
84 STDMETHOD_(BOOL,
SetTopIndex)(THIS_
int nIndex) OVERRIDE;
96 STDMETHOD_(
void,
SetItemHeight)(THIS_
int nItemHeight) OVERRIDE;
103 STDMETHOD_(LPARAM,
GetItemData)(THIS_
int nIndex) SCONST OVERRIDE;
111 STDMETHOD_(BOOL,
SetItemData)(THIS_
int nIndex, LPARAM lParam) OVERRIDE;
120 STDMETHOD_(BOOL,
GetIText)(THIS_
int nIndex, BOOL bRawText, IStringT *str) SCONST OVERRIDE;
125 STDMETHOD_(
void,
DeleteAll)(THIS) OVERRIDE;
132 STDMETHOD_(BOOL,
DeleteString)(THIS_
int nIndex) OVERRIDE;
141 STDMETHOD_(
int,
AddString)(THIS_ LPCTSTR lpszItem,
int nImage = -1, LPARAM lParam = 0) OVERRIDE;
152 (THIS_
int nIndex, LPCTSTR lpszItem,
int nImage = -1, LPARAM lParam = 0) OVERRIDE;
166 STDMETHOD_(
int,
FindString)(THIS_
int iFindAfter, LPCTSTR pszText) SCONST OVERRIDE;
174 STDMETHOD_(
void,
GetDesiredSize)(THIS_ SIZE *psz,
int nParentWid,
int nParentHei) OVERRIDE;
182 STDMETHOD_(BOOL,
SetItemImage)(THIS_
int nIndex,
int iImage) OVERRIDE;
189 STDMETHOD_(
int,
GetItemImage)(THIS_
int nIndex) OVERRIDE;
198 SStringT
GetText(
int nIndex, BOOL bRawText = FALSE)
const
201 GetIText(nIndex, bRawText, &strRet);
210 void RedrawItem(
int iItem);
217 int HitTest(CPoint &pt);
222 void UpdateScrollBar();
248 void LoadItemAttribute(
SXmlNode xmlNode, LPLBITEM pItem);
256 int InsertItem(
int nIndex, LPLBITEM pItem);
264 virtual void DrawItem(
IRenderTarget *pRT, CRect &rc,
int iItem);
271 void NotifySelChange(
int nOldSel,
int nNewSel);
285 void OnSize(UINT nType, CSize size);
327 void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags);
335 void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
377 ATTR_SKIN(L
"itemSkin", m_pItemSkin, TRUE)
378 ATTR_SKIN(L
"iconSkin", m_pIconSkin, TRUE)
379 ATTR_COLOR(L
"colorItemBkgnd",
m_crItemBg, FALSE)
383 ATTR_COLOR(L
"colorText",
m_crText, FALSE)
385 ATTR_LAYOUTSIZE(L
"icon-x",
m_ptIcon[0], FALSE)
386 ATTR_LAYOUTSIZE(L
"icon-y",
m_ptIcon[1], FALSE)
387 ATTR_LAYOUTSIZE(L
"text-x",
m_ptText[0], FALSE)
388 ATTR_LAYOUTSIZE(L
"text-y",
m_ptText[1], FALSE)
SOUI Panel with Scrollbar Support.
Smart pointer class for managing COM-style reference-counted objects.
BOOL GetIText(int nIndex, BOOL bRawText, IStringT *str) SCONST OVERRIDE
Get the text of an item.
void EnsureVisible(int nIndex) OVERRIDE
Ensure an item is visible.
int GetItemImage(int nIndex) OVERRIDE
Get the image of an item.
void OnPaint(IRenderTarget *pRT)
Paint the control.
BOOL DeleteString(int nIndex) OVERRIDE
Delete a specific item.
int GetCount() SCONST OVERRIDE
Get the number of items in the list box.
int GetTopIndex() SCONST OVERRIDE
Get the index of the top visible item.
void SetItemHeight(int nItemHeight) OVERRIDE
Set the height of the items.
int GetItemHeight() SCONST OVERRIDE
Get the height of the items.
void OnMouseMove(UINT nFlags, CPoint pt)
Handle mouse move event.
BOOL SetItemData(int nIndex, LPARAM lParam) OVERRIDE
Set the data associated with an item.
int FindString(int iFindAfter, LPCTSTR pszText) SCONST OVERRIDE
Find a string in the list box.
LPARAM GetItemData(int nIndex) SCONST OVERRIDE
Get the data associated with an item.
SStringT GetText(int nIndex, BOOL bRawText=FALSE) const
Get the text of an item.
BOOL SetTopIndex(int nIndex) OVERRIDE
Set the index of the top visible item.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handle left mouse button down event.
void OnSize(UINT nType, CSize size)
Handle size change event.
void OnMouseLeave()
Handle mouse leave event.
void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
Handle key down event.
SArray< LPLBITEM > m_arrItems
void DeleteAll() OVERRIDE
Delete all items in the list box.
int AddString(LPCTSTR lpszItem, int nImage=-1, LPARAM lParam=0) OVERRIDE
Add a string to the list box.
int GetCurSel() SCONST OVERRIDE
Get the index of the currently selected item.
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Get the desired size of the control.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handle left mouse button up event.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handle show window event.
int InsertString(int nIndex, LPCTSTR lpszItem, int nImage=-1, LPARAM lParam=0) OVERRIDE
Insert a string into the list box.
void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
Handle character input event.
BOOL SetItemImage(int nIndex, int iImage) OVERRIDE
Set the image of an item.
void OnLButtonDbClick(UINT nFlags, CPoint pt)
Handle left mouse button double-click event.
BOOL SetCurSel(int nIndex, BOOL bNotifyChange=FALSE) OVERRIDE
Set the currently selected item.
void OnDestroy()
Handle destroy event.
virtual void OnScaleChanged(int nScale)
Handles scale change events.
SPanel()
Constructor for SPanel.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handles the WM_SHOWWINDOW message.
void OnDestroy()
Handles the WM_DESTROY message.
Class for handling text with translation support.
Base class for SOUI DUI windows.
UINT OnGetDlgCode() SCONST OVERRIDE
Retrieves the dialog code for the window.
void OnMouseMove(UINT nFlags, CPoint pt)
Handles the mouse move event.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
void OnLButtonDbClick(UINT nFlags, CPoint point)
Handles the left mouse button double-click event.
void OnMouseLeave()
Handles the mouse leave event.
virtual HRESULT OnLanguageChanged()
Called when the language of the window changes.
void OnSize(UINT nType, CSize size)
Handles the resizing of the window.
void OnLButtonUp(UINT nFlags, CPoint pt)
Handles the left mouse button up event.
void OnLButtonDown(UINT nFlags, CPoint pt)
Handles the left mouse button down event.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Create child windows from XML node.
Class representing an XML node.
Interface for rendering target objects.
tagLBITEM(SWindow *pOwner)
Constructor.