Hello,
I'm very happy to submit a big patch for MinimalConfigurator.
It introduce 2 changes:
Default values for XML config (see DefaultValuesDoc.as)
=======================================================
// below a basic demo. You set default attributes for each node, ex:
<InputText event="change:onTextChange"/>
// So now you don't need to repeat these attributes in the XML config
to parse.
var xml:XML = <comps>
<VBox id="vbox" x="20" y="20">
<HUISlider id="hs1"/>
<HUISlider id="hs2" ref="long"/>
<HUISlider id="hs3" ref="small"/>
<HBox>
<InputText id="it1" text="txt 1"/>
<InputText id="it2" text="txt 2"/>
</HBox>
<PushButton id="pb1" label="push 1"/>
<PushButton id="pb2" label="push 2"/>
</VBox>
</comps>;
var def:XML = <comps>
<InputText width="70" event="change:onTextChange"/>
<HUISlider width="150" event="change:onHUISliderChange"/>
<HUISlider id="long" minimum="-100" maximum="200" width="500"
event="change:onHUISliderChange"/>
<HUISlider id="medium" minimum="-50" maximum="100" width="300"
event="change:onHUISliderChange"/>
<PushButton event="click:onPushButton"/>
</comps>;
configurator = new MinimalConfigurator(this, def);
configurator.parseXML(xml);
Actions for XML config (see Actions1Doc.as)
===========================================
// below a basic demo. You can set basic "action", this avoids
creating functions for simple interactions.
// ex: apply property, select/deselect a checkbox, clear a input text,
fill a text area, randInt or randFloat values on sliders.
// You can also call functions.
var xml:XML = <comps>
<VBox id="vbox" x="20" y="20">
<HUISlider id="hs1" action="property(square.rotation)"
label="rotation"/>
<CheckBox id="cb1" label="cb1"/>
<CheckBox id="cb2" label="cb2"/>
<CheckBox id="cb3" label="cb3"/>
<HBox>
<PushButton id="pbse" action="select(cb1,cb2,cb3)"
label="select all"/>
<PushButton id="pbde" action="deselect(cb1,cb2,cb3)"
label="deselect all"/>
</HBox>
</VBox>
</comps>;
configurator = new MinimalConfigurator(this);
configurator.parseXML(xml);
The file is located here :
http://code.google.com/p/minimalcomps/issues/detail?id=136
Hope you like it!
Thanks,
Jerome