One of my goals with the ScriptBasic IUP binding was to be able to use to output of the IUP dialog layout tool (see attached) to generate screen code I could use. Currently the dialog layout tool only generates C, Lua and LED source code. The C output was close enough that with a few tweaks, I could get it to run in SB.
Original C output
/* Generated by IupLayoutDialog export to C. */
#include <stdlib.h>
#include <iup.h>
Ihandle* create_dialog_iupdict2(void)
{
Ihandle* containers[10];
containers[4] = IupSetAtt(NULL, IupCreatep("hbox",
IupSetAtt(NULL, IupCreate("list"),
"EXPAND", "HORIZONTAL",
"SIZE", "120x",
"VALUE", "1",
"DROPDOWN", "YES",
NULL),
IupSetAtt(NULL, IupCreate("button"),
"SIZE", "50x",
"TITLE", "Fetch",
NULL),
NULL),
"GAP", "5",
NULL);
containers[3] = IupSetAtt(NULL, IupCreatep("frame",
containers[4],
NULL),
"TITLE", "Servers",
NULL);
containers[6] = IupSetAtt(NULL, IupCreatep("hbox",
IupSetAtt(NULL, IupCreate("button"),
"SIZE", "50x",
"TITLE", "About",
NULL),
IupSetAtt(NULL, IupCreate("button"),
"SIZE", "50x",
"TITLE", "Clear",
NULL),
IupSetAtt(NULL, IupCreate("button"),
"SIZE", "50x",
"TITLE", "Exit",
NULL),
NULL),
"GAP", "5",
NULL);
containers[5] = IupSetAtt(NULL, IupCreatep("frame",
containers[6],
NULL),
"TITLE", "Controls",
NULL);
containers[2] = IupSetAtt(NULL, IupCreatep("hbox",
containers[3],
containers[5],
NULL),
"GAP", "10",
NULL);
containers[7] = IupSetAtt(NULL, IupCreatep("frame",
IupSetAtt(NULL, IupCreate("list"),
"EXPAND", "YES",
"VISIBLELINES", "1",
NULL),
NULL),
"TITLE", "Dictionaries",
NULL);
containers[8] = IupSetAtt(NULL, IupCreatep("frame",
IupSetAtt(NULL, IupCreate("text"),
"EXPAND", "YES",
"MULTILINE", "YES",
NULL),
NULL),
"TITLE", "Translation",
NULL);
containers[9] = IupSetAtt(NULL, IupCreatep("hbox",
IupSetAtt(NULL, IupCreate("label"),
"SIZE", "x12",
"TITLE", "Enter Word to Search For:",
NULL),
IupSetAtt(NULL, IupCreate("text"),
"EXPAND", "HORIZONTAL",
NULL),
IupSetAtt(NULL, IupCreate("button"),
"SIZE", "50x",
"TITLE", "Search",
NULL),
IupSetAtt(NULL, IupCreate("toggle"),
"SIZE", "x12",
"TITLE", "ALL",
NULL),
IupSetAtt(NULL, IupCreate("toggle"),
"SIZE", "x12",
"TITLE", "UTF-8",
NULL),
NULL),
"GAP", "10",
NULL);
containers[1] = IupSetAtt(NULL, IupCreatep("vbox",
containers[2],
containers[7],
containers[8],
containers[9],
NULL),
"MARGIN", "10x10",
NULL);
containers[0] = IupSetAtt(NULL, IupCreatep("dialog",
containers[1],
NULL),
"TITLE", "Thesaurus",
"RASTERSIZE", "875x638",
NULL);
return containers[0];
}
Converted to ScriptBasic
IMPORT iup.bas
Iup::Open()
containers[4] = Iup::SetAtt("", Iup::Createp("hbox", _
Iup::SetAtt("", Iup::Create("list"), _
"EXPAND", "HORIZONTAL", _
"SIZE", "120x", _
"VALUE", "1", _
"DROPDOWN", "YES"), _
Iup::SetAtt("", Iup::Create("button"), _
"SIZE", "50x", _
"TITLE", "Fetch")), _
"GAP", "5")
containers[3] = Iup::SetAtt("", Iup::Createp("frame", _
containers[4]), _
"TITLE", "Servers")
containers[6] = Iup::SetAtt("", Iup::Createp("hbox", _
Iup::SetAtt("", Iup::Create("button"), _
"SIZE", "50x", _
"TITLE", "About"), _
Iup::SetAtt("", Iup::Create("button"), _
"SIZE", "50x", _
"TITLE", "Clear"), _
Iup::SetAtt("", Iup::Create("button"), _
"SIZE", "50x", _
"TITLE", "Exit")), _
"GAP", "5")
containers[5] = Iup::SetAtt("", Iup::Createp("frame", _
containers[6]), _
"TITLE", "Controls")
containers[2] = Iup::SetAtt("", Iup::Createp("hbox", _
containers[3], _
containers[5]), _
"GAP", "10")
containers[7] = Iup::SetAtt("", Iup::Createp("frame", _
Iup::SetAtt("", Iup::Create("list"), _
"EXPAND", "YES", _
"VISIBLELINES", "1")), _
"TITLE", "Dictionaries")
containers[8] = Iup::SetAtt("", Iup::Createp("frame", _
Iup::SetAtt("", Iup::Create("text"), _
"EXPAND", "YES", _
"MULTILINE", "YES")), _
"TITLE", "Translation")
containers[9] = Iup::SetAtt("", Iup::Createp("hbox", _
Iup::SetAtt("", Iup::Create("label"), _
"SIZE", "x12", _
"TITLE", "Enter Word to Search For:"), _
Iup::SetAtt("", Iup::Create("text"), _
"EXPAND", "HORIZONTAL"), _
Iup::SetAtt("", Iup::Create("button"), _
"SIZE", "50x", _
"TITLE", "Search"), _
Iup::SetAtt("", Iup::Create("toggle"), _
"SIZE", "x12", _
"TITLE", "ALL"), _
Iup::SetAtt("", Iup::Create("toggle"), _
"SIZE", "x12", _
"TITLE", "UTF-8")), _
"GAP", "10")
containers[1] = Iup::SetAtt("", Iup::Createp("vbox", _
containers[2], _
containers[7], _
containers[8], _
containers[9]), _
"MARGIN", "10x10")
containers[0] = Iup::SetAtt("", Iup::Createp("dialog", _
containers[1]), _
"TITLE", "Thesaurus", _
"RASTERSIZE", "875x638")
Iup::SetCallback(containers[0],"CLOSE_CB",ADDRESS(Win_exit()))
Iup::Show(containers[0])
Iup::MainLoop()
Iup::Close()
END
SUB Win_exit
Iup::ExitLoop = TRUE
END SUB