Documentation ¶
Overview ¶
The build.go file is used to get the right databinder & template when a new instruction is builded, & also used to decode a saved fiber by getting the databinder to use.
All you have to do is to list your functions with the associated databinder & template like this: case "A":
return new(ADatabinder), ATemplate
case "B":
return new(BDatabinder), BTemplate
...
For better lisibility, list them in alphabetical order
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var YourFunctionTemplate = []declarative.Widget{ declarative.GroupBox{ Title: "Foo String", Layout: declarative.HBox{}, Children: []declarative.Widget{ declarative.TextEdit{ Text: declarative.Bind("FooStringVarName"), Visible: declarative.Bind("IsFooStringAVar.Checked"), CompactHeight: true, }, declarative.TextEdit{ Text: declarative.Bind("FooString"), Visible: declarative.Bind("!IsFooStringAVar.Checked"), }, declarative.CheckBox{ Name: "IsFooStringAVar", Text: "Is a Var", Checked: declarative.Bind("FooStringIsVar"), }, }, }, declarative.GroupBox{ Title: "Foo Float", Layout: declarative.HBox{}, Children: []declarative.Widget{ declarative.TextEdit{ Text: declarative.Bind("FooFloatVarName"), Visible: declarative.Bind("IsFooFloatAVar.Checked"), CompactHeight: true, }, declarative.NumberEdit{ Value: declarative.Bind("FooFloat"), Visible: declarative.Bind("!IsFooFloatAVar.Checked"), Decimals: 5, }, declarative.CheckBox{ Name: "IsFooFloatAVar", Text: "Is a Var", Checked: declarative.Bind("FooFloatIsVar"), }, }, }, declarative.GroupBox{ Title: "Foo Int", Layout: declarative.HBox{}, Children: []declarative.Widget{ declarative.TextEdit{ Text: declarative.Bind("FooIntVarName"), Visible: declarative.Bind("IsFooIntAVar.Checked"), CompactHeight: true, }, declarative.NumberEdit{ Value: declarative.Bind("FooInt"), Visible: declarative.Bind("!IsFooIntAVar.Checked"), Decimals: 0, }, declarative.CheckBox{ Name: "IsFooIntAVar", Text: "Is a Var", Checked: declarative.Bind("FooIntIsVar"), }, }, }, declarative.GroupBox{ Title: "Foo Bool", Layout: declarative.HBox{}, Children: []declarative.Widget{ declarative.TextEdit{ Text: declarative.Bind("FooBoolVarName"), Visible: declarative.Bind("IsFooBoolAVar.Checked"), CompactHeight: true, AlwaysConsumeSpace: true, }, declarative.CheckBox{ Text: "True ?", Visible: declarative.Bind("!IsFooBoolAVar.Checked"), Checked: declarative.Bind("FooBool"), }, declarative.CheckBox{ Name: "IsFooBoolAVar", Text: "Is a Var", Checked: declarative.Bind("FooBoolIsVar"), }, }, }, declarative.GroupBox{ Title: "Foo Only Var Name", Layout: declarative.HBox{}, Children: []declarative.Widget{ declarative.TextEdit{ Text: declarative.Bind("FooOnlyVarName"), CompactHeight: true, }, declarative.CheckBox{ Text: "Is a Var", Checked: true, Enabled: false, }, }, }, declarative.Label{ Text: "Output var:", }, declarative.TextEdit{ Text: declarative.Bind("Output"), CompactHeight: true, }, }
YourFunctionTemplate Dialog's Template of your function
Functions ¶
func Build ¶
func Build(function string) (interface{}, []declarative.Widget)
Build Return the right databinder & the right template for a yourpackage instruction
Types ¶
type YourFunctionDatabinder ¶
type YourFunctionDatabinder struct { FooString string FooStringVarName string FooStringIsVar bool FooFloat float64 FooFloatVarName string FooFloatIsVar bool FooInt int FooIntVarName string FooIntIsVar bool FooBool bool FooBoolVarName string FooBoolIsVar bool FooOnlyVarName string Output string }
YourFunctionDatabinder Define the parameters needed for your function & that will be filled in the template
Click to show internal directories.
Click to hide internal directories.