Example #1
0
    window(int x, int y, int w, int h, const char *label = 0)
        : Fl_Window(x, y, w, h, label)
    {
        Fl_Box *o = new Fl_Box(10, 10, 300, 25,
            "Open CSV file to convert to HTML -->");
        o->box(FL_BORDER_BOX);
        o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER);
        o->color((Fl_Color)215);
        o->labelfont(FL_HELVETICA_BOLD);

        Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files");
        but->callback(on_pick_button_click, this);

        encode_check = new Fl_Check_Button(10, 40, 280, 25,
            "Escape special HTML characters.");
        encode_check->value(1);

        open_file_check = new Fl_Check_Button(10, 65, 280, 25,
            "Open HTML in browser.");
        open_file_check->value(1);

        Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li");
        author->box(FL_FLAT_BOX);
        author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
        author->labelsize(12);
        author->labelcolor(fl_rgb_color(128, 128, 128));
        author->callback(on_author_click, this);
    }
Example #2
0
void useserver_cb(Fl_Widget *w, void *arg)
{
  if(!arg) return;
  Fl_Check_Button *checkbox = (Fl_Check_Button *)w;
  onelabGroup *obj = (onelabGroup *)arg;
  obj->useServer(checkbox->value() == 1);
}
Example #3
0
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"));
}
Example #4
0
int main(int argc, char **argv) {
	ThemeLoader::init();
	IconLoader::init();
	win = new EdeWindow(455, 485, "Theme demo");
	win->begin();
	{ Fl_Button* o = new Fl_Button(355, 450, 90, 25, "Load");
	  o->tooltip("Load predefined theme");
	  o->callback(load_theme_cb);
	} // Fl_Button* o
	{ Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 455, 25);
	  o->menu(menu_);
	} // Fl_Menu_Bar* o
	{ Fl_Round_Button* o = new Fl_Round_Button(5, 285, 90, 25, "round");
	  o->down_box(FL_ROUND_DOWN_BOX);
	} // Fl_Round_Button* o
	{ new Fl_Return_Button(5, 195, 90, 25, "button");
	} // Fl_Return_Button* o
	{ new Fl_Input(160, 196, 285, 25, "input:");
	} // Fl_Input* o
	{ Fl_Output* o = new Fl_Output(160, 225, 285, 25, "output:");
	  o->value("Some output value");
	} // Fl_Output* o
	{ Fl_File_Browser* o = new Fl_File_Browser(5, 30, 210, 125);
	  o->load("/");
	} // Fl_File_Browser* o
	{ Fl_Check_Browser* o = new Fl_Check_Browser(220, 30, 225, 125);
	  o->add("foo");
	  o->add("foo");
	  o->add("foo");
	} // Fl_Check_Browser* o
	{ Fl_Progress* o = new Fl_Progress(5, 160, 210, 25, "progress bar");
	  o->value(50);
	} // Fl_Progress* o
	{ Fl_Slider* o = new Fl_Slider(220, 160, 225, 25);
	  o->type(1);
	  o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
	} // Fl_Slider* o
	{ new Fl_Light_Button(5, 225, 90, 25, "button");
	} // Fl_Light_Button* o
	{ Fl_Check_Button* o = new Fl_Check_Button(5, 255, 90, 25, "check");
	  o->down_box(FL_DOWN_BOX);
	} // Fl_Check_Button* o
	{ Fl_File_Input* o = new Fl_File_Input(160, 256, 285, 35, "file:");
	  o->value("/home/foo/baz/taz.txt");
	} // Fl_File_Input* o
	{ Fl_Text_Editor* o = new Fl_Text_Editor(160, 325, 285, 115, "Text editor");
	  o->buffer(new Fl_Text_Buffer());
	} // Fl_Text_Editor* o
	{ Fl_Box* o = new Fl_Box(25, 328, 80, 80, "image");
	  IconLoader::set(o, "utilities-terminal", ICON_SIZE_MEDIUM);
	} // Fl_Box* o
	win->end();
	win->show(argc, argv);

	Fl::run();
	ThemeLoader::shutdown();
	IconLoader::shutdown();
	return 0;
}
Example #5
0
void window::cb_startup(Fl_Widget *widget, void *v)
{
	Fl_Check_Button *checkbox = (Fl_Check_Button*)widget;
	int result = registry::startup_save(checkbox->value());

	if (result != ERROR_SUCCESS)
		checkbox->deactivate();
}
Example #6
0
	void shop_only12_callback(Fl_Widget* widget) {
		Fl_Check_Button* check = dynamic_cast<Fl_Check_Button*>(widget);
		std::shared_ptr<ShopContentsPatch> som = std::dynamic_pointer_cast<ShopContentsPatch>(mods->get("smo"));
		
		if(check->value()) {
			som->set_levels(4);
		}
		else {
			som->set_levels(0xFFFFFFFF);
		}
	}
				void Init() {

					cWindow = new Fl_Window(400, 420, 300, 70, "Connect to Host");
					bInput = new Fl_Input(50, 0, 150, 30, "Host: ");
					checkbx = new Fl_Check_Button(50, 40, 100, 14, " Scaling");
					checkbx->align(FL_ALIGN_LEFT);
					checkbx->callback(setscale, this);
					connectbtn = new Fl_Button(200, 0, 80, 30, "Connect");
					connectbtn->callback(try_connect_frm, this);
					cWindow->end();
					cWindow->show();

				}
Example #8
0
	void unstable_check_callback(Fl_Widget* widget) {
		std::shared_ptr<AppendAIPatch> aip = std::dynamic_pointer_cast<AppendAIPatch>(mods->get("aip"));
		Fl_Check_Button* unstable = dynamic_cast<Fl_Check_Button*>(widget);
		if(unstable->value()) {
			AppendAIPatch::entity_storage stor;
			stor.push_back(ENTITY_PIRANHA);
			stor.push_back(ENTITY_FISH_CRITTER);
			stor.push_back(ENTITY_PIRANHA_CRITTER);
			aip->set_ignored_entities(stor);
		}
		else {
			aip->set_ignored_entities(AppendAIPatch::entity_storage());
		}
	}
