当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Choice类代码示例

本文整理汇总了C++中Fl_Choice的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Choice类的具体用法?C++ Fl_Choice怎么用?C++ Fl_Choice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Fl_Choice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addParameter

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"));
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:60,代码来源:onelab2Group.cpp

示例2: choice_cb

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;
		}
	}
}
开发者ID:edeproject,项目名称:svn,代码行数:33,代码来源:ede-screensaver-conf.cpp

示例3: Fl_Double_Window

//-----------------------------------------------------------------------------
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();
}
开发者ID:ClinicalGraphics,项目名称:MathGL,代码行数:26,代码来源:table.cpp

示例4: main

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();
}
开发者ID:edeproject,项目名称:efltk,代码行数:56,代码来源:label.cpp

示例5: Fl_Double_Window

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
}
开发者ID:pOakley,项目名称:xcaldaq_client,代码行数:53,代码来源:ImageWindow.cpp

示例6: onelab_number_choice_cb

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]);
  }
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:16,代码来源:onelab2Group.cpp

示例7: mgl_gettext

//-----------------------------------------------------------------------------
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();
}
开发者ID:ClinicalGraphics,项目名称:MathGL,代码行数:20,代码来源:table.cpp

示例8: japtest

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());
}
开发者ID:tiborh,项目名称:cplusplus,代码行数:19,代码来源:japanese_test.cpp

示例9: main

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();
}
开发者ID:0mk,项目名称:non,代码行数:48,代码来源:ntk-perf.C

示例10: init_appendai_choices

	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;
	}
开发者ID:killbug2004,项目名称:Frozlunky,代码行数:37,代码来源:mods.cpp

示例11: Fl_Double_Window

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);
//.........这里部分代码省略.........
开发者ID:ishkabbible,项目名称:ZASF,代码行数:101,代码来源:SUBnoteUI.c

示例12: Fl_Group

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);
//.........这里部分代码省略.........
开发者ID:ishkabbible,项目名称:ZASF,代码行数:101,代码来源:FilterUI.c

示例13: size

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();
      }
//.........这里部分代码省略.........
开发者ID:Eigenstate,项目名称:vmd-python,代码行数:101,代码来源:ColorFltkMenu.C

示例14: Fl_Double_Window

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;
}
开发者ID:lavenderxy,项目名称:Computer-Graphic,代码行数:89,代码来源:IntersectionInterface.cpp

示例15: makeTree

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 );
//.........这里部分代码省略.........
开发者ID:orfeotoolbox,项目名称:Monteverdi,代码行数:101,代码来源:Flu_Tree_Browser_Try.cpp


注:本文中的Fl_Choice类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。