Comments (11)
精简化的源代码大概如下
virtual void Notify (TNotifyUI& msg) {
if (msg.sType == _T ("windowinit")) {
CDialogBuilder builder;
CContainerUI container = static_cast<CContainerUI>(m_pm.FindControl (_T ("tabM")));
for (int i = 0; i < N; ++i) {
container->Add (builder.Create (_T ("b.xml"), (UINT) 0, this, &m_pm));
CContainerUI group2 = static_cast<CContainerUI>(m_pm.FindControl (_T ("tab0")));//b.xml里面的东西,这个获取成功
group2->Add (builder.Create (_T ("c.xml"), (UINT) 0, this, &m_pm));//在b.xml里面插入新窗体,这儿报错
}
}
}
试过各种不同的方法,每次Create时新建builder对象也不行
from duilib_ultimate.
我并不是需要创建自定义控件,而是全部为标准控件,WindowImplBase都直接返回的,另外放在InitWindow里面了,也不行,相同的错误
from duilib_ultimate.
from duilib_ultimate.
我现在是不想弄成自定义控件,我只是想自动添加新的标签页,就是TabLayout,在这里面动态添加一堆Option和动态标签页,上面第一个思路目测太麻烦,第二个思路插入的位置不对。另外功能本身没问题,也就是说第一层的动态标签页可以插入并测试成功,只有在第一层里面插入第二层的时候才有问题
from duilib_ultimate.
布局位置不对应该能解决,建议使用ChildLayout方案。
windowinit消息是在窗口布局建立完成后,第一次WM_PAINT前发出的。你这种用法与框架思维不合,后面可能还会爆出其他问题。
from duilib_ultimate.
我如果在ChildLayout里面插入一堆窗口,怎么把它们移动到TabLayout里面?毕竟数量不定,用固定数量的ChildLayout不行,另外必须是TabLayout的子控件才能切换,子控件的子控件不行
from duilib_ultimate.
另外,我就是得等窗口布局建立以后,第一次WM_PAINT前创建才行,如果已经显示出来了,那么会闪屏,如果在窗口布局还没建立,那么找不到控件的名称了,这个名称用来作为插入点
from duilib_ultimate.
按你的意思“元素数量值”获取是比窗口创建先一步发生,即如此你可以试试在CDialogBuilder构建窗口过程中动态创建你需要的部分。(通过一个无效控件名字,触发CreateControl函数,产生一个动态创建的机会)。
方案不一定行,没实验过。
from duilib_ultimate.
我还是等下一个高手算了,,
from duilib_ultimate.
这个和窗口嵌套没关系,你直接加载c.xml试试
from duilib_ultimate.
直接加载或嵌套一层没有问题,一旦嵌套两层那就有问题
from duilib_ultimate.
Related Issues (20)
- 下拉框增加重载函数Remove HOT 1
- 请求功能新增时同步更新属性列表.xml
- 编辑框高分屏焦点与非焦点字符偏移 HOT 1
- 维护者有没有计划支持下MAC下界面开发? HOT 1
- UIRing内存泄漏 HOT 1
- 能否支持任意分辨率不等比缩放? HOT 1
- Add CMakeLists.txt
- Support MinGW-w64 on MSYS2
- 例子里的菜单都是竖向弹出式的, 有没有普通横向菜单, 常住标题栏下面那种?
- DPI 适配错误, 由94d0ba8 commit
- duilib combo下拉项 未做DPI适配
- float布局下的一个bug
- 向控件发送 Notify 函数 SendNotify 异步情况,不支持 虚拟窗口 virtualwnd 的问题,从duilib原版同步一句代码过来,就可以了 HOT 1
- 可否支持C++20的Module方式导出?
- DClick 双击是没办法响应的
- List还没完全适配DPI
- CRenderEngine::GdiplusDrawText错误
- 托盘菜单显示位置不对
- WindowImplBase下的GetResourceType和GetResourceID无实现, 与原版不兼容
- SDebug和SRelease编译问题, 附解决方案
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duilib_ultimate.