具有跨多列元素的 XUL 网格
如何在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须通过制作一个三列网格并在第三列第二行中放置一个水平盒来伪造这一点。你是对的,你不能跨越多列。
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.