12#ifndef __STILEVIEW__H__
13#define __STILEVIEW__H__
17#include <core/SItemPanel.h>
18#include <interface/SAdapter-i.h>
19#include <helper/STileViewItemLocator.h>
20#include <proxy/SPanelProxy.h>
31 :
public TPanelProxy<ITileView>
32 ,
protected SHostProxy
33 ,
protected IItemContainer {
34 DEF_SOBJECT(
SPanel, L
"tileview")
36 friend class STileViewDataSetObserver;
55 STDMETHOD_(BOOL,
SetAdapter)(THIS_ ILvAdapter *adapter) OVERRIDE;
61 STDMETHOD_(ILvAdapter *,
GetAdapter)(THIS) SCONST OVERRIDE;
67 STDMETHOD_(
void,
SetItemLocator)(THIS_ ITileViewItemLocator *pItemLocator) OVERRIDE;
73 STDMETHOD_(ITileViewItemLocator *,
GetItemLocator)(THIS) SCONST OVERRIDE;
80 STDMETHOD_(
void,
SetSel)(THIS_
int iItem, BOOL bNotify = FALSE) OVERRIDE;
86 STDMETHOD_(
int,
GetSel)(THIS) SCONST OVERRIDE;
99 STDMETHOD_(IItemPanel *,
HitTest)(THIS_
const POINT *pt) SCONST OVERRIDE;
107 SItemPanel *
HitTest(CPoint &pt)
const;
123 virtual BOOL
OnItemGetRect(
const SOsrPanel *pItem, CRect &rcItem)
const;
164 virtual BOOL
OnScroll(BOOL bVertical, UINT uCode,
int nPos);
280 void OnSize(UINT nType, CSize size);
294 LRESULT
OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
303 LRESULT
OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
311 void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags);
325 BOOL
OnMouseWheel(UINT nFlags,
short zDelta, CPoint pt);
346 LRESULT
OnSetScale(UINT uMsg, WPARAM wParam, LPARAM lParam);
366 MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST,
OnMouseEvent)
367 MESSAGE_RANGE_HANDLER_EX(WM_KEYFIRST, WM_KEYLAST,
OnKeyEvent)
368 MESSAGE_RANGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, WM_IME_KEYLAST,
OnKeyEvent)
370 MESSAGE_HANDLER_EX(WM_IME_REQUEST,
OnKeyEvent)
398 SList<ItemInfo> m_lstItems;
405 SArray<SList<SItemPanel *> *> m_itemRecycle;
SOUI Panel with Scrollbar Support.
Smart pointer class for managing COM-style reference-counted objects.
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.
SAutoRefPtr< ILvDataSetObserver > m_observer
void OnKeyDown(TCHAR nChar, UINT nRepCnt, UINT nFlags)
Handles the key down event.
BOOL m_bDatasetInvalidated
void UpdateScrollBar()
Updates the scroll bars.
void onDataSetInvalidated()
Handles data set invalidation.
void OnPaint(IRenderTarget *pRT)
Handles the paint event.
virtual BOOL IsItemRedrawDelay() const
Checks if item redraw is delayed.
SAutoRefPtr< ILvAdapter > m_adapter
ILvAdapter * GetAdapter() SCONST OVERRIDE
Gets the adapter for the tile view.
SItemPanel * GetItemPanel(int iItem)
Gets the item panel by index.
void UpdateVisibleItems()
Updates the visible items.
void EnsureVisible(int iItem) OVERRIDE
Ensures the specified item is visible.
LRESULT OnSetScale(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles the set scale event.
IItemPanel * HitTest(const POINT *pt) SCONST OVERRIDE
Performs a hit test on the tile view.
void OnSize(UINT nType, CSize size)
Handles the size event.
void SetSel(int iItem, BOOL bNotify=FALSE) OVERRIDE
Sets the selected item.
void SetItemLocator(ITileViewItemLocator *pItemLocator) OVERRIDE
Sets the item locator for the tile view.
void OnMouseLeave()
Handles the mouse leave event.
void UpdateVisibleItem(int iItem)
Updates a specific visible item.
void OnDestroy()
Handles the destroy event.
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handles the mouse wheel event.
void onDataSetChanged()
Handles data set changes.
SOsrPanel * m_itemCapture
int GetSel() SCONST OVERRIDE
Gets the selected item.
void onItemDataChanged(int iItem)
Handles data changes for a specific item.
ITileViewItemLocator * GetItemLocator() SCONST OVERRIDE
Gets the item locator for the tile view.
void OnShowWindow(BOOL bShow, UINT nStatus)
Handles the show window event.
CRect CalcItemDrawRect(int iItem) const
Calculates the drawing rectangle for an item.
void OnSetFocus(SWND wndOld)
Handles the set focus event.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles key events.
SAutoRefPtr< ITileViewItemLocator > m_tvItemLocator
STileView()
Constructor for STileView.
BOOL OnItemClick(IEvtArgs *pEvt)
Handles item click events.
void OnKillFocus(SWND wndFocus)
Handles the kill focus event.
BOOL SetAdapter(ILvAdapter *adapter) OVERRIDE
Sets the adapter for the tile view.
SLayoutSize m_nMarginSize
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles mouse events.
void DispatchMessage2Items(UINT uMsg, WPARAM wParam, LPARAM lParam)
Dispatches messages to items.
virtual BOOL OnItemGetRect(const SOsrPanel *pItem, CRect &rcItem) const
Gets the rectangle of an item.
void RedrawItem(SOsrPanel *pItem)
Redraws a specific item.
virtual void OnItemSetCapture(SOsrPanel *pItem, BOOL bCapture)
Handles the capture of an item.
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.
LRESULT OnSetScale(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles setting the scale 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.
Information about an item in the tile view.