Header Control. More...
#include <SHeaderCtrl.h>
Public Member Functions | |
SHeaderCtrl (void) | |
Constructor. | |
~SHeaderCtrl (void) | |
Destructor. | |
int | InsertItem (int iItem, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam, BOOL bDpiAware=FALSE, float fWeight=0.0f) OVERRIDE |
Insert a new item. | |
int | InsertItemA (int iItem, LPCSTR pszText, int nWidth, UINT fmt, LPARAM lParam, BOOL bDpiAware=FALSE, float fWeight=0.0f) OVERRIDE |
Insert a new item (ANSI version) | |
BOOL | GetItem (int iItem, SHDITEM *pItem) SCONST OVERRIDE |
Get an item. | |
BOOL | SetItem (int iItem, const SHDITEM *pItem) OVERRIDE |
Set an item. | |
UINT | GetItemCount () SCONST OVERRIDE |
Get the number of items. | |
int | GetTotalWidth (BOOL bMinWid=FALSE) SCONST OVERRIDE |
Get the total width of all items. | |
BOOL | IsAutoResize () SCONST OVERRIDE |
Check if auto-resize is enabled. | |
int | GetItemWidth (int iItem) SCONST OVERRIDE |
Get the width of a specific item. | |
BOOL | DeleteItem (int iItem) OVERRIDE |
Delete a specific item. | |
void | DeleteAllItems () OVERRIDE |
Delete all items. | |
void | SetItemSort (int iItem, UINT sortFlag) OVERRIDE |
Set the sort flag for an item. | |
void | SetItemVisible (int iItem, BOOL visible) OVERRIDE |
Set the visibility of an item. | |
BOOL | IsItemVisible (int iItem) SCONST OVERRIDE |
Check if an item is visible. | |
int | GetOriItemIndex (int iOrder) SCONST OVERRIDE |
Get the original item index from the order. | |
void | GetItemRect (int iItem, LPRECT prc) SCONST OVERRIDE |
Get the rectangle of an item. | |
CRect | GetItemRect (int iItem) const |
Get the rectangle of an item. | |
virtual HRESULT | SetAttribute (const SNS::SStringW &amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;strValue, BOOL bLoading=FALSE) |
Protected Member Functions | |
virtual BOOL | CreateChildren (SXmlNode xmlNode) |
Create child items from XML configuration. | |
virtual BOOL | OnSetCursor (const CPoint &pt) |
Set the cursor based on the mouse position. | |
void | OnPaint (IRenderTarget *pRT) |
Paint the control. | |
virtual void | DrawItem (IRenderTarget *pRT, CRect rcItem, const LPSHDITEMEX pItem) |
Draw an item. | |
virtual void | OnColorize (COLORREF cr) |
Handle colorization event. | |
virtual HRESULT | OnLanguageChanged () |
Handle language change event. | |
virtual void | OnScaleChanged (int nScale) |
Handle scale change event. | |
virtual BOOL | OnRelayout (const CRect &rcWnd) |
Handle relayout event. | |
DWORD | HitTest (CPoint pt) |
Hit test to determine the item under the mouse. | |
void | RedrawItem (int iItem) |
Redraw a specific item. | |
void | DrawDraggingState (DWORD dwDragTo) |
Draw the dragging state. | |
BOOL | IsItemHover (DWORD dwHitTest) |
Check if an item is in hover state. | |
HBITMAP | CreateDragImage (UINT iItem) |
Create a drag image for an item. | |
void | OnLButtonDown (UINT nFlags, CPoint pt) |
Handle left mouse button down event. | |
void | OnLButtonUp (UINT nFlags, CPoint pt) |
Handle left mouse button up event. | |
void | OnMouseMove (UINT nFlags, CPoint pt) |
Handle mouse move event. | |
void | OnMouseLeave () |
Handle mouse leave event. | |
void | OnDestroy () |
Handle destroy event. | |
void | OnActivateApp (BOOL bActive, DWORD dwThreadID) |
Handle activate application event. | |
Protected Attributes | |
SAutoRefPtr< ISkinObj > | m_pSkinItem |
SAutoRefPtr< ISkinObj > | m_pSkinSort |
BOOL | m_bSortHeader |
BOOL | m_bFixWidth |
BOOL | m_bItemSwapEnable |
BOOL | m_bDragging |
HBITMAP | m_hDragImg |
CPoint | m_ptClick |
DWORD | m_dwHitTest |
DWORD | m_dwDragTo |
int | m_nAdjItemOldWidth |
SArray< SHDITEMEX > | m_arrItems |
int | m_nScale |
Header Control.
A header control that manages columns with titles and sorting indicators.
Definition at line 18 of file SHeaderCtrl.h.
SNSBEGIN SHeaderCtrl::SHeaderCtrl | ( | void | ) |
Constructor.
Definition at line 6 of file SHeaderCtrl.cpp.
SHeaderCtrl::~SHeaderCtrl | ( | void | ) |
Destructor.
Definition at line 25 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Create child items from XML configuration.
xmlNode | XML node for the child items |
Reimplemented from SWindow.
Definition at line 464 of file SHeaderCtrl.cpp.
|
protected |
Create a drag image for an item.
iItem | Index of the item |
Definition at line 575 of file SHeaderCtrl.cpp.
void SHeaderCtrl::DeleteAllItems | ( | ) |
Delete all items.
Definition at line 191 of file SHeaderCtrl.cpp.
BOOL SHeaderCtrl::DeleteItem | ( | int | iItem | ) |
Delete a specific item.
iItem | Index of the item to delete |
Definition at line 171 of file SHeaderCtrl.cpp.
|
protected |
Draw the dragging state.
dwDragTo | Drag target |
Definition at line 602 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Draw an item.
pRT | Rendering target handle |
rcItem | Rectangle for the item |
pItem | Pointer to the item structure |
Definition at line 141 of file SHeaderCtrl.cpp.
BOOL SHeaderCtrl::GetItem | ( | int | iItem, |
SHDITEM * | pItem ) |
Get an item.
iItem | Index of the item |
pItem | Output structure for the item |
Definition at line 64 of file SHeaderCtrl.cpp.
UINT SHeaderCtrl::GetItemCount | ( | ) |
CRect SHeaderCtrl::GetItemRect | ( | int | iItem | ) | const |
Get the rectangle of an item.
iItem | Index of the item |
Definition at line 207 of file SHeaderCtrl.cpp.
void SHeaderCtrl::GetItemRect | ( | int | iItem, |
LPRECT | prc ) |
Get the rectangle of an item.
iItem | Index of the item |
prc | Output rectangle |
Definition at line 224 of file SHeaderCtrl.cpp.
int SHeaderCtrl::GetItemWidth | ( | int | iItem | ) |
Get the width of a specific item.
iItem | Index of the item |
Definition at line 657 of file SHeaderCtrl.cpp.
int SHeaderCtrl::GetOriItemIndex | ( | int | iOrder | ) |
Get the original item index from the order.
iOrder | Order index |
Definition at line 229 of file SHeaderCtrl.cpp.
int SHeaderCtrl::GetTotalWidth | ( | BOOL | bMinWid = FALSE | ) |
Get the total width of all items.
bMinWid | Whether to get the minimum width |
Definition at line 634 of file SHeaderCtrl.cpp.
|
protected |
Hit test to determine the item under the mouse.
pt | Mouse coordinates |
Definition at line 539 of file SHeaderCtrl.cpp.
int SHeaderCtrl::InsertItem | ( | int | iItem, |
LPCTSTR | pszText, | ||
int | nWidth, | ||
UINT | fmt, | ||
LPARAM | lParam, | ||
BOOL | bDpiAware = FALSE, | ||
float | fWeight = 0.0f ) |
Insert a new item.
iItem | Index of the new item |
pszText | Title of the new item |
nWidth | Width of the new item |
fmt | Format flag |
lParam | Additional parameter |
bDpiAware | DPI awareness flag |
fWeight | Font weight |
Definition at line 29 of file SHeaderCtrl.cpp.
|
inline |
Insert a new item (ANSI version)
iItem | Index of the new item |
pszText | Title of the new item |
nWidth | Width of the new item |
fmt | Format flag |
lParam | Additional parameter |
bDpiAware | DPI awareness flag |
fWeight | Font weight |
Definition at line 69 of file SHeaderCtrl.h.
BOOL SHeaderCtrl::IsAutoResize | ( | ) |
Check if auto-resize is enabled.
Definition at line 798 of file SHeaderCtrl.cpp.
|
inlineprotected |
Check if an item is in hover state.
dwHitTest | Hit test result |
Definition at line 259 of file SHeaderCtrl.h.
BOOL SHeaderCtrl::IsItemVisible | ( | int | iItem | ) |
Check if an item is visible.
iItem | Index of the item |
Definition at line 792 of file SHeaderCtrl.cpp.
|
protected |
Handle activate application event.
bActive | Activation flag |
dwThreadID | Thread ID |
Definition at line 702 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Handle colorization event.
cr | Color reference |
Reimplemented from SWindow.
Definition at line 734 of file SHeaderCtrl.cpp.
|
protected |
Handle destroy event.
Definition at line 199 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Handle language change event.
Reimplemented from SWindow.
Definition at line 743 of file SHeaderCtrl.cpp.
|
protected |
Handle left mouse button down event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 247 of file SHeaderCtrl.cpp.
|
protected |
Handle left mouse button up event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 267 of file SHeaderCtrl.cpp.
|
protected |
Handle mouse leave event.
Definition at line 448 of file SHeaderCtrl.cpp.
|
protected |
Handle mouse move event.
nFlags | Flags |
pt | Mouse coordinates |
Definition at line 330 of file SHeaderCtrl.cpp.
|
protected |
Paint the control.
pRT | Rendering target handle |
Definition at line 114 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Handle relayout event.
rcWnd | Window rectangle |
Reimplemented from SWindow.
Definition at line 768 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Handle scale change event.
nScale | Scale factor |
Reimplemented from SWindow.
Definition at line 753 of file SHeaderCtrl.cpp.
|
protectedvirtual |
Set the cursor based on the mouse position.
pt | Mouse coordinates |
Reimplemented from SWindow.
Definition at line 527 of file SHeaderCtrl.cpp.
|
protected |
Redraw a specific item.
iItem | Index of the item to redraw |
Definition at line 239 of file SHeaderCtrl.cpp.
|
inlinevirtual |
Reimplemented from SWindow.
Definition at line 173 of file SHeaderCtrl.h.
BOOL SHeaderCtrl::SetItem | ( | int | iItem, |
const SHDITEM * | pItem ) |
Set an item.
iItem | Index of the item |
pItem | Structure for the item |
Definition at line 89 of file SHeaderCtrl.cpp.
void SHeaderCtrl::SetItemSort | ( | int | iItem, |
UINT | sortFlag ) |
Set the sort flag for an item.
iItem | Index of the item |
sortFlag | Sort flag |
Definition at line 721 of file SHeaderCtrl.cpp.
void SHeaderCtrl::SetItemVisible | ( | int | iItem, |
BOOL | visible ) |
Set the visibility of an item.
iItem | Index of the item |
visible | Visibility flag |
Definition at line 779 of file SHeaderCtrl.cpp.
|
protected |
Array of header items
Definition at line 332 of file SHeaderCtrl.h.
|
protected |
Dragging flag
Definition at line 326 of file SHeaderCtrl.h.
|
protected |
Whether item widths are fixed
Definition at line 323 of file SHeaderCtrl.h.
|
protected |
Whether item swapping is enabled
Definition at line 324 of file SHeaderCtrl.h.
|
protected |
Whether header can be clicked to sort
Definition at line 322 of file SHeaderCtrl.h.
|
protected |
Drag target
Definition at line 330 of file SHeaderCtrl.h.
|
protected |
Hit test result
Definition at line 329 of file SHeaderCtrl.h.
|
protected |
Bitmap for drag image
Definition at line 327 of file SHeaderCtrl.h.
|
protected |
Original width of the dragged item
Definition at line 331 of file SHeaderCtrl.h.
|
protected |
Current scale factor
Definition at line 333 of file SHeaderCtrl.h.
|
protected |
Skin for drawing header items
Definition at line 320 of file SHeaderCtrl.h.
|
protected |
Skin for sorting indicators
Definition at line 321 of file SHeaderCtrl.h.
|
protected |
Click point
Definition at line 328 of file SHeaderCtrl.h.