I'm creating two groups of radio buttons where each group has two items. However, the radio buttons in the second item of each group are not aligned. Below is my code along with a screenshot showing that the radio button for "dm4" and "No" are misaligned.
Actual Behavior:
The radio buttons for the second item in each list (i.e. "dm4" and "No") do not line up with those of the first item.
Expected Behavior:
All radio buttons should be aligned uniformly.
Code Example:
// Creating first radio list
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 second radio list
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);
// Creating container box for 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 also attempted using DLGCreateRadioItem
in combination with DLGCreateGroup
, but that did not resolve the alignment issue:
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));
Questions:
Any guidance or suggestions would be appreciated!
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()