Example #9
0
static void onelab_number_check_button_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_Check_Button *o = (Fl_Check_Button*)w;
    onelab::number old = numbers[0];
    numbers[0].setValue(o->value());
    setGmshOption(numbers[0]);
    OnelabDatabase::instance()->set(numbers[0], std::string("localGUI"));
    autoCheck(old, numbers[0]);
  }
}
Example #10
0
static void dpms_enable_cb(Fl_Widget* w, void* s) {
	Fl_Check_Button* o = (Fl_Check_Button*)w;
	SaverPrefs* sp = (SaverPrefs*)s;

	if(o->value()) {
		standby_val->activate();
		suspend_val->activate();
		off_val->activate();
	} else {
		standby_val->deactivate();
		suspend_val->deactivate();
		off_val->deactivate();
	}

	sp->dpms_enabled = o->value();
}
Example #11
0
//-----------------------------------------------------------------------------
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();
}
Example #12
0
void onelab_listen_udt_cb(Fl_Widget *w, void *data)
{
  Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
  Fl_Input *sockUDT = (Fl_Input *)data;
  if(checkbutton->value() == 1) {
    sockUDT->deactivate();
    CTX::instance()->onelab.udtSock = sockUDT->value();
    std::size_t colon = CTX::instance()->onelab.udtSock.find(":");
    OnelabServer::instance()->listenOnTcp(
      ip4_inet_pton(CTX::instance()->onelab.udtSock.substr(0, colon).c_str()),
      atoi(CTX::instance()->onelab.udtSock.substr(colon+1, CTX::instance()->onelab.udtSock.size()-colon-1).c_str()));
  }
  else {
    sockUDT->activate();
    OnelabServer::instance()->stopUdt();
  }
}
Example #13
0
void onelab_listen_unix_cb(Fl_Widget *w, void *data)
{
  Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
  Fl_Input *sockUNIX = (Fl_Input *)data;
  if(checkbutton->value() == 1) {
    sockUNIX->deactivate();
    CTX::instance()->onelab.unixSock = sockUNIX->value();
    std::size_t colon = CTX::instance()->onelab.unixSock.find(":");
    std::ostringstream tmp;
    tmp << CTX::instance()->homeDir << CTX::instance()->onelab.unixSock;
    OnelabServer::instance()->listenOnUnix(tmp.str().c_str());
  }
  else {
    sockUNIX->activate();
    OnelabServer::instance()->stopUnix();
  }
}
Example #14
0
//-----------------------------------------------------------------------------
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;
	}
}
Example #15
0
/*
  Called everytime we click the refresh button. This will request all participants
  and update the UI.
 */ 
