du to the fact, that Ui.NumberPicker and Ui.Confirmation are only working with delegates, it is not possible to store the selected result into a variable.
Okay, it is. But only into a single variable.
What I´ve got:
class Settings
{
var Value1 = 1;
var Value2 = 5;
var Value3 = false;
}
Now I need two seperate NumberPicker Delegates for Value1 and Value2:
class NpVal1 extends Ui.NumberPickerDelegate
{
function onNumberPicked(value)
{
Settings.Value1 = value;
}
}
class NpVal2 extends Ui.NumberPickerDelegate
{
function onNumberPicked(value)
{
Settings.Value2 = value;
}
}
Also two different calls:
var np = new Ui.NumberPicker( Ui.NUMBER_PICKER_DISTANCE, Settings.Value1 );
Ui.pushView( np, new NpVal1(), Ui.SLIDE_IMMEDIATE );
var np = new Ui.NumberPicker( Ui.NUMBER_PICKER_DISTANCE, Settings.Value2 );
Ui.pushView( np, new NpVal2(), Ui.SLIDE_IMMEDIATE );
That is really annoying, to have several functions and calls, which nearly do the same. If Monkey C have had pointer, I could submit Settings.Value1 or Settings.Value2 to the delegate, and I´d be fine.
Is there a nicer solution?