英文:
Alignment of radio buttons in different radio lists
问题
两个问题的翻译:
问题1:两个单选按钮列表,第二个单选按钮未对齐。以下是代码和屏幕截图。dm4和No的单选按钮未对齐。
问题2:尝试使用DLGCreateRadioItem而不是DLGAddRadioItem,但不起作用。
英文:
all
I'd like to create two radio lists. Each list has two radio items. But the radio buttons of the second items are not aligned. Here is the code and screen shot. The radio button of dm4 and No are not aligned.
// Creating radio of format
TagGroup Dm3OrDm4, Dm3OrDm4Items
Dm3OrDm4 = DLGCreateRadioList(Dm3OrDm4Items,0).DLGAnchor("West")
Dm3OrDm4.DLGIdentifier( "#Dm3OrDm4" )
Dm3OrDm4Items.DLGAddRadioItem("dm3", 0).DLGSide("Left")
Dm3OrDm4Items.DLGAddRadioItem("dm4", 1).DLGSide("Left")
Dm3OrDm4.DLGTableLayOut(2,2,1)
// Creating radio of subfolder
TagGroup Subfolder, SubfolderItems
Subfolder = DLGCreateRadioList(SubfolderItems,1).DLGAnchor("West")
Subfolder.DLGIdentifier( "#Subfolder" )
SubfolderItems.DLGAddRadioItem("Yes", 0).DLGSide("Left")
SubfolderItems.DLGAddRadioItem("No", 1).DLGSide("Left")
Subfolder.DLGTableLayOut(2,1,1)
// Create box of conversion method
TagGroup Method, MethodItems
Method = DLGCreateBox("Method",MethodItems)
MethodItems.DLGAddElement(DLGCreateLabel("Output format").DLGAnchor("East"))
MethodItems.DLGAddElement(Dm3OrDm4)
MethodItems.DLGAddElement(DLGCreateLabel("Output to subfolder").DLGAnchor("East"))
MethodItems.DLGAddElement(Subfolder)
Method.DLGTableLayOut(2,2,1)
I tried to use DLGCreateRadioItem instead of DLGAddRadioItem. But it doesn't work.
TagGroup Dm3OrDm4Group, Dm3OrDm4GroupItems
Dm3OrDm4Group = DLGCreateGroup( Dm3OrDm4GroupItems ).DLGAnchor("East")
Dm3OrDm4Group.DLGIdentifier( "#Dm3OrDm4" )
Dm3OrDm4GroupItems.DLGAddElement(DLGCreateRadioItem("dm3", 0))
Dm3OrDm4GroupItems.DLGAddElement(DLGCreateLabel("dm3"))
Dm3OrDm4GroupItems.DLGAddElement(DLGCreateRadioItem("dm4", 1))
Dm3OrDm4GroupItems.DLGAddElement(DLGCreateLabel("dm4"))
Dm3OrDm4Group.DLGLayout( DLGCreateTableLayout( 4, 1, 0 ) )
答案1
得分: 1
抱歉,您提供的内容中包含代码,我会为您翻译除代码部分以外的文本。以下是翻译好的部分:
"Unfortunately there is no way to automatically "align" these items on a grid, as they are not part of the same "table"." - "不幸的是,由于它们不属于同一“表格”,没有自动将这些项目在网格上“对齐”的方法。"
"The only thing to align them is by manually tweaking the "width" of the individual radio-items so that they match up." - "唯一对齐它们的方法是手动调整各个单选按钮项的“宽度”,使它们相匹配。"
"This can best be done by using DLGInternalPadding
and DLGExternalPadding
." - "最好使用 DLGInternalPadding
和 DLGExternalPadding
来完成这个任务。"
"f.e. like this:" - "例如,像这样:"
[class Dlg:UIFrame... - 代码部分,不进行翻译。
"Alloc(dlg).Show()" - 代码部分,不进行翻译。
英文:
Unfortunately there is no way to automatically "align" these items on a grid, as they are not part of the same "table". This becomes clearer, when looking at the actual taggroup describing the dialog:
The only thing to align them is by manually tweaking the "width" of the individual radio-items so that they match up. This can best be done by using DLGInternalPadding
and DLGExternalPadding
.
f.e. like this:
class Dlg:UIFrame
{
Taggroup CreateDLGTagGroup(object self)
{
// Creating radio of format
TagGroup Dm3OrDm4, Dm3OrDm4Items
Dm3OrDm4 = DLGCreateRadioList(Dm3OrDm4Items,0)
Dm3OrDm4.DLGIdentifier( "#Dm3OrDm4" )
Dm3OrDm4Items.DLGAddRadioItem("dm3", 0).DLGSide("Left")
Dm3OrDm4Items.DLGAddRadioItem("dm4", 1)
// Creating radio of subfolder
TagGroup Subfolder, SubfolderItems
Subfolder = DLGCreateRadioList(SubfolderItems,1)
Subfolder.DLGIdentifier( "#Subfolder" )
SubfolderItems.DLGAddRadioItem("Yes ", 0).DLGSide("Left").DLGExternalPadding(1,0)
SubfolderItems.DLGAddRadioItem("No", 1)
subfolder.DLGSide("Left")
// Create box of conversion method
TagGroup Method, MethodItems
Method = DLGCreateBox("Method",MethodItems)
MethodItems.DLGAddElement(DLGCreateLabel("Output format").DLGAnchor("East"))
MethodItems.DLGAddElement(Dm3OrDm4.DLGAnchor("West"))
MethodItems.DLGAddElement(DLGCreateLabel("Output to subfolder").DLGAnchor("East"))
MethodItems.DLGAddElement(Subfolder.DLGAnchor("West"))
Method.DLGTableLayOut(2,2,0)
return method
}
void Show(object self)
{
self.init( self.CreateDLGTagGroup() ).display("Test (new)")
}
}
Alloc(dlg).Show()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论