void SelectorGUI::update(){
  int x = 40;
  int y = 10;
  int dy = 20; 
  int i = 0;
  int len = 0;
  
  swindow->clear();
  swindow->redraw();
  swindow->begin();
  
  len = GetParticipants(pList);
  
  for(i; i < len; i ++){
    ssrcList[i] = (char*)pList[i].ssrc;
    Fl_Check_Button* b = new Fl_Check_Button(x, y, 300, 30, pList[i].name);
    b->callback(static_selectCB, (void*) pList[i].ssrc);
    b->type(102);
    y = y + dy;
  }
  swindow->end();
  swindow->redraw();
}
Example #16
0
//==== Create & Init Gui CheckButton  ====//
void GroupLayout::AddButton( CheckButton& cbutton, const char* label )
{
    assert( m_Group && m_Screen );

    //==== Add Check Button ====//
    int bw = FitWidth( 0, m_ButtonWidth );
    Fl_Check_Button* flbutton = new Fl_Check_Button( m_X, m_Y, bw, m_StdHeight, label );
    flbutton->box( FL_DOWN_BOX );
    flbutton->down_box( FL_DOWN_BOX );
    flbutton->labelfont( 1 );
    flbutton->labelsize( 12 );
    flbutton->labelcolor( FL_DARK_BLUE );
    flbutton->copy_label( label );
    m_Group->add( flbutton );
    AddX( bw );

    AddY( m_StdHeight );
    NewLineX();

    cbutton.Init( m_Screen, flbutton );
}
Example #17
0
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();
}
Example #18
0
// 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;
}
Example #19
0
void window::cb_whitelist(Fl_Widget *widget, void *v)
{
	Fl_Check_Button *checkbox = (Fl_Check_Button*)widget;
	set.whitelist = checkbox->value() != 0;
}
Example #20
0
void ModelerUserInterface::pickGroupProperty(GroupProperty* group) {
	// Remove the event listeners for old controls
	// TODO: we really need to have a PropertyEditor class that handles this
	// automatically...
	if (currentGroup) {
		PropertyList* props = currentGroup->getProperties();
		for (PropertyList::iterator iter = props->begin();
			 iter != props->end();
			 iter++)
		{
			if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateRangeSlider);
			} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateColorChooser);
			} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateCheckbox);
			} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateChoice);
			}
		}

		// Clear out the old controls
		m_controlsPack->clear();

		currentGroup = NULL;
	}

	// Reset the scrollbar
	m_controlsScroll->position(0, 0);

	// If there's no group, exit
	if (!group) {
		m_controlsScroll->redraw();
		return;
	}

	// Constants for slider dimensions
	const int packWidth = m_controlsPack->w();
	const int textHeight = 20;
	const int sliderHeight = 20;
	const int chooserHeight = 100;
	const int buttonHeight = 20;

	// Show them
	// For each control, add appropriate objects to the user interface
	currentGroup = group;
	PropertyList* props = group->getProperties();
	for (PropertyList::iterator iter = props->begin();
		 iter != props->end();
		 iter++)
    {
		// Ignore it if it's a group property (those belong in the tree).
		if (dynamic_cast<GroupProperty*>(*iter))
			continue;

		// And now we'll create a UI element for the property.
		// The big if-statement below uses dynamic_cast<PropertyType*>(ptr),
		// to see if a property has a given type.  dynamic_cast will
		// return 0 if ptr is not of type PropertyType.

		// Add a slider if the property is a RangeProperty
		if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
			// Add the label
			Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
			box->labelsize(14);
			box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
			box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
			m_controlsPack->add(box);

			// Add the slider
			Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight);
			slider->type(1);
			slider->range(prop->getMin(), prop->getMax());
			slider->step(prop->getStep());
			slider->value(prop->getValue());
			m_controlsPack->add(slider);

			// Use the step size to determine the number of decimal places
			// shown in the slider's label.
			if (prop->getStep() > 0) {
			  slider->precision((int)-log(prop->getStep()));
			}

			// Have the slider notify the program when it changes
			slider->callback((Fl_Callback*)SliderCallback, (void*) prop);

			

			// Have the property notify the slider when it changes
			prop->listen((SignalListener)updateRangeSlider, (void*) slider);

		// Add a color picker if the property is an RGB property
		} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
			// Add the label
			Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
			box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
			box->labelsize(14);
			box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
			m_controlsPack->add(box);

			// Add a color chooser
			Fl_Color_Chooser* chooser = new Fl_Color_Chooser(0, 0, packWidth,
				chooserHeight);
			chooser->rgb(prop->getRed(), prop->getGreen(), prop->getBlue());
			m_controlsPack->add(chooser);

			// Have the chooser notify the program when it changes
			chooser->callback((Fl_Callback*)ColorPickerCallback, (void*) prop);

			// Remove any existing color chooser listeners on the property
			prop->unlisten((SignalListener)updateColorChooser);

			// Have the property notify the chooser when it changes
			prop->listen((SignalListener)updateColorChooser, (void*) chooser);

		// Add a checkbox if the property is a boolean property
		} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
			// Add the checkbox -- no label needed!
			Fl_Check_Button* btn = new Fl_Check_Button(0, 0, packWidth, buttonHeight,
				prop->getName());
			btn->labelsize(14);
			btn->type(FL_TOGGLE_BUTTON);
			btn->value(prop->getValue());
			m_controlsPack->add(btn);

			// Have the button notify the program when it changes
			btn->callback((Fl_Callback*)ButtonCallback, (void*) prop);

			// Remove any existing color chooser listeners on the property
			prop->unlisten((SignalListener)updateCheckbox);

			// Have the property notify the chooser when it changes
			prop->listen((SignalListener)updateCheckbox, (void*) btn);

		// Add radio buttons if the property is a choice property
		} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
			// Add the label
			Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
			box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
			box->labelsize(14);
			box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
			m_controlsPack->add(box);

			// Add a group
			Fl_Pack* pack = new Fl_Pack(0, 0, packWidth, buttonHeight);
			pack->type(Fl_Pack::VERTICAL);
			pack->box(FL_THIN_DOWN_FRAME);
			pack->user_data((void*) prop);

			// Add the radio buttons
			const char* choices = prop->getLabels();
			int start = 0, end = -1, index = 0;
			do {
				end++;
				if (choices[end] == 0 || choices[end] == '|') {
					string str(choices, start, end - start);
					Fl_Button* btn = new Fl_Round_Button(0, 0, packWidth, buttonHeight,
						prop->getName());
					btn->type(FL_RADIO_BUTTON);
					btn->copy_label(str.c_str());
					btn->value(prop->getValue() == index);

					// Have the button notify the program when it changes
					btn->callback((Fl_Callback*)ChoiceCallback, (void*)index);

					index++;
					start = end + 1;
				}
			} while (choices[end] != 0);

			pack->end();
			m_controlsPack->add(pack);

			// Remove any existing choce listeners on the property
			prop->unlisten((SignalListener)updateChoice);

			// Have the property update the choices when it changes
			prop->listen((SignalListener)updateChoice, (void*) pack);
		}
    }
	m_controlsScroll->redraw();
}
Example #21
0
Fl_Double_Window* FilterUI::make_formant_window() {
  { formantparswindow = new Fl_Double_Window(700, 205, "Formant Filter Parameters");
    formantparswindow->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(485, 47, 105, 113);
      o->box(FL_THIN_UP_BOX);
      { Fl_Counter* o = new Fl_Counter(545, 80, 40, 15, "Formant ");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textsize(10);
        o->callback((Fl_Callback*)cb_Formant);
        o->align(FL_ALIGN_LEFT);
        o->bounds(0,FF_MAX_FORMANTS-1);
        o->value(nformant);
      } // Fl_Counter* o
      { Fl_Counter* o = new Fl_Counter(545, 55, 40, 20, "Vowel no.");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textfont(1);
        o->textsize(11);
        o->callback((Fl_Callback*)cb_Vowel);
        o->align(FL_ALIGN_LEFT);
        o->bounds(0,FF_MAX_VOWELS-1);
        o->value(nvowel);
      } // Fl_Counter* o
      { formantparsgroup = new Fl_Group(490, 105, 95, 50);
        formantparsgroup->box(FL_ENGRAVED_FRAME);
        { formant_freq_dial = new WidgetPDial(495, 115, 25, 25, "freq");
          formant_freq_dial->tooltip("Formant frequency");
          formant_freq_dial->box(FL_ROUND_UP_BOX);
          formant_freq_dial->color(FL_BACKGROUND_COLOR);
          formant_freq_dial->selection_color(FL_INACTIVE_COLOR);
          formant_freq_dial->labeltype(FL_NORMAL_LABEL);
          formant_freq_dial->labelfont(0);
          formant_freq_dial->labelsize(10);
          formant_freq_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_freq_dial->maximum(127);
          formant_freq_dial->step(1);
          formant_freq_dial->callback((Fl_Callback*)cb_formant_freq_dial);
          formant_freq_dial->align(FL_ALIGN_BOTTOM);
          formant_freq_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_freq_dial
        { formant_q_dial = new WidgetPDial(525, 115, 24, 25, "Q");
          formant_q_dial->tooltip("Formant\'s Q");
          formant_q_dial->box(FL_ROUND_UP_BOX);
          formant_q_dial->color(FL_BACKGROUND_COLOR);
          formant_q_dial->selection_color(FL_INACTIVE_COLOR);
          formant_q_dial->labeltype(FL_NORMAL_LABEL);
          formant_q_dial->labelfont(0);
          formant_q_dial->labelsize(10);
          formant_q_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_q_dial->maximum(127);
          formant_q_dial->step(1);
          formant_q_dial->callback((Fl_Callback*)cb_formant_q_dial);
          formant_q_dial->align(FL_ALIGN_BOTTOM);
          formant_q_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_q_dial
        { formant_amp_dial = new WidgetPDial(555, 115, 24, 25, "amp");
          formant_amp_dial->tooltip("Formant amplitude");
          formant_amp_dial->box(FL_ROUND_UP_BOX);
          formant_amp_dial->color(FL_BACKGROUND_COLOR);
          formant_amp_dial->selection_color(FL_INACTIVE_COLOR);
          formant_amp_dial->labeltype(FL_NORMAL_LABEL);
          formant_amp_dial->labelfont(0);
          formant_amp_dial->labelsize(10);
          formant_amp_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_amp_dial->maximum(127);
          formant_amp_dial->step(1);
          formant_amp_dial->callback((Fl_Callback*)cb_formant_amp_dial);
          formant_amp_dial->align(FL_ALIGN_BOTTOM);
          formant_amp_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_amp_dial
        formantparsgroup->end();
      } // Fl_Group* formantparsgroup
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(590, 47, 100, 113);
      o->box(FL_THIN_UP_BOX);
      { Fl_Counter* o = new Fl_Counter(595, 62, 55, 20, "Seq.Size");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textfont(1);
        o->textsize(11);
        o->callback((Fl_Callback*)cb_Seq);
        o->align(FL_ALIGN_TOP_LEFT);
        o->bounds(1,FF_MAX_SEQUENCE-1);
        o->value(pars->Psequencesize);
      } // Fl_Counter* o
      { Fl_Counter* o = new Fl_Counter(595, 97, 40, 15, "S.Pos.");
        o->tooltip("Current position from the sequence");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textsize(10);
        o->callback((Fl_Callback*)cb_S);
        o->align(FL_ALIGN_TOP_RIGHT);
        o->bounds(0,FF_MAX_SEQUENCE-2);
        o->value(nseqpos);
      } // Fl_Counter* o
      { Fl_Counter* o = vowel_counter = new Fl_Counter(640, 97, 40, 15, "Vowel");
        vowel_counter->type(1);
        vowel_counter->labelsize(10);
        vowel_counter->minimum(0);
        vowel_counter->maximum(127);
        vowel_counter->step(1);
        vowel_counter->textsize(10);
        vowel_counter->callback((Fl_Callback*)cb_vowel_counter);
        vowel_counter->align(FL_ALIGN_TOP);
        o->bounds(0,FF_MAX_VOWELS-1);
      } // Fl_Counter* vowel_counter
      { Fl_Check_Button* o = new Fl_Check_Button(625, 132, 60, 20, "Neg.Input");
        o->tooltip("Negate the input from LFO/envelopes/etc.");
        o->down_box(FL_DOWN_BOX);
        o->labelsize(10);
        o->callback((Fl_Callback*)cb_Neg);
        o->value(pars->Psequencereversed);
      } // Fl_Check_Button* o
      { WidgetPDial* o = strchdial = new WidgetPDial(595, 130, 25, 25, "Strch");
        strchdial->tooltip("Sequence Stretch");
        strchdial->box(FL_ROUND_UP_BOX);
        strchdial->color(FL_BACKGROUND_COLOR);
        strchdial->selection_color(FL_INACTIVE_COLOR);
        strchdial->labeltype(FL_NORMAL_LABEL);
        strchdial->labelfont(0);
        strchdial->labelsize(10);
        strchdial->labelcolor(FL_FOREGROUND_COLOR);
        strchdial->maximum(127);
        strchdial->step(1);
        strchdial->callback((Fl_Callback*)cb_strchdial);
        strchdial->align(FL_ALIGN_TOP);
        strchdial->when(FL_WHEN_CHANGED);
        o->value(pars->Psequencestretch);
      } // WidgetPDial* strchdial
      o->end();
    } // Fl_Group* o
    { Fl_Counter* o = new Fl_Counter(485, 15, 65, 20, "Num.Formants");
      o->type(1);
      o->labelfont(1);
      o->labelsize(10);
      o->minimum(0);
      o->maximum(127);
      o->step(1);
      o->callback((Fl_Callback*)cb_Num);
      o->align(FL_ALIGN_TOP_LEFT);
      o->bounds(1,FF_MAX_FORMANTS);
      o->value(pars->Pnumformants);
    } // Fl_Counter* o
    { WidgetPDial* o = frsldial = new WidgetPDial(565, 15, 25, 25, "Fr.Sl.");
      frsldial->tooltip("Formant\'s Slowness (Morphing)");
      frsldial->box(FL_ROUND_UP_BOX);
      frsldial->color(FL_BACKGROUND_COLOR);
      frsldial->selection_color(FL_INACTIVE_COLOR);
      frsldial->labeltype(FL_NORMAL_LABEL);
      frsldial->labelfont(1);
      frsldial->labelsize(10);
      frsldial->labelcolor(FL_FOREGROUND_COLOR);
      frsldial->maximum(127);
      frsldial->step(1);
      frsldial->callback((Fl_Callback*)cb_frsldial);
      frsldial->align(FL_ALIGN_TOP);
      frsldial->when(FL_WHEN_CHANGED);
      o->value(pars->Pformantslowness);
    } // WidgetPDial* frsldial
    { Fl_Value_Output* o = centerfreqvo = new Fl_Value_Output(515, 164, 33, 18, "C.f.");
      centerfreqvo->tooltip("Center Frequency (kHz)");
      centerfreqvo->minimum(1);
      centerfreqvo->maximum(10);
      centerfreqvo->step(0.01);
      centerfreqvo->value(1);
      centerfreqvo->textfont(1);
      centerfreqvo->callback((Fl_Callback*)cb_centerfreqvo);
      centerfreqvo->when(3);
      o->value(pars->getcenterfreq()/1000.0);
    } // Fl_Value_Output* centerfreqvo
    { Fl_Value_Output* o = octavesfreqvo = new Fl_Value_Output(515, 182, 33, 18, "Oct.");
      octavesfreqvo->tooltip("No. of octaves");
      octavesfreqvo->minimum(1);
      octavesfreqvo->maximum(127);
      octavesfreqvo->step(1);
      octavesfreqvo->value(5);
      octavesfreqvo->textfont(1);
      octavesfreqvo->callback((Fl_Callback*)cb_octavesfreqvo);
      octavesfreqvo->when(3);
      o->value(pars->getoctavesfreq());
    } // Fl_Value_Output* octavesfreqvo
    { Fl_Slider* o = cfknob = new Fl_Slider(551, 167, 84, 15);
      cfknob->type(5);
      cfknob->box(FL_FLAT_BOX);
      cfknob->maximum(127);
      cfknob->callback((Fl_Callback*)cb_cfknob);
      o->value(pars->Pcenterfreq);
    } // Fl_Slider* cfknob
    { Fl_Slider* o = octknob = new Fl_Slider(551, 185, 84, 15);
      octknob->type(5);
      octknob->box(FL_FLAT_BOX);
      octknob->maximum(127);
      octknob->callback((Fl_Callback*)cb_octknob);
      o->value(pars->Poctavesfreq);
    } // Fl_Slider* octknob
    { FormantFilterGraph* o = formantfiltergraph = new FormantFilterGraph(5, 5, 475, 195);
      formantfiltergraph->box(FL_BORDER_BOX);
      formantfiltergraph->color(FL_BACKGROUND_COLOR);
      formantfiltergraph->selection_color(FL_BACKGROUND_COLOR);
      formantfiltergraph->labeltype(FL_NORMAL_LABEL);
      formantfiltergraph->labelfont(0);
      formantfiltergraph->labelsize(14);
      formantfiltergraph->labelcolor(FL_FOREGROUND_COLOR);
      formantfiltergraph->align(FL_ALIGN_CENTER);
      formantfiltergraph->when(FL_WHEN_RELEASE);
      o->init(pars,&nvowel,&nformant);
    } // FormantFilterGraph* formantfiltergraph
    { WidgetPDial* o = wvknob = new WidgetPDial(600, 15, 25, 25, "Vw.Cl.");
      wvknob->tooltip("Vowel \"clearness\" (how the mixed vowels are avoided)");
      wvknob->box(FL_ROUND_UP_BOX);
      wvknob->color(FL_BACKGROUND_COLOR);
      wvknob->selection_color(FL_INACTIVE_COLOR);
      wvknob->labeltype(FL_NORMAL_LABEL);
      wvknob->labelfont(1);
      wvknob->labelsize(10);
      wvknob->labelcolor(FL_FOREGROUND_COLOR);
      wvknob->maximum(127);
      wvknob->step(1);
      wvknob->callback((Fl_Callback*)cb_wvknob);
      wvknob->align(FL_ALIGN_TOP);
      wvknob->when(FL_WHEN_CHANGED);
      o->value(pars->Pvowelclearness);
    } // WidgetPDial* wvknob
    { Fl_Button* o = new Fl_Button(645, 180, 50, 25, "Close");
      o->box(FL_THIN_UP_BOX);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(635, 25, 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_C1);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(665, 25, 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_P1);
    } // Fl_Button* o
    { new Fl_Box(635, 10, 55, 15, "Vowel");
    } // Fl_Box* o
    formantparswindow->end();
  } // Fl_Double_Window* formantparswindow
  return formantparswindow;
}
Example #22
0
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;
}
// turns on and off the autoresize mode (try it with a small number of keys): value is given by
// the Fl_Check_Button check_autoresize
void autoresize_cb(Fl_Widget* w, void* p) {
    Fl_Check_Button* cb = (Fl_Check_Button*) w;
    kb->resize_mode(cb->value());
}
Example #24
0
void window::cb_display(Fl_Widget *widget, void *v)
{
	Fl_Check_Button *checkbox = (Fl_Check_Button*)widget;
	set.mode_display = checkbox->value() != 0;
}
Example #25
0
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;
}
Example #26
0
Fl_Double_Window* UserInterface::make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_mainWindow = new Fl_Double_Window(797, 595, "Mesh viewer");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(0, 22, 125, 506, "Camera controls");
      o->box(FL_ENGRAVED_BOX);
      { Fl_Slider* o = m_sldZoom = new Fl_Slider(16, 29, 95, 25, "Zoom");
        o->tooltip("Zoom camera in and out");
        o->type(1);
        o->minimum(0.0001);
        o->maximum(0.999);
        o->step(0.01);
        o->value(0.5);
        o->slider_size(0.040404);
        o->callback((Fl_Callback*)cb_m_sldZoom);
      }
      { Fl_Roller* o = m_rolRotAmt = new Fl_Roller(45, 333, 75, 20, "Rot. ");
        o->tooltip("Set rotation amount for key (j,k,i,m,r,R)");
        o->type(1);
        o->value(0.2);
        o->callback((Fl_Callback*)cb_m_rolRotAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Dial* o = m_dialSpin = new Fl_Dial(74, 91, 31, 30, "Spin");
        o->tooltip("Spin camera");
        o->step(0.05);
        o->callback((Fl_Callback*)cb_m_dialSpin);
      }
      { Fl_Adjuster* o = m_adjXTrans = new Fl_Adjuster(5, 223, 105, 17, "Move horiz");
        o->tooltip("Pan left/right");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjXTrans);
      }
      { Fl_Adjuster* o = m_adjYTrans = new Fl_Adjuster(5, 257, 105, 17, "Move vertical");
        o->tooltip("Camera up/down");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjYTrans);
      }
      { Fl_Adjuster* o = m_adjInOut = new Fl_Adjuster(5, 296, 105, 17, "In/Out");
        o->tooltip("Move camera in and out");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjInOut);
      }
      { Fl_Roller* o = m_rolTransAmt = new Fl_Roller(45, 358, 75, 15, "Trans.");
        o->tooltip("Change translation amount");
        o->type(1);
        o->maximum(10);
        o->value(0.1);
        o->callback((Fl_Callback*)cb_m_rolTransAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Button* o = new Fl_Button(24, 378, 65, 25, "Reset");
        o->tooltip("Reset camera");
        o->callback((Fl_Callback*)cb_Reset);
      }
      { Fl_Roller* o = m_rolUpDown = new Fl_Roller(15, 68, 20, 70, "Up/down");
        o->tooltip("Rotate the camera up/down");
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolUpDown);
      }
      { Fl_Roller* o = m_rolLeftRight = new Fl_Roller(16, 158, 85, 20, "Rot left/rignt");
        o->tooltip("Rotate left to right");
        o->type(1);
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolLeftRight);
      }
      { Fl_Button* o = new Fl_Button(5, 194, 35, 25, "Zero");
        o->tooltip("Zero trans sliders");
        o->callback((Fl_Callback*)cb_Zero);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 462, 20, 25, "IBar");
        o->down_box(FL_DOWN_BOX);
        o->value(1);
        o->callback((Fl_Callback*)cb_IBar);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 483, 25, 20, "Center obj");
        o->down_box(FL_DOWN_BOX);
        o->callback((Fl_Callback*)cb_Center);
      }
      o->end();
    }
    { JofGTIBar* o = m_view = new JofGTIBar(135, 3, 560, 557);
      Fl_Group::current()->resizable(o);
    }
    o->end();
  }
  return w;
}
Example #27
0
void window::cb_mouse(Fl_Widget *widget, void *v)
{
	Fl_Check_Button *checkbox = (Fl_Check_Button*)widget;
	set.mode_mouse = checkbox->value() != 0;
}
Example #28
0
	Fl_Double_Window* make_mods_window() {
		if(mods_window != nullptr) {
			delete (Fl_Double_Window*)mods_window;
			mods_window = nullptr;
		}

		std::shared_ptr<AppendAIPatch> aip = std::dynamic_pointer_cast<AppendAIPatch>(mods->get("aip"));

		Fl_Double_Window* w;
		{ Fl_Double_Window* o = new Fl_Double_Window(264, 340, "Special Mods");
		w = o;
		{ new DoneButton(5, 310, 255, 25, "Close Window");
		} // Fl_Button* o
		{ Fl_Check_Button* o = new ModCheckbox("dpos", 5, 10, 255, 15, "Dark ice caves and hell are possible");
		o->down_box(FL_DOWN_BOX);
		} // Fl_Check_Button* o
		{ Fl_Check_Button* o = new ModCheckbox("alld", 5, 30, 255, 15, "All levels are dark");
		o->down_box(FL_DOWN_BOX);
		} // Fl_Check_Button* o
		{ Fl_Check_Button* o = new ModCheckbox("smlt", 5, 50, 255, 15, "End Timer is not set to 99 minutes");
		  o->down_box(FL_DOWN_BOX);
		}
		{ Fl_Check_Button* o = new ModCheckbox("pret", 5, 70, 255, 15, "Display precise timer");
		  o->down_box(FL_DOWN_BOX);
		}
		{
			{ 
				init_appendai_choices();
				init_appendai_list();
			}
			{ Fl_Check_Button* o = new Fl_Check_Button(5, 172+40, 255, 15, "Piranhas unaffected (anti-crash)");
			  o->callback(unstable_check_callback);
			  if(aip->ignored_entities().size() > 0) {
				o->value(true);
			  }
			  else {
				o->value(false);
			  }
			}
		}

		std::shared_ptr<ShopContentsPatch> som = std::dynamic_pointer_cast<ShopContentsPatch>(mods->get("smo"));

		{ Fl_Group* o = new Fl_Group(5, 190+25+40, 255, 45, "Shop Mods");
		{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_JETPACK, 10, 195+25+40, 75, 15, "Jetpack");
			o->down_box(FL_DOWN_BOX);
		  } // Fl_Check_Button* o
		  { Fl_Check_Button* o = new ShopItemCheckbox(ITEM_TELEPORTER, 85, 195+25+40, 90, 15, "Teleporter");
			o->down_box(FL_DOWN_BOX);
		  } // Fl_Check_Button* o
		  { Fl_Check_Button* o = new ShopItemCheckbox(ITEM_COMPASS, 175, 195+25+40, 83, 15, "Compass");
			o->down_box(FL_DOWN_BOX);
		  } // Fl_Check_Button* o
		  { Fl_Check_Button* o = new ShopItemCheckbox(ITEM_MATTOCK, 10, 215+25+40, 85, 15, "Mattock");
		    o->down_box(FL_DOWN_BOX);
		  }
		  { Fl_Check_Button* o = new ShopItemCheckbox(ITEM_BOMB_BOX, 85, 215+25+40, 110, 15, "Bomb Box");
		    o->down_box(FL_DOWN_BOX);
		  }
		  { Fl_Check_Button* o = new Fl_Check_Button(175, 215+25+40, 110, 15, "1-2 Only");
			o->down_box(FL_DOWN_BOX);
			if(som->valid()) {
				o->value(som->levels() == 4);
				o->callback(shop_only12_callback);
			}
			else {
				o->deactivate();
			}
		  } // Fl_Check_Button* o
		  o->box(FL_UP_FRAME);
		  o->end();
			
		} // Fl_Group* o


		o->end();
		} // Fl_Double_Window* o

		mods_window = w;

		return w;
	}
