jerson Messages: 202 Registered: June 2010 Location: Bombay, India
Experienced Member
I am looking to make a combination of a widget that houses a label with spin buttons. The intention is to use the spin buttons to change the text displayed in the widget from an array of texts
I have investigated various options including the template WithSpin<>. However, these things are beyond my understanding at this stage and I seek some help.
The way I did the task right now is very clumsy, but it works
I have an EditIntSpin on my layout that is shrunk to just show the spin buttons but not the value it holds. Another StaticLabel is lying adjacent to it that shows the String corresponding to the int value contained in the EditIntSpin. The way it works is when the spin is used, it callsback a function that loads the text to the label.
Example
index Text
0 125
1 250
2 500
3 750
So, if the IntSpinner holds a value of 2, the Label will show 500
void A2001_13::ChangeFrequency()
{
Test.lblFreq.SetText(xLegend[Test.spnFrequency]);
}
// in the topwindow code
Test.spnFrequency <<= THISBACK(ChangeFrequency);
I know this can be done using an ArrayCtrl + WithSpin; but, I am not upto it at the moment. Help please