void onelabGroup::updateParameter(onelab::number &p) { Fl_Tree_Item *n = _tree->find_item(p.getName().c_str()); if(!n) { addParameter(p); return; } Fl_Group *grp = (Fl_Group *)n->widget(); // enumeration (display choices as value labels, not numbers) if(p.getChoices().size() && p.getChoices().size() == p.getValueLabels().size()){ Fl_Choice *but = (Fl_Choice *)grp->child(0); //std::vector<Fl_Menu_Item> menu; //std::map<double, std::string> labels(p.getValueLabels()); //for(std::map<double, std::string>::iterator it = labels.begin(); // it != labels.end(); it++){ // char *str = strdup(it->second.c_str()); // _treeStrings.push_back(str); // Fl_Menu_Item menuItem = {str, 0, 0, 0, 0}; // if(highlight) menuItem.labelcolor(c); // menu.push_back(menuItem); //} //Fl_Menu_Item it = {0}; //menu.push_back(it); //but->copy(&menu[0]); for(unsigned int i = 0; i < p.getChoices().size(); i++){ if(p.getValue() == p.getChoices()[i]){ but->value(i); break; } } return; } // check box (boolean choice) if(p.getChoices().size() == 2 && p.getChoices()[0] == 0 && p.getChoices()[1] == 1){ Fl_Check_Button *but = (Fl_Check_Button *)grp->child(0); but->value(p.getValue()); return; } // non-editable value FIXME if(p.getReadOnly()){ outputRange *but = (outputRange *)grp->child(0);; but->value(p.getValue()); but->graph(p.getAttribute("Graph")); return; } // general number input inputRange *but = (inputRange *)grp->child(0); but->value(p.getValue()); but->minimum(p.getMin()); but->maximum(p.getMax()); but->step(p.getStep()); but->choices(p.getChoices()); but->loop(p.getAttribute("Loop")); but->graph(p.getAttribute("Graph")); }
static void choice_cb(Fl_Widget* w, void* s) { Fl_Choice* c = (Fl_Choice*)w; SaverPrefs* sp = (SaverPrefs*)s; const char* saver_name = c->text(); if(!saver_name) return; /* when we want to disable it */ if(strcmp(saver_name, "(None)") == 0) { xscreensaver_kill_preview(); /* just draw an empty box */ Fl_Box* b = new Fl_Box(0, 0, 180, 134); preview_win->add(b); preview_win->redraw(); sp->mode = SAVER_OFF; return; } /* FIXME: for now only one is allowed */ sp->mode = SAVER_ONE; /* find the name matches in our list and run it's command */ HackListIter it = sp->hacks.begin(), it_end = sp->hacks.end(); for(; it != it_end; ++it) { if((*it)->name == saver_name) { xscreensaver_preview(fl_xid(preview_win), (*it)->exec.c_str()); sp->curr_hack = (*it)->sindex; break; } } }
//----------------------------------------------------------------------------- void NrmDlg::create_dlg() { Fl_Menu_Item k[]={{"x"}, {"y"}, { "z"}, {0}}; wnd = new Fl_Double_Window(135, 215); min = new Fl_Value_Input(10, 25, 115, 25, mgl_gettext("Minimal value (v1)")); min->align(FL_ALIGN_TOP_LEFT); min->tooltip(mgl_gettext("Minimal value for resulting data values")); max = new Fl_Value_Input(10, 70, 115, 25, mgl_gettext("Maximal value (v2)")); max->align(FL_ALIGN_TOP_LEFT); max->tooltip(mgl_gettext("Maximal value for resulting data values")); dir = new Fl_Choice(10, 115, 115, 25, mgl_gettext("Direction")); dir->align(FL_ALIGN_TOP_LEFT); dir->copy(k); dir->tooltip(mgl_gettext("Direction along which data will be filled")); sym = new Fl_Check_Button(10, 115, 115, 25, mgl_gettext("Symetrical range")); sym->tooltip(mgl_gettext("Normalize in symmetrical range: -max(|v1|,|v2|) ... max(|v1|,|v2|)")); Fl_Button *o; o = new Fl_Button(25, 150, 85, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o->tooltip(mgl_gettext("Do nothing and close this window")); o = new Fl_Return_Button(25, 180, 85, 25, mgl_gettext("Change"));o->callback(nrm_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o->tooltip(mgl_gettext("Change data values and close this window")); wnd->end(); }
int main(int argc, char **argv) { window = new Fl_Double_Window(400,400); input = new Fl_Input(25,375,350,25); input->static_value("The quick brown fox jumps over the lazy dog."); input->when(FL_WHEN_CHANGED); input->callback(input_cb); sizes= new Fl_Value_Slider(50,350,350,25,"Size:"); sizes->type(Fl_Slider::HORIZONTAL); sizes->clear_flag(FL_ALIGN_MASK); sizes->set_flag(FL_ALIGN_LEFT); sizes->range(1,64); sizes->step(1); sizes->value(14); sizes->callback(size_cb); fonts=new Fl_Value_Slider(50,325,350,25,"Font:"); fonts->type(Fl_Slider::HORIZONTAL); fonts->clear_flag(FL_ALIGN_MASK); fonts->set_flag(FL_ALIGN_LEFT); fonts->range(0,15); fonts->step(1); fonts->value(0); fonts->callback(font_cb); Fl_Group *g = new Fl_Group(25,300,350,25); leftb = new Fl_Toggle_Button(0,0,50,25,"left"); leftb->callback(button_cb); rightb = new Fl_Toggle_Button(50,0,50,25,"right"); rightb->callback(button_cb); topb = new Fl_Toggle_Button(100,0,50,25,"top"); topb->callback(button_cb); bottomb = new Fl_Toggle_Button(150,0,50,25,"bottom"); bottomb->callback(button_cb); insideb = new Fl_Toggle_Button(200,0,50,25,"inside"); insideb->callback(button_cb); wrapb = new Fl_Toggle_Button(250,0,50,25,"wrap"); wrapb->callback(button_cb); clipb = new Fl_Toggle_Button(300,0,50,25,"clip"); clipb->callback(button_cb); g->end(); Fl_Choice *c = new Fl_Choice(100,250,200,25); c->menu(choices); text= new Fl_Box(100,75,200,100,input->value()); text->box(FL_ENGRAVED_BOX); text->clear_flag(FL_ALIGN_MASK); text->set_flag(FL_ALIGN_CENTER); window->resizable(text); window->end(); window->show(argc,argv); return Fl::run(); }
ImageWindow::ImageWindow() { Fl_Double_Window* w; { Fl_Double_Window* o = new Fl_Double_Window(930, 580, "Total Counts"); w = o; o->user_data((void*)(this)); { new Fl_Button(30, 190, 285, 30, "Save Image"); } // Fl_Button* o { new Fl_Button(30, 240, 285, 30, "Reset Image"); } // Fl_Button* o { new Fl_Light_Button(85, 492, 175, 40, "Analyze Pointing"); } // Fl_Light_Button* o { new Fl_Value_Output(127, 384, 115, 25, "RA"); } // Fl_Value_Output* o { new Fl_Value_Output(127, 419, 115, 25, "Dec"); } // Fl_Value_Output* o { new Fl_Value_Output(127, 455, 115, 25, "Roll"); } // Fl_Value_Output* o { Fl_Box* o = new Fl_Box(25, 359, 300, 214, "Current Pointing"); o->box(FL_THIN_UP_FRAME); o->labelfont(1); o->align(Fl_Align(FL_ALIGN_TOP)); } // Fl_Box* o { Fl_Choice* o = new Fl_Choice(456, 535, 155, 25, "Image Scaling"); o->down_box(FL_BORDER_BOX); } // Fl_Choice* o { new Fl_Value_Output(199, 55, 115, 25, "Total Counts"); } // Fl_Value_Output* o { Fl_Value_Output* o = new Fl_Value_Output(199, 97, 115, 25, "Average Count Rate"); o->align(Fl_Align(132)); } // Fl_Value_Output* o { Fl_Value_Output* o = new Fl_Value_Output(199, 140, 115, 25, "Bright Pixel Count Rate"); o->align(Fl_Align(132)); } // Fl_Value_Output* o { Fl_Box* o = new Fl_Box(23, 37, 300, 258, "Image Statistics"); o->box(FL_THIN_UP_FRAME); o->labelfont(1); o->align(Fl_Align(FL_ALIGN_TOP)); } // Fl_Box* o { new Fl_Progress(30, 540, 290, 30); } // Fl_Progress* o { Fl_Box* o = new Fl_Box(365, 40, 530, 475, "Detector Image"); o->box(FL_THIN_UP_FRAME); o->labelfont(1); o->align(Fl_Align(FL_ALIGN_TOP)); } // Fl_Box* o { Fl_Choice* o = new Fl_Choice(760, 535, 155, 25, "Pixel Arrangement"); o->down_box(FL_BORDER_BOX); } // Fl_Choice* o plot = new plotWindow (100,100,500,500); o->end(); w->show(); } // Fl_Double_Window* o }
static void onelab_number_choice_cb(Fl_Widget *w, void *data) { if(!data) return; std::string name((char*)data); std::vector<onelab::number> numbers; OnelabDatabase::instance()->get(numbers, name); if(numbers.size()){ Fl_Choice *o = (Fl_Choice*)w; std::vector<double> choices = numbers[0].getChoices(); onelab::number old = numbers[0]; if(o->value() < (int)choices.size()) numbers[0].setValue(choices[o->value()]); setGmshOption(numbers[0]); OnelabDatabase::instance()->set(numbers[0], std::string("localGUI")); autoCheck(old, numbers[0]); } }
//----------------------------------------------------------------------------- void NwdtDlg::create_dlg() { Fl_Menu_Item k[]={{mgl_gettext("Summation of")}, {mgl_gettext("Maximum of")}, { mgl_gettext("Minimum of")}, {0}}; wnd = new Fl_Double_Window(165, 215, mgl_gettext("Extract data")); kind = new Fl_Choice(10, 25, 145, 25, mgl_gettext("Type of operation")); kind->align(FL_ALIGN_TOP_LEFT); kind->copy(k); dx = new Fl_Check_Button(10, 55, 140, 25, mgl_gettext("apply in x direction")); dy = new Fl_Check_Button(10, 80, 140, 25, mgl_gettext("apply in y direction")); dz = new Fl_Check_Button(10, 105, 140, 25, mgl_gettext("apply in z direction")); name = new Fl_Input(10, 145, 145, 25, mgl_gettext("Name for output")); name->align(FL_ALIGN_TOP_LEFT); Fl_Button *o; o = new Fl_Button(10, 180, 65, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o = new Fl_Return_Button(90, 180, 65, 25, mgl_gettext("Do"));o->callback(chng_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); wnd->end(); }
//----------------------------------------------------------------------------- void ChngDlg::execute(mglData *d) { char r[8]="3"; if(dx->value()) strcat(r,"x"); if(dy->value()) strcat(r,"y"); if(dz->value()) strcat(r,"z"); if(!r[0]) return; if(type->value()==1) r[0] = '5'; if(type->value()==2) r[0] = ' '; switch(kind->value()) { case 0: d->Smooth(r); break; case 1: d->CumSum(r); break; case 2: d->Integral(r); break; case 3: d->Diff(r); break; case 4: d->Diff2(r); break; case 5: d->Swap(r); break; } }
int japtest() { Fl::set_font(FL_HELVETICA, "Kochi Mincho"); // uncomment for linux Fl_Window *win = new Fl_Window(500,500,"Japanese Test"); Fl_Multiline_Output *output = new Fl_Multiline_Output(140,10,340,400,"Output\n産量\n[さんりょう]"); output->labelsize(22); output->textsize(22); Fl_Choice *choice = new Fl_Choice(140,output->y()+output->h()+10,340,30,"Choice\n取捨\n[しゅしゃ]"); choice->labelsize(22); choice->textsize(22); for ( int t=0; songnames[t]; t++ ) { choice->add(songnames[t]); output->insert(songnames[t]); output->insert("\n"); } choice->value(0); win->resizable(win); win->show(); return(Fl::run()); }
//----------------------------------------------------------------------------- void ChngDlg::create_dlg() { Fl_Menu_Item k[]={{mgl_gettext("Smooth")}, {mgl_gettext("CumSum")}, { mgl_gettext("Integrate")}, { mgl_gettext("Difference")}, { mgl_gettext("Double diff.")}, { mgl_gettext("Swap parts")}, {0}}; Fl_Menu_Item t[]={{mgl_gettext("Linear *3")}, {mgl_gettext("Linear *5")}, {mgl_gettext("Parabolic *5")},{0}}; wnd = new Fl_Double_Window(165, 215, mgl_gettext("Change data")); kind = new Fl_Choice(10, 25, 145, 25, mgl_gettext("Type of operation")); kind->align(FL_ALIGN_TOP_LEFT); kind->copy(k); dx = new Fl_Check_Button(10, 55, 140, 25, mgl_gettext("apply in x direction")); dy = new Fl_Check_Button(10, 80, 140, 25, mgl_gettext("apply in y direction")); dz = new Fl_Check_Button(10, 105, 140, 25, mgl_gettext("apply in z direction")); type = new Fl_Choice(10, 145, 145, 25, mgl_gettext("Type of smoothing")); type->align(FL_ALIGN_TOP_LEFT); type->copy(t); Fl_Button *o; o = new Fl_Button(10, 180, 65, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o = new Fl_Return_Button(90, 180, 65, 25, mgl_gettext("Do"));o->callback(chng_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); wnd->end(); }
int main ( int argc, char **argv ) { { Fl_Single_Window *w = new Fl_Single_Window( 800, 600 ); { Fl_Choice *o = new Fl_Choice( 0, 0, 200, 24, "Boxtype" ); o->align( FL_ALIGN_RIGHT ); o->callback( boxtype_cb, NULL ); o->add( "UP_BOX" ); o->add( "FLAT_BOX" ); o->add( "ROUNDED_BOX" ); o->add( "OVAL_BOX" ); } { Fl_Pack *o = new Fl_Pack( 0, 24, 800, 600 - 24 ); o->type( 0 ); { PerfTest *o = new PerfTest( 0,0, 800, 400, "Xlib" ); } { PerfTest *o = new PerfTest( 0,0, 800, 400, "Cairo" ); o->use_cairo = true; } o->end(); } w->end(); w->show(); } /* { */ /* Fl_Single_Window *w = new Fl_Single_Window( 800, 600 ); */ /* PerfTest *o = new PerfTest( 0,0, 800, 600 ); */ /* w->end(); */ /* w->show(); */ /* } */ Fl::run(); }
void init_appendai_choices() { Fl_Choice* o = new Fl_Choice(5, 145+40, 140, 20, ""); o->down_box(FL_DOWN_BOX); std::shared_ptr<AppendAIPatch> aip = std::dynamic_pointer_cast<AppendAIPatch>(mods->get("aip")); if(!aip->valid()) { o->deactivate(); } else { std::map<std::string, unsigned> order; auto entities = aip->entities(); { int idx = 0; for(unsigned entity : entities) { order[AppendAIPatch::FriendlyName(entity)] = entity; idx++; } if(choice_entity_map.empty()) { idx = 0; for(std::pair<std::string, unsigned> pair : order) { choice_entity_map[idx] = pair.second; idx++; } } for(std::pair<std::string, unsigned> pair : order) { o->add(pair.first.c_str()); } } o->value(o->find_item(order.begin()->first.c_str())); } entity_list = o; }
Fl_Double_Window* SUBnoteUI::make_window() { { SUBparameters = new Fl_Double_Window(735, 390, "SUBsynth Parameters"); SUBparameters->user_data((void*)(this)); { Fl_Scroll* o = new Fl_Scroll(5, 140, 435, 245); o->type(1); o->box(FL_THIN_UP_BOX); { Fl_Pack* o = harmonics = new Fl_Pack(10, 145, 425, 235); harmonics->type(1); for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars,i);} harmonics->end(); } // Fl_Pack* harmonics o->end(); } // Fl_Scroll* o { Fl_Button* o = new Fl_Button(625, 365, 105, 20, "Close"); o->box(FL_THIN_UP_BOX); o->labelfont(1); o->labelsize(11); o->callback((Fl_Callback*)cb_Close); } // Fl_Button* o { Fl_Group* o = new Fl_Group(5, 5, 215, 135, "AMPLITUDE"); o->box(FL_THIN_UP_FRAME); o->labeltype(FL_EMBOSSED_LABEL); o->labelfont(1); o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); { Fl_Value_Slider* o = vol = new Fl_Value_Slider(10, 25, 140, 15, "Vol"); vol->tooltip("Volume"); vol->type(5); vol->box(FL_FLAT_BOX); vol->labelsize(11); vol->maximum(127); vol->step(1); vol->callback((Fl_Callback*)cb_vol); vol->align(FL_ALIGN_RIGHT); o->value(pars->PVolume); } // Fl_Value_Slider* vol { Fl_Value_Slider* o = vsns = new Fl_Value_Slider(10, 45, 140, 15, "V.Sns"); vsns->tooltip("Velocity Sensing Function (rightmost to disable)"); vsns->type(5); vsns->box(FL_FLAT_BOX); vsns->labelsize(11); vsns->maximum(127); vsns->step(1); vsns->callback((Fl_Callback*)cb_vsns); vsns->align(FL_ALIGN_RIGHT); o->value(pars->PAmpVelocityScaleFunction); } // Fl_Value_Slider* vsns { WidgetPDial* o = pan = new WidgetPDial(185, 20, 30, 30, "Pan"); pan->tooltip("Panning (leftmost is Random)"); pan->box(FL_ROUND_UP_BOX); pan->color(FL_BACKGROUND_COLOR); pan->selection_color(FL_INACTIVE_COLOR); pan->labeltype(FL_NORMAL_LABEL); pan->labelfont(0); pan->labelsize(10); pan->labelcolor(FL_FOREGROUND_COLOR); pan->maximum(127); pan->step(1); pan->callback((Fl_Callback*)cb_pan); pan->align(FL_ALIGN_BOTTOM); pan->when(FL_WHEN_CHANGED); o->value(pars->PPanning); } // WidgetPDial* pan { EnvelopeUI* o = ampenv = new EnvelopeUI(10, 65, 205, 70, "SUBsynth - Amplitude Envelope"); ampenv->box(FL_FLAT_BOX); ampenv->color((Fl_Color)51); ampenv->selection_color(FL_BACKGROUND_COLOR); ampenv->labeltype(FL_NORMAL_LABEL); ampenv->labelfont(0); ampenv->labelsize(14); ampenv->labelcolor(FL_FOREGROUND_COLOR); ampenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); ampenv->when(FL_WHEN_RELEASE); o->init(pars->AmpEnvelope,master); ampenv->end(); } // EnvelopeUI* ampenv o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(495, 325, 235, 35); o->box(FL_THIN_UP_FRAME); { Fl_Counter* o = filterstages = new Fl_Counter(515, 340, 45, 15, "Filter Stages"); filterstages->tooltip("How many times the noise is filtered"); filterstages->type(1); filterstages->labelfont(1); filterstages->labelsize(10); filterstages->minimum(1); filterstages->maximum(5); filterstages->step(1); filterstages->textsize(10); filterstages->callback((Fl_Callback*)cb_filterstages); filterstages->align(FL_ALIGN_TOP); o->value(pars->Pnumstages); } // Fl_Counter* filterstages { Fl_Choice* o = magtype = new Fl_Choice(585, 340, 65, 15, "Mag.Type"); magtype->down_box(FL_BORDER_BOX); magtype->labelfont(1); magtype->labelsize(10); magtype->textsize(11); magtype->callback((Fl_Callback*)cb_magtype); magtype->align(FL_ALIGN_TOP); magtype->menu(menu_magtype); o->value(pars->Phmagtype); } // Fl_Choice* magtype { Fl_Choice* o = start = new Fl_Choice(670, 340, 50, 15, "Start"); start->down_box(FL_BORDER_BOX); start->labelfont(1); start->labelsize(10); start->textsize(11); start->callback((Fl_Callback*)cb_start); start->align(FL_ALIGN_TOP); start->menu(menu_start); o->value(pars->Pstart); } // Fl_Choice* start o->end(); } // Fl_Group* o { freqsettingsui = new Fl_Group(440, 5, 290, 135, "FREQUENCY"); freqsettingsui->box(FL_THIN_UP_FRAME); freqsettingsui->labeltype(FL_EMBOSSED_LABEL); freqsettingsui->labelfont(1); freqsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); { EnvelopeUI* o = freqenvelopegroup = new EnvelopeUI(445, 65, 205, 70, "SUBsynth - Frequency Envelope"); freqenvelopegroup->box(FL_FLAT_BOX); freqenvelopegroup->color((Fl_Color)51); freqenvelopegroup->selection_color(FL_BACKGROUND_COLOR); freqenvelopegroup->labeltype(FL_NORMAL_LABEL); freqenvelopegroup->labelfont(0); freqenvelopegroup->labelsize(14); freqenvelopegroup->labelcolor(FL_FOREGROUND_COLOR); freqenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); freqenvelopegroup->when(FL_WHEN_RELEASE); o->init(pars->FreqEnvelope,master); if (pars->PFreqEnvelopeEnabled==0) o->deactivate(); freqenvelopegroup->end(); } // EnvelopeUI* freqenvelopegroup { Fl_Check_Button* o = freqee = new Fl_Check_Button(445, 68, 55, 15, "Enabled"); freqee->down_box(FL_DOWN_BOX); freqee->labelfont(1); freqee->labelsize(10); freqee->callback((Fl_Callback*)cb_freqee); o->value(pars->PFreqEnvelopeEnabled); } // Fl_Check_Button* freqee { Fl_Counter* o = octave = new Fl_Counter(670, 50, 45, 15, "Octave"); octave->tooltip("Octave"); octave->type(1); octave->labelsize(10); octave->minimum(-8); octave->maximum(7); octave->step(1); octave->textfont(1); octave->textsize(11); octave->callback((Fl_Callback*)cb_octave); octave->align(FL_ALIGN_TOP); int k=pars->PCoarseDetune/1024;if (k>=8) k-=16; o->value(k); } // Fl_Counter* octave { Fl_Counter* o = coarsedet = new Fl_Counter(655, 115, 60, 20, "Coarse Det."); coarsedet->tooltip("Coarse Detune"); coarsedet->labelsize(10); coarsedet->minimum(-64); coarsedet->maximum(63); coarsedet->step(1); coarsedet->textfont(1); coarsedet->textsize(11); coarsedet->callback((Fl_Callback*)cb_coarsedet); coarsedet->align(FL_ALIGN_TOP); int k=pars->PCoarseDetune%1024;if (k>=512) k-=1024; o->value(k); o->lstep(10); } // Fl_Counter* coarsedet { Fl_Slider* o = detune = new Fl_Slider(495, 25, 230, 15); detune->tooltip("Fine Detune (cents)"); detune->type(5); detune->box(FL_FLAT_BOX); detune->minimum(-8192); detune->maximum(8191); detune->step(1); detune->callback((Fl_Callback*)cb_detune); o->value(pars->PDetune-8192); } // Fl_Slider* detune { Fl_Value_Output* o = detunevalueoutput = new Fl_Value_Output(448, 25, 45, 15, "Detune"); detunevalueoutput->labelsize(10); detunevalueoutput->minimum(-5000); detunevalueoutput->maximum(5000); detunevalueoutput->step(0.01); detunevalueoutput->textfont(1); detunevalueoutput->textsize(10); detunevalueoutput->callback((Fl_Callback*)cb_detunevalueoutput); detunevalueoutput->align(FL_ALIGN_TOP_LEFT); o->value(getdetune(pars->PDetuneType,0,pars->PDetune)); } // Fl_Value_Output* detunevalueoutput { Fl_Check_Button* o = hz440 = new Fl_Check_Button(555, 45, 50, 15, "440Hz"); hz440->tooltip("set the base frequency to 440Hz"); hz440->down_box(FL_DOWN_BOX); hz440->labelfont(1); hz440->labelsize(10); hz440->callback((Fl_Callback*)cb_hz440); o->value(pars->Pfixedfreq); } // Fl_Check_Button* hz440 { WidgetPDial* o = fixedfreqetdial = new WidgetPDial(610, 45, 15, 15, "Eq.T."); fixedfreqetdial->tooltip("How the frequency varies acording to the keyboard (leftmost for fixed frequen\ cy)"); fixedfreqetdial->box(FL_ROUND_UP_BOX); fixedfreqetdial->color(FL_BACKGROUND_COLOR); fixedfreqetdial->selection_color(FL_INACTIVE_COLOR); fixedfreqetdial->labeltype(FL_NORMAL_LABEL); fixedfreqetdial->labelfont(0); fixedfreqetdial->labelsize(10); fixedfreqetdial->labelcolor(FL_FOREGROUND_COLOR); fixedfreqetdial->maximum(127); fixedfreqetdial->step(1); fixedfreqetdial->callback((Fl_Callback*)cb_fixedfreqetdial); fixedfreqetdial->align(FL_ALIGN_RIGHT); fixedfreqetdial->when(FL_WHEN_CHANGED); o->value(pars->PfixedfreqET); if (pars->Pfixedfreq==0) o->deactivate(); } // WidgetPDial* fixedfreqetdial { Fl_Choice* o = detunetype = new Fl_Choice(655, 85, 70, 15, "Detune Type"); detunetype->down_box(FL_BORDER_BOX); detunetype->labelsize(10); detunetype->textfont(1); detunetype->textsize(10); detunetype->callback((Fl_Callback*)cb_detunetype); detunetype->align(FL_ALIGN_TOP_LEFT); o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents"); o->value(pars->PDetuneType-1); } // Fl_Choice* detunetype freqsettingsui->end(); } // Fl_Group* freqsettingsui { Fl_Check_Button* o = stereo = new Fl_Check_Button(440, 325, 55, 35, "Stereo"); stereo->box(FL_THIN_UP_BOX); stereo->down_box(FL_DOWN_BOX); stereo->labelfont(1); stereo->labelsize(10); stereo->callback((Fl_Callback*)cb_stereo); o->value(pars->Pstereo); } // Fl_Check_Button* stereo { Fl_Button* o = new Fl_Button(445, 365, 70, 20, "Clear"); o->tooltip("Clear the harmonics"); o->box(FL_THIN_UP_BOX); o->labelfont(1); o->labelsize(11); o->callback((Fl_Callback*)cb_Clear); } // Fl_Button* o { bandwidthsettingsui = new Fl_Group(220, 5, 220, 135, "BANDWIDTH"); bandwidthsettingsui->box(FL_THIN_UP_FRAME); bandwidthsettingsui->labeltype(FL_EMBOSSED_LABEL); bandwidthsettingsui->labelfont(1); bandwidthsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); { EnvelopeUI* o = bandwidthenvelopegroup = new EnvelopeUI(225, 65, 205, 70, "SUBsynth - BandWidth Envelope"); bandwidthenvelopegroup->box(FL_FLAT_BOX); bandwidthenvelopegroup->color((Fl_Color)51); bandwidthenvelopegroup->selection_color(FL_BACKGROUND_COLOR); bandwidthenvelopegroup->labeltype(FL_NORMAL_LABEL); bandwidthenvelopegroup->labelfont(0); bandwidthenvelopegroup->labelsize(14); bandwidthenvelopegroup->labelcolor(FL_FOREGROUND_COLOR); bandwidthenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); bandwidthenvelopegroup->when(FL_WHEN_RELEASE); o->init(pars->BandWidthEnvelope,master); if (pars->PBandWidthEnvelopeEnabled==0) o->deactivate(); bandwidthenvelopegroup->end(); } // EnvelopeUI* bandwidthenvelopegroup { Fl_Check_Button* o = bwee = new Fl_Check_Button(225, 67, 55, 15, "Enabled"); bwee->down_box(FL_DOWN_BOX); bwee->labelfont(1); bwee->labelsize(10); bwee->callback((Fl_Callback*)cb_bwee); o->value(pars->PBandWidthEnvelopeEnabled); } // Fl_Check_Button* bwee { Fl_Value_Slider* o = bandwidth = new Fl_Value_Slider(225, 40, 115, 15, "Band Width"); bandwidth->type(5); bandwidth->box(FL_FLAT_BOX); bandwidth->labelsize(10); bandwidth->maximum(127); bandwidth->step(1); bandwidth->callback((Fl_Callback*)cb_bandwidth); bandwidth->align(FL_ALIGN_TOP); o->value(pars->Pbandwidth); } // Fl_Value_Slider* bandwidth { Fl_Value_Slider* o = bwidthscale = new Fl_Value_Slider(345, 40, 90, 15, "B.Width Scale"); bwidthscale->tooltip("How much I increase the BandWidth according to lower/higher harmonics"); bwidthscale->type(5); bwidthscale->box(FL_FLAT_BOX); bwidthscale->labelsize(10); bwidthscale->minimum(-64); bwidthscale->maximum(63); bwidthscale->step(1); bwidthscale->callback((Fl_Callback*)cb_bwidthscale); bwidthscale->align(FL_ALIGN_TOP); o->value(pars->Pbwscale-64); } // Fl_Value_Slider* bwidthscale bandwidthsettingsui->end(); } // Fl_Group* bandwidthsettingsui { Fl_Group* o = globalfiltergroup = new Fl_Group(440, 140, 290, 185, "FILTER"); globalfiltergroup->box(FL_THIN_UP_FRAME); globalfiltergroup->labeltype(FL_EMBOSSED_LABEL); globalfiltergroup->labelfont(1); globalfiltergroup->labelsize(13); globalfiltergroup->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); { EnvelopeUI* o = filterenv = new EnvelopeUI(445, 250, 275, 70, "SUBsynth - Filter Envelope"); filterenv->box(FL_FLAT_BOX); filterenv->color((Fl_Color)51); filterenv->selection_color(FL_BACKGROUND_COLOR); filterenv->labeltype(FL_NORMAL_LABEL); filterenv->labelfont(0); filterenv->labelsize(14); filterenv->labelcolor(FL_FOREGROUND_COLOR); filterenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); filterenv->when(FL_WHEN_RELEASE); o->init(pars->GlobalFilterEnvelope,master); filterenv->end(); } // EnvelopeUI* filterenv { FilterUI* o = filterui = new FilterUI(445, 170, 275, 75, "SUBsynthl - Filter"); filterui->box(FL_FLAT_BOX); filterui->color(FL_LIGHT1); filterui->selection_color(FL_BACKGROUND_COLOR); filterui->labeltype(FL_NORMAL_LABEL); filterui->labelfont(0); filterui->labelsize(14); filterui->labelcolor(FL_FOREGROUND_COLOR); filterui->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE); filterui->when(FL_WHEN_RELEASE); o->init(pars->GlobalFilter,&pars->PGlobalFilterVelocityScale,&pars->PGlobalFilterVelocityScaleFunction,master); filterui->end(); } // FilterUI* filterui if (pars->PGlobalFilterEnabled==0) o->deactivate(); globalfiltergroup->end(); } // Fl_Group* globalfiltergroup { Fl_Check_Button* o = filtere = new Fl_Check_Button(445, 145, 85, 20, "Enabled"); filtere->down_box(FL_DOWN_BOX); filtere->labelfont(1); filtere->labelsize(11); filtere->callback((Fl_Callback*)cb_filtere); o->value(pars->PGlobalFilterEnabled); } // Fl_Check_Button* filtere { Fl_Button* o = new Fl_Button(540, 370, 25, 15, "C"); o->box(FL_THIN_UP_BOX); o->color((Fl_Color)179); o->labelfont(1); o->labelsize(11); o->labelcolor(FL_BACKGROUND2_COLOR); o->callback((Fl_Callback*)cb_C); } // Fl_Button* o { Fl_Button* o = new Fl_Button(570, 370, 25, 15, "P"); o->box(FL_THIN_UP_BOX); o->color((Fl_Color)179); o->labelfont(1); o->labelsize(11); o->labelcolor(FL_BACKGROUND2_COLOR); o->callback((Fl_Callback*)cb_P); } // Fl_Button* o SUBparameters->end(); } // Fl_Double_Window* SUBparameters return SUBparameters; }
Fl_Group* FilterUI::make_window() { { filterui = new Fl_Group(0, 0, 275, 75); filterui->box(FL_FLAT_BOX); filterui->color(FL_LIGHT1); filterui->selection_color(FL_BACKGROUND_COLOR); filterui->labeltype(FL_NO_LABEL); filterui->labelfont(1); filterui->labelsize(14); filterui->labelcolor(FL_FOREGROUND_COLOR); filterui->user_data((void*)(this)); filterui->align(FL_ALIGN_TOP); filterui->when(FL_WHEN_RELEASE); { filterparamswindow = new Fl_Group(0, 0, 275, 75, "Filter Parameters"); filterparamswindow->box(FL_PLASTIC_UP_BOX); filterparamswindow->color(FL_CYAN); filterparamswindow->labeltype(FL_ENGRAVED_LABEL); filterparamswindow->labelsize(10); filterparamswindow->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); { Fl_Choice* o = analogfiltertypechoice = new Fl_Choice(10, 50, 50, 15, "FilterType"); analogfiltertypechoice->tooltip("The Filter type"); analogfiltertypechoice->down_box(FL_BORDER_BOX); analogfiltertypechoice->labelsize(10); analogfiltertypechoice->textsize(10); analogfiltertypechoice->callback((Fl_Callback*)cb_analogfiltertypechoice); analogfiltertypechoice->align(FL_ALIGN_TOP_LEFT); analogfiltertypechoice->menu(menu_analogfiltertypechoice); o->value(pars->Ptype); } // Fl_Choice* analogfiltertypechoice { Fl_Choice* o = svfiltertypechoice = new Fl_Choice(10, 50, 50, 15, "FilterType"); svfiltertypechoice->tooltip("The Filter type"); svfiltertypechoice->down_box(FL_BORDER_BOX); svfiltertypechoice->labelsize(10); svfiltertypechoice->textsize(10); svfiltertypechoice->callback((Fl_Callback*)cb_svfiltertypechoice); svfiltertypechoice->align(FL_ALIGN_TOP_LEFT); svfiltertypechoice->menu(menu_svfiltertypechoice); o->value(pars->Ptype); } // Fl_Choice* svfiltertypechoice { Fl_Choice* o = filtertype = new Fl_Choice(10, 20, 60, 15, "Category"); filtertype->tooltip("The Category of the Filter (Analog/Formantic/etc.)"); filtertype->down_box(FL_BORDER_BOX); filtertype->labelsize(10); filtertype->textsize(10); filtertype->callback((Fl_Callback*)cb_filtertype); filtertype->align(FL_ALIGN_TOP_LEFT); filtertype->menu(menu_filtertype); o->value(pars->Pcategory); } // Fl_Choice* filtertype { WidgetPDial* o = cfreqdial = new WidgetPDial(75, 25, 30, 30, "C.Freq"); cfreqdial->tooltip("Center Frequency of the Filter or the base position in the vowel\'s sequence"); cfreqdial->box(FL_ROUND_UP_BOX); cfreqdial->color(FL_BACKGROUND_COLOR); cfreqdial->selection_color(FL_INACTIVE_COLOR); cfreqdial->labeltype(FL_NORMAL_LABEL); cfreqdial->labelfont(0); cfreqdial->labelsize(10); cfreqdial->labelcolor(FL_FOREGROUND_COLOR); cfreqdial->maximum(127); cfreqdial->step(1); cfreqdial->callback((Fl_Callback*)cb_cfreqdial); cfreqdial->align(FL_ALIGN_BOTTOM); cfreqdial->when(FL_WHEN_CHANGED); o->value(pars->Pfreq); } // WidgetPDial* cfreqdial { WidgetPDial* o = qdial = new WidgetPDial(110, 25, 30, 30, "Q"); qdial->tooltip("Filter resonance or bandwidth"); qdial->box(FL_ROUND_UP_BOX); qdial->color(FL_BACKGROUND_COLOR); qdial->selection_color(FL_INACTIVE_COLOR); qdial->labeltype(FL_NORMAL_LABEL); qdial->labelfont(0); qdial->labelsize(10); qdial->labelcolor(FL_FOREGROUND_COLOR); qdial->maximum(127); qdial->step(1); qdial->callback((Fl_Callback*)cb_qdial); qdial->align(FL_ALIGN_BOTTOM); qdial->when(FL_WHEN_CHANGED); o->value(pars->Pq); } // WidgetPDial* qdial { WidgetPDial* o = freqtrdial = new WidgetPDial(215, 25, 30, 30, "freq.tr."); freqtrdial->tooltip("Filter frequency tracking (left is negative, middle is 0, and right is positi\ ve)"); freqtrdial->box(FL_ROUND_UP_BOX); freqtrdial->color(FL_BACKGROUND_COLOR); freqtrdial->selection_color(FL_INACTIVE_COLOR); freqtrdial->labeltype(FL_NORMAL_LABEL); freqtrdial->labelfont(0); freqtrdial->labelsize(10); freqtrdial->labelcolor(FL_FOREGROUND_COLOR); freqtrdial->maximum(127); freqtrdial->step(1); freqtrdial->callback((Fl_Callback*)cb_freqtrdial); freqtrdial->align(FL_ALIGN_BOTTOM); freqtrdial->when(FL_WHEN_CHANGED); o->value(pars->Pfreqtrack); } // WidgetPDial* freqtrdial { vsnsadial = new WidgetPDial(145, 25, 30, 30, "V.SnsA."); vsnsadial->tooltip("Velocity sensing amount of the Filter"); vsnsadial->box(FL_ROUND_UP_BOX); vsnsadial->color(FL_BACKGROUND_COLOR); vsnsadial->selection_color(FL_INACTIVE_COLOR); vsnsadial->labeltype(FL_NORMAL_LABEL); vsnsadial->labelfont(0); vsnsadial->labelsize(10); vsnsadial->labelcolor(FL_FOREGROUND_COLOR); vsnsadial->maximum(127); vsnsadial->step(1); vsnsadial->callback((Fl_Callback*)cb_vsnsadial); vsnsadial->align(FL_ALIGN_BOTTOM); vsnsadial->when(FL_WHEN_CHANGED); } // WidgetPDial* vsnsadial { vsnsdial = new WidgetPDial(180, 25, 30, 30, "V.Sns."); vsnsdial->tooltip("Velocity Sensing Function of the Filter"); vsnsdial->box(FL_ROUND_UP_BOX); vsnsdial->color(FL_BACKGROUND_COLOR); vsnsdial->selection_color(FL_INACTIVE_COLOR); vsnsdial->labeltype(FL_NORMAL_LABEL); vsnsdial->labelfont(0); vsnsdial->labelsize(10); vsnsdial->labelcolor(FL_FOREGROUND_COLOR); vsnsdial->maximum(127); vsnsdial->step(1); vsnsdial->callback((Fl_Callback*)cb_vsnsdial); vsnsdial->align(FL_ALIGN_BOTTOM); vsnsdial->when(FL_WHEN_CHANGED); } // WidgetPDial* vsnsdial { WidgetPDial* o = gaindial = new WidgetPDial(250, 35, 20, 20, "gain"); gaindial->tooltip("Filter output gain/damp"); gaindial->box(FL_ROUND_UP_BOX); gaindial->color(FL_BACKGROUND_COLOR); gaindial->selection_color(FL_INACTIVE_COLOR); gaindial->labeltype(FL_NORMAL_LABEL); gaindial->labelfont(0); gaindial->labelsize(10); gaindial->labelcolor(FL_FOREGROUND_COLOR); gaindial->maximum(127); gaindial->step(1); gaindial->callback((Fl_Callback*)cb_gaindial); gaindial->align(FL_ALIGN_BOTTOM); gaindial->when(FL_WHEN_CHANGED); o->value(pars->Pgain); } // WidgetPDial* gaindial { Fl_Choice* o = stcounter = new Fl_Choice(235, 5, 35, 15, "St"); stcounter->tooltip("Filter stages (in order to increase dB/oct. value and the order of the filter\ )"); stcounter->down_box(FL_BORDER_BOX); stcounter->labelsize(10); stcounter->textfont(1); stcounter->textsize(10); stcounter->callback((Fl_Callback*)cb_stcounter); for (int i=0;i<MAX_FILTER_STAGES;i++) {char tmp[10];snprintf(tmp,10,"%dx",i+1);o->add(tmp);}; o->value(pars->Pstages); } // Fl_Choice* stcounter filterparamswindow->end(); } // Fl_Group* filterparamswindow { editbutton = new Fl_Button(15, 40, 50, 25, "Edit"); editbutton->box(FL_PLASTIC_UP_BOX); editbutton->labelfont(1); editbutton->labelsize(11); editbutton->callback((Fl_Callback*)cb_editbutton); } // Fl_Button* editbutton { Fl_Button* o = new Fl_Button(186, 5, 15, 15, "C"); o->box(FL_THIN_UP_BOX); o->color((Fl_Color)179); o->labelfont(1); o->labelsize(10); o->labelcolor(FL_BACKGROUND2_COLOR); o->callback((Fl_Callback*)cb_C); } // Fl_Button* o { Fl_Button* o = new Fl_Button(203, 5, 15, 15, "P"); o->box(FL_THIN_UP_BOX); o->color((Fl_Color)179); o->labelfont(1); o->labelsize(10); o->labelcolor(FL_BACKGROUND2_COLOR); o->callback((Fl_Callback*)cb_P); } // Fl_Button* o filterui->end(); } // Fl_Group* filterui return filterui; }
void ColorFltkMenu::make_window() { size(400, 305); { { Fl_Hold_Browser* o = categorybrowser = new Fl_Hold_Browser(10, 55, 125, 100, "Categories"); o->align(FL_ALIGN_TOP); o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL); o->callback(category_cb, this); VMDFLTKTOOLTIP(o, "Select color category then name to set active color") } { Fl_Hold_Browser* o = itembrowser = new Fl_Hold_Browser(140, 55, 120, 100, "Names"); o->align(FL_ALIGN_TOP); o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL); o->callback(item_cb, this); VMDFLTKTOOLTIP(o, "Select color category then name to set active color") } { Fl_Hold_Browser* o = colorbrowser = new Fl_Hold_Browser(265, 55, 125, 100, "Colors"); o->align(FL_ALIGN_TOP); o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL); o->callback(color_cb, this); VMDFLTKTOOLTIP(o, "Select color category then name to set active color") } new Fl_Box(10, 10, 190, 25, "Assign colors to categories:"); { Fl_Tabs* o = new Fl_Tabs(0, 165, 400, 150); #if defined(VMDMENU_WINDOW) o->color(VMDMENU_WINDOW, FL_GRAY); o->selection_color(VMDMENU_WINDOW); #endif { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Definitions"); #if defined(VMDMENU_WINDOW) o->color(VMDMENU_WINDOW, FL_GRAY); o->selection_color(VMDMENU_WINDOW); #endif { Fl_Hold_Browser* o = colordefbrowser = new Fl_Hold_Browser(15, 195, 135, 100); o->labeltype(FL_NO_LABEL); o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL); o->callback(colordef_cb, this); VMDFLTKTOOLTIP(o, "Select color name to adjust RGB color definition") } { Fl_Value_Slider* o = redscale = new Fl_Value_Slider(160, 195, 225, 20); o->type(FL_HORIZONTAL); o->color(VMDMENU_COLOR_RSLIDER); o->callback(rgb_cb, this); VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition") } { Fl_Value_Slider* o = greenscale = new Fl_Value_Slider(160, 215, 225, 20); o->type(FL_HORIZONTAL); o->color(VMDMENU_COLOR_GSLIDER); o->callback(rgb_cb, this); VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition") } { Fl_Value_Slider* o = bluescale = new Fl_Value_Slider(160, 235, 225, 20); o->type(FL_HORIZONTAL); o->color(VMDMENU_COLOR_BSLIDER); o->callback(rgb_cb, this); VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition") } { Fl_Button* o = grayscalebutton = new Fl_Button(165, 265, 85, 25, "Grayscale"); o->type(FL_TOGGLE_BUTTON); #if defined(VMDMENU_WINDOW) o->color(VMDMENU_WINDOW, FL_GRAY); #endif VMDFLTKTOOLTIP(o, "Lock sliders for grayscale color") } defaultbutton = new Fl_Button(290, 265, 85, 25, "Default"); #if defined(VMDMENU_WINDOW) defaultbutton->color(VMDMENU_WINDOW, FL_GRAY); #endif defaultbutton->callback(default_cb, this); VMDFLTKTOOLTIP(defaultbutton, "Reset to original RGB color") o->end(); } { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Scale"); #if defined(VMDMENU_WINDOW) o->color(VMDMENU_WINDOW, FL_GRAY); o->selection_color(VMDMENU_WINDOW); #endif o->hide(); { Fl_Choice* o = scalemethod = new Fl_Choice(15, 220, 80, 25, "Method"); o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL); o->down_box(FL_BORDER_BOX); o->align(FL_ALIGN_TOP); o->callback(scalemethod_cb, this); } offsetvalue = new Fl_Value_Slider(160, 205, 180, 20, "Offset"); offsetvalue->type(FL_HORIZONTAL); offsetvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG); offsetvalue->align(FL_ALIGN_LEFT); offsetvalue->range(-1.0, 1.0); offsetvalue->callback(scalesettings_cb, this); { Fl_Value_Slider* o = midpointvalue = new Fl_Value_Slider(160, 235, 180, 20, "Midpoint"); o->type(FL_HORIZONTAL); midpointvalue->align(FL_ALIGN_LEFT); midpointvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG); o->range(0.0, 1.0); o->callback(scalesettings_cb, this); } image = new ColorscaleImage(10, 265, 380, 25, app); o->end(); } o->end(); } end(); } }
Fl_Double_Window* IntersectionInterface::make_window() { Fl_Double_Window* w; { Fl_Double_Window* o = m_intersectionWindow = new Fl_Double_Window(420, 265, "Intersection UI"); w = o; o->user_data((void*)(this)); { Fl_Group* o = new Fl_Group(5, 25, 145, 30); o->end(); } { Fl_Choice* o = m_iShapeType = new Fl_Choice(5, 25, 145, 30, "Object type"); o->down_box(FL_BORDER_BOX); o->align(FL_ALIGN_TOP_LEFT); o->menu(menu_m_iShapeType); } { Fl_Value_Slider* o = m_dXAt = new Fl_Value_Slider(5, 75, 200, 25, "At x pos"); o->type(5); o->minimum(-1.5); o->maximum(1.5); o->callback((Fl_Callback*)cb_m_dXAt); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Value_Slider* o = m_dYAt = new Fl_Value_Slider(5, 115, 200, 25, "At y pos"); o->type(5); o->minimum(-1.5); o->maximum(1.5); o->callback((Fl_Callback*)cb_m_dYAt); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Value_Slider* o = m_dZAt = new Fl_Value_Slider(5, 155, 200, 25, "At z pos"); o->type(5); o->minimum(-1.5); o->maximum(1.5); o->callback((Fl_Callback*)cb_m_dZAt); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Value_Slider* o = m_dTheta = new Fl_Value_Slider(5, 195, 200, 25, "Vec theta"); o->type(5); o->maximum(360); o->step(1); o->callback((Fl_Callback*)cb_m_dTheta); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Value_Slider* o = m_dPhi = new Fl_Value_Slider(5, 235, 200, 25, "Vec phi"); o->type(5); o->minimum(-90); o->maximum(90); o->step(1); o->value(45); o->callback((Fl_Callback*)cb_m_dPhi); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Button* o = new Fl_Button(330, 25, 85, 25, "Write test"); o->callback((Fl_Callback*)cb_Write); } { Fl_Value_Slider* o = m_dXRot = new Fl_Value_Slider(215, 75, 200, 25, "View rotation"); o->type(5); o->maximum(360); o->step(1); o->callback((Fl_Callback*)cb_m_dXRot); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Value_Slider* o = m_dYRot = new Fl_Value_Slider(215, 115, 200, 25, "View height"); o->type(5); o->minimum(-90); o->maximum(90); o->step(1); o->callback((Fl_Callback*)cb_m_dYRot); o->align(FL_ALIGN_TOP_LEFT); } { Fl_Check_Button* o = m_bGrid = new Fl_Check_Button(215, 155, 25, 25, "Show grid"); o->down_box(FL_DOWN_BOX); o->value(1); o->callback((Fl_Callback*)cb_m_bGrid); } { Fl_Check_Button* o = m_bRay = new Fl_Check_Button(215, 195, 25, 25, "Show ray"); o->down_box(FL_DOWN_BOX); o->value(1); o->callback((Fl_Callback*)cb_m_bRay); } { Fl_Check_Button* o = m_bRayShadow = new Fl_Check_Button(215, 235, 25, 25, "Show ray shadow"); o->down_box(FL_DOWN_BOX); o->value(1); o->callback((Fl_Callback*)cb_m_bRayShadow); } m_iSeed = new Fl_Value_Input(240, 30, 85, 20, "Seed"); o->end(); o->resizable(o); } return w; }
void makeTree() { Flu_Tree_Browser::Node* n; // set the default leaf icon to be a blue dot tree->leaf_icon( &blue_dot ); tree->clear(); tree->label( "Tree Browser Demo" ); //tree->select_under_mouse( true ); n = tree->get_root(); if( n ) n->branch_icons( &computer, &computer ); //tree->move_only_same_group( true ); /* char buf[32]; for( int i = 0; i < 1000; i++ ) { sprintf( buf, "%d", i ); tree->add( "/", buf ); } return; */ n = tree->add( "/Customizable Icons!" ); if( n ) n->leaf_icon( &red_dot ); n = tree->add( "Text Entries!" ); if( n ) n->leaf_icon( NULL ); tree->add( "Identical Entries!" ); tree->add( "Identical Entries!" ); //n = tree->add( "/widgets!/" ); n = tree->add_branch( "/widgets!" ); n->always_open( true ); //n->branch_icon( NULL ); tree->add_branch( "two" ); n = tree->add( "/widgets!/text item" ); if( n ) n->leaf_icon( &text_doc ); tree->add( "two/four" ); n = tree->add( "/folders/six/123", "eight" ); if( n ) n->leaf_icon( &green_dot ); tree->add_leaf( "/folders/six/abc/" ); tree->add( "/folders/six/seven/" ); tree->add_leaf( "/uuu" ); tree->add( "/folders/zilch/" ); n = tree->find( "/folders" ); if( n ) n->collapse_icons( &arrow_closed, &arrow_open ); n = tree->add( "/branches/ten/eleven" ); printf( "Path %s\n", tree->find_path( n ) ); tree->add( "/two/this\\/that" ); // use the escape character for '/' (have to use \\ since the compiler automatically does escape replacement in strings) n = tree->add( "/zoom/" ); if( n ) n->branch_icons( &cd_drive, &cd_drive ); tree->add( "zoom", "zurb" ); tree->add( "zoom", "zoom" ); tree->open( true ); // test the depth-first traversal interface /* printf( "----------------\n" ); n = tree->last();//tree->first(); while( n ) { printf( "%s\n", n->label() ); n = n->previous();//n->next(); } */ //return; Fl_Input *i = new Fl_Input( 0, 0, 100, 20 ); tree->add( "/input/", i ); Fl_Choice *c = new Fl_Choice( 0, 0, 100, 20 ); c->add( "one" ); c->add( "two" ); c->add( "three" ); c->add( "four" ); c->value( 0 ); n = tree->add( "/widgets!/choice", c ); if( n ) n->expand_to_width( true ); tree->leaf_icon( NULL ); Fl_Button *b = new Fl_Button( 0, 0, 100, 20, "Button" ); b->callback( button_callback ); tree->add( "/widgets!/Button", b, false ); printf( "Path %s\n", tree->find_path( b ) ); { Fl_Check_Button *c = new Fl_Check_Button( 0, 0, 80, 20, "Check 1" ); n = tree->add( "/widgets!/Check1", c, false ); n->auto_label_color( true ); c = new Fl_Check_Button( 0, 0, 80, 20, "Check 2" ); n = tree->add( "/widgets!/Check2", c, true ); n->auto_label_color( true ); c = new Fl_Check_Button( 0, 0, 80, 20, "Check 3" ); n = tree->add( "/widgets!/Check3", c, true ); n->swap_label_and_widget( true ); n->auto_label_color( true ); } { Fl_Round_Button *r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 1" ); r->type( FL_RADIO_BUTTON ); n = tree->add( "/widgets!/Radio1", r, false ); n->auto_label_color( true ); r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 2" ); r->type( FL_RADIO_BUTTON ); n = tree->add( "/widgets!/Radio2", r, false ); n->auto_label_color( true ); r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 3" ); r->type( FL_RADIO_BUTTON ); n = tree->add( "/widgets!/Radio3", r, false ); n->auto_label_color( true ); n->leaf_icon( &red_dot ); n->icon_at_end( true ); } { Fl_Round_Button *r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 1" ); r->type( FL_RADIO_BUTTON ); n = tree->add( "/usr/Radio1", r, false ); n->auto_label_color( true ); r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 2" ); r->type( FL_RADIO_BUTTON ); n->auto_label_color( true ); n = tree->add( "/usr/Radio2", r, false ); r = new Fl_Round_Button( 0, 0, 70, 20, "Radio 3" ); r->type( FL_RADIO_BUTTON ); n->auto_label_color( true ); n = tree->add( "/usr/Radio3", r, false ); } tree->add( "/usr/bin/foo" ); tree->add( "/bin/foo" ); tree->add( "/usr" ); // this should fail since there is already a branch called "usr" // disable the branch icons for this entry n = tree->find( "/usr" ); if( n ) n->branch_icons( 0, 0 ); // test the find_next() interface /* printf( "%d\n", tree->find_number( "Identical Entries!" ) ); n = tree->find( "Identical Entries!" ); printf( "%d %d\n", n->id(), tree->find_next( "Identical Entries!", n )->id() ); n = tree->find_next( "Identical Entries!", n ); printf( "removed: %d\n", tree->remove( n ) ); */ //n = tree->find( "bin" ); //if( n ) //n->label( "New" ); // find the absolute path of the node with unique ID = 10 //printf( "%s\n", tree->find_path( 10 ) ); // find the choice widget and deactivate it /* n = tree->find( c ); if( n ) n->deactivate(); */ tree->redraw(); }
void ColorFltkMenu::scalemethod_cb(Fl_Widget *w, void *v) { ColorFltkMenu *self = (ColorFltkMenu *)v; Fl_Choice *choice = (Fl_Choice *)w; self->app->colorscale_setmethod(choice->value()); }
Fl_Double_Window* make_window() { Fl_Double_Window* w; {Fl_Double_Window* o = new Fl_Double_Window(560, 489); w = o; o->type(241); {Fl_Box* o = imbox = new Fl_Box(5, 30, 385, 455); o->box(FL_ENGRAVED_BOX); o->align(FL_ALIGN_CLIP); Fl_Group::current()->resizable(o); } {Fl_Box* o = filename_box = new Fl_Box(5, 5, 385, 20, "No file loaded..."); o->box(FL_THIN_DOWN_BOX); o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } {Fl_Group* o = new Fl_Group(395, 5, 160, 480); o->box(FL_THIN_DOWN_BOX); {Fl_Button* o = new Fl_Button(10, 10, 140, 25, "Load File"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)cb_Load); } {Fl_Button* o = new Fl_Button(10, 40, 140, 25, "Exit"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)cb_Exit); } new Fl_Divider(10, 75, 140, 15, "label"); {Fl_Button* o = new Fl_Button(10, 100, 140, 25, "Fit To Box"); o->type(Fl_Button::TOGGLE); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)cb_Fit); } {Fl_Button* o = new Fl_Button(10, 130, 140, 25, "Tile"); o->type(Fl_Button::TOGGLE); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)cb_Tile); } {Fl_Choice* o = filter_choice = new Fl_Choice(10, 335, 140, 25, "Filter:"); o->begin(); o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); o->tooltip("Choose filter"); {Fl_Item* o = new Fl_Item("None"); o->user_data((void*)(0)); } {Fl_Item* o = new Fl_Item("Brightness"); o->user_data((void*)(FILTER_BRIGHTNESS)); } {Fl_Item* o = new Fl_Item("Contrast"); o->user_data((void*)(FILTER_CONTRAST)); } {Fl_Item* o = new Fl_Item("Grayscale"); o->user_data((void*)(FILTER_GRAYSCALE)); } {Fl_Item* o = new Fl_Item("Gamma"); o->user_data((void*)(FILTER_GAMMA)); } {Fl_Item* o = new Fl_Item("Fore Blend"); o->user_data((void*)(FILTER_FOREBLEND)); } {Fl_Item* o = new Fl_Item("Back Blend"); o->user_data((void*)(FILTER_BACKBLEND)); } o->end(); } {Fl_Box* o = new Fl_Box(10, 160, 140, 160); o->parent()->resizable(o); } {Fl_Value_Slider* o = Rslider = new Fl_Value_Slider(25, 380, 125, 15, "R"); o->type(Fl_Value_Slider::HORIZONTAL); o->label_size(10); o->text_size(10); o->minimum(-3); o->maximum(3); o->value(1); o->slider_size(5); o->align(FL_ALIGN_LEFT); o->tooltip("Red value for filter"); } {Fl_Value_Slider* o = Gslider = new Fl_Value_Slider(25, 400, 125, 15, "G"); o->type(Fl_Value_Slider::HORIZONTAL); o->label_size(10); o->text_size(10); o->minimum(-3); o->maximum(3); o->value(1); o->slider_size(5); o->align(FL_ALIGN_LEFT); o->tooltip("Green value for filter"); } {Fl_Value_Slider* o = Bslider = new Fl_Value_Slider(25, 420, 125, 15, "B"); o->type(Fl_Value_Slider::HORIZONTAL); o->label_size(10); o->text_size(10); o->minimum(-3); o->maximum(3); o->value(1); o->slider_size(5); o->align(FL_ALIGN_LEFT); o->tooltip("Blue value for filter"); } {Fl_Button* o = new Fl_Button(10, 445, 140, 25, "Apply"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)cb_Apply); o->tooltip("Apply current selected filter"); } {Fl_Check_Button* o = lock = new Fl_Check_Button(10, 365, 140, 15, "Lock sliders"); o->label_size(10); o->callback((Fl_Callback*)cb_lock); o->tooltip("Lock slider, RGB values taken from R slider "); } o->end(); } o->end(); } return w; }
void initParamWindow() { const int heightInput = 28; const int wideLabel = 205; const int wideInput = 130; const int between = 5; const int Ybetween = 3; const int YbetweenMore = 6; const int alignStyle = FL_ALIGN_INSIDE | FL_ALIGN_RIGHT; const Fl_Boxtype inputStyle = FL_PLASTIC_DOWN_BOX; int x = 10; int y = 10; const int wide = x+wideLabel+between+wideInput+x; const int height = y + 14*(heightInput+Ybetween) - Ybetween + 9*YbetweenMore + y; paramWindow = new Fl_Window( wide, height, _("Parameters") ); Fl_Group* win2 = new Fl_Group( 0, 0, wide, height ); paramWindow->resizable(win2); { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Schema size:") ); o->align( alignStyle ); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); o->type(FL_HORIZONTAL); o->minimum(0); o->maximum(1); o->value(glito->getCloseEdge()); o->step(0.01); o->callback( (Fl_Callback*)closeEdge_param, glito ); } y += heightInput + Ybetween; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Preview Size:") ); o->align( alignStyle ); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); o->type(FL_HORIZONTAL); o->minimum(0); o->maximum(1); o->value(glito->getPreviewSize()); o->step(0.01); o->callback( (Fl_Callback*)previewSize_param, glito ); } y += heightInput + Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Rotation shift (rad):") ); o->align( alignStyle ); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); o->type(FL_HORIZONTAL); o->minimum(0.002); o->maximum(0.2); o->value(glito->rotationShift); o->step(0.001); o->callback( (Fl_Callback*)rotationShift_param, glito ); } y += heightInput + Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of saved images:") ); o->align( alignStyle ); } { Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput ); o->box(inputStyle); o->value(IS::translate(glito->imageSavedWidth).c_str()); o->callback( (Fl_Callback*)imageSavedWidth_param, glito ); } { Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER ); } { Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y, wideInput/2-5, heightInput ); o->box(inputStyle); o->value(IS::translate(glito->imageSavedHeight).c_str()); o->callback( (Fl_Callback*)imageSavedHeight_param, glito ); } y += heightInput + Ybetween; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of animations:") ); o->align( alignStyle ); } { Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput ); o->box(inputStyle); o->value(IS::translate(glito->animationSavedWidth).c_str()); o->callback( (Fl_Callback*)animationSavedWidth_param, glito ); } { Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER ); } { Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y, wideInput/2-5, heightInput ); o->box(inputStyle); o->value(IS::translate(glito->animationSavedHeight).c_str()); o->callback( (Fl_Callback*)animationSavedHeight_param, glito ); } y += heightInput + Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Frames per cycle (>1):") ); o->align( alignStyle ); } { Fl_Value_Input* o = new Fl_Value_Input( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); o->minimum(10); o->maximum(100); o->value(glito->framesPerCycle); o->step(1); o->callback( (Fl_Callback*)framesPerCycle_param, glito ); } y += heightInput + Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Motion detection (ms):") ); o->align( alignStyle ); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); o->type(FL_HORIZONTAL); o->minimum(1); o->maximum(200); o->value(glito->intervalMotionDetection); o->step(1); o->callback( (Fl_Callback*)intervalMotionDetection_param, glito ); } y += heightInput + Ybetween + YbetweenMore; { { Fl_Button* o = new Fl_Button( x, y, 70, heightInput, _("Density") ); o->box(FL_PLASTIC_UP_BOX); o->value( glito->trueDensity ); o->callback( (Fl_Callback*)trueDensity_param, glito ); } { Fl_Box* o = new Fl_Box( x, y, wideLabel+30, heightInput, _("or pseudo-density:") ); o->align( alignStyle ); if ( glito->trueDensity ) o->deactivate(); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+30+between, y, 100, heightInput ); o->box(inputStyle); if ( glito->trueDensity ) o->deactivate(); o->type(FL_HORIZONTAL); o->minimum(0); o->maximum(1); o->value( ImagePseudoDensity::pseudoDensity.getProba() ); o->step(0.01); o->callback( (Fl_Callback*)logProbaHitMax_param ); } } y += heightInput + Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wideInput, heightInput, _("Points for framing:") ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT ); } y += heightInput; { int xLine = 0; { Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput ); o->box(inputStyle); o->value(IS::translate(glito->pointsForFraming).c_str()); o->callback( (Fl_Callback*)pointsForFraming_param, glito ); } xLine += 80; { Fl_Box* o = new Fl_Box( x+xLine, y, 20, heightInput, " (x " ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER ); } xLine += 20; { Fl_Value_Slider* o = new Fl_Value_Slider( x+xLine, y, 100, heightInput ); o->box(inputStyle); o->type(FL_HORIZONTAL); o->minimum(0); o->maximum(1); o->box(inputStyle); o->value(glito->animationFraming); o->step(0.01); o->callback( (Fl_Callback*)animationFraming_param, glito ); } xLine += 100; { Fl_Box* o = new Fl_Box( x+xLine, y, 110, heightInput, _(" for animation)") ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT ); } } y += heightInput + 2*Ybetween + YbetweenMore; { Fl_Box* o = new Fl_Box( x, y, wide-20, heightInput, _("Number of iterations limited by:") ); o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT ); } y += heightInput; { Fl_Round_Button* o = new Fl_Round_Button( x, y, wideInput, heightInput, _("Interval per frame (ms)") ); o->box(FL_NO_BOX); o->type(FL_RADIO_BUTTON); o->when(FL_WHEN_CHANGED); o->value(glito->clockNumber); o->callback( (Fl_Callback*)clockNumber_param, glito ); } { Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput ); o->box(inputStyle); if ( !glito->clockNumber ) o->deactivate(); o->type(FL_HORIZONTAL); o->minimum(1); o->maximum(200); o->value(glito->intervalFrame); o->step(1); o->callback( (Fl_Callback*)intervalFrame_param, glito ); } y += heightInput + Ybetween; { int xLine = 0; { Fl_Round_Button* o = new Fl_Round_Button( x, y, 127, heightInput, _("Points per frame") ); o->box(FL_NO_BOX); o->type(FL_RADIO_BUTTON); o->when(FL_WHEN_CHANGED); o->value(!glito->clockNumber); o->callback( (Fl_Callback*)clockNumber_param, glito ); } xLine += 127 + between; { Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput ); o->box(inputStyle); if ( glito->clockNumber ) o->deactivate(); o->value(IS::translate(glito->pointsPerFrame).c_str()); o->callback( (Fl_Callback*)pointsPerFrame_param, glito ); } xLine += 80 + 2; { Fl_Button* o = new Fl_Button( x+xLine, y, wide - (x+xLine) - 10, heightInput, _("Calibrate") ); o->box(FL_PLASTIC_UP_BOX); if ( glito->clockNumber ) o->deactivate(); o->callback( (Fl_Callback*)calibrate_param, glito ); } } y += heightInput + Ybetween + 2*YbetweenMore; { int xLine = 0; { Fl_Button* o = new Fl_Button( x, y, 90, heightInput, _("Black/White") ); o->box(FL_PLASTIC_UP_BOX); o->value( !ImageGray::background.isBlack() ); o->callback( (Fl_Callback*)blackWhite_param ); } xLine += 90 + 2*between + 5; { Fl_Choice* o = new Fl_Choice( x+xLine+110, y, 95, heightInput, _("Transparency:") ); o->add( ImageGray::transparency.stringNone().c_str(), 0, (Fl_Callback*)transparency_param, (void*)0 ); o->add( ImageGray::transparency.stringSimple().c_str(), 0, (Fl_Callback*)transparency_param, (void*)1 ); o->add( ImageGray::transparency.stringAlpha().c_str(), 0, (Fl_Callback*)transparency_param, (void*)2 ); if ( ImageGray::transparency.useAlphaTransparency() ) { o->value(2); } else if ( ImageGray::transparency.useSimpleTransparency() ) { o->value(1); } else { o->value(0); } } } y += heightInput + Ybetween; { // invisible box to allow correct resizing Fl_Box* o = new Fl_Box( 0, y, 100, 0 ); win2->resizable(*o); } win2->end(); paramWindow->end(); }
int main (int argc, char **argv) { Fl_Window* w; fl_init_locale_support("ewmconf", PREFIX"/share/locale"); readConfiguration(); {Fl_Window* o = new Fl_Window(320, 370, _("Window manager settings")); w = o; {Fl_Tabs* o = new Fl_Tabs(2, 5, 318, 325); o->color((Fl_Color)16); {Fl_Group* o = new Fl_Group(1, 29, 316, 295, _("&Titlebar")); o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); {Fl_Choice* o = new Fl_Choice(83, 13, 105, 22, _("Text align:")); o->begin(); o->callback((Fl_Callback*)cb_Text); new Fl_Item(_("Left")); new Fl_Item(_("Right")); new Fl_Item(_("Center")); o->value(title_align); o->end(); } {Fl_Value_Input* o = new Fl_Value_Input(243, 13, 60, 22, _("Height:")); o->minimum(10); o->maximum(50); o->step(1); o->value(20); o->callback((Fl_Callback*)cb_Height); o->value(title_height); } {Fl_Button* o = titlebarLabelColorButton = new Fl_Button(85, 55, 60, 20, _("Titlebar label color: ")); o->box(FL_DOWN_BOX); o->callback((Fl_Callback*)cb_titlebarLabelColorButton); o->align(132); o->color((Fl_Color)title_normal_color_text); } {Fl_Button* o = titlebarColorButton = new Fl_Button(85, 120, 60, 20, _("Titlebar color: ")); o->box(FL_DOWN_BOX); o->callback((Fl_Callback*)cb_titlebarColorButton); o->align(132); o->color((Fl_Color) title_normal_color); } {Fl_Group* o = new Fl_Group(153, 45, 160, 110); {Fl_Button* o = titlebarActiveLabelColorButton = new Fl_Button(90, 10, 60, 20, _("Titlebar active label color: ")); o->box(FL_DOWN_BOX); o->callback((Fl_Callback*)cb_titlebarActiveLabelColorButton); o->align(132); o->color((Fl_Color) title_active_color_text); } {Fl_Button* o = titlebarActiveColorButton = new Fl_Button(90, 75, 60, 20, _("Titlebar active color: ")); o->box(FL_DOWN_BOX); o->callback((Fl_Callback*)cb_titlebarActiveColorButton); o->align(132); o->color((Fl_Color)title_active_color); } o->end(); } {Fl_Choice* o = titlebarDrawGrad = new Fl_Choice(85, 157, 163, 23, _("Box type:")); o->begin(); o->callback((Fl_Callback*)cb_titlebarDrawGrad); o->align(132); new Fl_Item(_("Flat")); new Fl_Item(_("Horizontal shade")); new Fl_Item(_("Thin down")); new Fl_Item(_("Up box")); new Fl_Item(_("Down box")); new Fl_Item(_("Plastic")); o->value(title_draw_grad); o->end(); } {Fl_Check_Button* o = useThemeButton = new Fl_Check_Button(8, 220, 300, 20, _("&Use theme")); o->callback((Fl_Callback*)cb_useThemeButton); o->value(use_theme); } {Fl_Input* o = themePathInput = new Fl_Input(65, 247, 210, 23, _("Path:")); o->callback((Fl_Callback*)cb_themePathInput); o->deactivate(); themePathInput->value(theme_path); } {Fl_Button* o = browse_btn = new Fl_Button(280, 247, 25, 23, _("...")); o->callback((Fl_Callback*)cb_browse_btn); o->deactivate(); } {Fl_Divider* o = new Fl_Divider(8, 190, 300, 25, _("label")); o->color((Fl_Color)16); } {Fl_Divider* o = new Fl_Divider(8, 85, 297, 25, _("label")); o->color((Fl_Color)16); } o->end(); } {Fl_Group* o = new Fl_Group(3, 20, 310, 305, _("&Resizing")); o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT); o->hide(); {Fl_Check_Button* o = animateButton = new Fl_Check_Button(10, 10, 300, 20, _("Animate size changes")); o->value(1); o->callback((Fl_Callback*)cb_animateButton); o->value(animate); } {Fl_Value_Slider* o = animateSlider = new Fl_Value_Slider(70, 35, 235, 20, _("Speed:")); o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE); o->box(FL_DOWN_BOX); o->text_size(10); o->minimum(5); o->maximum(20); o->step(2); o->value(14); o->slider_size(8); o->callback((Fl_Callback*)cb_animateSlider); o->align(FL_ALIGN_LEFT); o->value(animate_speed); if(animate) o->activate(); else o->deactivate(); } new Fl_Divider(0, 60, 300, 25, _("label")); {Fl_Check_Button* o = opaqueResize = new Fl_Check_Button(10, 85, 290, 20, _("Show window content while resizing")); o->callback((Fl_Callback*)cb_opaqueResize); o->value(opaque_resize); } o->end(); } o->end(); } {Fl_Button* o = new Fl_Button(67, 337, 80, 25, _("&OK")); o->shortcut(0xff0d); o->callback((Fl_Callback*)cb_OK); } {Fl_Button* o = new Fl_Button(152, 337, 80, 25, _("&Apply")); o->callback((Fl_Callback*)cb_Apply); } {Fl_Button* o = new Fl_Button(237, 337, 80, 25, _("&Cancel")); o->shortcut(0xff1b); o->callback((Fl_Callback*)cb_Cancel); } o->end(); } useThemeButton->do_callback(); w->show(argc, argv); return Fl::run(); }
void DisplayFltkMenu::make_window() { size(235, 445); { { Fl_Counter* o = nearclip = new Fl_Counter(105, 25, 110, 25, "Near Clip"); o->align(FL_ALIGN_LEFT); o->range(0.01, 1000.0); o->step(0.05); o->lstep(0.5); o->precision(2); o->callback(nearclip_cb, app); VMDFLTKTOOLTIP(o, "Set near clipping plane (OpenGL display only)") } { Fl_Counter* o = farclip = new Fl_Counter(105, 50, 110, 25, "Far Clip"); o->align(FL_ALIGN_LEFT); o->range(0.01, 1000.0); o->step(0.05); o->lstep(0.5); o->precision(2); o->callback(farclip_cb, app); VMDFLTKTOOLTIP(o, "Set far clipping plane (OpenGL display only)") } { Fl_Counter* o = eyesep = new Fl_Counter(105, 75, 110, 25, "Eye Sep"); o->align(FL_ALIGN_LEFT); o->range(0.0, 100.0); o->step(0.01); o->lstep(0.1); o->precision(2); o->callback(eyesep_cb, app); VMDFLTKTOOLTIP(o, "Set stereo eye separation") } { Fl_Counter* o = focal = new Fl_Counter(105, 100, 110, 25, "Focal Length"); o->align(FL_ALIGN_LEFT); o->range(0.01, 1000.0); o->step(0.05); o->lstep(0.5); o->precision(2); o->callback(focal_cb, app); VMDFLTKTOOLTIP(o, "Set stereo focal point") } { Fl_Counter* o = screenh = new Fl_Counter(105, 135, 110, 25, "Screen Hgt"); o->align(FL_ALIGN_LEFT); o->range(0.0, 100000.0); o->step(0.1); o->lstep(1.0); o->precision(1); o->callback(screenh_cb, app); VMDFLTKTOOLTIP(o, "Set viewing frustum height") } { Fl_Counter* o = screend = new Fl_Counter(105, 160, 110, 25, "Screen Dist"); o->align(FL_ALIGN_LEFT); o->range(-100000.0, 100000.0); o->step(0.1); o->lstep(1.0); o->precision(1); o->callback(screend_cb, app); VMDFLTKTOOLTIP(o, "Set viewing frustum distance") } { Fl_Choice* o = cuemode = new Fl_Choice(105, 195, 110, 25, "Cue Mode"); o->color(VMDMENU_CHOOSER_BG); o->selection_color(VMDMENU_CHOOSER_SEL); o->box(FL_THIN_UP_BOX); o->align(FL_ALIGN_LEFT); o->callback(cuemode_cb, app); VMDFLTKTOOLTIP(o, "Set depth cueing mode") for (int m=0; m<app->display->num_cue_modes(); m++) cuemode->add(app->display->cue_mode_name(m)); } { Fl_Counter* o = cuestart = new Fl_Counter(105, 220, 110, 25, "Cue Start"); o->align(FL_ALIGN_LEFT); o->range(0.001, 1000.0); o->step(0.05); o->lstep(0.25); o->precision(2); o->callback(cuestart_cb, app); VMDFLTKTOOLTIP(o, "Set linear depth cueing starting distance") } { Fl_Counter* o = cueend = new Fl_Counter(105, 245, 110, 25, "Cue End"); o->align(FL_ALIGN_LEFT); o->range(0.001, 1000.0); o->step(0.05); o->lstep(0.25); o->precision(2); o->callback(cueend_cb, app); VMDFLTKTOOLTIP(o, "Set linear depth cueing end distance") } { Fl_Counter* o = cuedensity = new Fl_Counter(105, 270, 110, 25, "Cue Density"); o->align(FL_ALIGN_LEFT); o->range(0.001, 1000.0); o->step(0.05); o->lstep(0.1); o->precision(2); o->callback(cuedensity_cb, app); VMDFLTKTOOLTIP(o, "Set exponential depth cueing density") } new Fl_Box(35, 305, 170, 25, "External Renderer Options"); { Fl_Choice* o = shadowmode = new Fl_Choice(105, 330, 110, 25, "Shadows"); o->color(VMDMENU_CHOOSER_BG); o->selection_color(VMDMENU_CHOOSER_SEL); o->box(FL_THIN_UP_BOX); o->align(FL_ALIGN_LEFT); o->callback(shadowmode_cb, app); VMDFLTKTOOLTIP(o, "Enable shadows in external renderers") shadowmode->add("Off"); shadowmode->add("On"); } { Fl_Choice* o = aomode = new Fl_Choice(105, 355, 110, 25, "Amb. Occl."); o->color(VMDMENU_CHOOSER_BG); o->selection_color(VMDMENU_CHOOSER_SEL); o->box(FL_THIN_UP_BOX); o->align(FL_ALIGN_LEFT); o->callback(aomode_cb, app); VMDFLTKTOOLTIP(o, "Enable ambient occlusion lighting in external renderers") aomode->add("Off"); aomode->add("On"); } { Fl_Counter* o = aoambient = new Fl_Counter(105, 380, 110, 25, "AO Ambient"); o->align(FL_ALIGN_LEFT); o->range(0.0, 1.0); o->step(0.01); o->lstep(0.10); o->precision(2); o->callback(aoambient_cb, app); VMDFLTKTOOLTIP(o, "Ambient occlusion lighting coefficient") } { Fl_Counter* o = aodirect = new Fl_Counter(105, 405, 110, 25, "AO Direct"); o->align(FL_ALIGN_LEFT); o->range(0.0, 1.0); o->step(0.01); o->lstep(0.10); o->precision(2); o->callback(aodirect_cb, app); VMDFLTKTOOLTIP(o, "Direct lighting rescaling coefficient") } Fl_Box *box1 = new Fl_Box(10, 10, 215, 120); box1->box(FL_ENGRAVED_FRAME); Fl_Box *box2 = new Fl_Box(10, 130, 215, 65); box2->box(FL_ENGRAVED_FRAME); Fl_Box *box3 = new Fl_Box(10, 190, 215, 110); box3->box(FL_ENGRAVED_FRAME); Fl_Box *box4 = new Fl_Box(10, 300, 215, 135); box4->box(FL_ENGRAVED_FRAME); end(); end(); } }
Panner::Panner ( int X, int Y, int W, int H, const char *L ) : Fl_Group( X, Y, W, H, L ) { _bg_image = 0; _bg_image_scaled = 0; _bg_image_projection = 0; // _projection = POLAR; _points.push_back( Point( 1, 0 ) ); static float ranges[] = { 1,3,5,10,15 }; { Fl_Choice *o = _range_choice = new Fl_Choice(X + 40,Y + H - 18,75,18,"Range:"); o->box(FL_UP_FRAME); o->down_box(FL_DOWN_FRAME); o->textsize(9); o->labelsize(9); o->align(FL_ALIGN_LEFT); o->add("1 Meter",0,0,&ranges[0]); o->add("3 Meters",0,0,&ranges[1]); o->add("5 Meters",0,0,&ranges[2]); o->add("10 Meters",0,0,&ranges[3]); o->add("15 Meters",0,0,&ranges[4]); o->value(_range_mode); o->callback( cb_mode, this ); } { Fl_Choice *o = _projection_choice = new Fl_Choice(X + W - 75,Y + H - 18,75,18,"Projection:"); o->box(FL_UP_FRAME); o->down_box(FL_DOWN_FRAME); o->textsize(9); o->labelsize(9); o->align(FL_ALIGN_LEFT); o->add("Spherical"); o->add("Planar"); o->value(_projection_mode); o->callback( cb_mode, this ); } end(); }
//---------------------------------------------------- // Constructor. Creates all of the widgets. // Add new widgets here //---------------------------------------------------- ImpressionistUI::ImpressionistUI() { // Create the main window m_mainWindow = new Fl_Window(600, 300, "Impressionist"); m_mainWindow->user_data((void*)(this)); // record self to be used by static callback functions // install menu bar m_menubar = new Fl_Menu_Bar(0, 0, 600, 25); m_menubar->menu(menuitems); // Create a group that will hold two sub windows inside the main // window Fl_Group* group = new Fl_Group(0, 25, 600, 275); // install paint view window m_paintView = new PaintView(300, 25, 300, 275, "This is the paint view");//0jon m_paintView->box(FL_DOWN_FRAME); // install original view window m_origView = new OriginalView(0, 25, 300, 275, "This is the orig view");//300jon m_origView->box(FL_DOWN_FRAME); // m_origView->deactivate(); group->end(); Fl_Group::current()->resizable(group); m_mainWindow->end(); // init values m_nSize = 10; m_nAngle = 45; m_nAlpha = 255; m_nBackgroundAlpha = 100; // brush dialog definition m_brushDialog = new Fl_Window(400, 325, "Brush Dialog"); // Add a brush type choice to the dialog m_BrushTypeChoice = new Fl_Choice(50,10,150,25,"&Brush"); m_BrushTypeChoice->user_data((void*)(this)); // record self to be used by static callback functions m_BrushTypeChoice->menu(brushTypeMenu); m_BrushTypeChoice->callback(cb_brushChoice); m_ClearCanvasButton = new Fl_Button(240,10,150,25,"&Clear Canvas"); m_ClearCanvasButton->user_data((void*)(this)); m_ClearCanvasButton->callback(cb_clear_canvas_button); m_transparentBackgroundButton = new Fl_Button(130,280,150,25,"&Show Background"); m_transparentBackgroundButton->user_data((void*)(this)); m_transparentBackgroundButton->callback(cb_transparentBackground); m_edgeImageButton = new Fl_Button(130,180,150,25,"&Toggle Edge Image"); m_edgeImageButton->user_data((void*)(this)); m_edgeImageButton->callback(cb_edgeImage); //Add angle choice menu Fl_Choice * myChoice = new Fl_Choice(95,60,150,25,"&Angle Choice"); myChoice->user_data((void*)(this)); // record self to be used by static callback functions myChoice->menu(angleChoiceMenu); myChoice->callback(cb_angleChoice); // Add brush size slider to the dialog m_BrushSizeSlider = new Fl_Value_Slider(10, 100, 300, 20, "Size"); m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER); m_BrushSizeSlider->labelfont(FL_COURIER); m_BrushSizeSlider->labelsize(12); m_BrushSizeSlider->minimum(1); m_BrushSizeSlider->maximum(40); m_BrushSizeSlider->step(1); m_BrushSizeSlider->value(m_nSize); m_BrushSizeSlider->align(FL_ALIGN_RIGHT); m_BrushSizeSlider->callback(cb_sizeSlides); // Add brush angle slider to the dialog m_BrushSizeSlider = new Fl_Value_Slider(10, 120, 300, 20, "Angle"); m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER); m_BrushSizeSlider->labelfont(FL_COURIER); m_BrushSizeSlider->labelsize(12); m_BrushSizeSlider->minimum(0); m_BrushSizeSlider->maximum(180); m_BrushSizeSlider->step(1); m_BrushSizeSlider->value(m_nAngle); m_BrushSizeSlider->align(FL_ALIGN_RIGHT); m_BrushSizeSlider->callback(cb_angleSlides); // Add brush angle slider to the dialog m_BrushSizeSlider = new Fl_Value_Slider(10, 140, 300, 20, "Opacity"); m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER); m_BrushSizeSlider->labelfont(FL_COURIER); m_BrushSizeSlider->labelsize(12); m_BrushSizeSlider->minimum(0); m_BrushSizeSlider->maximum(255); m_BrushSizeSlider->step(1); m_BrushSizeSlider->value(m_nAlpha); m_BrushSizeSlider->align(FL_ALIGN_RIGHT); m_BrushSizeSlider->callback(cb_alphaSlides); // Add brush angle slider to the dialog m_BrushSizeSlider = new Fl_Value_Slider(10, 250, 300, 20, "Background\nOpacity"); m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER); m_BrushSizeSlider->labelfont(FL_COURIER); m_BrushSizeSlider->labelsize(12); m_BrushSizeSlider->minimum(0); m_BrushSizeSlider->maximum(255); m_BrushSizeSlider->step(1); m_BrushSizeSlider->value(m_nBackgroundAlpha); m_BrushSizeSlider->align(FL_ALIGN_RIGHT); m_BrushSizeSlider->callback(cb_backgroundAlphaSlides); m_brushDialog->end(); // filter dialog definition std::fill(fltKernel,fltKernel+(FLT_WIDTH*FLT_HEIGHT)-1,0.0f); // m_nScale = 1.0f; // m_nOffset = 0.0f; m_filterDialog = new Fl_Window(400, 200, "Filter Dialog"); m_BrushTypeChoice = new Fl_Choice(150,10,150,25,"&Select Source"); m_BrushTypeChoice->user_data((void*)(this)); // record self to be used by static callback functions m_BrushTypeChoice->menu(filterChoiceMenu); m_BrushTypeChoice->callback(cb_filterChoice); m_ApplyFilterButton = new Fl_Button(30,170,100,25,"&Apply Filter"); m_ApplyFilterButton->user_data((void*)(this)); m_ApplyFilterButton->callback(cb_apply_filter_button); m_PreviewFilterButton = new Fl_Button(150,170,100,25,"&Preview Filter"); m_PreviewFilterButton->user_data((void*)(this)); m_PreviewFilterButton->callback(cb_preview_filter_button); m_CancelFilterButton = new Fl_Button(270,170,100,25,"&Cancel"); m_CancelFilterButton->user_data((void*)(this)); m_CancelFilterButton->callback(cb_cancel_filter_button); Fl_Float_Input* scaleInput = new Fl_Float_Input(50, 80, 40, 20,"&Scale"); scaleInput->user_data((void*)(this)); scaleInput->callback(cb_scaleInput); Fl_Float_Input* offsetInput = new Fl_Float_Input(50, 100, 40, 20,"&Offset"); offsetInput->user_data((void*)(this)); offsetInput->callback(cb_offsetInput); Fl_Float_Input* filterInput_00 = new Fl_Float_Input(100, 50, 50, 20); filterInput_00->user_data((void*)(this)); filterInput_00->callback(cb_filterInput_00); Fl_Float_Input* filterInput_01 = new Fl_Float_Input(150, 50, 50, 20); filterInput_01->user_data((void*)(this)); filterInput_01->callback(cb_filterInput_01); Fl_Float_Input* filterInput_02 = new Fl_Float_Input(200, 50, 50, 20); filterInput_02->user_data((void*)(this)); filterInput_02->callback(cb_filterInput_02); Fl_Float_Input* filterInput_03 = new Fl_Float_Input(250, 50, 50, 20); filterInput_03->user_data((void*)(this)); filterInput_03->callback(cb_filterInput_03); Fl_Float_Input* filterInput_04 = new Fl_Float_Input(300, 50, 50, 20); filterInput_04->user_data((void*)(this)); filterInput_04->callback(cb_filterInput_04); Fl_Float_Input* filterInput_10 = new Fl_Float_Input(100, 70, 50, 20); filterInput_10->user_data((void*)(this)); filterInput_10->callback(cb_filterInput_10); Fl_Float_Input* filterInput_11 = new Fl_Float_Input(150, 70, 50, 20); filterInput_11->user_data((void*)(this)); filterInput_11->callback(cb_filterInput_11); Fl_Float_Input* filterInput_12 = new Fl_Float_Input(200, 70, 50, 20); filterInput_12->user_data((void*)(this)); filterInput_12->callback(cb_filterInput_12); Fl_Float_Input* filterInput_13 = new Fl_Float_Input(250, 70, 50, 20); filterInput_13->user_data((void*)(this)); filterInput_13->callback(cb_filterInput_13); Fl_Float_Input* filterInput_14 = new Fl_Float_Input(300, 70, 50, 20); filterInput_14->user_data((void*)(this)); filterInput_14->callback(cb_filterInput_14); Fl_Float_Input* filterInput_20 = new Fl_Float_Input(100, 90, 50, 20); filterInput_20->user_data((void*)(this)); filterInput_20->callback(cb_filterInput_20); Fl_Float_Input* filterInput_21 = new Fl_Float_Input(150, 90, 50, 20); filterInput_21->user_data((void*)(this)); filterInput_21->callback(cb_filterInput_21); Fl_Float_Input* filterInput_22 = new Fl_Float_Input(200, 90, 50, 20); filterInput_22->user_data((void*)(this)); filterInput_22->callback(cb_filterInput_22); Fl_Float_Input* filterInput_23 = new Fl_Float_Input(250, 90, 50, 20); filterInput_23->user_data((void*)(this)); filterInput_23->callback(cb_filterInput_23); Fl_Float_Input* filterInput_24 = new Fl_Float_Input(300, 90, 50, 20); filterInput_24->user_data((void*)(this)); filterInput_24->callback(cb_filterInput_24); Fl_Float_Input* filterInput_30 = new Fl_Float_Input(100, 110, 50, 20); filterInput_30->user_data((void*)(this)); filterInput_30->callback(cb_filterInput_30); Fl_Float_Input* filterInput_31 = new Fl_Float_Input(150, 110, 50, 20); filterInput_31->user_data((void*)(this)); filterInput_31->callback(cb_filterInput_31); Fl_Float_Input* filterInput_32 = new Fl_Float_Input(200, 110, 50, 20); filterInput_32->user_data((void*)(this)); filterInput_32->callback(cb_filterInput_32); Fl_Float_Input* filterInput_33 = new Fl_Float_Input(250, 110, 50, 20); filterInput_33->user_data((void*)(this)); filterInput_33->callback(cb_filterInput_33); Fl_Float_Input* filterInput_34 = new Fl_Float_Input(300, 110, 50, 20); filterInput_34->user_data((void*)(this)); filterInput_34->callback(cb_filterInput_34); Fl_Float_Input* filterInput_40 = new Fl_Float_Input(100, 130, 50, 20); filterInput_40->user_data((void*)(this)); filterInput_40->callback(cb_filterInput_40); Fl_Float_Input* filterInput_41 = new Fl_Float_Input(150, 130, 50, 20); filterInput_41->user_data((void*)(this)); filterInput_41->callback(cb_filterInput_41); Fl_Float_Input* filterInput_42 = new Fl_Float_Input(200, 130, 50, 20); filterInput_42->user_data((void*)(this)); filterInput_42->callback(cb_filterInput_42); Fl_Float_Input* filterInput_43 = new Fl_Float_Input(250, 130, 50, 20); filterInput_43->user_data((void*)(this)); filterInput_43->callback(cb_filterInput_43); Fl_Float_Input* filterInput_44 = new Fl_Float_Input(300, 130, 50, 20); filterInput_44->user_data((void*)(this)); filterInput_44->callback(cb_filterInput_44); m_filterDialog->end(); }
static void style_cb(Fl_Widget *w, void *v) { Fl_Choice *choice = (Fl_Choice *)w; VMDApp *app = (VMDApp *)v; app->animation_set_style(choice->value()); }
// add a parameter number to the tree Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh, Fl_Tree_Item *n, bool highlight, Fl_Color c) { char *path = strdup(getPath(n).c_str()); _treeStrings.push_back(path); // enumeration (display choices as value labels, not numbers) if(p.getChoices().size() && p.getChoices().size() == p.getValueLabels().size()){ Fl_Choice *but = new Fl_Choice(1, 1, ww, hh); std::vector<Fl_Menu_Item> menu; std::map<double, std::string> labels(p.getValueLabels()); for(std::map<double, std::string>::iterator it = labels.begin(); it != labels.end(); it++){ char *str = strdup(it->second.c_str()); _treeStrings.push_back(str); Fl_Menu_Item menuItem = {str, 0, 0, 0, 0}; if(highlight) menuItem.labelcolor(c); menu.push_back(menuItem); } Fl_Menu_Item it = {0}; menu.push_back(it); but->copy(&menu[0]); for(unsigned int i = 0; i < p.getChoices().size(); i++){ if(p.getValue() == p.getChoices()[i]){ but->value(i); break; } } but->callback(onelab_number_choice_cb, (void*)path); but->align(FL_ALIGN_RIGHT); if(p.getReadOnly()) but->deactivate(); return but; } // check box (boolean choice) if(p.getChoices().size() == 2 && p.getChoices()[0] == 0 && p.getChoices()[1] == 1){ n->labelsize(FL_NORMAL_SIZE + 2); Fl_Check_Button *but = new Fl_Check_Button(1, 1, ww / _widgetLabelRatio, hh); but->box(FL_FLAT_BOX); but->color(_tree->color()); but->value(p.getValue()); but->callback(onelab_number_check_button_cb, (void*)path); if(highlight) but->color(c); if(p.getReadOnly()) but->deactivate(); return but; } // non-editable value if(p.getReadOnly()){ outputRange *but = new outputRange(1, 1, ww, hh); //TODO but->callback(onelab_number_output_range_cb, (void*)path); but->value(p.getValue()); but->align(FL_ALIGN_RIGHT); but->graph(p.getAttribute("Graph")); if(highlight) but->color(c); return but; } // general number input inputRange *but = new inputRange(1, 1, ww, hh, onelab::parameter::maxNumber(), p.getAttribute("ReadOnlyRange") == "1"); but->value(p.getValue()); but->minimum(p.getMin()); but->maximum(p.getMax()); but->step(p.getStep()); but->choices(p.getChoices()); but->loop(p.getAttribute("Loop")); but->graph(p.getAttribute("Graph")); but->callback(onelab_number_input_range_cb, (void*)path); but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY); but->align(FL_ALIGN_RIGHT); if(highlight) but->color(c); return but; }
static void repchooser_cb(Fl_Widget *w, void *v) { Fl_Choice *c = (Fl_Choice *)w; if (c->value()) ((SaveTrajectoryFltkMenu *)v)->select_atoms(c->text()); }
SaveTrajectoryFltkMenu::SaveTrajectoryFltkMenu(VMDApp *vmdapp) : VMDFltkMenu("save", "Save Trajectory", vmdapp) { size(450, 250); { Fl_Choice* o = molchooser = new Fl_Choice(120, 10, 320, 25, "Save data from: "); o->box(FL_THIN_UP_BOX); o->down_box(FL_BORDER_BOX); o->color(VMDMENU_CHOOSER_BG); o->selection_color(VMDMENU_CHOOSER_SEL); o->callback(molchooser_cb, this); } { Fl_Input *o = selectinput = new Fl_Input(120, 45, 295, 25, "Selected atoms:"); o->selection_color(VMDMENU_VALUE_SEL); } { Fl_Choice* o = repchooser = new Fl_Choice(415, 45, 25, 25); o->down_box(FL_BORDER_BOX); o->align(FL_ALIGN_TOP_LEFT); o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL); o->callback(repchooser_cb, this); } { Fl_Choice* o = filetypechooser = new Fl_Choice(20, 90, 115, 25, "File type:"); o->down_box(FL_BORDER_BOX); o->align(FL_ALIGN_TOP_LEFT); o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL); } savebutton = new Fl_Return_Button(345, 90, 95, 25, "Save..."); savebutton->callback(save_cb, this); { Fl_Group* o = timestepgroup = new Fl_Group(20, 145, 165, 95, "Frames: "); o->box(FL_ENGRAVED_FRAME); o->align(FL_ALIGN_TOP_LEFT); { Fl_Button* o = saveinbackgroundbutton = new Fl_Round_Button(30, 215, 150, 20, "Save in background"); o->down_box(FL_ROUND_DOWN_BOX); o->type(FL_RADIO_BUTTON); } { Fl_Button* o = allatoncebutton = new Fl_Round_Button(30, 195, 150, 20, "Save all at once"); o->down_box(FL_ROUND_DOWN_BOX); o->type(FL_RADIO_BUTTON); } { Fl_Input* o = firstinput = new Fl_Int_Input(25, 170, 45, 20, "First:"); o->align(FL_ALIGN_TOP); o->selection_color(VMDMENU_VALUE_SEL); } { Fl_Input* o = lastinput = new Fl_Int_Input(80, 170, 45, 20, "Last:"); o->align(FL_ALIGN_TOP); o->selection_color(VMDMENU_VALUE_SEL); } { Fl_Input* o = strideinput = new Fl_Int_Input(135, 170, 45, 20, "Stride:"); o->align(FL_ALIGN_TOP); o->selection_color(VMDMENU_VALUE_SEL); } o->end(); datasetbrowser = new Fl_Multi_Browser(195, 145, 240, 95, "Volumetric Datasets"); datasetbrowser->align(5); datasetbrowser->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL); } end(); allatoncebutton->value(1); selected_molid = -1; datasetbrowser->deactivate(); command_wanted(Command::PLUGIN_UPDATE); command_wanted(Command::MOL_NEW); command_wanted(Command::MOL_RENAME); command_wanted(Command::MOL_DEL); command_wanted(Command::MOL_ADDREP); command_wanted(Command::MOL_DELREP); command_wanted(Command::MOL_MODREP); command_wanted(Command::MOL_MODREPITEM); command_wanted(Command::ANIM_DELETE); }
Fl_Scopes_Manager::Fl_Scopes_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name) { Fl::lock(); s->begin(); Fl_MDI_Window *w = SWin = new Fl_MDI_Window(0, 0, width, height, name); w->user_data((void *)this); w->resizable(w->view()); w->titlebar()->close_button()->hide(); w->view()->begin(); Scopes_Tabs = new Fl_Tabs*[Num_Scopes]; Scope_Show = new Fl_Check_Button*[Num_Scopes]; Scope_Pause = new Fl_Button*[Num_Scopes]; Scope_OneShot = new Fl_Check_Button*[Num_Scopes]; Scope_Options = new Fl_Menu_Button*[Num_Scopes]; Grid_Color = new Fl_Button*[Num_Scopes]; Bg_Color = new Fl_Button*[Num_Scopes]; Sec_Div = new Fl_Input_Browser*[Num_Scopes]; Save_Type = new Fl_Check_Button*[Num_Scopes]; Save_Points = new Fl_Int_Input*[Num_Scopes]; Save_Time = new Fl_Float_Input*[Num_Scopes]; Save_File = new Fl_Input*[Num_Scopes]; Save = new Fl_Light_Button*[Num_Scopes]; Save_Flag = new int[Num_Scopes]; Save_File_Pointer = new FILE*[Num_Scopes]; Trace_Page = new Fl_Group**[Num_Scopes]; Trace_Show = new Fl_Check_Button**[Num_Scopes]; Units_Div = new Fl_Input_Browser**[Num_Scopes]; Trace_Color = new Fl_Button**[Num_Scopes]; Trace_Pos = new Fl_Dial**[Num_Scopes]; Trace_Width = new Fl_Dial**[Num_Scopes]; Trigger_Mode = new Fl_Choice*[Num_Scopes]; Trace_Options = new Fl_Menu_Button**[Num_Scopes]; Scope_Windows = new Fl_Scope_Window*[Num_Scopes]; for (int i = 0; i < Num_Scopes; i++) { Save_Flag[i] = false; { Fl_Tabs *o = Scopes_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-40); o->new_page("General"); { Fl_Check_Button *o = Scope_Show[i] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide"); o->callback((Fl_Callback *)show_scope, (void *)i); } { Fl_Button *o = Scope_Pause[i] = new Fl_Button(10, 75, 90, 25, "Trigger"); o->value(0); o->deactivate(); o->when(FL_WHEN_CHANGED); o->callback((Fl_Callback *)pause_scope, (void *)i); } { Fl_Check_Button *o = Scope_OneShot[i] = new Fl_Check_Button(10, 50, 100, 20, "OneShot/Run"); o->deactivate(); o->callback((Fl_Callback *)oneshot_scope, (void *)i); } { Fl_Menu_Button *o = Scope_Options[i] = new Fl_Menu_Button(10, 105, 90, 25, "Options"); o->menu(Scope_Opts); o->when(FL_WHEN_ENTER_KEY); o->child(0)->set_value(); o->callback((Fl_Callback *)enter_options, (void *)i); } { Fl_Button *o = Grid_Color[i] = new Fl_Button(10, 135, 90, 25, "Grid Color"); o->callback((Fl_Callback *)select_grid_color, (void *)i); } { Fl_Button *o = Bg_Color[i] = new Fl_Button(10, 165, 90, 25, "Bg Color"); o->callback((Fl_Callback *)select_bg_color, (void *)i); } { Fl_Input_Browser *o = Sec_Div[i] = new Fl_Input_Browser(200, 25, 60, 20, "Sec/Div: "); o->add("0.001|0.005|0.01|0.05|0.1|0.5|1"); o->align(FL_ALIGN_LEFT); o->value("0.1"); o->when(FL_WHEN_ENTER_KEY); o->callback((Fl_Callback *)enter_secdiv, (void *)i); } { Fl_Check_Button *o = Save_Type[i] = new Fl_Check_Button(140, 50, 100, 20, "Points/Time"); o->value(1); o->callback((Fl_Callback *)select_save, (void *)i); } { Fl_Int_Input *o = Save_Points[i] = new Fl_Int_Input(200, 75, 60, 20, "N Points: "); o->align(FL_ALIGN_LEFT); o->value("1000"); } { Fl_Float_Input *o = Save_Time[i] = new Fl_Float_Input(200, 105, 60, 20, "Time [s]: "); o->align(FL_ALIGN_LEFT); o->value("1.0"); o->deactivate(); } { Fl_Input *o = Save_File[i] = new Fl_Input(200, 135, 100, 20, "Filename:"); char buf[100]; o->align(FL_ALIGN_LEFT); sprintf(buf, "%s", Scopes[i].name); o->value(buf); } { Fl_Light_Button *o = Save[i] = new Fl_Light_Button(140, 165, 90, 25, "Save"); o->selection_color(FL_BLACK); o->callback((Fl_Callback *)enable_saving, (void *)i); } { Fl_Choice *o = Trigger_Mode[i] = new Fl_Choice(60, 200, 170, 25, "Trigger:"); o->add("Continuous Roling|Continuous Overwrite|Rising (-to+) CH1|Falling (+to-) CH1|Hold"); o->align(FL_ALIGN_LEFT); o->value(0); o->when(FL_WHEN_ENTER_KEY); o->callback((Fl_Callback *)enter_trigger_mode, (void *)i); } Trace_Page[i] = new Fl_Group*[Scopes[i].ntraces]; Trace_Show[i] = new Fl_Check_Button*[Scopes[i].ntraces]; Units_Div[i] = new Fl_Input_Browser*[Scopes[i].ntraces]; Trace_Color[i] = new Fl_Button*[Scopes[i].ntraces]; Trace_Pos[i] = new Fl_Dial*[Scopes[i].ntraces]; Trace_Width[i] = new Fl_Dial*[Scopes[i].ntraces]; Trace_Options[i] = new Fl_Menu_Button*[Scopes[i].ntraces]; for (int j = 0; j < Scopes[i].ntraces; j++) { s_idx_T *idx = new s_idx_T; idx->scope_idx = i; idx->trace_idx = j; Trace_Page[i][j] = o->new_page(Scopes[i].traceName[j]); Trace_Page[i][j]->label_color(FL_WHITE); { Fl_Check_Button *o = Trace_Show[i][j] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide"); o->value(1); o->callback((Fl_Callback *)show_trace, (void *)idx); } { Fl_Input_Browser *o = Units_Div[i][j] = new Fl_Input_Browser(77, 55, 60, 20, "Units/Div: "); o->align(FL_ALIGN_LEFT); o->value("2.5"); o->add("0.001|0.002|0.005|0.01|0.02|0.05|0.1|0.2|0.5|1|2|5|10|50|100|1000"); o->when(FL_WHEN_ENTER_KEY); o->callback((Fl_Callback *)enter_unitsdiv, (void *)idx); } { Fl_Button *o = Trace_Color[i][j] = new Fl_Button(10, 90, 90, 25, "Trace Color"); o->callback((Fl_Callback *)select_trace_color, (void *)idx); } { Fl_Dial *o = Trace_Pos[i][j] = new Fl_Dial(170, 40, 50, 50, "Trace Offset"); o->type(Fl_Dial::LINE); o->minimum(0.0); o->maximum(2.0); o->value(1); o->callback((Fl_Callback *)change_trace_pos, (void *)idx); } { Fl_Dial *o = Trace_Width[i][j] = new Fl_Dial(250, 40, 50, 50, "Trace Width"); o->type(Fl_Dial::LINE); o->minimum(0.1); o->maximum(40.0); o->value(0.1); o->callback((Fl_Callback *)change_trace_width, (void *)idx); } { Fl_Menu_Button *o = Trace_Options[i][j] = new Fl_Menu_Button(10, 130, 90, 25, "Options "); int i; o->menu(Trace_Opts); o->when(FL_WHEN_ENTER_KEY); o->callback((Fl_Callback *)enter_options, (void *)idx); // for(i=0;i<o->children();i++) { // loop through all menu items, and add checked items to the value // o->child(i)->set_value(); // } } } o->end(); Fl_Group::current()->resizable(w); } } for (int i = 1; i < Num_Scopes; i++) { Scopes_Tabs[i]->hide(); } Scopes_Tabs[0]->show(); Help = new Fl_Button(width-150, height-30, 70, 25, "Help"); Close = new Fl_Button(width-75, height-30, 70, 25, "Close"); Close->callback((Fl_Callback *)close); Fl_Browser *o = Scopes_Tree = new Fl_Browser(5, 5, 150, height-10); o->indented(1); o->callback((Fl_Callback *)select_scope); for (int i = 0; i < Num_Scopes; i++) { add_paper(Scopes_Tree, Scopes[i].name, Fl_Image::read_xpm(0, scope_icon)); } w->view()->end(); s->end(); w->titlebar()->h(15); w->titlebar()->color(FL_BLACK); w->position(x, y); Fl::unlock(); }