Example #29
0
Fl_Double_Window* ResonanceUI::make_window() {
  { resonancewindow = new Fl_Double_Window(780, 305, "Resonance");
    resonancewindow->user_data((void*)(this));
    { khzvalue = new Fl_Value_Output(415, 264, 45, 18, "kHz");
      khzvalue->labelsize(12);
      khzvalue->minimum(0.001);
      khzvalue->maximum(48);
      khzvalue->step(0.01);
      khzvalue->textfont(1);
      khzvalue->textsize(12);
      khzvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* khzvalue
    { dbvalue = new Fl_Value_Output(415, 282, 45, 18, "dB");
      dbvalue->labelsize(12);
      dbvalue->minimum(-150);
      dbvalue->maximum(150);
      dbvalue->step(0.1);
      dbvalue->textfont(1);
      dbvalue->textsize(12);
      dbvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* dbvalue
    { Fl_Group* o = new Fl_Group(6, 5, 768, 256);
      o->box(FL_BORDER_BOX);
      rg=new ResonanceGraph(o->x(),o->y(),o->w(),o->h(),"");
      rg->init(respar,khzvalue,dbvalue);
      rg->show();
      o->end();
    } // Fl_Group* o
    { Fl_Button* o = new Fl_Button(690, 283, 84, 17, "Close");
      o->box(FL_THIN_UP_BOX);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 264, 66, 15, "Zero");
      o->tooltip("Clear the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Zero);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 282, 66, 18, "Smooth");
      o->tooltip("Smooth the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Smooth);
    } // Fl_Button* o
    { Fl_Check_Button* o = enabled = new Fl_Check_Button(6, 270, 78, 27, "Enable");
      enabled->box(FL_THIN_UP_BOX);
      enabled->down_box(FL_DOWN_BOX);
      enabled->callback((Fl_Callback*)cb_enabled);
      o->value(respar->Penabled);
    } // Fl_Check_Button* enabled
    { maxdb = new Fl_Roller(90, 282, 84, 15);
      maxdb->type(1);
      maxdb->minimum(1);
      maxdb->maximum(90);
      maxdb->step(1);
      maxdb->value(30);
      maxdb->callback((Fl_Callback*)cb_maxdb);
    } // Fl_Roller* maxdb
    { Fl_Value_Output* o = maxdbvo = new Fl_Value_Output(126, 264, 24, 18, "Max.");
      maxdbvo->tooltip("The Maximum amplitude (dB)");
      maxdbvo->labelsize(12);
      maxdbvo->minimum(1);
      maxdbvo->maximum(127);
      maxdbvo->step(1);
      maxdbvo->value(30);
      maxdbvo->textfont(1);
      maxdbvo->textsize(12);
      maxdbvo->callback((Fl_Callback*)cb_maxdbvo);
      o->value(respar->PmaxdB);
    } // Fl_Value_Output* maxdbvo
    { new Fl_Box(150, 264, 24, 18, "dB");
    } // Fl_Box* o
    { Fl_Value_Output* o = centerfreqvo = new Fl_Value_Output(210, 264, 33, 18, "C.f.");
      centerfreqvo->tooltip("Center Frequency (kHz)");
      centerfreqvo->labelsize(12);
      centerfreqvo->minimum(1);
      centerfreqvo->maximum(10);
      centerfreqvo->step(0.01);
      centerfreqvo->value(1);
      centerfreqvo->textfont(1);
      centerfreqvo->textsize(12);
      centerfreqvo->callback((Fl_Callback*)cb_centerfreqvo);
      centerfreqvo->when(3);
      o->value(respar->getcenterfreq()/1000.0);
    } // Fl_Value_Output* centerfreqvo
    { Fl_Value_Output* o = octavesfreqvo = new Fl_Value_Output(210, 282, 33, 18, "Oct.");
      octavesfreqvo->tooltip("No. of octaves");
      octavesfreqvo->labelsize(12);
      octavesfreqvo->minimum(1);
      octavesfreqvo->maximum(127);
      octavesfreqvo->step(1);
      octavesfreqvo->value(30);
      octavesfreqvo->textfont(1);
      octavesfreqvo->textsize(12);
      octavesfreqvo->callback((Fl_Callback*)cb_octavesfreqvo);
      octavesfreqvo->when(3);
      o->value(respar->getoctavesfreq());
    } // Fl_Value_Output* octavesfreqvo
    { Fl_Button* o = new Fl_Button(566, 276, 42, 12, "RND2");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND2);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(566, 264, 42, 12, "RND1");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND1);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(566, 288, 42, 12, "RND3");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND3);
    } // Fl_Button* o
    { Fl_Check_Button* o = p1st = new Fl_Check_Button(365, 285, 45, 15, "P.1st");
      p1st->tooltip("Protect the fundamental frequency (do not damp the first harmonic)");
      p1st->down_box(FL_DOWN_BOX);
      p1st->labelsize(10);
      p1st->callback((Fl_Callback*)cb_p1st);
      o->value(respar->Pprotectthefundamental);
    } // Fl_Check_Button* p1st
    { Fl_Button* o = new Fl_Button(365, 265, 46, 15, "InterpP");
      o->tooltip("Interpolate the peaks");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_InterpP);
    } // Fl_Button* o
    { WidgetPDial* o = centerfreq = new WidgetPDial(master, 245, 265, 30, 30, "C.f.");
      centerfreq->box(FL_ROUND_UP_BOX);
      centerfreq->color(FL_BACKGROUND_COLOR);
      centerfreq->selection_color(FL_INACTIVE_COLOR);
      centerfreq->labeltype(FL_NORMAL_LABEL);
      centerfreq->labelfont(0);
      centerfreq->labelsize(10);
      centerfreq->labelcolor(FL_FOREGROUND_COLOR);
      centerfreq->maximum(127);
      centerfreq->step(1);
      centerfreq->callback((Fl_Callback*)cb_centerfreq);
      centerfreq->align(FL_ALIGN_BOTTOM);
      centerfreq->when(FL_WHEN_CHANGED);
      o->value(respar->Pcenterfreq);
    } // WidgetPDial* centerfreq
    { WidgetPDial* o = octavesfreq = new WidgetPDial(master, 280, 265, 30, 30, "Oct.");
      octavesfreq->box(FL_ROUND_UP_BOX);
      octavesfreq->color(FL_BACKGROUND_COLOR);
      octavesfreq->selection_color(FL_INACTIVE_COLOR);
      octavesfreq->labeltype(FL_NORMAL_LABEL);
      octavesfreq->labelfont(0);
      octavesfreq->labelsize(10);
      octavesfreq->labelcolor(FL_FOREGROUND_COLOR);
      octavesfreq->maximum(127);
      octavesfreq->step(1);
      octavesfreq->callback((Fl_Callback*)cb_octavesfreq);
      octavesfreq->align(FL_ALIGN_BOTTOM);
      octavesfreq->when(FL_WHEN_CHANGED);
      o->value(respar->Poctavesfreq);
    } // WidgetPDial* octavesfreq
    { Fl_Button* o = new Fl_Button(625, 275, 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(655, 275, 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
    { applybutton = new Fl_Button(690, 265, 85, 15, "Apply");
      applybutton->box(FL_THIN_UP_BOX);
      applybutton->labelfont(1);
      applybutton->labelsize(11);
      applybutton->callback((Fl_Callback*)cb_applybutton);
    } // Fl_Button* applybutton
    resonancewindow->end();
  } // Fl_Double_Window* resonancewindow
  return resonancewindow;
}
Example #30
0
edisplayconf::edisplayconf() {
  Fl_Window* w;
   {Fl_Window* o = win = new Fl_Window(265, 335, _("Display configuration"));
    w = o;
    o->callback((Fl_Callback*)cb_win, (void*)(this));
     {Fl_Tabs* o = new Fl_Tabs(5, 5, 255, 285);
       {Fl_Group* o = group_mouse = new Fl_Group(0, 20, 255, 265, _("Mouse"));
        o->align(FL_ALIGN_LEFT);
         {Fl_Value_Slider* o = slider_accel = new Fl_Value_Slider(25, 25, 220, 18, _("Acceleration"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(10);
          o->step(1);
          o->value(2);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_thresh = new Fl_Value_Slider(25, 65, 220, 18, _("Threshold (pixels)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(20);
          o->step(1);
          o->value(4);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_bell = new Fl_Group(0, 20, 255, 265, _("Bell"));
        o->hide();
         {Fl_Value_Slider* o = slider_volume = new Fl_Value_Slider(25, 25, 220, 18, _("Volume in %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_pitch = new Fl_Value_Slider(25, 70, 220, 18, _("Pitch in Hz"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(100);
          o->maximum(1000);
          o->step(1);
          o->value(440);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_duration = new Fl_Value_Slider(25, 115, 220, 18, _("Duration in ms"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(1000);
          o->step(1);
          o->value(200);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Button* o = new Fl_Button(180, 165, 60, 25, _("Test"));
          o->callback((Fl_Callback*)cb_Test);
        }
        o->end();
      }
       {Fl_Group* o = group_keyboard = new Fl_Group(0, 20, 255, 265, _("Keyboard"));
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
        o->hide();
         {Fl_Check_Button* o = check_autorepeat = new Fl_Check_Button(24, 25, 221, 20, _("  Repeat key activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
         {Fl_Value_Slider* o = slider_click = new Fl_Value_Slider(25, 65, 220, 18, _("Click volume %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_screen = new Fl_Group(0, 20, 255, 265, _("Screen"));
        o->hide();
         {Fl_Button* o = but_activate = new Fl_Button(165, 187, 80, 25, _("&Test"));
          o->callback((Fl_Callback*)cb_but_activate);
        }
        new Fl_Box(10, 1, 234, 55);
         {Fl_Value_Slider* o = slider_delay = new Fl_Value_Slider(25, 77, 220, 18, _("Activation delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(5);
          o->maximum(120);
          o->step(1);
          o->value(15);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Check_Button* o = check_blanking = new Fl_Check_Button(23, 25, 222, 20, _(" Screen blanker activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
        new Fl_Box(10, 100, 234, 37);
         {Fl_Value_Slider* o = slider_pattern = new Fl_Value_Slider(25, 152, 220, 18, _("Pattern change delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(1);
          o->maximum(5);
          o->step(0);
          o->value(2);
          o->align(FL_ALIGN_TOP);
          o->deactivate();
        }
         {Fl_Group* o = new Fl_Group(30, 105, 210, 25);
           {Fl_Round_Button* o = radio_blank = new Fl_Round_Button(0, 5, 105, 20, _("Blank"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->value(1);
            o->callback((Fl_Callback*)cb_radio_blank);
          }
           {Fl_Round_Button* o = radio_pattern = new Fl_Round_Button(115, 5, 95, 20, _("Pattern"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->callback((Fl_Callback*)cb_radio_pattern);
          }
          o->end();
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(190, 300, 70, 25, _("&Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
      o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    }
     {Fl_Button* o = but_kbd_apply = new Fl_Button(115, 300, 70, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_but_kbd_apply);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(40, 300, 70, 25, _("OK"));
      o->shortcut(0xd);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
}