|
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2014-2050 SOUI<EFBFBD>Ŷ<EFBFBD>(ˮľ֮<EFBFBD><EFBFBD>
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* @file SListCtrlex.h
|
|
|
|
|
* @brief
|
|
|
|
|
* @version v1.0
|
|
|
|
|
* @author soui
|
|
|
|
|
* @date 2015-02-05
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>չ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <core/SPanel.h>
|
|
|
|
|
#include <core/Sitempanel.h>
|
|
|
|
|
#include <control/SHeaderCtrl.h>
|
|
|
|
|
|
|
|
|
|
namespace SOUI
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @class SListBox
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>չ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>չ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
#define IDC_LSTCEX_SELECT -300
|
|
|
|
|
class SListCtrlEx :public SScrollView
|
|
|
|
|
,public IItemContainer
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
SOUI_CLASS_NAME(SListCtrlEx, L"listctrlex")
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::SListBox
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD>캯<EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD>캯<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
SListCtrlEx();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListBox::~SListBox
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual ~SListCtrlEx();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::DeleteAllItems
|
|
|
|
|
* @brief ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param BOOL bUpdate -- <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void DeleteAllItems(BOOL bUpdate=TRUE);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::DeleteItem
|
|
|
|
|
* @brief ɾ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe ɾ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void DeleteItem(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::InsertItem
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param pugi::xml_node xmlNode -- xml<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
* @param DWORD dwData -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int InsertItem(int iItem,pugi::xml_node xmlNode,LPARAM dwData=0);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::InsertItem
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param LPCWSTR pszXml -- xml<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
* @param DWORD dwData -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int InsertItem(int iItem,LPCWSTR pszXml,LPARAM dwData=0);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::SetCurSel
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nIndex -- <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
BOOL SetCurSel(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::EnsureVisible
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
* @param int nIndex -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
*/
|
|
|
|
|
void EnsureVisible(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetCurSel
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǰѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>int
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǰѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int GetCurSel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetItemPanel
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>SWindow
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
SWindow * GetItemPanel(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetItemData
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nIndex -- ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>LPARAM
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
LPARAM GetItemData(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::SetItemData
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nIndex -- ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param LPARAM lParam -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>BOOL
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void SetItemData(int iItem,LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::SetItemCount
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nItems <EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param LPCTSTR pszXmlTemplate <EFBFBD><EFBFBD>ʾʱʹ<EFBFBD>õ<EFBFBD>XMLģ<EFBFBD>壬
|
|
|
|
|
* Ϊ<EFBFBD><EFBFBD>ʱʹ<EFBFBD><EFBFBD>XML<EFBFBD>ű<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>template<EFBFBD>ӽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
BOOL SetItemCount(int nItems,LPCTSTR pszXmlTemplate=NULL);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetItemCount
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD> int
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int GetItemCount() ;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetItemHeight
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD>߶<EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>int
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡ<EFBFBD>߶<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int GetItemHeight()
|
|
|
|
|
{
|
|
|
|
|
return m_nItemHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::RedrawItem
|
|
|
|
|
* @brief <EFBFBD>ػ<EFBFBD>ѡ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD>ػ<EFBFBD>ѡ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void RedrawItem(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::HitTest
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
* @param CPoint &pt -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>pt<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
int HitTest(CPoint &pt);
|
|
|
|
|
|
|
|
|
|
void SwapItem(int srcIdx, int desIdx);
|
|
|
|
|
|
|
|
|
|
BOOL SortItems(PFNLVCOMPAREEX pfnCompare, void * pContext);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnItemSetCapture
|
|
|
|
|
* @brief
|
|
|
|
|
* @param SItemPanel *pItem
|
|
|
|
|
* @param BOOL bCapture
|
|
|
|
|
*
|
|
|
|
|
* Describe
|
|
|
|
|
*/
|
|
|
|
|
virtual void OnItemSetCapture(SItemPanel *pItem,BOOL bCapture);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnItemGetRect
|
|
|
|
|
* @brief
|
|
|
|
|
* @param SItemPanel *pItem
|
|
|
|
|
* @param CRect &rcItem
|
|
|
|
|
*
|
|
|
|
|
* Describe
|
|
|
|
|
*/
|
|
|
|
|
virtual BOOL OnItemGetRect(SItemPanel *pItem,CRect &rcItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::IsItemRedrawDelay
|
|
|
|
|
* @brief
|
|
|
|
|
*
|
|
|
|
|
* Describe
|
|
|
|
|
*/
|
|
|
|
|
virtual BOOL IsItemRedrawDelay(){return m_bItemRedrawDelay;}
|
|
|
|
|
|
|
|
|
|
virtual void OnItemRequestRelayout(SItemPanel *pItem);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::UpdatePanelsIndex
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT nFirst
|
|
|
|
|
* @param UINT nLast
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void UpdatePanelsIndex(UINT nFirst=0,UINT nLast=-1);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::GetItemRect
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡָ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>CRect
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
CRect GetItemRect(int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnPaint
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param IRenderTarget *pRT -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnPaint(IRenderTarget * pRT);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnSize
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT nType --
|
|
|
|
|
* @param CSize size --
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnSize(UINT nType, CSize size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::DrawItem
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param IRenderTarget *pRT -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸
|
|
|
|
|
* @param CRect & rc -- λ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param int iItem -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual void DrawItem(IRenderTarget *pRT, CRect &rcItem, int iItem);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::CreateChildren
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param pugi::xml_node xmlNode -- xml<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>xml<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual BOOL CreateChildren(pugi::xml_node xmlNode);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnUpdateToolTip
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
* @param CPoint pt -- <EFBFBD><EFBFBD>Ӧλ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param SwndToolTipInfo & tipInfo -- <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
* @return BOOL
|
|
|
|
|
*
|
|
|
|
|
* Describe
|
|
|
|
|
*/
|
|
|
|
|
virtual BOOL OnUpdateToolTip(CPoint pt, SwndToolTipInfo & tipInfo);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::NotifySelChange
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nOldSel -- <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param int nNewSel -- <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void NotifySelChange(int nOldSel,int nNewSel, BOOL checkBox = FALSE);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnMouseEvent
|
|
|
|
|
* @brief <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT uMsg -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param WPARAM wParam -- wParam
|
|
|
|
|
* @param LPARAM lParam -- lParam
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>LRESULT
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
LRESULT OnMouseEvent(UINT uMsg,WPARAM wParam,LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnKeyEvent
|
|
|
|
|
* @brief <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT uMsg -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param WPARAM wParam -- wParam
|
|
|
|
|
* @param LPARAM lParam -- lParam
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>LRESULT
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
LRESULT OnKeyEvent( UINT uMsg,WPARAM wParam,LPARAM lParam );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnMouseLeave
|
|
|
|
|
* @brief <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnMouseLeave();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnMouseWheel
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
|
|
|
|
* @param UINT nFlags -- <EFBFBD><EFBFBD>־
|
|
|
|
|
* @param short zDelta -- <EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param CPoint pt -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD>BOOL
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnKeyDown
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param TCHAR nChar -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param UINT nRepCnt -- <EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT nFlags -- <EFBFBD><EFBFBD>־
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnKeyDown( TCHAR nChar, UINT nRepCnt, UINT nFlags );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnChar
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param TCHAR nChar -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param UINT nRepCnt -- <EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param UINT nFlags -- <EFBFBD><EFBFBD>־
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnGetDlgCode
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param <EFBFBD><EFBFBD><EFBFBD><EFBFBD>UINT
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
UINT OnGetDlgCode();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnSetCursor
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param <EFBFBD><EFBFBD><EFBFBD><EFBFBD>BOOL
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual BOOL OnSetCursor(const CPoint &pt);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnViewOriginChanged
|
|
|
|
|
* @brief
|
|
|
|
|
* @param CPoint ptOld --
|
|
|
|
|
* @param CPoint ptNew --
|
|
|
|
|
*
|
|
|
|
|
* Describe
|
|
|
|
|
*/
|
|
|
|
|
virtual void OnViewOriginChanged(CPoint ptOld,CPoint ptNew);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnDestroy
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnDestroy();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnSetFocus
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnSetFocus(SWND wndOld);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnKillFocus
|
|
|
|
|
* @brief ʧȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe ʧȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void OnKillFocus(SWND wndFocus);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::OnNcCalcSize
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
* @param BOOL bCalcValidRects -- <EFBFBD><EFBFBD>С
|
|
|
|
|
* @param LPARAM lParam -- <EFBFBD><EFBFBD><EFBFBD>Ӳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
*/
|
|
|
|
|
LRESULT OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SListCtrlEx::Relayout
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Describe <EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Relayout();
|
|
|
|
|
protected:
|
|
|
|
|
SArray<SItemPanel *> m_arrItems; /**< <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int m_nItemHeight; /**< <EFBFBD>߶<EFBFBD> */
|
|
|
|
|
int m_iSelItem; /**< ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ */
|
|
|
|
|
int m_iHoverItem; /**< Hover״̬<EFBFBD><EFBFBD>Ŀ */
|
|
|
|
|
int m_iScrollSpeed; /**< <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD> */
|
|
|
|
|
BOOL m_bHotTrack; /**< */
|
|
|
|
|
|
|
|
|
|
pugi::xml_document m_xmlTempl; /**< <EFBFBD>б<EFBFBD>ģ<EFBFBD><EFBFBD>XML */
|
|
|
|
|
SItemPanel *m_pCapturedFrame; /**< <EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>setcapture<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
ISkinObj *m_pItemSkin; /**< <EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>skin */
|
|
|
|
|
SStringW m_strSelectRangeSkin; /**< ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>skin */
|
|
|
|
|
COLORREF m_crItemBg; /**< <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
|
|
|
COLORREF m_crItemSelBg; /**< ѡ<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
|
|
|
COLORREF m_crItemHotBg; /**< Hot<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
|
|
|
BOOL m_bItemRedrawDelay; /**< <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ػ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
SWindow *m_pWndRectangle; /**< <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
CRect m_rcWnd;/**< ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD> */
|
|
|
|
|
CPoint m_ptTmp;
|
|
|
|
|
BOOL m_bMouseDown;
|
|
|
|
|
BOOL m_bStartSelect;
|
|
|
|
|
BOOL m_bCheckBox;
|
|
|
|
|
BOOL m_bMultiSelection;
|
|
|
|
|
CPoint m_ptOrigin; /**< */
|
|
|
|
|
int GetTopIndex() const;
|
|
|
|
|
virtual BOOL OnScroll(BOOL bVertical,UINT uCode,int nPos);
|
|
|
|
|
void UpdateHeaderCtrl();
|
|
|
|
|
CRect GetListRect();
|
|
|
|
|
int m_nHeaderHeight; /**< <EFBFBD>б<EFBFBD>ͷ<EFBFBD>߶<EFBFBD> */
|
|
|
|
|
SHeaderCtrl* m_pHeader; /**< <EFBFBD>б<EFBFBD>ͷ<EFBFBD>ؼ<EFBFBD> */
|
|
|
|
|
int InsertColumn(int nIndex, LPCTSTR pszText, int nWidth, LPARAM lParam=0);
|
|
|
|
|
virtual void UpdateChildrenPosition();
|
|
|
|
|
virtual void UpdateScrollBar();
|
|
|
|
|
int GetCountPerPage(BOOL bPartial);
|
|
|
|
|
bool OnHeaderClick(EventArgs *pEvt);
|
|
|
|
|
bool OnHeaderSizeChanging(EventArgs *pEvt);
|
|
|
|
|
bool OnHeaderSwap(EventArgs *pEvt);
|
|
|
|
|
int GetColumnCount() const;
|
|
|
|
|
public:
|
|
|
|
|
SOUI_ATTRS_BEGIN()
|
|
|
|
|
ATTR_INT(L"headerHeight", m_nHeaderHeight, FALSE)
|
|
|
|
|
ATTR_INT(L"itemHeight", m_nItemHeight, FALSE)
|
|
|
|
|
ATTR_SKIN(L"itemSkin", m_pItemSkin, TRUE)
|
|
|
|
|
ATTR_STRINGW(L"selectRangeSkin", m_strSelectRangeSkin, FALSE)
|
|
|
|
|
ATTR_COLOR(L"colorItemBkgnd",m_crItemBg,FALSE)
|
|
|
|
|
ATTR_COLOR(L"colorItemSelBkgnd",m_crItemSelBg,FALSE)
|
|
|
|
|
ATTR_COLOR(L"colorItemHotBkgnd",m_crItemHotBg,FALSE)
|
|
|
|
|
ATTR_INT(L"itemRedrawDelay", m_bItemRedrawDelay, TRUE)
|
|
|
|
|
ATTR_INT(L"hotTrack",m_bHotTrack,FALSE)
|
|
|
|
|
ATTR_INT(L"multiSelection", m_bMultiSelection, TRUE)
|
|
|
|
|
SOUI_ATTRS_END()
|
|
|
|
|
|
|
|
|
|
SOUI_MSG_MAP_BEGIN()
|
|
|
|
|
MSG_WM_MOUSEWHEEL(OnMouseWheel)
|
|
|
|
|
MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST,WM_MOUSELAST,OnMouseEvent)
|
|
|
|
|
MESSAGE_RANGE_HANDLER_EX(WM_KEYFIRST,WM_KEYLAST,OnKeyEvent)
|
|
|
|
|
MESSAGE_RANGE_HANDLER_EX(WM_IME_STARTCOMPOSITION,WM_IME_KEYLAST,OnKeyEvent)
|
|
|
|
|
MESSAGE_HANDLER_EX(WM_IME_CHAR,OnKeyEvent)
|
|
|
|
|
MSG_WM_DESTROY(OnDestroy)
|
|
|
|
|
MSG_WM_PAINT_EX(OnPaint)
|
|
|
|
|
MSG_WM_MOUSELEAVE(OnMouseLeave)
|
|
|
|
|
MSG_WM_KEYDOWN(OnKeyDown)
|
|
|
|
|
MSG_WM_CHAR(OnChar)
|
|
|
|
|
MSG_WM_SIZE(OnSize)
|
|
|
|
|
MSG_WM_SETFOCUS_EX(OnSetFocus)
|
|
|
|
|
MSG_WM_KILLFOCUS_EX(OnKillFocus)
|
|
|
|
|
MSG_WM_NCCALCSIZE(OnNcCalcSize)
|
|
|
|
|
SOUI_MSG_MAP_END()
|
|
|
|
|
|
|
|
|
|
// ͨ<EFBFBD><EFBFBD> IItemContainer <EFBFBD>̳<EFBFBD>
|
|
|
|
|
virtual BOOL OnItemGetRect(const SItemPanel* pItem, CRect& rcItem) const override;
|
|
|
|
|
virtual BOOL IsItemRedrawDelay() const override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}//namespace SOUI
|