|
|
@@ -1,4 +1,4 @@
|
|
|
-#include "StdAfx.h"
|
|
|
+#include "StdAfx.h"
|
|
|
|
|
|
namespace DuiLib {
|
|
|
|
|
|
@@ -20,7 +20,7 @@ namespace DuiLib {
|
|
|
Add(m_pHeader);
|
|
|
Add(m_pList);
|
|
|
|
|
|
- // ÁбíÅäÖÃ
|
|
|
+ // 列表�置
|
|
|
m_ListInfo.nColumns = 0;
|
|
|
m_ListInfo.nFont = -1;
|
|
|
m_ListInfo.uTextStyle = DT_VCENTER | DT_SINGLELINE;
|
|
|
@@ -400,7 +400,7 @@ namespace DuiLib {
|
|
|
return;
|
|
|
case 0x41:// Ctrl+A
|
|
|
{
|
|
|
- //ȫѡ
|
|
|
+ //全选
|
|
|
if (IsMultiSelect() && (GetKeyState(VK_CONTROL) & 0x8000)) {
|
|
|
UnSelectAllItems();
|
|
|
SelectAllItems();
|
|
|
@@ -476,18 +476,18 @@ namespace DuiLib {
|
|
|
|
|
|
bool CListUI::SelectItem(int iIndex, bool bTakeFocus)
|
|
|
{
|
|
|
- // ÖØÖöàÑ¡ÆðʼÐòºÅ
|
|
|
+ // �置多选起始��
|
|
|
m_iFirstSel = -1;
|
|
|
- // È¡ÏûÆäËüÑ¡ÔñÏî
|
|
|
+ // �消其它选择项
|
|
|
UnSelectItem(iIndex, true);
|
|
|
- // ÅжÏÊÇ·ñºÏ·¨ÁбíÏî
|
|
|
+ // åˆ¤æ–æ˜¯å�¦å�ˆæ³•列表项
|
|
|
if (iIndex < 0) return false;
|
|
|
- // ÒѾѡÔñ
|
|
|
+ // 已�选择
|
|
|
int aIndex = m_aSelItems.Find((LPVOID)iIndex);
|
|
|
if (aIndex != -1) {
|
|
|
return true;
|
|
|
}
|
|
|
- // Ñ¡Ôñµ±Ç°ÁбíÏî
|
|
|
+ // 选择当�列表项
|
|
|
CControlUI* pControl = GetItemAt(iIndex);
|
|
|
if (pControl == NULL) return false;
|
|
|
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
|
|
|
@@ -497,7 +497,7 @@ namespace DuiLib {
|
|
|
}
|
|
|
int iLastSel = m_iCurSel;
|
|
|
m_iCurSel = iIndex;
|
|
|
- //Èç¹ûÒѾѡÖÐÁ˾ÍÎÞÐèÒªÔÙÖØ¸´¼ÓÈëby nakkler
|
|
|
+ //如果已ç»�选ä¸äº†å°±æ— 需è¦�å†�é‡�å¤�åŠ å…¥by nakkler
|
|
|
if(m_aSelItems.Find((LPVOID)iIndex)==-1)
|
|
|
m_aSelItems.Add((LPVOID)iIndex);
|
|
|
|
|
|
@@ -513,15 +513,15 @@ namespace DuiLib {
|
|
|
|
|
|
bool CListUI::SelectMultiItem(int iIndex, bool bTakeFocus)
|
|
|
{
|
|
|
- // 먦Æô¶àÑ¡
|
|
|
+ // 未开�多选
|
|
|
if (!IsMultiSelect()) return SelectItem(iIndex, bTakeFocus);
|
|
|
- // È«²¿È¡Ïû
|
|
|
+ // 全部�消
|
|
|
if (iIndex < 0) {
|
|
|
UnSelectAllItems();
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- // ¶àÑ¡ÆðʼÐòºÅ
|
|
|
+ // 多选起始��
|
|
|
if (m_iFirstSel == -1) {
|
|
|
if (m_iCurSel != -1) {
|
|
|
m_iFirstSel = m_iCurSel;
|
|
|
@@ -537,7 +537,7 @@ namespace DuiLib {
|
|
|
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
|
|
|
if (pListItem == NULL) return false;
|
|
|
|
|
|
- // ¶àÑ¡ÅжÏ
|
|
|
+ // 多选判æ–
|
|
|
if ((GetKeyState(VK_CONTROL) & 0x8000)) {
|
|
|
int aIndex = m_aSelItems.Find((LPVOID)iIndex);
|
|
|
if (aIndex != -1) {
|
|
|
@@ -989,7 +989,7 @@ namespace DuiLib {
|
|
|
|
|
|
void CListUI::EnsureVisible(int iIndex)
|
|
|
{
|
|
|
- if (m_iCurSel < 0) return;
|
|
|
+ //if (m_iCurSel < 0) return;
|
|
|
RECT rcItem = m_pList->GetItemAt(iIndex)->GetPos();
|
|
|
RECT rcList = m_pList->GetPos();
|
|
|
RECT rcListInset = m_pList->GetInset();
|
|
|
@@ -1506,7 +1506,7 @@ namespace DuiLib {
|
|
|
}
|
|
|
UINT uListType = m_pOwner->GetListType();
|
|
|
if (uListType == LT_LIST) {
|
|
|
- // ¼ÆËãºáÏò³ß´ç
|
|
|
+ // 计算横�尺寸
|
|
|
int nItemCount = m_items.GetSize();
|
|
|
if (nItemCount > 0)
|
|
|
{
|
|
|
@@ -2244,7 +2244,7 @@ namespace DuiLib {
|
|
|
bool CListElementUI::Select(bool bSelect)
|
|
|
{
|
|
|
if (!IsEnabled()) return false;
|
|
|
- // È¡ÏûÆäËüÁбíÏîÊý¾Ý
|
|
|
+ // �消其它列表项数�
|
|
|
if (m_pOwner) {
|
|
|
m_pOwner->UnSelectItem(m_iIndex, true);
|
|
|
}
|
|
|
@@ -2411,13 +2411,13 @@ namespace DuiLib {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // ÓÒ¼üÑ¡Ôñ
|
|
|
+ // �键选择
|
|
|
if (m_pOwner != NULL)
|
|
|
{
|
|
|
if (m_pOwner->GetListInfo()->bRSelected && event.Type == UIEVENT_RBUTTONDOWN)
|
|
|
{
|
|
|
if (IsEnabled()) {
|
|
|
- // ¶àÑ¡
|
|
|
+ // 多选
|
|
|
if ((GetKeyState(VK_CONTROL) & 0x8000) || (GetKeyState(VK_SHIFT) & 0x8000)) {
|
|
|
if (m_pOwner != NULL) m_pOwner->SelectMultiItem(m_iIndex);
|
|
|
}
|
|
|
@@ -2434,7 +2434,7 @@ namespace DuiLib {
|
|
|
if (IsEnabled()) {
|
|
|
if(IsRichEvent()) m_pManager->SendNotify(this, DUI_MSGTYPE_BUTTONDOWN);
|
|
|
|
|
|
- // ¶àÑ¡
|
|
|
+ // 多选
|
|
|
if ((GetKeyState(VK_CONTROL) & 0x8000) || (GetKeyState(VK_SHIFT) & 0x8000)) {
|
|
|
if (m_pOwner != NULL) m_pOwner->SelectMultiItem(m_iIndex);
|
|
|
}
|
|
|
@@ -2886,7 +2886,7 @@ namespace DuiLib {
|
|
|
bool CListContainerElementUI::Select(bool bSelect)
|
|
|
{
|
|
|
if (!IsEnabled()) return false;
|
|
|
- // È¡ÏûÆäËüÁбíÏîÊý¾Ý
|
|
|
+ // �消其它列表项数�
|
|
|
if (m_pOwner) {
|
|
|
m_pOwner->UnSelectItem(m_iIndex, true);
|
|
|
}
|
|
|
@@ -2951,7 +2951,7 @@ namespace DuiLib {
|
|
|
if (IsEnabled()) {
|
|
|
if(IsRichEvent()) m_pManager->SendNotify(this, DUI_MSGTYPE_BUTTONDOWN);
|
|
|
|
|
|
- // ¶àÑ¡
|
|
|
+ // 多选
|
|
|
if ((GetKeyState(VK_CONTROL) & 0x8000) || (GetKeyState(VK_SHIFT) & 0x8000)) {
|
|
|
if (m_pOwner != NULL) m_pOwner->SelectMultiItem(m_iIndex);
|
|
|
}
|
|
|
@@ -2961,13 +2961,13 @@ namespace DuiLib {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- // ÓÒ¼üÑ¡Ôñ
|
|
|
+ // �键选择
|
|
|
if (m_pOwner != NULL)
|
|
|
{
|
|
|
if (m_pOwner->GetListInfo()->bRSelected && event.Type == UIEVENT_RBUTTONDOWN)
|
|
|
{
|
|
|
if (IsEnabled()) {
|
|
|
- // ¶àÑ¡
|
|
|
+ // 多选
|
|
|
if ((GetKeyState(VK_CONTROL) & 0x8000) || (GetKeyState(VK_SHIFT) & 0x8000)) {
|
|
|
if (m_pOwner != NULL) m_pOwner->SelectMultiItem(m_iIndex);
|
|
|
}
|