soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STileView Class Reference

A tile view control for displaying items in a grid layout. More...

#include <STileView.h>

Classes

struct  ItemInfo
 Information about an item in the tile view. More...
 

Public Member Functions

 STileView ()
 Constructor for STileView.
 
 ~STileView ()
 Destructor for STileView.
 
BOOL SetAdapter (ILvAdapter *adapter) OVERRIDE
 Sets the adapter for the tile view.
 
ILvAdapter * GetAdapter () SCONST OVERRIDE
 Gets the adapter for the tile view.
 
void SetItemLocator (ITileViewItemLocator *pItemLocator) OVERRIDE
 Sets the item locator for the tile view.
 
ITileViewItemLocator * GetItemLocator () SCONST OVERRIDE
 Gets the item locator for the tile view.
 
void SetSel (int iItem, BOOL bNotify=FALSE) OVERRIDE
 Sets the selected item.
 
int GetSel () SCONST OVERRIDE
 Gets the selected item.
 
void EnsureVisible (int iItem) OVERRIDE
 Ensures the specified item is visible.
 
IItemPanel * HitTest (const POINT *pt) SCONST OVERRIDE
 Performs a hit test on the tile view.
 
SItemPanel * HitTest (CPoint &pt) const
 Performs a hit test on the tile view.
 

Protected Member Functions

virtual void OnItemSetCapture (SOsrPanel *pItem, BOOL bCapture)
 Handles the capture of an item.
 
virtual BOOL OnItemGetRect (const SOsrPanel *pItem, CRect &rcItem) const
 Gets the rectangle of an item.
 
virtual BOOL IsItemRedrawDelay () const
 Checks if item redraw is delayed.
 
void onDataSetChanged ()
 Handles data set changes.
 
void onDataSetInvalidated ()
 Handles data set invalidation.
 
void onItemDataChanged (int iItem)
 Handles data changes for a specific item.
 
BOOL OnItemClick (IEvtArgs *pEvt)
 Handles item click events.
 
virtual BOOL OnScroll (BOOL bVertical, UINT uCode, int nPos)
 Handles scroll events.
 
virtual int GetScrollLineSize (BOOL bVertical)
 Gets the scroll line size.
 
virtual BOOL CreateChildren (SXmlNode xmlNode)
 Creates child windows from an XML node.
 
virtual BOOL UpdateToolTip (CPoint pt, SwndToolTipInfo &tipInfo)
 Updates the tooltip.
 
virtual UINT WINAPI OnGetDlgCode () const
 Gets the dialog code for the window.
 
virtual BOOL OnSetCursor (const CPoint &pt)
 Sets the cursor.
 
virtual void OnColorize (COLORREF cr)
 Handles colorization.
 
virtual void OnScaleChanged (int nScale)
 Handles scale changes.
 
virtual HRESULT OnLanguageChanged ()
 Handles language changes.
 
virtual void OnRebuildFont ()
 Rebuilds the font.
 
