当前位置:网站首页>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
:
边栏推荐
- Application of containerization technology in embedded field
- Array advanced improvement
- Webrtc audio and video capture and playback examples and mediastream media stream analysis
- easyclick,ec权朗网络验证源码
- Jericho's thimble reaction when directly touching the prototype is abnormal [chapter]
- [chestnut sugar GIS] ArcScene - how to make elevation map with height
- 在SOUI里使用真窗口时使用SOUI的滚动条
- 分布式监控系统zabbix
- 力扣刷题(2022-6-28)
- ping域名报错unknown host,nslookup/systemd-resolve可以正常解析,ping公网地址通怎么解决?
猜你喜欢

Xiaopeng P7 had an accident and the airbag did not pop up. Is this normal?

China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!

Configuration clic droit pour choisir d'ouvrir le fichier avec vs Code

Potplayer set minimized shortcut keys
![[Solved] Splunk: Cannot get username when all users are selected“](/img/13/1e824c8005701e21fc5b4e73308d53.png)
[Solved] Splunk: Cannot get username when all users are selected“

情感对话识别与生成简述

Boot actuator - Prometheus use

Mask R-CNN

Construction of Hisilicon 3559 universal platform: rotation operation on the captured YUV image

海思 VI接入视频流程
随机推荐
Lambda表达式:一篇文章带你通透
Looking at Ctrip's toughness and vision from the Q1 financial report in 2022
中国信通院、清华大学、腾讯安全,云原生安全产学研用强强联合!
Innovation strength is recognized again! Tencent security MSS was the pioneer of cloud native security guard in 2022
Introduction to the latest plan of horizon in April 2022
[leetcode] reverse the word III in the string [557]
Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
严守工期,确保质量,这家AI数据标注公司做到了!
Set right click to select vs code to open the file
创新实力再获认可!腾讯安全MSS获2022年度云原生安全守护先锋
Application of containerization technology in embedded field
C#中Linq用法汇集
Xiaopeng P7 had an accident and the airbag did not pop up. Is this normal?
密码技术---密钥和SSL/TLS
密码技术---分组密码的模式
Is 408 not fragrant? The number of universities taking the 408 examination this year has basically not increased!
Niuke network: maximum submatrix
[hardware] origin of standard resistance value
Splunk audit 的设定
AES高級加密協議的動機闡述