1#ifndef __SMCLISTVIEW__H__
2#define __SMCLISTVIEW__H__
5#include "core/SItemPanel.h"
6#include "SHeaderCtrl.h"
16 :
public TPanelProxy<IMcListView>
17 ,
protected SHostProxy
18 ,
protected IItemContainer {
19 DEF_SOBJECT(
SPanel, L
"mclistview")
21 friend class SMCListViewDataSetObserver;
40 STDMETHOD_(BOOL,
SetAdapter)(THIS_ IMcAdapter *adapter) OVERRIDE;
46 STDMETHOD_(IMcAdapter *,
GetAdapter)(THIS) SCONST OVERRIDE;
52 STDMETHOD_(IListViewItemLocator *,
GetItemLocator)(THIS) SCONST OVERRIDE;
58 STDMETHOD_(
void,
SetItemLocator)(THIS_ IListViewItemLocator *pItemLocator) OVERRIDE;
71 STDMETHOD_(
void,
SetSel)(THIS_
int iItem, BOOL bNotify = FALSE) OVERRIDE;
77 STDMETHOD_(
int,
GetSel)(THIS) SCONST OVERRIDE;
84 STDMETHOD_(IItemPanel *,
HitTest)(THIS_
const POINT *pt) SCONST OVERRIDE;
104 (THIS_
int nIndex, LPCTSTR pszText,
int nWidth, UINT fmt, LPARAM lParam = 0, BOOL bDpiAware = TRUE,
float fWeight = 0.0f) OVERRIDE;
110 STDMETHOD_(
void,
DeleteColumn)(THIS_
int iCol) OVERRIDE;
124 STDMETHOD_(
void,
GetDesiredSize)(THIS_ SIZE *psz,
int nParentWid,
int nParentHei) OVERRIDE;
132 SItemPanel *
HitTest(CPoint &pt)
const;
165 virtual BOOL
OnItemGetRect(
const SOsrPanel *pItem, CRect &rcItem)
const;
206 virtual BOOL
OnScroll(BOOL bVertical, UINT uCode,
int nPos);
304 void OnSize(UINT nType, CSize size);
318 LRESULT
OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
327 LRESULT
OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
335 void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags);
349 BOOL
OnMouseWheel(UINT nFlags,
short zDelta, CPoint pt);
380 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST,
OnMouseEvent)
381 MESSAGE_RANGE_HANDLER_EX(WM_KEYFIRST, WM_KEYLAST,
OnKeyEvent)
382 MESSAGE_RANGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, WM_IME_KEYLAST,
OnKeyEvent)
384 MESSAGE_HANDLER_EX(WM_IME_REQUEST,
OnKeyEvent)
393 ATTR_COLOR(L
"colorGrid",
m_crGrid, TRUE)
SOUI Panel with Scrollbar Support.
Smart pointer class for managing COM-style reference-counted objects.
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Get the desired size of the control.
void UpdateVisibleItems()
Update visible items.
SHeaderCtrl * GetHeaderCtrl() const
Get the header control.
SList< ItemInfo > m_lstItems
BOOL OnItemClick(IEvtArgs *pEvt)
Handle item click event.
SArray< SList< SItemPanel * > * > m_itemRecycle
virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const
Get the rectangle of an item.
IHeaderCtrl * GetIHeaderCtrl() SCONST OVERRIDE
Get the header control.
SItemPanel * GetItemPanel(int iItem)
Get the item panel for a specific item.
void UpdateChildrenPosition() OVERRIDE
Update the position of child items.
void onDataSetChanged()
Handle data set changed event.
int GetSel() SCONST OVERRIDE
Get the selected item.
SAutoRefPtr< IListViewItemLocator > m_lvItemLocator
void SetSel(int iItem, BOOL bNotify=FALSE) OVERRIDE
Set the selected item.
CRect GetListRect()
Get the rectangle of the list.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handle show window event.
void OnKillFocus(SWND wndFocus)
Handle kill focus event.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handle key event.
int GetColumnCount() SCONST OVERRIDE
Get the total number of columns.
BOOL m_bDatasetInvalidated
void DispatchMessage2Items(UINT uMsg, WPARAM wParam, LPARAM lParam)
Dispatch messages to items.
void _UpdateAdapterColumnsWidth() const
Update the column widths in the adapter.
void UpdateHeaderCtrl()
Update the header control.
BOOL OnHeaderClick(IEvtArgs *pEvt)
Handle header click event.
SLayoutSize m_nHeaderHeight
virtual BOOL IsItemRedrawDelay() const
Check if item redraw is delayed.
int GetHeaderHeight() const
Get the height of the header.
BOOL SetAdapter(IMcAdapter *adapter) OVERRIDE
Set the adapter for the list view.
void UpdateScrollBar()
Update the scroll bar.
void UpdateVisibleItem(int iItem)
Update a specific visible item.
BOOL OnHeaderSizeChanging(IEvtArgs *pEvt)
Handle header size changing event.
virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture)
Handle item capture.
void onDataSetInvalidated()
Handle data set invalidated event.
SAutoRefPtr< IMcAdapter > m_adapter
void OnSize(UINT nType, CSize size)
Handle size change event.
void RedrawItem(SOsrPanel *pItem)
Redraw a specific item.
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handle mouse wheel event.
void OnPaint(IRenderTarget *pRT)
Paint the control.
int InsertColumn(int nIndex, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam=0, BOOL bDpiAware=TRUE, float fWeight=0.0f) OVERRIDE
Insert a column.
SMCListView()
Constructor.
void DeleteColumn(int iCol) OVERRIDE
Delete a specific column.
CRect _OnItemGetRect(int iPosition) const
Get the rectangle of an item by position.
void OnSetFocus(SWND wndOld)
Handle set focus event.
void EnsureVisible(int iItem) OVERRIDE
Ensure an item is visible.
void SetItemLocator(IListViewItemLocator *pItemLocator) OVERRIDE
Set the item locator for the list view.
void OnMouseLeave()
Handle mouse leave event.
SAutoRefPtr< ISkinObj > m_pSkinDivider
void onItemDataChanged(int iItem)
Handle item data changed event.
IItemPanel * HitTest(const POINT *pt) SCONST OVERRIDE
Hit test to determine the item under the mouse.
BOOL OnHeaderSwap(IEvtArgs *pEvt)
Handle header swap event.
void OnDestroy()
Handle destroy event.
IMcAdapter * GetAdapter() SCONST OVERRIDE
Get the adapter for the list view.
IListViewItemLocator * GetItemLocator() SCONST OVERRIDE
Get the item locator for the list view.
SOsrPanel * m_itemCapture
SLayoutSize m_nDividerSize
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handle mouse event.
SAutoRefPtr< ILvDataSetObserver > m_observer
void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
Handle key down event.
virtual int GetScrollLineSize(BOOL bVertical)
Gets the line size for scrolling.
virtual void OnColorize(COLORREF cr)
Handles colorization events.
virtual void OnScaleChanged(int nScale)
Handles scale change events.
SPanel()
Constructor for SPanel.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handles the WM_SHOWWINDOW message.
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handles the WM_MOUSEWHEEL message.
virtual BOOL OnScroll(BOOL bVertical, UINT uCode, int nPos)
Handles scroll events.
void OnDestroy()
Handles the WM_DESTROY message.
UINT OnGetDlgCode() SCONST OVERRIDE
Retrieves the dialog code for the window.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Handle tooltip updates.
void OnKillFocus(SWND wndFocus)
Handles losing focus.
void OnPaint(IRenderTarget *pRT)
Handles the painting of the window.
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.
virtual void OnRebuildFont()
Called when the font of the window needs to be rebuilt.
virtual BOOL OnSetCursor(const CPoint &pt)
Sets the cursor when the mouse hovers over the window.
virtual BOOL CreateChildren(SXmlNode xmlNode)
Create child windows from XML node.
void OnSetFocus(SWND wndOld)
Handles gaining focus.
Implementation of IXmlDoc.
Class representing an XML node.
Interface for rendering target objects.