动态跟进CComboUI::SelectItem:

bool CComboUI::SelectItem(int iIndex, bool bTakeFocus)
{if( m_pWindow != NULL ) m_pWindow->Close();if( iIndex == m_iCurSel ) return true;int iOldSel = m_iCurSel;if( m_iCurSel >= 0 ) {CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);if( !pControl ) return false;IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));if( pListItem != NULL ) pListItem->Select(false);m_iCurSel = -1;}if( iIndex < 0 ) return false;if( m_items.GetSize() == 0 ) return false;if( iIndex >= m_items.GetSize() ) iIndex = m_items.GetSize() - 1;CControlUI* pControl = static_cast<CControlUI*>(m_items[iIndex]);if( !pControl || !pControl->IsVisible() || !pControl->IsEnabled() ) return false;IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));if( pListItem == NULL ) return false;m_iCurSel = iIndex;if( m_pWindow != NULL || bTakeFocus ) pControl->SetFocus();pListItem->Select(true);if( m_pManager != NULL ) m_pManager->SendNotify(this, DUI_MSGTYPE_ITEMSELECT, m_iCurSel, iOldSel);Invalidate();return true;
}

跟进IsVisible:

bool CControlUI::IsVisible() const
{return m_bVisible && m_bInternVisible;
}

发现m_bInternVisible为false。
在向CComboUI添加元素时会调用Add:

bool CContainerUI::Add(CControlUI* pControl)
{if( pControl == NULL) return false;if( m_pManager != NULL ) m_pManager->InitControls(pControl, this);if( IsVisible() ) NeedUpdate();else pControl->SetInternVisible(false);return m_items.Add(pControl);
}

整个界面使用了Tab,Tab在显示一页的时候其他页面是隐藏的,那么它所有的子控件也都设置了隐藏:

bool CTabLayoutUI::Add(CControlUI* pControl)
{bool ret = CContainerUI::Add(pControl);if( !ret ) return ret;if(m_iCurSel == -1 && pControl->IsVisible()){m_iCurSel = GetItemIndex(pControl);}else{pControl->SetVisible(false);}return ret;
}
void CContainerUI::SetVisible(bool bVisible)
{if( m_bVisible == bVisible ) return;CControlUI::SetVisible(bVisible);for( int it = 0; it < m_items.GetSize(); it++ ) {static_cast<CControlUI*>(m_items[it])->SetInternVisible(IsVisible());}
}
void CControlUI::SetInternVisible(bool bVisible)
{m_bInternVisible = bVisible;if (!bVisible && m_pManager && m_pManager->GetFocus() == this) {m_pManager->SetFocus(NULL) ;}
}

所以解决办法是在调用CComboUI::Add添加元素后再重新调一下SetInternVisible设置为true

duilib-CComboUI执行SelectItem无效果排查相关推荐

  1. 当CComboUI控件处于不可见,SelectItem无效果的解决方法

    文章目录 1.问题 2.duilib源码分析 3.解决办法 1.问题 当CComboUI控件处于不可见时,SelectItem无效果的解决方法. 2.duilib源码分析 bool CComboUI: ...

  2. 【解决】insert 语句无效果,在查询中正常运行问题

    今天碰到一个奇怪的问题,具体见csdn:http://topic.csdn.net/u/20120424/19/0aeacbce-a9d5-4630-8b87-a08d5df1828b.html?se ...

  3. html 5效果不显示,详解如何解决H5开发使用wx.hideMenuItems无效果不生效

    情况:引入SDK 的签名不报错与调试工具生成的结果也是一模一样,但是使用hideMenuItems没有小效果,不会报错. 解决方式:把要执行的wx.hideMenuItems()放到wx.ready这 ...

  4. sublime text3 怎么配置、运行python_SublimeText3按ctrl+b执行python无反应

    最后更新时间:2017-09-14 现象: 在Sublime中打开.py文件,按"ctrl+b"执行时无反应.点击工具->编译系统中已经有且识别到Python,但执行&quo ...

  5. android 动态创建view,react-native动态创建Android View 无效果

    问题描述 react-native动态创建Android View 无效果,我想在react-native里面直接点击函数进行创建,也就是通过module中的方法创建View 问题出现的环境背景及自己 ...

  6. ajax beforeSend中无效果

    asnyc:false 与beforesend 同时使用 无效果 转载于:https://www.cnblogs.com/kunlunmountain/p/5740070.html

  7. 解决android手机EditText设置光标颜色,android:textCursorDrawable=@drawable/corner_cursor 华为手机无效果的问题

    app开发,根据产品需求,需要修改输入框内,光标的颜色, 需要增加一个属性, android:textCursorDrawable="@drawable/corner_cursor" ...

  8. antd table 超出显示省略号无效果

    antd table 超出显示省略号无效果 我是用的css 去做的,具体方法,如下图 {title: "表头",dataIndex: "key",onCell: ...

  9. DUILIB 实现微信气泡聊天效果

    DUILIB 实现微信气泡聊天效果,直接上图

最新文章

  1. python培训班那家好-江苏南京Python培训班哪家好
  2. 【转】Linux上安装使用SSH(ubunturedhat)
  3. mysql5.7跳过gitd_MySQL5.7在线开启/关闭GTID
  4. 微软职位内部推荐-Senior PM
  5. 台式电脑如何截屏_如何选购台式电脑显卡?小白装机通俗易懂的独立显卡知识指南...
  6. 默认方法:Java 8的无名英雄
  7. python名称与作用域_Python变量命名与作用域的坑
  8. 《你不知道的JavaScript》中卷 KYLE SIMPSON 著 单业 姜南 译
  9. 4-10:TCP协议之面向字节流和粘包问题
  10. Laravel 成为最佳 PHP 框架的 14 个理由!
  11. C#基础1:输入输出+变量定义
  12. Mysql 忘记密码怎么办(win10)
  13. GNS3安装图文教程
  14. 每日必读DZone Spring:Spring @Transactional 是如何真正工作的?
  15. Truffle Unbox failed问题解决方法
  16. Python pywinauto 自动操作Windows GUI
  17. 浅析末端并联端接(转载)
  18. 利用python绘制奥运五环_绘制奥运五环_清华尹成python入门教程_少儿编程视频-51CTO学院...
  19. C# 基于免费人脸识别SDK完成人脸识别和注册
  20. linux怎么移动文件并改名,Linux mv命令:移动文件或改名

热门文章

  1. DBCA时,报DBT-08001、DBT-08002
  2. ERROR: Cannot find command ‘git‘ - do you have ‘git‘ installed and in your PATH
  3. unity中向量单位化
  4. 尝试将 SCRIPT vl_nnconv 作为函数执行
  5. HTML URL 编码汇总 转载以备不时之需
  6. Android开发电商app的基本框架
  7. Vue报错“Component name “School“ should always be multi-word”
  8. 欧拉角的三维空间旋转
  9. [Research Tips] 我的zotero文献管理方案: 云端同步+iPad批注+overleaf笔记
  10. 微众银行严强:如何构建区块链可信应用的点线面体