mirror of
https://github.com/duilib/duilib.git
synced 2026-10-16 21:51:33 +08:00
Fix UIList problem from hiroyukki
Fix UIList Keyboard behavior problem from hiroyukki
This commit is contained in:
+10
-10
@@ -278,7 +278,7 @@ void CListUI::RemoveAll()
|
||||
|
||||
void CListUI::SetPos(RECT rc, bool bNeedInvalidate)
|
||||
{
|
||||
if( m_pHeader != NULL ) { // 设置header各子元素x坐标,因为有些listitem的setpos需要用到(临时修复)
|
||||
if( m_pHeader != NULL ) { // 设置header各子元素x坐标,因为有些listitem的setpos需要用到(临时修复)
|
||||
int iLeft = rc.left + m_rcInset.left;
|
||||
int iRight = rc.right - m_rcInset.right;
|
||||
|
||||
@@ -395,19 +395,19 @@ void CListUI::DoEvent(TEventUI& event)
|
||||
if (IsKeyboardEnabled() && IsEnabled()) {
|
||||
switch( event.chKey ) {
|
||||
case VK_UP:
|
||||
SelectItem(FindSelectable(m_iCurSel - 1, false), true);
|
||||
SelectItem(FindSelectable(m_iCurSel - 1, false), true); break;
|
||||
case VK_DOWN:
|
||||
SelectItem(FindSelectable(m_iCurSel + 1, true), true);
|
||||
SelectItem(FindSelectable(m_iCurSel + 1, true), true); break;
|
||||
case VK_PRIOR:
|
||||
PageUp();
|
||||
PageUp(); break;
|
||||
case VK_NEXT:
|
||||
PageDown();
|
||||
PageDown(); break;
|
||||
case VK_HOME:
|
||||
SelectItem(FindSelectable(0, false), true);
|
||||
SelectItem(FindSelectable(0, false), true); break;
|
||||
case VK_END:
|
||||
SelectItem(FindSelectable(GetCount() - 1, true), true);
|
||||
SelectItem(FindSelectable(GetCount() - 1, true), true); break;
|
||||
case VK_RETURN:
|
||||
if( m_iCurSel != -1 ) GetItemAt(m_iCurSel)->Activate();
|
||||
if( m_iCurSel != -1 ) GetItemAt(m_iCurSel)->Activate(); break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1363,7 +1363,7 @@ bool CListBodyUI::DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl
|
||||
iDrawIndex += 1;
|
||||
}
|
||||
if (pListInfo && pListInfo->iHLineSize > 0) {
|
||||
// 因为没有为最后一个预留分割条长度,如果list铺满,最后一条不会显示
|
||||
// 因为没有为最后一个预留分割条长度,如果list铺满,最后一条不会显示
|
||||
RECT rcPadding = pControl->GetPadding();
|
||||
const RECT& rcPos = pControl->GetPos();
|
||||
RECT rcBottomLine = { rcPos.left, rcPos.bottom + rcPadding.bottom, rcPos.right, rcPos.bottom + rcPadding.bottom + pListInfo->iHLineSize };
|
||||
@@ -2579,7 +2579,7 @@ void CListTextElementUI::DrawItemText(HDC hDC, const RECT& rcItem)
|
||||
rcItem.top += pInfo->rcTextPadding.top;
|
||||
rcItem.bottom -= pInfo->rcTextPadding.bottom;
|
||||
|
||||
CDuiString strText;//不使用LPCTSTR,否则限制太多 by cddjr 2011/10/20
|
||||
CDuiString strText;//不使用LPCTSTR,否则限制太多 by cddjr 2011/10/20
|
||||
if( pCallback ) strText = pCallback->GetItemText(this, m_iIndex, i);
|
||||
else strText.Assign(GetText(i));
|
||||
if( pInfo->bShowHtml )
|
||||
|
||||
Reference in New Issue
Block a user