void DispatchMessage2Items (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Dispatches messages to items.
 
void UpdateScrollBar ()
 Updates the scroll bars.
 
void RedrawItem (SOsrPanel *pItem)
 Redraws a specific item.
 
SItemPanel * GetItemPanel (int iItem)
 Gets the item panel by index.
 
CRect CalcItemDrawRect (int iItem) const
 Calculates the drawing rectangle for an item.
 
void UpdateVisibleItems ()
 Updates the visible items.
 
void UpdateVisibleItem (int iItem)
 Updates a specific visible item.
 
void OnPaint (IRenderTarget *pRT)
 Handles the paint event.
 
void OnSize (UINT nType, CSize size)
 Handles the size event.
 
void OnDestroy ()
 Handles the destroy event.
 
LRESULT OnMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse events.
 
LRESULT OnKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles key events.
 
void OnKeyDown (TCHAR nChar, UINT nRepCnt, UINT nFlags)
 Handles the key down event.
 
void OnMouseLeave ()
 Handles the mouse leave event.
 
BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
 Handles the mouse wheel event.
 
void OnKillFocus (SWND wndFocus)
 Handles the kill focus event.
 
void OnSetFocus (SWND wndOld)
 Handles the set focus event.
 
LRESULT OnSetScale (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles the set scale event.
 
void OnShowWindow (BOOL bShow, UINT nStatus)
 Handles the show window event.
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 

Protected Attributes

SAutoRefPtr< ILvAdapter > m_adapter
 
SAutoRefPtr< ILvDataSetObserver > m_observer
 
SAutoRefPtr< ITileViewItemLocator > m_tvItemLocator
 
bool m_bPendingUpdate
 
int m_iPendingUpdateItem
 
int m_iPendingViewItem
 
int m_iFirstVisible
 
SList< ItemInfom_lstItems
 
SOsrPanel * m_itemCapture
 
int m_iSelItem
 
SOsrPanel * m_pHoverItem
 
SArray< SList< SItemPanel * > * > m_itemRecycle
 
SXmlDoc m_xmlTemplate
 
SLayoutSize m_nMarginSize
 
BOOL m_bWantTab
 
BOOL m_bDatasetInvalidated
 

Friends

class STileViewDataSetObserver
 

Detailed Description

A tile view control for displaying items in a grid layout.

This class represents a tile view control that can display items in a grid layout with various customization options.

Definition at line 30 of file STileView.h.

Constructor & Destructor Documentation

◆ STileView()

STileView::STileView ( )

Constructor for STileView.

Definition at line 39 of file STileView.cpp.

◆ ~STileView()

STileView::~STileView ( )

Destructor for STileView.

Definition at line 60 of file STileView.cpp.

Member Function Documentation

◆ CalcItemDrawRect()

CRect STileView::CalcItemDrawRect ( int iItem) const
protected

Calculates the drawing rectangle for an item.

Parameters
iItemIndex of the item.
Returns
Drawing rectangle of the item.

Definition at line 478 of file STileView.cpp.

◆ CreateChildren()

BOOL STileView::CreateChildren ( SXmlNode xmlNode)
protectedvirtual

Creates child windows from an XML node.

Parameters
xmlNodeXML node containing the child window definitions.
Returns
TRUE if successful, otherwise FALSE.

Reimplemented from SWindow.

Definition at line 779 of file STileView.cpp.

◆ DispatchMessage2Items()

void STileView::DispatchMessage2Items ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Dispatches messages to items.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.

Definition at line 985 of file STileView.cpp.

◆ EnsureVisible()

void STileView::EnsureVisible ( int iItem)

Ensures the specified item is visible.

Parameters
iItemIndex of the item to make visible.

Definition at line 716 of file STileView.cpp.

◆ GetAdapter()

ILvAdapter * STileView::GetAdapter ( )

Gets the adapter for the tile view.

Returns
Pointer to the adapter.

Definition at line 1033 of file STileView.cpp.

◆ GetItemLocator()

ITileViewItemLocator * STileView::GetItemLocator ( )

Gets the item locator for the tile view.

Returns
Pointer to the item locator.

Definition at line 1038 of file STileView.cpp.

◆ GetItemPanel()

SItemPanel * STileView::GetItemPanel ( int iItem)
protected

Gets the item panel by index.

Parameters
iItemIndex of the item.
Returns
Pointer to the item panel.

Definition at line 761 of file STileView.cpp.

◆ GetScrollLineSize()

int STileView::GetScrollLineSize ( BOOL bVertical)
protectedvirtual

Gets the scroll line size.

Parameters
bVerticalFlag indicating if the scroll is vertical.
Returns
Scroll line size.

Reimplemented from SPanel.

Definition at line 756 of file STileView.cpp.

◆ GetSel()

int STileView::GetSel ( )

Gets the selected item.

Returns
Index of the selected item.

Definition at line 1043 of file STileView.cpp.

◆ HitTest() [1/2]

IItemPanel * STileView::HitTest ( const POINT * pt)

Performs a hit test on the tile view.

Parameters
ptPointer to the point to test.
Returns
Pointer to the item panel at the specified point.

◆ HitTest() [2/2]

SItemPanel * STileView::HitTest ( CPoint & pt) const

Performs a hit test on the tile view.

Parameters
ptThe point to test.
Returns
Pointer to the item panel at the specified point.

Definition at line 520 of file STileView.cpp.

◆ IsItemRedrawDelay()

BOOL STileView::IsItemRedrawDelay ( ) const
protectedvirtual

Checks if item redraw is delayed.

Returns
TRUE if item redraw is delayed, otherwise FALSE.

Definition at line 473 of file STileView.cpp.

◆ OnColorize()

void STileView::OnColorize ( COLORREF cr)
protectedvirtual

Handles colorization.

Parameters
crColor reference.

Reimplemented from SPanel.

Definition at line 963 of file STileView.cpp.

◆ onDataSetChanged()

void STileView::onDataSetChanged ( )
protected

Handles data set changes.

Definition at line 172 of file STileView.cpp.

◆ onDataSetInvalidated()

void STileView::onDataSetInvalidated ( )
protected

Handles data set invalidation.

Definition at line 189 of file STileView.cpp.

◆ OnDestroy()

void STileView::OnDestroy ( )
protected

Handles the destroy event.

Definition at line 440 of file STileView.cpp.

◆ OnGetDlgCode()

UINT STileView::OnGetDlgCode ( ) const
protectedvirtual

Gets the dialog code for the window.

Returns
Dialog code.

Definition at line 881 of file STileView.cpp.

◆ OnItemClick()

BOOL STileView::OnItemClick ( IEvtArgs * pEvt)
protected

Handles item click events.

Parameters
pEvtPointer to the event arguments.
Returns
TRUE if the event was handled, otherwise FALSE.

Definition at line 952 of file STileView.cpp.

◆ onItemDataChanged()

void STileView::onItemDataChanged ( int iItem)
protected

Handles data changes for a specific item.

Parameters
iItemIndex of the item.

Definition at line 205 of file STileView.cpp.

◆ OnItemGetRect()

BOOL STileView::OnItemGetRect ( const SOsrPanel * pItem,
CRect & rcItem ) const
protectedvirtual

Gets the rectangle of an item.

Parameters
pItemPointer to the item panel.
rcItemRectangle to receive the item position.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 492 of file STileView.cpp.

◆ OnItemSetCapture()

void STileView::OnItemSetCapture ( SOsrPanel * pItem,
BOOL bCapture )
protectedvirtual

Handles the capture of an item.

Parameters
pItemPointer to the item panel.
bCaptureFlag indicating if the item should be captured.

Definition at line 501 of file STileView.cpp.

◆ OnKeyDown()

void STileView::OnKeyDown ( TCHAR nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handles the key down event.

Parameters
nCharVirtual key code of the key.
nRepCntRepeat count for the key.
nFlagsFlags associated with the key event.

Definition at line 627 of file STileView.cpp.

◆ OnKeyEvent()

LRESULT STileView::OnKeyEvent ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles key events.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.
Returns
Result of the message handling.

Definition at line 600 of file STileView.cpp.

◆ OnKillFocus()

void STileView::OnKillFocus ( SWND wndFocus)
protected

Handles the kill focus event.

Parameters
wndFocusHandle to the window receiving focus.

Definition at line 893 of file STileView.cpp.

◆ OnLanguageChanged()

HRESULT STileView::OnLanguageChanged ( )
protectedvirtual

Handles language changes.

Returns
Result of the language change handling.

Reimplemented from SWindow.

Definition at line 978 of file STileView.cpp.

◆ OnMouseEvent()

LRESULT STileView::OnMouseEvent ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles mouse events.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.
Returns
Result of the message handling.

Definition at line 545 of file STileView.cpp.

◆ OnMouseLeave()

void STileView::OnMouseLeave ( )
protected

Handles the mouse leave event.

Definition at line 616 of file STileView.cpp.

◆ OnMouseWheel()

BOOL STileView::OnMouseWheel ( UINT nFlags,
short zDelta,
CPoint pt )
protected

Handles the mouse wheel event.

Parameters
nFlagsFlags associated with the mouse event.
zDeltaWheel delta.
ptMouse position.
Returns
TRUE if the event was handled, otherwise FALSE.

Definition at line 741 of file STileView.cpp.

◆ OnPaint()

void STileView::OnPaint ( IRenderTarget * pRT)
protected

Handles the paint event.

Parameters
pRTPointer to the rendering target.

Definition at line 222 of file STileView.cpp.

◆ OnRebuildFont()

void STileView::OnRebuildFont ( )
protectedvirtual

Rebuilds the font.

Reimplemented from SWindow.

Definition at line 1027 of file STileView.cpp.

◆ OnScaleChanged()

void STileView::OnScaleChanged ( int nScale)
protectedvirtual

Handles scale changes.

Parameters
nScaleNew scale value.

Reimplemented from SPanel.

Definition at line 969 of file STileView.cpp.

◆ OnScroll()

BOOL STileView::OnScroll ( BOOL bVertical,
UINT uCode,
int nPos )
protectedvirtual

Handles scroll events.

Parameters
bVerticalFlag indicating if the scroll is vertical.
uCodeScroll code.
nPosScroll position.
Returns
TRUE if the event was handled, otherwise FALSE.

Reimplemented from SPanel.

Definition at line 274 of file STileView.cpp.

◆ OnSetCursor()

BOOL STileView::OnSetCursor ( const CPoint & pt)
protectedvirtual

Sets the cursor.

Parameters
ptMouse position.
Returns
TRUE if the cursor was set, otherwise FALSE.

Reimplemented from SWindow.

Definition at line 932 of file STileView.cpp.

◆ OnSetFocus()

void STileView::OnSetFocus ( SWND wndOld)
protected

Handles the set focus event.

Parameters
wndOldHandle to the window losing focus.

Definition at line 909 of file STileView.cpp.

◆ OnSetScale()

LRESULT STileView::OnSetScale ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles the set scale event.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.
Returns
Result of the message handling.

Definition at line 924 of file STileView.cpp.

◆ OnShowWindow()

void STileView::OnShowWindow ( BOOL bShow,
UINT nStatus )
protected

Handles the show window event.

Parameters
bShowFlag indicating if the window is being shown.
nStatusStatus of the window. Paint event. Size event. Destroy event. Mouse wheel event. Mouse leave event. Key down event. Kill focus event. Set focus event. Set scale event. Show window event. Mouse event range. Key event range. IME key event range. IME character event. IME request event.

Definition at line 1005 of file STileView.cpp.

◆ OnSize()

void STileView::OnSize ( UINT nType,
CSize size )
protected

Handles the size event.

Parameters
nTypeType of size change.
sizeNew size.

Definition at line 429 of file STileView.cpp.

◆ RedrawItem()

void STileView::RedrawItem ( SOsrPanel * pItem)
protected

Redraws a specific item.

Parameters
pItemPointer to the item panel.

Definition at line 515 of file STileView.cpp.

◆ SetAdapter()

BOOL STileView::SetAdapter ( ILvAdapter * adapter)

Sets the adapter for the tile view.

Parameters
adapterPointer to the adapter.
Returns
TRUE if successful, otherwise FALSE.

Definition at line 66 of file STileView.cpp.

◆ SetAttribute()

virtual HRESULT STileView::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlineprotectedvirtual

< Margin size for items.

< Flag indicating if tabbing is wanted.

Reimplemented from SPanel.

Definition at line 373 of file STileView.h.

◆ SetItemLocator()

void STileView::SetItemLocator ( ITileViewItemLocator * pItemLocator)

Sets the item locator for the tile view.

Parameters
pItemLocatorPointer to the item locator.

Definition at line 795 of file STileView.cpp.

◆ SetSel()

void STileView::SetSel ( int iItem,
BOOL bNotify = FALSE )

Sets the selected item.

Parameters
iItemIndex of the item to select.
bNotifyFlag indicating if a notification should be sent.

Definition at line 815 of file STileView.cpp.

◆ UpdateScrollBar()

void STileView::UpdateScrollBar ( )
protected

Updates the scroll bars.

Definition at line 135 of file STileView.cpp.

◆ UpdateToolTip()

BOOL STileView::UpdateToolTip ( CPoint pt,
SwndToolTipInfo & tipInfo )
protectedvirtual

Updates the tooltip.

Parameters
ptMouse position.
tipInfoTooltip information.
Returns
TRUE if the tooltip was updated, otherwise FALSE.

Reimplemented from SWindow.

Definition at line 806 of file STileView.cpp.

◆ UpdateVisibleItem()

void STileView::UpdateVisibleItem ( int iItem)
protected

Updates a specific visible item.

Parameters
iItemIndex of the item.

Definition at line 195 of file STileView.cpp.

◆ UpdateVisibleItems()

void STileView::UpdateVisibleItems ( )
protected

Updates the visible items.

Definition at line 293 of file STileView.cpp.

Friends And Related Symbol Documentation

◆ STileViewDataSetObserver

friend class STileViewDataSetObserver
friend

Definition at line 36 of file STileView.h.

Member Data Documentation

◆ m_adapter

SAutoRefPtr<ILvAdapter> STileView::m_adapter
protected

Adapter for the tile view.

Definition at line 379 of file STileView.h.

◆ m_bDatasetInvalidated

BOOL STileView::m_bDatasetInvalidated
protected

Flag indicating if the data set is invalidated.

Definition at line 410 of file STileView.h.

◆ m_bPendingUpdate

bool STileView::m_bPendingUpdate
protected

Flag indicating if an update is pending due to data set changes.

Definition at line 393 of file STileView.h.

◆ m_bWantTab

BOOL STileView::m_bWantTab
protected

Flag indicating if tabbing is wanted.

Definition at line 409 of file STileView.h.

◆ m_iFirstVisible

int STileView::m_iFirstVisible
protected

Index of the first visible item.

Definition at line 397 of file STileView.h.

◆ m_iPendingUpdateItem

int STileView::m_iPendingUpdateItem
protected

Index of the item to update, -1 for all, -2 for nothing.

Definition at line 394 of file STileView.h.

◆ m_iPendingViewItem

int STileView::m_iPendingViewItem
protected

Index of the item to view, -1 for initialization.

Definition at line 395 of file STileView.h.

◆ m_iSelItem

int STileView::m_iSelItem
protected

Index of the selected item.

Definition at line 402 of file STileView.h.

◆ m_itemCapture

SOsrPanel* STileView::m_itemCapture
protected

Item panel that has been set capture.

Definition at line 400 of file STileView.h.

◆ m_itemRecycle

SArray<SList<SItemPanel *> *> STileView::m_itemRecycle
protected

Definition at line 405 of file STileView.h.

◆ m_lstItems

SList<ItemInfo> STileView::m_lstItems
protected

Definition at line 398 of file STileView.h.

◆ m_nMarginSize

SLayoutSize STileView::m_nMarginSize
protected

Margin size for items.

Definition at line 408 of file STileView.h.

◆ m_observer

SAutoRefPtr<ILvDataSetObserver> STileView::m_observer
protected

Data set observer.

Definition at line 380 of file STileView.h.

◆ m_pHoverItem

SOsrPanel* STileView::m_pHoverItem
protected

Item panel under the hover state.

Definition at line 403 of file STileView.h.

◆ m_tvItemLocator

SAutoRefPtr<ITileViewItemLocator> STileView::m_tvItemLocator
protected

Item locator for the tile view.

Definition at line 381 of file STileView.h.

◆ m_xmlTemplate

SXmlDoc STileView::m_xmlTemplate
protected

XML template for item panels.

Definition at line 407 of file STileView.h.


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