#include <UiList.h>
继承自UiWin。
公有成员 | |
| void | AddItem (ListItem &item) |
| add an item to the list | |
| virtual int | CalcContentHeight () |
| calculate the content's height (the drawing of vertical scrollbar will called this member,can be derived) | |
| virtual int | CalcContentTopPosV () |
| calculate the content's top position (the drawing of vertical scrollbar will called this member,can be derived) | |
| virtual int | CalcIndexOfPos (int xPos, int yPos) |
| virtual int | CalcItemHeight (int index) |
| virtual bool | CalcItemRect (int index, __in RECT *prcWin, __out RECT *pRect) |
| calc and get the item's rectangle | |
| virtual int | CalcItemTopPos (int index) |
| int | CalcTotalItemsHeight () |
| get all items' height | |
| virtual void | DrawItem (HDC hdcDst, int nIndex, RECT *prcItem, RECT *prcWin, RECT *prcUpdate) |
| called when an item needed to be drawn. override to do owner drawings. | |
| void | EnableGridlines (bool bEnable) |
| Enable grid lines drawings | |
| void | EnableUltraGridlines (bool bEnable) |
| Enable ultra grid lines. even when items are not enough to full fill the control, grid lines will full fill the control) | |
| void | EnableVaryItemHeight (bool bEnable) |
| Enable that items could have different item-height | |
| int | GetFirstVisibleItemIndex (int &nItemTopPos, RECT *prcWin, RECT *prcUpdate) |
| MZFC_INLINE COLORREF | GetGridlineColor_GradientBottomLeft () |
| MZFC_INLINE COLORREF | GetGridlineColor_GradientBottomrRight () |
| MZFC_INLINE COLORREF | GetGridlineColor_GradientTopLeft () |
| MZFC_INLINE COLORREF | GetGridlineColor_GradientTopRight () |
| ListItem * | GetItem (int index) |
| Get an item | |
| virtual int | GetItemCount () |
| get total count of items | |
| int | GetOriginOffset () |
| int | GetSelectedIndex () |
| bool | GetVisibleRange (int *nIndex, int *nCount) |
| void | InsertItem (ListItem &item, int nPos=-1) |
| insert an item to the list: nPos: 0:front, -1:last | |
| void | InvalidateItem (int nIndex) |
| bool | IsEnableVaryItemHeight () |
| Is Enable that items could have different item-height | |
| bool | IsGridlinesEnabled () |
| bool | IsUltraGridlinesEnabled () |
| void | MoveTopPos (int nOffset) |
| move the top position of the content | |
| virtual int | OnLButtonDown (UINT fwKeys, int xPos, int yPos) |
| mouse message handlers | |
| virtual int | OnLButtonUp (UINT fwKeys, int xPos, int yPos) |
| called when the mouse left button is is released on the control | |
| virtual int | OnMouseMove (UINT fwKeys, int xPos, int yPos) |
| called when the control has mouse move message. | |
| virtual void | OnRemoveItem (int nIndex) |
| called when an item is to be removed | |
| virtual void | OnSelectItem (int nIndex, UINT fwKeys, int xPos, int yPos) |
| called when an item is set selected | |
| virtual int | OnTimer (UINT_PTR nIDEvent) |
| called then Timer arrived. | |
| void | PaintWin (HDC hdc, RECT *prcWin, RECT *prcUpdate) |
| Draw the control on the destinate DC. | |
| void | RemoveAll () |
| remove all items of the list | |
| void | RemoveItem (int nIndex) |
| remove an item of the list | |
| void | ScrollStart (double fScrollSpeed) |
| start scroll | |
| void | ScrollStop () |
| stop scroll | |
| void | ScrollTo (int nScrollToType=UI_SCROLLTO_TOP, int nDstTopPos=0, bool bAnimate=true) |
| Scroll the content of a control to a position | |
| void | SetGridlineColor_GradientBottomLeft (COLORREF clrGridline) |
| set color of bottom the grid line's left gradient | |
| void | SetGridlineColor_GradientBottomRight (COLORREF clrGridline) |
| set color of bottom the grid line's middle gradient | |
| void | SetGridlineColor_GradientTopLeft (COLORREF clrGridline) |
| set color of top the grid line's left gradient | |
| void | SetGridlineColor_GradientTopRight (COLORREF clrGridline) |
| set color of top the grid line's middle gradient | |
| void | SetItemHeight (int nHeight) |
| set item height | |
| void | SetOriginOffset (int offset) |
| the offset of the content top position to the control's origin | |
| void | SetSelectedIndex (int index) |
| set the selected item: | |
| void | SetTopPos (int nTopPos) |
| set the top position of the content | |
| UiList (void) | |
| ~UiList (void) | |
保护属性 | |
| bool | m_bEnableVaryItemHeight |
| bool | m_bIsEnableDragScroll |
| bool | m_bMouseDown |
| ListItems | m_Items |
| items of the list | |
| int | m_nDragMode |
| int | m_nItemHeight |
| int | m_nOriginOffset |
| int | m_nSelectedIndex |
| UiList::UiList | ( | void | ) |
| UiList::~UiList | ( | void | ) |
| void UiList::AddItem | ( | ListItem & | item | ) |
add an item to the list
operations to items
| virtual int UiList::CalcContentHeight | ( | ) | [virtual] |
calculate the content's height (the drawing of vertical scrollbar will called this member,can be derived)
重载UiWin。
| virtual int UiList::CalcContentTopPosV | ( | ) | [virtual] |
calculate the content's top position (the drawing of vertical scrollbar will called this member,can be derived)
重载UiWin。
| virtual int UiList::CalcIndexOfPos | ( | int | xPos, | |
| int | yPos | |||
| ) | [virtual] |
calc and get the index of item of a specify position relative to the control: return: -1: none
| virtual int UiList::CalcItemHeight | ( | int | index | ) | [virtual] |
get the specify item's height override to redefine the item's height. index: -1:return the default height of items; >=0:return the item's height this member will be called when IsEnableVaryItemHeight() is true
| virtual bool UiList::CalcItemRect | ( | int | index, | |
| __in RECT * | prcWin, | |||
| __out RECT * | pRect | |||
| ) | [virtual] |
calc and get the item's rectangle
| virtual int UiList::CalcItemTopPos | ( | int | index | ) | [virtual] |
| int UiList::CalcTotalItemsHeight | ( | ) |
get all items' height
| virtual void UiList::DrawItem | ( | HDC | hdcDst, | |
| int | nIndex, | |||
| RECT * | prcItem, | |||
| RECT * | prcWin, | |||
| RECT * | prcUpdate | |||
| ) | [virtual] |
called when an item needed to be drawn. override to do owner drawings.
| void UiList::EnableGridlines | ( | bool | bEnable | ) |
Enable grid lines drawings
| void UiList::EnableUltraGridlines | ( | bool | bEnable | ) |
Enable ultra grid lines. even when items are not enough to full fill the control, grid lines will full fill the control)
| void UiList::EnableVaryItemHeight | ( | bool | bEnable | ) |
Enable that items could have different item-height
| int UiList::GetFirstVisibleItemIndex | ( | int & | nItemTopPos, | |
| RECT * | prcWin, | |||
| RECT * | prcUpdate | |||
| ) |
| MZFC_INLINE COLORREF UiList::GetGridlineColor_GradientBottomLeft | ( | ) |
| MZFC_INLINE COLORREF UiList::GetGridlineColor_GradientBottomrRight | ( | ) |
| MZFC_INLINE COLORREF UiList::GetGridlineColor_GradientTopLeft | ( | ) |
| MZFC_INLINE COLORREF UiList::GetGridlineColor_GradientTopRight | ( | ) |
| ListItem* UiList::GetItem | ( | int | index | ) |
Get an item
| virtual int UiList::GetItemCount | ( | ) | [virtual] |
get total count of items
| int UiList::GetOriginOffset | ( | ) |
| int UiList::GetSelectedIndex | ( | ) |
get the selected item: return: -1:none, >=0: index of selected item
| bool UiList::GetVisibleRange | ( | int * | nIndex, | |
| int * | nCount | |||
| ) |
| void UiList::InsertItem | ( | ListItem & | item, | |
| int | nPos = -1 | |||
| ) |
insert an item to the list: nPos: 0:front, -1:last
| void UiList::InvalidateItem | ( | int | nIndex | ) |
invalidate an item's rect. nIndex: the index of the item, >=0
| bool UiList::IsEnableVaryItemHeight | ( | ) |
Is Enable that items could have different item-height
| bool UiList::IsGridlinesEnabled | ( | ) |
| bool UiList::IsUltraGridlinesEnabled | ( | ) |
| void UiList::MoveTopPos | ( | int | nOffset | ) | [virtual] |
| virtual int UiList::OnLButtonDown | ( | UINT | fwKeys, | |
| int | xPos, | |||
| int | yPos | |||
| ) | [virtual] |
| virtual int UiList::OnLButtonUp | ( | UINT | fwKeys, | |
| int | xPos, | |||
| int | yPos | |||
| ) | [virtual] |
| virtual int UiList::OnMouseMove | ( | UINT | fwKeys, | |
| int | xPos, | |||
| int | yPos | |||
| ) | [virtual] |
| virtual void UiList::OnRemoveItem | ( | int | nIndex | ) | [virtual] |
called when an item is to be removed
| virtual void UiList::OnSelectItem | ( | int | nIndex, | |
| UINT | fwKeys, | |||
| int | xPos, | |||
| int | yPos | |||
| ) | [virtual] |
called when an item is set selected
| virtual int UiList::OnTimer | ( | UINT_PTR | nIDEvent | ) | [virtual] |
| void UiList::PaintWin | ( | HDC | hdcDst, | |
| RECT * | prcWin, | |||
| RECT * | prcUpdate | |||
| ) | [virtual] |
Draw the control on the destinate DC.
Override this member function to define your own drawings of the control
| hdcDst | Destinate device contact | |
| prcWin | The Rect of the control(hdc 's left-top is the origin) | |
| prcUpdate | Rect of the hdc that need to be update(hdc 's left-top is the origin) |
重载UiWin。
| void UiList::RemoveAll | ( | ) |
remove all items of the list
| void UiList::RemoveItem | ( | int | nIndex | ) |
remove an item of the list
| void UiList::ScrollStart | ( | double | fScrollSpeed | ) | [virtual] |
| void UiList::ScrollStop | ( | ) | [virtual] |
| void UiList::ScrollTo | ( | int | nScrollToType = UI_SCROLLTO_TOP, |
|
| int | nDstTopPos = 0, |
|||
| bool | bAnimate = true | |||
| ) | [virtual] |
Scroll the content of a control to a position
| nScrollToType | UI_SCROLLTO_TOP, UI_SCROLLTO_BOTTOM, UI_SCROLLTO_POS | |
| nDstTopPos | destinate content top position,only available when nScrollToType==UI_SCROLLTO_POS | |
| bAnimate | whether do animation of scrolling |
重载UiWin。
| void UiList::SetGridlineColor_GradientBottomLeft | ( | COLORREF | clrGridline | ) |
set color of bottom the grid line's left gradient
| void UiList::SetGridlineColor_GradientBottomRight | ( | COLORREF | clrGridline | ) |
set color of bottom the grid line's middle gradient
| void UiList::SetGridlineColor_GradientTopLeft | ( | COLORREF | clrGridline | ) |
set color of top the grid line's left gradient
| void UiList::SetGridlineColor_GradientTopRight | ( | COLORREF | clrGridline | ) |
set color of top the grid line's middle gradient
| void UiList::SetItemHeight | ( | int | nHeight | ) |
set item height
| void UiList::SetOriginOffset | ( | int | offset | ) |
the offset of the content top position to the control's origin
| void UiList::SetSelectedIndex | ( | int | index | ) |
set the selected item:
| void UiList::SetTopPos | ( | int | nTopPos | ) | [virtual] |
bool UiList::m_bEnableVaryItemHeight [protected] |
bool UiList::m_bIsEnableDragScroll [protected] |
重载UiWin。
bool UiList::m_bMouseDown [protected] |
ListItems UiList::m_Items [protected] |
items of the list
int UiList::m_nDragMode [protected] |
重载UiWin。
int UiList::m_nItemHeight [protected] |
int UiList::m_nOriginOffset [protected] |
int UiList::m_nSelectedIndex [protected] |