Just so I think I am following what you are saying I copied in my slider and in
quotes since I can't bold where I think you are talking about. I think I could
have done it wrong but I have no idea. Now when I go to make them on the
different windows would I be using the "new" operator so for instance on window
1 it was AudioSliderInput *vol1 = new AudioSliderInput(x, y, w, h, l);
would window 2 be AudioSliderInput *vol1 = new.... as well or how would that be?
class AudioSliderInput : public Fl_Group
{
Fl_Slider *slider;
Fl_Input *audio_txt;
void slider_cb2()
{
static int recurse = 0;
if( recurse )
{
return;
}
else
{
recurse = 1;
char s[80];
sprintf(s, "%d", (int)("AudioSliderInput[].slider->value()))"; //
originally slider->value()));
audio_txt->value(s);
if((int)slider->value() < 10) // limits lowest volume to 10
{
slider->value(10);
audio_txt->value("10");
}
recurse = 0;
}
}
static void slider_cb(Fl_Widget *w, void *data)
{
((AudioSliderInput*)data)->slider_cb2();
}
void input_cb2()
{
static int recurse = 0;
if( recurse )
{
return;
}
else
{
recurse = 1;
int val = 0;
if(sscanf("AudioSliderInput[].audio_txt->value()"//originally
audio_txt->value(), "%d", &val) != 1)
{
val = 0;
}
slider->value(val);
recurse = 0;
}
}
static void input_cb(Fl_Widget *w, void *data)
{
((AudioSliderInput*)data)->input_cb2();
}
public:
AudioSliderInput(int x, int y, int w, int h, const char*l =
0):Fl_Group(x,y,w,h,l)
{
"static *AudioSliderInput[];"
audio_txt = new Fl_Input(x - 50, y + 70, w + 15, h - 110);
audio_txt->callback(input_cb,(void*)this);
audio_txt->box(FL_BORDER_BOX);
audio_txt->when(FL_ENTER|FL_WHEN_NOT_CHANGED|FL_WHEN_CHANGED);
audio_txt->deactivate();
audio_txt->textsize(12);
slider = new Fl_Slider(x, y, w, h);
slider->type(4);
slider->box(FL_BORDER_BOX);
slider->callback(slider_cb,(void*)this);
slider->bounds(100, 0);
align(Fl_Align(FL_ALIGN_TOP));
labelfont(1);
slider->step(1.0);
slider->precision(2);
end();
}
float value() const {return((float)(slider->value()));}
void value(float val) {slider->value(val); slider_cb2();}
void minimum(float val) {slider->minimum(val);}
float minimum() const {return((float)(slider->minimum()));}
void maximum(float val) {slider->maximum(val);}
float maximum() const {return((float)(slider->maximum()));}
void bounds(int low, int high){slider->bounds(low, high);}
};
Thank you again for your help.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk