www.pudn.com > smstools.rar > Fl_WaitMessage.cxx
// generated by Fast Light User Interface Designer (fluid) version 1.0011 #include "Fl_WaitMessage.hxx" #includeFl_WaitMessage::Fl_WaitMessage() { Fl::lock(); Fl_Window* w; { Fl_Window* o = mWindow = new Fl_Window(341, 100, "Please wait..."); w = o; o->box(FL_UP_BOX); o->user_data((void*)(this)); { Fl_Slider* o = mSlider = new Fl_Slider(5, 55, 330, 30); o->type(1); o->box(FL_THIN_DOWN_BOX); o->selection_color(60); o->minimum(-1); o->slider_size(0.5); } { Fl_Box* o = mLabel = new Fl_Box(5, 15, 330, 30); o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); } o->set_modal(); o->end(); } mValue = 0.0f; mValueInc = 0.05f; timeout(); Fl::unlock(); } Fl_WaitMessage::~Fl_WaitMessage() { Fl::remove_timeout(s_timeout,this); delete mWindow; } void Fl_WaitMessage::s_timeout(void* ptr) { ((Fl_WaitMessage*)ptr)->timeout(); } void Fl_WaitMessage::timeout(void) { Fl::lock(); Fl::add_timeout(0.03,s_timeout,this); mSlider->value(mValue); mWindow->redraw(); mValue += mValueInc; if (mValue<=-1.0) mValueInc = -mValueInc; if (mValue>=1.0) mValueInc = -mValueInc; Fl::unlock(); }