Giter VIP home page Giter VIP logo

Comments (11)

fawdlstty avatar fawdlstty commented on July 19, 2024

精简化的源代码大概如下
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.

fawdlstty avatar fawdlstty commented on July 19, 2024

我并不是需要创建自定义控件,而是全部为标准控件,WindowImplBase都直接返回的,另外放在InitWindow里面了,也不行,相同的错误

from duilib_ultimate.

GXKe avatar GXKe commented on July 19, 2024

ChildLayout

from duilib_ultimate.

fawdlstty avatar fawdlstty commented on July 19, 2024

我现在是不想弄成自定义控件,我只是想自动添加新的标签页,就是TabLayout,在这里面动态添加一堆Option和动态标签页,上面第一个思路目测太麻烦,第二个思路插入的位置不对。另外功能本身没问题,也就是说第一层的动态标签页可以插入并测试成功,只有在第一层里面插入第二层的时候才有问题

from duilib_ultimate.

GXKe avatar GXKe commented on July 19, 2024

布局位置不对应该能解决,建议使用ChildLayout方案。
windowinit消息是在窗口布局建立完成后,第一次WM_PAINT前发出的。你这种用法与框架思维不合,后面可能还会爆出其他问题。

from duilib_ultimate.

fawdlstty avatar fawdlstty commented on July 19, 2024

我如果在ChildLayout里面插入一堆窗口,怎么把它们移动到TabLayout里面?毕竟数量不定,用固定数量的ChildLayout不行,另外必须是TabLayout的子控件才能切换,子控件的子控件不行

from duilib_ultimate.

fawdlstty avatar fawdlstty commented on July 19, 2024

另外,我就是得等窗口布局建立以后,第一次WM_PAINT前创建才行,如果已经显示出来了,那么会闪屏,如果在窗口布局还没建立,那么找不到控件的名称了,这个名称用来作为插入点

from duilib_ultimate.

GXKe avatar GXKe commented on July 19, 2024

按你的意思“元素数量值”获取是比窗口创建先一步发生,即如此你可以试试在CDialogBuilder构建窗口过程中动态创建你需要的部分。(通过一个无效控件名字,触发CreateControl函数,产生一个动态创建的机会)。
方案不一定行,没实验过。

from duilib_ultimate.

fawdlstty avatar fawdlstty commented on July 19, 2024

我还是等下一个高手算了,,

from duilib_ultimate.

qdtroy avatar qdtroy commented on July 19, 2024

这个和窗口嵌套没关系,你直接加载c.xml试试

from duilib_ultimate.

fawdlstty avatar fawdlstty commented on July 19, 2024

直接加载或嵌套一层没有问题,一旦嵌套两层那就有问题

from duilib_ultimate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.