From my needs I 'have simply rewritten a minimal interface panel and some methods to create input fields for the interface to do similar things:
It is not a big things, just some basic input fields, but with some "steroids" like limits and so on.
the creation is driven by a tuple holding the data
Code: Select all
# tuple holding interface data
# format (name (panel, type, unit, min, max, step, default), info)
fields = (
("ifi_sides", ("mn", "Box Sides", "mm", 3, 10, 1, 4),
"Number of sides"),
("cbo_type", ("mn", "Box Type", ("Closed", "Open", "Frame", "With Cover")),
"Box Type"),
("ifd_hei", ("mn", "Box Height", "mm", 20, 800, 0.5, 200),
"Box Height (along Y axis), for polygonal boxes this value is the " +
"internal diameter, (apothem * 2)"),
("ifd_wid", ("mn", "Box Width", "mm", 20, 800, 0.5, 100),
"Box Width (along X axis)"),
("ifd_dep", ("mn", "Box Depth", "mm", 20, 800, 0.5, 50),
"Box Depth"),
("chb_ind", ("mn", "Inner Dims", True),
"Given dimensions are inner dimensions"),
....
the "field name" is used also to compose the exit dictionary with proper values when invoking a ReadData() methods so it is easy to guess things aorund the code.
If it will be useful for your FreeCAD work, we could talk maybe in PM.
Hoping having not bothered...
Regards
Carlo D.