具有跨多列元素的 XUL 网格

发布于 2024-09-30 22:23:10 字数 5620 浏览 5 评论 0原文

如何在 XUL 中制作这样的布局?

--------------------------------------------
elem11 | elem12 | elem13                   |
--------------------------------------------
elem21 | elem22 | elem23 | elem24 | elem25 |
--------------------------------------------

似乎不允许一个元素跨越多个列,除非我遗漏了一些东西。

编辑:XUL

<groupbox flex="1">
    <caption label="&options.general.keyBindings;" />
    <vbox flex="1">
        <hbox flex="1" align="center">
            <checkbox id="nextpleaseAllowNumberShortcuts" oncommand="nextplease.enableDisableNumberShortcutModifierMenu();"/>
            <menulist id="nextpleaseNumberShortcutModifier" prefstring="nextplease.numbermodifier" style="margin-right: 0">
                <menupopup onpopuphiding="nextplease.keyBindingsChanged = true;"/>
            </menulist>
            <label id="nextpleaseAllowNumberShortcuts1"/>
        </hbox>
        <separator class="thin"/>
        <grid>
            <columns>
                <column/>
                <column/>
                <column/>
                <column/>
                <column/>
                <column/>
            </columns>

            <rows>
                <row align="center">
                    <label value="&options.general.nextKey;" />
                    <menulist id="nextpleaseNextModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="nextkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="nextkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.prevKey;" />
                    <menulist id="nextpleasePrevModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="prevkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="prevkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.firstKey;" />
                    <menulist id="nextpleaseFirstModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="firstkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="firstkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.lastKey;" />
                    <menulist id="nextpleaseLastModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="lastkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="lastkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');"/>
                    </menulist>
                </row>
            </rows>
        </grid>
    </vbox>
</groupbox>

我想要的是将带有 nextpleaseAllowNumberShortcuts 变成其下面的一行网格。带有标签的复选框位于第一列,菜单位于第二列(其他行具有相同的菜单),标签跨越其余列。

How can I make a layout like this in XUL?

--------------------------------------------
elem11 | elem12 | elem13                   |
--------------------------------------------
elem21 | elem22 | elem23 | elem24 | elem25 |
--------------------------------------------

<grid> doesn't appear to allow one element to span multiple columns, unless I am missing something.

EDIT: XUL

<groupbox flex="1">
    <caption label="&options.general.keyBindings;" />
    <vbox flex="1">
        <hbox flex="1" align="center">
            <checkbox id="nextpleaseAllowNumberShortcuts" oncommand="nextplease.enableDisableNumberShortcutModifierMenu();"/>
            <menulist id="nextpleaseNumberShortcutModifier" prefstring="nextplease.numbermodifier" style="margin-right: 0">
                <menupopup onpopuphiding="nextplease.keyBindingsChanged = true;"/>
            </menulist>
            <label id="nextpleaseAllowNumberShortcuts1"/>
        </hbox>
        <separator class="thin"/>
        <grid>
            <columns>
                <column/>
                <column/>
                <column/>
                <column/>
                <column/>
                <column/>
            </columns>

            <rows>
                <row align="center">
                    <label value="&options.general.nextKey;" />
                    <menulist id="nextpleaseNextModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="nextkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="nextkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('nextkey', 'nextkeymenu', 'nextpleaseModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.prevKey;" />
                    <menulist id="nextpleasePrevModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="prevkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="prevkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('prevkey', 'prevkeymenu', 'nextpleasePrevModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.firstKey;" />
                    <menulist id="nextpleaseFirstModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="firstkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="firstkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('firstkey', 'firstkeymenu', 'nextpleaseFirstModifier');"/>
                    </menulist>
                </row>
                <row align="center">
                    <label value="&options.general.lastKey;" />
                    <menulist id="nextpleaseLastModifier" prefstring="nextplease.modifier">
                        <menupopup onpopuphiding="nextplease.onModifierMenuChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');"/>
                    </menulist>
                    <label value="&options.general.enterKey;" />
                    <textbox id="lastkey" type="text" size="1" maxlength="1"
                        onchange="return nextplease.onKeyChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');" />
                    <label value="&options.general.or;" />
                    <menulist id="lastkeymenu">
                        <menupopup onpopuphiding="return nextplease.onKeyMenuChange('lastkey', 'lastkeymenu', 'nextpleaseLastModifier');"/>
                    </menulist>
                </row>
            </rows>
        </grid>
    </vbox>
</groupbox>

What I wanted was to turn the <hbox> with nextpleaseAllowNumberShortcuts into a row of the grid below it. The checkbox with the label would be in the first column, the menu in the second one (the other rows have the same menu there), and the label span the rest of the columns.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

給妳壹絲溫柔 2024-10-07 22:23:11

您必须通过制作一个三列网格并在第三列第二行中放置一个水平盒来伪造这一点。你是对的,你不能跨越多列。

You have to fake this by making a three column grid, and putting an hbox in the third column, second row. You are correct that you cannot span multiple columns.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文