当前位置:网站首页>Use the scroll bar of souI when using the real window in souI
Use the scroll bar of souI when using the real window in souI
2022-07-02 23:08:00 【Brick carrying Taoist】
stay UI Reasonable use of real windows in general can make full use of existing controls , And reduce the trouble of rewriting , But in DUI Inner fusion is a problem , Controls with scroll bars generally have their own scroll bars , This situation may require HOOK Drop the current control . The other is that the size of your own window implementation is larger than the size of the view, and you need to display the scroll bar , This article discusses the second case . In this case, use SOUI The way I use the self-contained scroll bar is to add another layer on the outer layer. The real window answers like this clip Effect of sub window . Here we only talk about the key parts without providing source code .
One 、 Close window transparency , A real window cannot be displayed as a child window in a transparent window .
Two 、 Add... When the outer window is created WS_CLIPCHILDREN sign .
3、 ... and 、 Put a in the Zhenzi window scollview in .
Four 、 When creating a real child window, you need to create two layers , Outside for clip The function is always the same as the view size . The following is the method I used to create
HWND CVideoHostWnd::Create(HWND hWndParent, int id)
{
HWND hWnd = SNativeWnd::Create(_T("video_host_wnd"), WS_CHILD | WS_VISIBLE/*| WS_CLIPCHILDREN*/, NULL, 0, 0, 0, 0, hWndParent, NULL);
m_hRealWnd.Create(_T("video_wnd"), WS_CHILD | WS_VISIBLE, NULL, 0, 0, 0, 0, hWnd, NULL);
SetRelWndID(id);
return hWnd;
}stay IRealWndHandler Interface implemented OnRealWndCreate
CVideoHostWnd* pvideoWnd = new CVideoHostWnd();
pvideoWnd->Create(pRealWnd->GetContainer()->GetHostHwnd(),pRealWnd->GetID());
pRealWnd->SetData(pvideoWnd);
// Returns the window handle after successful creation
return pvideoWnd->m_hWnd;5、 ... and 、 Adjust the size and position of the two windows at the right time
void CRealWndHelper::Init(CVideoHostWnd* pvideoWnd, SScrollView* pScoroll)
{
m_pvideoWnd = pvideoWnd;
m_pScoroll = pScoroll;
SASSERT(m_pvideoWnd && m_pScoroll);
m_pScoroll->GetEventSet()->subscribeEvent<CRealWndHelper, EventScrollViewOriginChanged>(&CRealWndHelper::OnScrollViewOriginChanged, this);
m_pScoroll->GetEventSet()->subscribeEvent<CRealWndHelper, EventScrollViewSizeChanged>(&CRealWndHelper::OnScrollViewSizeChanged, this);
}
void CRealWndHelper::SetvideoViewSize(CSize szViewSize)
{
SASSERT(m_pvideoWnd && m_pScoroll);
m_pScoroll->SetAttribute(L"viewsize", SStringT().Format(L"%dpx,%dpx", szViewSize.cx, szViewSize.cy), TRUE);
m_pScoroll->RequestRelayout();
}
bool CRealWndHelper::OnScrollViewSizeChanged(EventScrollViewSizeChanged* pEv)
{
m_pvideoWnd->SetRelWndSize(pEv->szNewViewSize);
return true;
}
bool CRealWndHelper::OnScrollViewOriginChanged(EventScrollViewOriginChanged* pEv)
{
m_pvideoWnd->SetRelWndOrg(pEv->ptNewOrigin);
return true;
} The final effect is as follows
:
边栏推荐
- 2016. maximum difference between incremental elements
- Performance optimization - rigorous mode
- MySQL查询附近的数据.并按距离进行排序.
- Splunk audit setting
- [adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)
- Addition, deletion, modification and query of handwritten ORM (object relationship mapping)
- 密码技术---分组密码的模式
- 剑指 Offer II 099. 最小路径之和-双百代码
- Brief introduction of emotional dialogue recognition and generation
- mysql重置密码,忘记密码,重置root密码,重置mysql密码
猜你喜欢
![The kth largest element in the [leetcode] array [215]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
The kth largest element in the [leetcode] array [215]

程序员版本的八荣八耻~
![[NPUCTF2020]ezlogin xPATH注入](/img/6e/dac4dfa0970829775084bada740542.png)
[NPUCTF2020]ezlogin xPATH注入

QT qsplitter splitter

Analyse des données dossiers d'apprentissage - - analyse simple de la variance à facteur unique avec Excel

Mask R-CNN

海思 VI接入视频流程
![[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM](/img/5d/c23ec16df6ce8d78207b635f59dc20.png)
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM

MySQL查询附近的数据.并按距离进行排序.

Qt QSplitter拆分器
随机推荐
程序员版本的八荣八耻~
海思3559万能平台搭建:在截获的YUV图像上旋转操作
Start from the bottom structure to learn the customization and testing of FPGA --- Xilinx ROM IP
阿里云有奖体验:如何使用 PolarDB-X
设置单击右键可以选择用VS Code打开文件
How does Jerry test the wrong touch rate of keys [chapter]
海思3559万能平台搭建:在截获的YUV图像上画框
The motivation of AES Advanced Encryption Protocol
mysql重置密码,忘记密码,重置root密码,重置mysql密码
Jatpack------LiveData
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM
LC173. 二叉搜索树迭代器
海思调用接口之Makefile配置
The kth largest element in the [leetcode] array [215]
China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!
归并排序详解及应用
Detailed explanation and application of merging and sorting
静态文件显示问题
Odoo13 build a hospital HRP environment (detailed steps)
Successfully changed Splunk default URL root path