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 #2
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 #3
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 #4
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 #5
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 #6
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 #7
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 #8
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 #9
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 #10
0
int main(int argc, char **argv) {
	fl_open_display();
	/* start daemon if not started */
	xscreensaver_run_daemon(fl_display);

	SaverPrefs* sp = xscreensaver_read_config();

	main_win = new Fl_Double_Window(340, 445, _("Screensaver options"));
	/* so ESC does not interrupt running process */
	main_win->callback(close_cb);

	main_win->begin();
		/* monitor */
		Fl_Box* b1 = new Fl_Box(120, 163, 100, 15);
		b1->box(FL_BORDER_BOX);
		Fl_Box* b2 = new Fl_Box(65, 10, 210, 158);
		b2->box(FL_THIN_UP_BOX);

		Fl_Box* b3 = new Fl_Box(78, 20, 184, 138);
		b3->color(FL_BLACK);
		b3->box(FL_DOWN_BOX);

		/* preview window in 'b3' box */
		preview_win = new Fl_Double_Window(80, 22, 180, 134);
		preview_win->color(FL_BLACK);
		preview_win->begin();

		/* if failed to load any screensaver */
		if(!sp) {
			Fl_Box* b4 = new Fl_Box(0, 0, 180, 134, _("No screensavers found"));
			b4->labelcolor(FL_GRAY);
			b4->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP);
		}

		preview_win->end();

		Fl_Box* b4 = new Fl_Box(95, 173, 146, 14);
		b4->box(FL_THIN_UP_BOX);
		
		Fl_Group* g1 = new Fl_Group(10, 215, 320, 45, _("Screensaver"));
		g1->box(FL_ENGRAVED_BOX);
		g1->align(FL_ALIGN_TOP_LEFT);
		g1->begin();
			Fl_Choice* saver_list = new Fl_Choice(19, 225, 180, 25);
			saver_list->down_box(FL_BORDER_BOX);
			saver_list->add("(None)", 0, 0);

			if(sp) {
				int sel = 0;
				saver_list->callback((Fl_Callback*)choice_cb, sp);

				/* fix possible error */
				if(sp->curr_hack >= sp->hacks.size())
					sp->curr_hack = 0;

				HackListIter it = sp->hacks.begin(), it_end = sp->hacks.end();
				for(int i = 1; it != it_end; ++it, i++) {
					saver_list->add((*it)->name.c_str(), 0, 0);

					/*
					 * Check real hack index number against current one and let it match 
					 * position in our Fl_Choice list. Note that first item is '(None)'
					 * so 'i' starts from 1
					 */
					if(sp->mode != SAVER_OFF && (*it)->sindex == sp->curr_hack)
						sel = i;
				}

				saver_list->value(sel);
			}

			timeout_val = new Fl_Spinner(275, 226, 45, 25, _("Timeout:"));
			timeout_val->tooltip(_("Idle time in minutes after screensaver is started"));
			timeout_val->range(1, 500);
			if(sp)
				timeout_val->value(sp->timeout);
			else
				timeout_val->value(1);

		g1->end();

		Fl_Group* g2 = new Fl_Group(10, 290, 320, 110, _("Power management"));
		g2->box(FL_ENGRAVED_BOX);
		g2->align(FL_ALIGN_TOP_LEFT);
		g2->begin();
			Fl_Check_Button* denabled = new Fl_Check_Button(20, 299, 180, 26, _("Enabled"));
			denabled->down_box(FL_DOWN_BOX);
			denabled->tooltip(_("Enable or disable Display Power Management Signaling support"));
			if(sp) {
				denabled->callback((Fl_Callback*)dpms_enable_cb, sp);
				denabled->value(sp->dpms_enabled);
			} else {
				denabled->value(1);
			}

			Fl_Box* energy_image = new Fl_Box(20, 341, 75, 49);
			energy_image->image(image_energy);

			standby_val = new Fl_Spinner(275, 301, 45, 24, _("Standby:"));
			standby_val->tooltip(_("Minutes for standby"));
			standby_val->range(1, 500);
			if(sp)
				standby_val->value(sp->dpms_standby);
			else
				standby_val->value(1);

			suspend_val = new Fl_Spinner(275, 331, 45, 24, _("Suspend:"));
			suspend_val->tooltip(_("Minutes for suspend"));
			suspend_val->range(1, 500);
			if(sp)
				suspend_val->value(sp->dpms_suspend);
			else
				suspend_val->value(1);

			off_val = new Fl_Spinner(275, 360, 45, 24, _("Off:"));
			off_val->tooltip(_("Minutes to turn off the screen"));
			off_val->range(1, 500);
			if(sp)
				off_val->value(sp->dpms_off);
			else
				off_val->value(1);

			/* execute callback to apply changes before main_window is shown */
			denabled->do_callback();
		g2->end();

		Fl_Button* ok_button = new Fl_Button(145, 410, 90, 25, _("&OK"));
		ok_button->callback(ok_cb, sp);

		Fl_Button* close_button = new Fl_Button(240, 410, 90, 25, _("&Cancel"));
		close_button->callback(close_cb);
	main_win->end();

	main_win->show(argc, argv);
	/* run preview immediately */
	saver_list->do_callback();
	int ret = Fl::run();

	if(sp) {
		HackListIter it = sp->hacks.begin(), it_end = sp->hacks.end();
		for(; it != it_end; ++it)
			delete *it;
		delete sp;
	}

	return ret;
}
void editor::_editor() {
    //create the window
    keepUserdat=new std::vector<std::pair<unsigned,int64_t>>;
    luaCallback=new std::vector<std::pair<std::string,int64_t>>;
    startLuaConf();
    menu = new Fl_Menu_Bar(0,0,800,24);//Create menubar, items..
    lua_getglobal(Lconf,"generateMenu");
    runLuaFunc(Lconf,0,1);
    {   unsigned menucnt;
        std::vector<Fl_Menu_Item> tmp;
        if(!(menucnt=lua_rawlen(Lconf,-1))) {
            fl_alert("generateMenu must return a table");
            exit(1);
        }
        for(unsigned i=1; i<=menucnt; ++i) {
            lua_rawgeti(Lconf,-1,i);
            unsigned len=lua_rawlen(Lconf,-1);
            if(len) {
                Fl_Menu_Item mi{0};
                lua_rawgeti(Lconf,-1,1);
                char*txt=(char*)luaL_optstring(Lconf,-1,0);
                if(txt)
                    txt=strdup(txt);
                mi.text=txt;
                lua_pop(Lconf,1);
                if(len>=2) {
                    lua_rawgeti(Lconf,-1,2);
                    mi.shortcut_=luaL_optinteger(Lconf,-1,0);
                    lua_pop(Lconf,1);
                } else
                    mi.shortcut_=0;
                int64_t userdat;
                if(len>=4) {
                    lua_rawgeti(Lconf,-1,4);
                    userdat=luaL_optinteger(Lconf,-1,0);
                    lua_pop(Lconf,1);
                } else
                    userdat=0;

                if(len>=3) {
                    lua_rawgeti(Lconf,-1,3);
                    if(lua_type(Lconf,-1)==LUA_TSTRING) {
                        luaCallback->emplace_back(std::make_pair(lua_tostring(Lconf,-1),userdat));
                        mi.callback_=callLuaCB;
                        mi.user_data_=&(*luaCallback)[luaCallback->size()-1];
                    } else if(lua_type(Lconf,-1)==LUA_TNUMBER) {
                        int64_t lcall=lua_tointeger(Lconf,-1);
                        if(lcall>0) {
                            keepUserdat->emplace_back(std::make_pair(lcall-1,userdat));
                            mi.callback_=callCFuncLua;
                            mi.user_data_=&(*keepUserdat)[keepUserdat->size()-1];
                        } else
                            mi.callback_=0;
                    } else {
                        fl_alert("Error invalid type for callback %s",lua_typename(Lconf,lua_type(Lconf,-1)));
                        exit(1);
                    }
                    lua_pop(Lconf,1);
                } else {
                    mi.callback_=0;
                    mi.user_data_=0;
                }
                if(len>=5) {
                    lua_rawgeti(Lconf,-1,5);
                    mi.flags=luaL_optinteger(Lconf,-1,0);
                    lua_pop(Lconf,1);
                } else
                    mi.flags=0;
                tmp.emplace_back(mi);
            } else
                tmp.emplace_back(Fl_Menu_Item{0});
            lua_pop(Lconf,1);
        }
        unsigned cidx=0,lidx=0;
        for(unsigned i=0; i<menucnt; ++i) { //While resizing the vector the addresses may have changed.
            lua_rawgeti(Lconf,-1,i+1);
            unsigned len=lua_rawlen(Lconf,-1);
            if(len>=3) {
                lua_rawgeti(Lconf,-1,3);
                if(lua_type(Lconf,-1)==LUA_TSTRING) {
                    tmp[i].user_data_=&(*luaCallback)[lidx++];
                } else if(lua_type(Lconf,-1)==LUA_TNUMBER) {
                    int64_t lcall=lua_tointeger(Lconf,-1);
                    if(lcall>0)
                        tmp[i].user_data_=&(*keepUserdat)[cidx++];
                }
                lua_pop(Lconf,1);
            }
            lua_pop(Lconf,1);
        }
        lua_pop(Lconf,1);
        menu->copy(tmp.data());
    }
    tile_placer_tile_offset_y=default_tile_placer_tile_offset_y;
    true_color_box_x=default_true_color_box_x;
    true_color_box_y=default_true_color_box_y;
    tile_edit_truecolor_off_x=default_tile_edit_truecolor_off_x;
    tile_edit_truecolor_off_y=default_tile_edit_truecolor_off_y;
    std::fill(tabsHidden,&tabsHidden[shareAmtPj],false);
    {
        the_tabs = new Fl_Tabs(0, 24, 800, 576);
        the_tabs->callback(set_mode_tabs);
        int rx,ry,rw,rh;
        the_tabs->client_area(rx,ry,rw,rh);
        {
            tabsMain.emplace_back(new Fl_Group(rx, ry, rw, rh, "Palette editor"));
            //stuff related to this group should go here
            palBar.addTab(0,true);
            pal_size = new Fl_Hor_Value_Slider(128,384,320,24,"Palette box size");
            pal_size->minimum(1);
            pal_size->maximum(42);
            pal_size->step(1);
            pal_size->value(32);
            pal_size->align(FL_ALIGN_LEFT);
            pal_size->callback(redrawOnlyCB);
            ditherPower = new Fl_Hor_Value_Slider(128,416,320,24,"Dither Power");
            ditherPower->tooltip("A lower value results in more dithering artifacts a higher value results in less artifacts");
            ditherPower->minimum(1);
            ditherPower->maximum(256);
            ditherPower->step(1);
            ditherPower->value(16);
            ditherPower->align(FL_ALIGN_LEFT);
            ditherPower->callback(setSubditherSetting);
            gameSysSel=new Fl_Choice(96, 312, 192, 24);
            gameSysSel->copy(gameSysMenuSel);
            ditherAlgSel=new Fl_Choice(64, 464, 144, 24);
            ditherAlgSel->copy(ditherChoices);
            subSysC=new Fl_Choice(208, 464, 128, 24);
            subSysC->copy(subSysGenesis);
            subSysC->value(0);
            {   Fl_Group *o = new Fl_Group(306, 188, 88, 96);
                {
                    palType[0] = new Fl_Round_Button(306, 188, 64, 32, "Free");
                    palType[0]->type(FL_RADIO_BUTTON);
                    palType[0]->set();
                    palType[0]->callback((Fl_Callback*) setPalType,(void *)0);
                    palType[0]->tooltip(freeDes);
                    palType[1] = new Fl_Round_Button(306, 220, 72, 32, "Locked");
                    palType[1]->type(FL_RADIO_BUTTON);
                    palType[1]->callback((Fl_Callback*) setPalType,(void *)1);
                    palType[1]->tooltip(lockedDes);
                    palType[2] = new Fl_Round_Button(306, 252, 88, 32, "Reserved");
                    palType[2]->type(FL_RADIO_BUTTON);
                    palType[2]->callback((Fl_Callback*) setPalType,(void *)2);
                    palType[2]->tooltip(reservedDes);
                    o->end();
                } // End of buttons
            }//end of group

            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,pal_edit);
            runLuaFunc(Lconf,1,0);

            tabsMain[pal_edit]->end();
        } // Fl_Group* o
        {   tabsMain.emplace_back(new Fl_Group(rx, ry, rw, rh, "Tile editor"));
            //stuff related to this group should go here
            {   Fl_Group* o = new Fl_Group(0, 0, 800, 567);
                palRTE[0] = new Fl_Round_Button(384, default_palette_bar_offset_y+40, 56, 32, "Row 0");
                palRTE[0]->type(FL_RADIO_BUTTON);
                palRTE[0]->set();
                palRTE[0]->callback((Fl_Callback*) set_tile_row,(void *)0);
                palRTE[1] = new Fl_Round_Button(448, default_palette_bar_offset_y+40, 56, 32, "Row 1");
                palRTE[1]->type(FL_RADIO_BUTTON);
                palRTE[1]->callback((Fl_Callback*) set_tile_row,(void *)1);
                palRTE[2] = new Fl_Round_Button(512, default_palette_bar_offset_y+40, 56, 32, "Row 2");
                palRTE[2]->type(FL_RADIO_BUTTON);
                palRTE[2]->callback((Fl_Callback*) set_tile_row,(void *)2);
                palRTE[3] = new Fl_Round_Button(576, default_palette_bar_offset_y+40, 56, 32, "Row 3");
                palRTE[3]->type(FL_RADIO_BUTTON);
                palRTE[3]->callback((Fl_Callback*) set_tile_row,(void *)3);
                o->end();
            } // Fl_Group* o
            {   Fl_Button *o = new Fl_Button(538, default_palette_bar_offset_y, 104, 32, "Append tile");//these button should be inline with the palette bar
                o->tooltip("This will append a blank tile to the tile buffer in the ram.");
                o->callback(new_tile);
            }
            {   Fl_Button *o = new Fl_Button(656, default_palette_bar_offset_y, 140, 32, "Delete selected tile");
                o->tooltip("This button will delete the currently selected tile");
                o->callback(delete_tile_at_location);
                o->labelsize(12);
            }
            {   Fl_Button *o = new Fl_Button(656, default_palette_bar_offset_y+34,140, 32,"Insert after tile");
                o->callback(insertTileCB);
            }
            palBar.addTab(1);
            rgb_red = new Fl_Hor_Value_Slider(64,default_palette_bar_offset_y+136,128,24,"RGB red");
            rgb_red->minimum(0);
            rgb_red->maximum(255);
            rgb_red->step(1);
            rgb_red->value(0);
            rgb_red->align(FL_ALIGN_LEFT);
            rgb_red->callback(update_truecolor,(void *)0);
            rgb_green = new Fl_Hor_Value_Slider(240,default_palette_bar_offset_y+136,128,24,"Green");
            rgb_green->minimum(0);
            rgb_green->maximum(255);
            rgb_green->step(1);
            rgb_green->value(0);
            rgb_green->align(FL_ALIGN_LEFT);
            rgb_green->callback(update_truecolor,(void *)1);
            rgb_blue = new Fl_Hor_Value_Slider(402,default_palette_bar_offset_y+136,128,24,"Blue");
            rgb_blue->minimum(0);
            rgb_blue->maximum(255);
            rgb_blue->step(1);
            rgb_blue->value(0);
            rgb_blue->align(FL_ALIGN_LEFT);
            rgb_blue->callback(update_truecolor,(void *)2);
            rgb_alpha = new Fl_Hor_Value_Slider(576,default_palette_bar_offset_y+136,128,24,"Alpha");
            rgb_alpha->minimum(0);
            rgb_alpha->maximum(255);
            rgb_alpha->step(1);
            rgb_alpha->value(0);
            rgb_alpha->align(FL_ALIGN_LEFT);
            rgb_alpha->callback(update_truecolor,(void *)3);
            {   Fl_Group *o = new Fl_Group(304, 96, 88, 96);
                {
                    palType[3] = new Fl_Round_Button(304, 96, 64, 32, "Free");
                    palType[3]->type(FL_RADIO_BUTTON);
                    palType[3]->set();
                    palType[3]->callback((Fl_Callback*) setPalType,(void *)0);
                    palType[3]->tooltip(freeDes);
                    palType[4] = new Fl_Round_Button(304, 128, 72, 32, "Locked");
                    palType[4]->type(FL_RADIO_BUTTON);
                    palType[4]->callback((Fl_Callback*) setPalType,(void *)1);
                    palType[4]->tooltip(lockedDes);
                    palType[5] = new Fl_Round_Button(304, 160, 88, 32, "Reserved");
                    palType[5]->type(FL_RADIO_BUTTON);
                    palType[5]->callback((Fl_Callback*) setPalType,(void *)2);
                    palType[5]->tooltip(reservedDes);
                    o->end();
                } // End of buttons
            }//end of group
            {   Fl_Check_Button* o = new Fl_Check_Button(694,default_palette_bar_offset_y+68,100,32,"Show grid?");
                o->callback(set_grid);
                o->tooltip("This button Toggles weather or not you which to see a grid while editing your tiles. A grid can help you see the spacing between each pixel.");
            }
            tile_edit_offset_x=default_tile_edit_offset_x;
            tile_edit_offset_y=default_tile_edit_offset_y;
            tile_size = new Fl_Hor_Value_Slider(448,default_palette_bar_offset_y+72,242,24,"Tile zoom");
            tile_size->tooltip(TooltipZoom);
            tile_size->minimum(1);
            tile_size->maximum(64);
            tile_size->step(1);
            tile_size->value(46);
            tile_size->align(FL_ALIGN_LEFT);
            tile_size->callback(update_offset_tile_edit);
            //now for the tile select slider
            tile_select = new Fl_Hor_Value_Slider(480,default_palette_bar_offset_y+104,312,24,"Tile select");
            tile_select->tooltip("This slider selects which tile that you are editing the first tile is zero");
            tile_select->minimum(0);
            tile_select->maximum(0);
            tile_select->step(1);
            tile_select->align(FL_ALIGN_LEFT);
            tile_select->callback(set_tile_current);
            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,tile_edit);
            runLuaFunc(Lconf,1,0);
            tabsMain[tile_edit]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Plane mapping/block editor"));
            {   Fl_Group* o = new Fl_Group(tile_place_buttons_x_off, 192, 60, 128);
                palRTE[4] = new Fl_Round_Button(tile_place_buttons_x_off, 192, 60, 28, "Row 0");
                palRTE[4]->type(FL_RADIO_BUTTON);
                palRTE[4]->set();
                palRTE[4]->callback((Fl_Callback*) set_tile_row,(void *)0);
                palRTE[5] = new Fl_Round_Button(tile_place_buttons_x_off, 220, 60, 28, "Row 1");
                palRTE[5]->type(FL_RADIO_BUTTON);
                palRTE[5]->callback((Fl_Callback*) set_tile_row,(void *)1);
                palRTE[6] = new Fl_Round_Button(tile_place_buttons_x_off, 248, 60, 28, "Row 2");
                palRTE[6]->type(FL_RADIO_BUTTON);
                palRTE[6]->callback((Fl_Callback*) set_tile_row,(void *)2);
                palRTE[7] = new Fl_Round_Button(tile_place_buttons_x_off, 276, 60, 28, "Row 3");
                palRTE[7]->type(FL_RADIO_BUTTON);
                palRTE[7]->callback((Fl_Callback*) set_tile_row,(void *)3);
                o->end();
            } // Fl_Group* o


            planeSelect=new Fl_Choice(408,default_palette_bar_offset_y+56,112,24,"Plane selection");
            planeSelect->align(FL_ALIGN_TOP);

            {   Fl_Button *o = new Fl_Button(408, default_palette_bar_offset_y+80,112,24,"Add plane");
                o->callback(addPlaneTilemap);
            }

            {   Fl_Button *o = new Fl_Button(408, default_palette_bar_offset_y+104,112,24,"Remove plane");
                o->callback(removeTilemapsPlane);
            }

            curPlaneName = new Fl_Input(tile_place_buttons_x_off+616,56,168,24,"Plane name");
            curPlaneName->value("0");
            curPlaneName->callback(updateNameTilemaps);

            map_w = new Fl_Int_Input(608,default_palette_bar_offset_y+72,184,24,MapWidthTxt);
            map_w->when(FL_WHEN_ENTER_KEY);
            map_w->value("2");
            map_w->align(FL_ALIGN_LEFT);
            map_w->callback(callback_resize_map);
            map_h = new Fl_Int_Input(608,default_palette_bar_offset_y+104,184,24,MapHeightTxt);
            map_h->when(FL_WHEN_ENTER_KEY);
            map_h->value("2");
            map_h->align(FL_ALIGN_LEFT);
            map_h->callback(callback_resize_map);
            map_amt = new Fl_Int_Input(480,default_palette_bar_offset_y+136,312,24,"Blocks");
            map_amt->value("1");
            map_amt->align(FL_ALIGN_LEFT);
            map_amt->callback(blocksAmtCB);
            map_amt->hide();
            map_x_scroll = new Fl_Scrollbar(default_map_off_x-32, default_map_off_y-32, 800-8-default_map_off_x, 24);
            map_x_scroll->value(0,0,0,0);
            map_x_scroll->type(FL_HORIZONTAL);
            map_x_scroll->tooltip("Use this scroll bar to move around the tile map if you are zoomed in and there is not enough room to display the entire tilemap at once. This scroll bar will move the map left and right.");
            map_x_scroll->callback(update_map_scroll_x);
            map_x_scroll->hide();
            map_x_scroll->linesize(1);
            map_y_scroll = new Fl_Scrollbar(default_map_off_x-32, default_map_off_y, 24, 600-8-default_map_off_y);
            map_y_scroll->value(0,0,0,0);
            //map_x_scroll->type(FL_HORIZONTAL);
            map_y_scroll->tooltip("Use this scroll bar to move around the tile map if you are zoomed in and there is not enough room to display the entire tilemap at once. This scroll bar will move the map up and down.");
            map_y_scroll->callback(update_map_scroll_y);
            map_y_scroll->hide();
            map_y_scroll->linesize(1);
            //now for the tile select slider
            tile_select_2 = new Fl_Hor_Value_Slider(528,default_palette_bar_offset_y+40,264,24,"Tile select");
            tile_select_2->tooltip("This slider allows you to choice which tile you would like to place on the map remember you can both horizontally and vertically flip the tile once placed on the map and select which row the tile uses");
            tile_select_2->minimum(0);
            tile_select_2->maximum(0);
            tile_select_2->step(1);
            tile_select_2->align(FL_ALIGN_TOP_LEFT);
            tile_select_2->callback(set_tile_currentTP);
            totalTiles=new Fl_Box(600,default_palette_bar_offset_y,128,64);
            totalTiles->labelsize(12);
            palBar.addTab(2);
            //buttons for tile settings
            {   Fl_Group *o = new Fl_Group(304, 96, 88, 96);
                {
                    palType[6] = new Fl_Round_Button(304, 90, 64, 32, "Free");
                    palType[6]->type(FL_RADIO_BUTTON);
                    palType[6]->set();
                    palType[6]->callback((Fl_Callback*) setPalType,(void *)0);
                    palType[6]->tooltip(freeDes);
                    palType[7] = new Fl_Round_Button(304, 122, 72, 32, "Locked");
                    palType[7]->type(FL_RADIO_BUTTON);
                    palType[7]->callback((Fl_Callback*) setPalType,(void *)1);
                    palType[7]->tooltip(lockedDes);
                    palType[8] = new Fl_Round_Button(304, 154, 88, 32, "Reserved");
                    palType[8]->type(FL_RADIO_BUTTON);
                    palType[8]->callback((Fl_Callback*) setPalType,(void *)2);
                    palType[8]->tooltip(reservedDes);
                    o->end();
                } // End of buttons
            }//end of group

            hflipCB[0] = new Fl_Check_Button(tile_place_buttons_x_off,304,64,32,"Hflip");
            hflipCB[0]->callback(set_hflipCB,(void*)0);
            hflipCB[0]->tooltip("This sets whether or not the tile is flipped horizontally");
            vflipCB[0] = new Fl_Check_Button(tile_place_buttons_x_off,336,64,32,"Vflip");
            vflipCB[0]->callback(set_vflipCB,(void*)0);
            vflipCB[0]->tooltip("This sets whether or not the tile is flipped vertically");
            prioCB[0] = new Fl_Check_Button(tile_place_buttons_x_off,368,72,32,"Priority");
            prioCB[0]->callback(set_prioCB,(void*)0);
            prioCB[0]->tooltip("If checked tile is high priority");
            {   Fl_Check_Button* o = new Fl_Check_Button(tile_place_buttons_x_off,400,96,32,"Show grid?");
                o->callback(set_grid_placer);
                o->tooltip("This button toggles whether or not a grid is visible over the tile map this will allow you to easily see were each tile is");
            }
            BlocksCBtn = new Fl_Check_Button(tile_place_buttons_x_off,432,96,32,"Blocks?");
            BlocksCBtn->callback(toggleBlocksCB);
            BlocksCBtn->tooltip("Toggles if tile map is treated as blocks");
            {   Fl_Check_Button* o = new Fl_Check_Button(tile_place_buttons_x_off,464,192,32,"Show only selected row");
                o->callback(toggleRowSolo);
                o->tooltip("When checked tiles that do not use the selected row will not be drawn");
            }
            place_tile_size = new Fl_Hor_Value_Slider(tile_place_buttons_x_off,512,168,24,"Tile zoom factor:");
            place_tile_size->minimum(1);
            place_tile_size->maximum(16);
            place_tile_size->step(1);
            place_tile_size->value(12);
            place_tile_size->align(FL_ALIGN_TOP);
            place_tile_size->callback(update_map_size);
            place_tile_size->tooltip(TooltipZoom);

            tmapOffset = new Fl_Int_Input(tile_place_buttons_x_off,552,168,24,"Tile offset");
            tmapOffset->when(FL_WHEN_ENTER_KEY);
            tmapOffset->value("0");
            tmapOffset->align(FL_ALIGN_TOP);
            tmapOffset->callback(setTmapOffsetCB);

            cordDisp[0]=new Fl_Box(tile_place_buttons_x_off,556,128,64);
            cordDisp[0]->labelsize(12);

            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,tile_place);
            runLuaFunc(Lconf,1,0);
            tabsMain[tile_place]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Chunk editor"));
            useBlocksChunkCBtn=new Fl_Check_Button(8, 48, 152, 24, "Use blocks");
            useBlocksChunkCBtn->callback(useBlocksCB);

            chunkX = new Fl_Scrollbar(DefaultChunkX-32, DefaultChunkY-32, 800-DefaultChunkX+24, 24);
            chunkX->value(0,0,0,0);
            chunkX->type(FL_HORIZONTAL);
            chunkX->callback(scrollChunkX);
            chunkX->hide();

            chunkY = new Fl_Scrollbar(DefaultChunkX-32, DefaultChunkY, 24, 600-8-DefaultChunkY);
            chunkY->value(0,0,0,0);
            chunkY->callback(scrollChunkY);
            chunkY->hide();

            chunk_select = new Fl_Hor_Value_Slider(tile_place_buttons_x_off,88,160,24,"Chunk select");
            chunk_select->minimum(0);
            chunk_select->maximum(0);
            chunk_select->step(1);
            chunk_select->value(0);
            chunk_select->align(FL_ALIGN_TOP);
            chunk_select->callback(currentChunkCB);

            tile_select_3 = new Fl_Hor_Value_Slider(tile_place_buttons_x_off,136,160,24,"Tile select");
            tile_select_3->minimum(0);
            tile_select_3->maximum(0);
            tile_select_3->step(1);
            tile_select_3->align(FL_ALIGN_TOP);
            tile_select_3->callback(selBlockCB);

            hflipCB[1] = new Fl_Check_Button(tile_place_buttons_x_off,160,64,32,"Hflip");
            hflipCB[1]->callback(set_hflipCB,(void*)1);
            vflipCB[1] = new Fl_Check_Button(tile_place_buttons_x_off,192,64,32,"Vflip");
            vflipCB[1]->callback(set_vflipCB,(void*)1);
            prioCB[1] = new Fl_Check_Button(tile_place_buttons_x_off,224,72,32,"Priority");
            prioCB[1]->callback(set_prioCB,(void*)1);

            solidChunkMenu=new Fl_Choice(tile_place_buttons_x_off,256,128,24);
            solidChunkMenu->copy(SolidMenu);

            chunksize[0]=new Fl_Int_Input(tile_place_buttons_x_off,296,128,24,"Width (in tiles)");
            chunksize[0]->when(FL_WHEN_ENTER_KEY);
            chunksize[0]->align(FL_ALIGN_TOP);
            chunksize[0]->callback(resizeChunkCB);
            chunksize[0]->value("16");

            chunksize[1]=new Fl_Int_Input(tile_place_buttons_x_off,336,128,24,"Height (in tiles)");
            chunksize[1]->when(FL_WHEN_ENTER_KEY);
            chunksize[1]->align(FL_ALIGN_TOP);
            chunksize[1]->callback(resizeChunkCB);
            chunksize[1]->value("16");

            planeSelectChunk = new Fl_Hor_Value_Slider(tile_place_buttons_x_off,480,160,24,"Plane select");
            planeSelectChunk->minimum(0);
            planeSelectChunk->maximum(0);
            planeSelectChunk->step(1);
            planeSelectChunk->align(FL_ALIGN_TOP);
            planeSelectChunk->callback(setCurPlaneChunkCB);

            chunk_tile_size = new Fl_Hor_Value_Slider(tile_place_buttons_x_off,520,160,24,"Tile zoom factor:");
            chunk_tile_size->minimum(1);
            chunk_tile_size->maximum(16);
            chunk_tile_size->step(1);
            chunk_tile_size->value(2);
            chunk_tile_size->align(FL_ALIGN_TOP);
            chunk_tile_size->callback(scrollChunkCB);
            chunk_tile_size->tooltip(TooltipZoom);

            cordDisp[1]=new Fl_Box(tile_place_buttons_x_off,556,128,64);
            cordDisp[1]->labelsize(12);

            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off,364, 112, 32, "Append chunk");
                o->callback(appendChunkCB);
            }

            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off,396, 128, 32, "Insert after chunk");
                o->callback(insertChunkCB);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off,428, 160, 32, "Delete selected chunk");
                o->callback(delChunkAtCB);
            }
            updateChunkSize();

            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,chunkEditor);
            runLuaFunc(Lconf,1,0);
            tabsMain[chunkEditor]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Sprites"));
            palBar.addTab(3,false,true,true);
            {   Fl_Group *o = new Fl_Group(tile_place_buttons_x_off+616, 44, 88, 96);
                {
                    palType[9] = new Fl_Round_Button(tile_place_buttons_x_off+616, 44, 64, 24, "Free");
                    palType[9]->type(FL_RADIO_BUTTON);
                    palType[9]->set();
                    palType[9]->callback((Fl_Callback*) setPalType,(void *)0);
                    palType[9]->tooltip(freeDes);
                    palType[10] = new Fl_Round_Button(tile_place_buttons_x_off+616, 68, 72, 24, "Locked");
                    palType[10]->type(FL_RADIO_BUTTON);
                    palType[10]->callback((Fl_Callback*) setPalType,(void *)1);
                    palType[10]->tooltip(lockedDes);
                    palType[11] = new Fl_Round_Button(tile_place_buttons_x_off+616, 92, 88, 24, "Reserved");
                    palType[11]->type(FL_RADIO_BUTTON);
                    palType[11]->callback((Fl_Callback*) setPalType,(void *)2);
                    palType[11]->tooltip(reservedDes);
                    o->end();
                }
            }

            spritegrouptxt = new Fl_Input(tile_place_buttons_x_off+616,128,168,24,"Group name");
            spritegrouptxt->align(FL_ALIGN_TOP);
            spritegrouptxt->value(spriteDefName);
            spritegrouptxt->callback(assignSpritegroupnameCB);

            spritemetatxt = new Fl_Input(tile_place_buttons_x_off+616,168,168,24,"Meta name");
            spritemetatxt->value(spritesName);
            spritemetatxt->callback(assignSpritemetaNameCB);
            spritemetatxt->align(FL_ALIGN_TOP);

            spriteglobaltxt = new Fl_Input(tile_place_buttons_x_off+616,208,168,24,"All meta name");
            spriteglobaltxt->value(defMDesc);
            spriteglobaltxt->callback(assignSpriteAllMetanameCB);
            spriteglobaltxt->align(FL_ALIGN_TOP);


            metaspritesel=new Fl_Hor_Value_Slider(tile_place_buttons_x_off+616,244,168,24,"Meta group select:");
            metaspritesel->step(1);
            metaspritesel->maximum(0);
            metaspritesel->align(FL_ALIGN_TOP);
            metaspritesel->callback(selspriteMeta);
            metaspritesel->labelsize(12);


            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+616, 274, 96, 28, "Append meta");
                o->callback(appendSpriteCB,(void*)(intptr_t)2);
            }

            spriteselgroup=new Fl_Hor_Value_Slider(tile_place_buttons_x_off,184,168,22,"Sprite group select:");
            spriteselgroup->step(1);
            spriteselgroup->maximum(0);
            spriteselgroup->align(FL_ALIGN_TOP);
            spriteselgroup->callback(selspriteGroup);
            spriteselgroup->labelsize(12);

            spritesel=new Fl_Hor_Value_Slider(tile_place_buttons_x_off,220,168,22,"Sprite select:");
            spritesel->step(1);
            spritesel->maximum(0);
            spritesel->align(FL_ALIGN_TOP);
            spritesel->callback(selSpriteCB);
            spritesel->labelsize(12);

            spritest=new Fl_Hor_Value_Slider(tile_place_buttons_x_off,256,168,22,"Start tile:");
            spritest->step(1);
            spritest->maximum(0);
            spritest->align(FL_ALIGN_TOP);
            spritest->callback(setvalueSpriteCB,0);
            spritest->labelsize(12);

            spriteslat=new Fl_Hor_Value_Slider(tile_place_buttons_x_off,292,168,22,"Mapping tile");
            spriteslat->step(1);
            spriteslat->maximum(0);
            spriteslat->align(FL_ALIGN_TOP);
            spriteslat->callback(setvalueSpriteCB,(void*)4);
            spriteslat->labelsize(12);

            spritesize[0]=new Fl_Hor_Value_Slider(tile_place_buttons_x_off+40,316,128,22,"Width");
            spritesize[0]->step(1);
            spritesize[0]->value(1);
            spritesize[0]->minimum(1);
            spritesize[0]->maximum(4);
            spritesize[0]->align(FL_ALIGN_LEFT);
            spritesize[0]->callback(setvalueSpriteCB,(void*)1);
            spritesize[0]->labelsize(12);

            spritesize[1]=new Fl_Hor_Value_Slider(tile_place_buttons_x_off+40,340,128,22,"Height");
            spritesize[1]->step(1);
            spritesize[1]->value(1);
            spritesize[1]->minimum(1);
            spritesize[1]->maximum(4);
            spritesize[1]->align(FL_ALIGN_LEFT);
            spritesize[1]->callback(setvalueSpriteCB,(void*)2);
            spritesize[1]->labelsize(12);

            spritepalrow=new Fl_Hor_Value_Slider(tile_place_buttons_x_off,376,168,22,"Palette row:");
            spritepalrow->step(1);
            spritepalrow->maximum(3);
            spritepalrow->align(FL_ALIGN_TOP);
            spritepalrow->callback(setvalueSpriteCB,(void*)3);
            spritepalrow->labelsize(12);

            spritezoom=new Fl_Hor_Value_Slider(tile_place_buttons_x_off+38,400,130,22,"Zoom");
            spritezoom->step(1);
            spritezoom->minimum(1);
            spritezoom->value(16);
            spritezoom->maximum(16);
            spritezoom->align(FL_ALIGN_LEFT);
            spritezoom->callback(redrawOnlyCB);
            spritezoom->labelsize(12);

            spritesoff[0] = new Fl_Int_Input(tile_place_buttons_x_off+62,424,106,24,"Offset X:");
            spritesoff[0]->when(FL_WHEN_ENTER_KEY);
            spritesoff[0]->value("0");
            spritesoff[0]->align(FL_ALIGN_LEFT);
            spritesoff[0]->callback(setoffspriteCB,0);

            spritesoff[1] = new Fl_Int_Input(tile_place_buttons_x_off+62,448,106,24,"Offset Y:");
            spritesoff[1]->when(FL_WHEN_ENTER_KEY);
            spritesoff[1]->value("0");
            spritesoff[1]->align(FL_ALIGN_LEFT);
            spritesoff[1]->callback(setoffspriteCB,(void*)1);

            spritehflip = new Fl_Check_Button(tile_place_buttons_x_off,470,48,20,"Hflip");
            spritehflip->callback(spriteHflipCB);
            spritevflip = new Fl_Check_Button(tile_place_buttons_x_off+52,470,48,20,"Vflip");
            spritevflip->callback(spriteVflipCB);
            spriteprio = new Fl_Check_Button(tile_place_buttons_x_off+104,470,56,20,"Priority");
            spriteprio->callback(spritePrioCB);

            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off, 492, 64, 28, "Append");
                o->callback(appendSpriteCB,0);
                o->labelsize(12);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+72, 492, 96, 28, "Append group");
                o->callback(appendSpriteCB,(void*)(intptr_t)1);
                o->labelsize(12);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off, 522, 64, 28, "Delete");
                o->callback(delSpriteCB,0);
                o->labelsize(12);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+72, 522, 96, 28, "Delete group");
                o->callback(delSpriteCB,(void*)1);
                o->labelsize(12);
            }
            spritealign[0] = new Fl_Button(tile_place_buttons_x_off, 552, 32, 28, "Left");
            spritealign[0]->labelsize(12);
            spritealign[0]->callback(alignSpriteCB,(void*)0);

            spritealign[1] = new Fl_Button(tile_place_buttons_x_off+34, 552, 40, 28, "Right");
            spritealign[1]->labelsize(12);
            spritealign[1]->callback(alignSpriteCB,(void*)1);

            spritealign[2] = new Fl_Button(tile_place_buttons_x_off+78, 552, 28, 28, "Top");
            spritealign[2]->labelsize(12);
            spritealign[2]->callback(alignSpriteCB,(void*)2);

            spritealign[3] = new Fl_Button(tile_place_buttons_x_off+112, 552, 48, 28, "Bottom");
            spritealign[3]->labelsize(12);
            spritealign[3]->callback(alignSpriteCB,(void*)3);

            {
                Fl_Group *o = new Fl_Group(tile_place_buttons_x_off, 572, 800, 480);
                {
                    Fl_Round_Button*m = new Fl_Round_Button(tile_place_buttons_x_off, 572, 96, 32, "Top corner");
                    m->type(FL_RADIO_BUTTON);
                    m->callback(setDrawSpriteCB,(void *)0);
                    m->set();
                } // Fl_Round_Button* o
                {
                    Fl_Round_Button*m = new Fl_Round_Button(tile_place_buttons_x_off+96, 572, 64, 32, "Center");
                    m->type(FL_RADIO_BUTTON);
                    m->callback(setDrawSpriteCB,(void *)1);
                } // Fl_Round_Button* o
                o->end();
            } // End of buttons

            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,spriteEditor);
            runLuaFunc(Lconf,1,0);
            tabsMain[spriteEditor]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Level editor"));
            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,levelEditor);
            runLuaFunc(Lconf,1,0);
            tabsMain[levelEditor]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Settings/projects"));
            projectSelect=new Fl_Hor_Value_Slider(112,56,128,24,"Current project");
            projectSelect->minimum(0);
            projectSelect->maximum(0);
            projectSelect->step(1);
            projectSelect->value(0);
            projectSelect->align(FL_ALIGN_LEFT);
            projectSelect->callback(switchProjectCB);
            {   Fl_Button *o = new Fl_Button(260, 52, 152, 32, "Append blank project");
                o->callback(appendProjectCB);
            }
            {   Fl_Button *o = new Fl_Button(428, 52, 168, 32, "Delete selected project");
                o->callback(deleteProjectCB);
            }
            //IMPORTANT if adding a new tab remember to update these
            sharePrj[0]=new Fl_Check_Button(8,112,112,16,"Share palette");
            sharePrj[0]->callback(shareProjectCB,(void*)pjHavePal);
            sharePrj[1]=new Fl_Check_Button(120,112,96,16,"Share tiles");
            sharePrj[1]->callback(shareProjectCB,(void*)pjHaveTiles);
            sharePrj[2]=new Fl_Check_Button(216,112,120,16,"Share tile map");
            sharePrj[2]->callback(shareProjectCB,(void*)pjHaveMap);
            sharePrj[3]=new Fl_Check_Button(336,112,120,16,"Share chunks");
            sharePrj[3]->callback(shareProjectCB,(void*)pjHaveChunks);
            sharePrj[4]=new Fl_Check_Button(456,112,120,16,"Share sprites");
            sharePrj[4]->callback(shareProjectCB,(void*)pjHaveSprites);
            sharePrj[5]=new Fl_Check_Button(576,112,120,16,"Share level");
            sharePrj[5]->callback(shareProjectCB,(void*)pjHaveLevel);

            havePrj[0]=new Fl_Check_Button(8,88,112,16,"Have palette");
            havePrj[0]->callback(haveCB,(void*)pjHavePal);
            havePrj[1]=new Fl_Check_Button(120,88,96,16,"Have tiles");
            havePrj[1]->callback(haveCB,(void*)pjHaveTiles);
            havePrj[2]=new Fl_Check_Button(232,88,120,16,"Have tile map");
            havePrj[2]->callback(haveCB,(void*)pjHaveMap);
            havePrj[3]=new Fl_Check_Button(344,88,120,16,"Have chunks");
            havePrj[3]->callback(haveCB,(void*)pjHaveChunks);
            havePrj[4]=new Fl_Check_Button(456,88,120,16,"Have sprites");
            havePrj[4]->callback(haveCB,(void*)pjHaveSprites);
            havePrj[5]=new Fl_Check_Button(568,88,120,16,"Have level");
            havePrj[5]->callback(haveCB,(void*)pjHaveLevel);

            shareWith[0]=new Fl_Hor_Value_Slider(8,142,128,24,"Share palette with:");
            shareWith[0]->callback(switchShareCB,(void*)pjHavePal);
            shareWith[1]=new Fl_Hor_Value_Slider(136,142,128,24,"Share tiles with:");
            shareWith[1]->callback(switchShareCB,(void*)pjHaveTiles);
            shareWith[2]=new Fl_Hor_Value_Slider(264,142,128,24,"Share tile map with:");
            shareWith[2]->callback(switchShareCB,(void*)pjHaveMap);
            shareWith[3]=new Fl_Hor_Value_Slider(400,142,128,24,"Share chunks with:");
            shareWith[3]->callback(switchShareCB,(void*)pjHaveChunks);
            shareWith[4]=new Fl_Hor_Value_Slider(536,142,128,24,"Share sprites with:");
            shareWith[4]->callback(switchShareCB,(void*)pjHaveSprites);
            shareWith[5]=new Fl_Hor_Value_Slider(672,142,128,24,"Share level with:");
            shareWith[5]->callback(switchShareCB,(void*)pjHaveLevel);
            for(unsigned x=0; x<shareAmtPj; ++x) {
                havePrj[x]->value(1);
                shareWith[x]->minimum(0);
                shareWith[x]->maximum(0);
                shareWith[x]->step(1);
                shareWith[x]->value(0);
                shareWith[x]->align(FL_ALIGN_TOP);
            }


            TxtBufProject = new Fl_Text_Buffer;
            TxtEditProject = new Fl_Text_Editor(8, 184, 640, 370,"Description/Notes");
            TxtEditProject->buffer(TxtBufProject);
            TxtEditProject->textfont(FL_TIMES);
            TxtBufProject->text(currentProject->Name.c_str());
            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,settingsTab);
            runLuaFunc(Lconf,1,0);
            tabsMain[settingsTab]->end();
        }
        {   tabsMain.emplace_back(new Fl_Group(rx,ry,rw,rh,"Lua scripting"));
            luaScriptSel=new Fl_Choice(tile_place_buttons_x_off,default_palette_bar_offset_y+8,112,24);
            luaScriptSel->label("Script selection");
            luaScriptSel->align(FL_ALIGN_TOP);
            luaScriptSel->callback(switchCurLuaScript);
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+120, default_palette_bar_offset_y,112, 32, "Append script");
                o->callback(appendLuaScript);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+240, default_palette_bar_offset_y,144,32, "Delete selected script");
                o->callback(deleteLuaScript);
            }
            {   Fl_Button *o = new Fl_Button(tile_place_buttons_x_off+392, default_palette_bar_offset_y,48,32, "Run");
                o->callback(runCurLuaScript);
            }
            luaScriptName = new Fl_Input(tile_place_buttons_x_off+448+8,default_palette_bar_offset_y+8,328,24,"Script name");
            luaScriptName->callback(setNameLuaScript);
            luaScriptName->align(FL_ALIGN_TOP);
            luaBufProject = new Fl_Text_Buffer;
            luaEditProject = new Fl_Text_Editor(tile_place_buttons_x_off,default_palette_bar_offset_y+48, 784, 456,"Currently selected Lua script");
            luaEditProject->buffer(luaBufProject);
            luaEditProject->textfont(FL_COURIER);
            luaEditProject->hide();
            lua_getglobal(Lconf,"tabConfig");
            lua_pushinteger(Lconf,luaTab);
            runLuaFunc(Lconf,1,0);
            tabsMain[luaTab]->end();
        }
    }
}
Fl_Double_Window* IntersectionInterface::make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_intersectionWindow = new Fl_Double_Window(420, 265, "Intersection UI");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 25, 145, 30);
      o->end();
    }
    { Fl_Choice* o = m_iShapeType = new Fl_Choice(5, 25, 145, 30, "Object type");
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->menu(menu_m_iShapeType);
    }
    { Fl_Value_Slider* o = m_dXAt = new Fl_Value_Slider(5, 75, 200, 25, "At x pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dXAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dYAt = new Fl_Value_Slider(5, 115, 200, 25, "At y pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dYAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dZAt = new Fl_Value_Slider(5, 155, 200, 25, "At z pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dZAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dTheta = new Fl_Value_Slider(5, 195, 200, 25, "Vec theta");
      o->type(5);
      o->maximum(360);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dTheta);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dPhi = new Fl_Value_Slider(5, 235, 200, 25, "Vec phi");
      o->type(5);
      o->minimum(-90);
      o->maximum(90);
      o->step(1);
      o->value(45);
      o->callback((Fl_Callback*)cb_m_dPhi);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Button* o = new Fl_Button(330, 25, 85, 25, "Write test");
      o->callback((Fl_Callback*)cb_Write);
    }
    { Fl_Value_Slider* o = m_dXRot = new Fl_Value_Slider(215, 75, 200, 25, "View rotation");
      o->type(5);
      o->maximum(360);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dXRot);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dYRot = new Fl_Value_Slider(215, 115, 200, 25, "View height");
      o->type(5);
      o->minimum(-90);
      o->maximum(90);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dYRot);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Check_Button* o = m_bGrid = new Fl_Check_Button(215, 155, 25, 25, "Show grid");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bGrid);
    }
    { Fl_Check_Button* o = m_bRay = new Fl_Check_Button(215, 195, 25, 25, "Show ray");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bRay);
    }
    { Fl_Check_Button* o = m_bRayShadow = new Fl_Check_Button(215, 235, 25, 25, "Show ray shadow");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bRayShadow);
    }
    m_iSeed = new Fl_Value_Input(240, 30, 85, 20, "Seed");
    o->end();
    o->resizable(o);
  }
  return w;
}
Example #13
0
Fl_Window* make_codingstyle_window() {
  Fl_Window* w;
   {Fl_Window* o = new Fl_Window(310, 255);
    w = o;
    o->shortcut(0xff1b);
     {Fl_Tabs* o = new Fl_Tabs(0, 0, 303, 220);
      o->color((Fl_Color)0xfffffffe);
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Brace Style"));
         {Fl_Group* o = new Fl_Group(14, 22, 282, 122, _("Brace Style"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Box* o = new Fl_Box(20, 6, 47, 20, _("if ( x ) {"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 25, 45, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 41, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(115, 42, 46, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle1 = new Fl_Round_Button(16, 84, 66, 25, _("Style 1"));
            o->type(Fl_Round_Button::RADIO);
            o->value(1);
            o->callback((Fl_Callback*)cb_pStyle1);
          }
           {Fl_Box* o = new Fl_Box(201, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(227, 42, 34, 22, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle2 = new Fl_Round_Button(109, 84, 66, 25, _("Style 2"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle2);
          }
           {Fl_Round_Button* o = pStyle3 = new Fl_Round_Button(200, 84, 66, 25, _("Style 3"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle3);
          }
          o->end();
        }
         {Fl_Check_Button* o = pNoSpaceParens = new Fl_Check_Button(15, 147, 195, 22, _("No space before parentheses"));
          o->callback((Fl_Callback*)cb_pNoSpaceParens);
        }
         {Fl_Check_Button* o = pBraceFuncs = new Fl_Check_Button(15, 170, 174, 22, _("Apply to function braces"));
          o->value(1);
          o->callback((Fl_Callback*)cb_pBraceFuncs);
        }
        o->end();
      }
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Other"));
        o->hide();
         {Fl_Group* o = new Fl_Group(11, 22, 284, 90, _("Indentation"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Value_Input* o = pTabSize = new Fl_Value_Input(129, 33, 60, 22, _("Tab size for indents"));
            o->maximum(12);
            o->value(2);
            o->callback((Fl_Callback*)cb_pTabSize);
          }
           {Fl_Check_Button* o = pIndentTabs = new Fl_Check_Button(13, 7, 114, 22, _("Indent with tabs"));
            o->callback((Fl_Callback*)cb_pIndentTabs);
          }
           {Fl_Check_Button* o = pIndentCode = new Fl_Check_Button(14, 58, 151, 22, _("Indent code blocks"));
            o->callback((Fl_Callback*)cb_pIndentCode);
          }
          o->end();
        }
         {Fl_Check_Button* o = pReturnParens = new Fl_Check_Button(10, 120, 220, 22, _("Always use parentheses on return"));
          o->callback((Fl_Callback*)cb_pReturnParens);
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(115, 227, 59, 23, _("Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
    }
     {Fl_Button* o = new Fl_Button(180, 227, 59, 23, _("Save"));
      o->callback((Fl_Callback*)cb_Save);
    }
     {Fl_Button* o = new Fl_Button(245, 227, 59, 23, _("Use"));
      o->callback((Fl_Callback*)cb_Use);
    }
    o->end();
    o->resizable(o);
  }
  return  w;
}
Example #14
0
int main (int argc, char **argv) {

  Fl_Window* w;
  fl_init_locale_support("eiconsconf", PREFIX"/share/locale");
  readIconsConfiguration();
   {Fl_Window* o = iconsConfWindow = new Fl_Window(265, 314, _("Icons settings"));
    w = o;
    o->shortcut(0xff1b);
     {Fl_Button* o = new Fl_Button(25, 280, 75, 25, _("&OK"));
      o->callback((Fl_Callback*)cb_OK);
    }
     {Fl_Button* o = new Fl_Button(185, 280, 75, 25, _("&Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
    }
     {Fl_Button* o = new Fl_Button(105, 280, 75, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_Apply);
    }
     {Fl_Tabs* o = new Fl_Tabs(3, 5, 257, 265);
      o->color((Fl_Color)0xfffffffe);
       {Fl_Group* o = new Fl_Group(1, 23, 255, 241, _("Look&&feel"));
        o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
         {Fl_Button* o = colorButton = new Fl_Button(165, 17, 60, 18, _("Background color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_colorButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->color((Fl_Color) label_background);
          if(label_trans) o->deactivate();
        }
         {Fl_Button* o = colorButton1 = new Fl_Button(165, 47, 60, 18, _("Label color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_colorButton1);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->color((Fl_Color) label_foreground);
        }
         {Fl_Value_Slider* o = maxWidthSlider = new Fl_Value_Slider(115, 95, 125, 20, _("Maximum width: "));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(48);
          o->maximum(200);
          o->step(1);
          o->value(50);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_maxWidthSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_maxwidth);
        }
         {Fl_Value_Slider* o = fontsizeSlider = new Fl_Value_Slider(115, 125, 125, 20, _("Font height: "));
          o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
          o->minimum(8);
          o->maximum(48);
          o->step(1);
          o->value(10);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_fontsizeSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_fontsize);
        }
         {Fl_Value_Slider* o = gridspaceSlider = new Fl_Value_Slider(115, 155, 125, 20, _("Grid spacing: "));
          o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
          o->minimum(1);
          o->maximum(50);
          o->step(1);
          o->value(10);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_gridspaceSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_gridspacing);
        }
         {Fl_Check_Button* o = autoArrButton = new Fl_Check_Button(25, 215, 222, 20, _("Auto arrange icons"));
          o->callback((Fl_Callback*)cb_autoArrButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
          o->value(auto_arr);
        }
         {Fl_Check_Button* o = engageButton = new Fl_Check_Button(25, 190, 222, 20, _("Engage with just one click"));
          o->callback((Fl_Callback*)cb_engageButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
          o->value(label_engage_1click);
        }
         {Fl_Check_Button* o = bg_color_check = new Fl_Check_Button(227, 17, 20, 18);
          o->callback((Fl_Callback*)cb_bg_color_check);
          o->tooltip(_("Clear this, to get transparent background."));
          if(!label_trans) o->set_value();
        }
        o->end();
      }
      o->end();
    }
    o->end();
    o->resizable(o);
  }
  w->show(argc, argv);
  return  Fl::run();
}
Example #15
0
Fl_Scopes_Manager::Fl_Scopes_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name)
{
	Fl::lock();

	s->begin();
	Fl_MDI_Window *w = SWin = new Fl_MDI_Window(0, 0, width, height, name);
	w->user_data((void *)this);
	w->resizable(w->view());

	w->titlebar()->close_button()->hide();

	w->view()->begin();

	Scopes_Tabs = new Fl_Tabs*[Num_Scopes];
	Scope_Show = new Fl_Check_Button*[Num_Scopes];
	Scope_Pause = new Fl_Button*[Num_Scopes];
	Scope_OneShot = new Fl_Check_Button*[Num_Scopes];
	Scope_Options = new Fl_Menu_Button*[Num_Scopes];
	Grid_Color = new Fl_Button*[Num_Scopes];
	Bg_Color = new Fl_Button*[Num_Scopes];
	Sec_Div = new Fl_Input_Browser*[Num_Scopes];
	Save_Type = new Fl_Check_Button*[Num_Scopes];
	Save_Points = new Fl_Int_Input*[Num_Scopes];
	Save_Time = new Fl_Float_Input*[Num_Scopes];
	Save_File = new Fl_Input*[Num_Scopes];
	Save = new Fl_Light_Button*[Num_Scopes];
	Save_Flag = new int[Num_Scopes];
	Save_File_Pointer = new FILE*[Num_Scopes];

	Trace_Page = new Fl_Group**[Num_Scopes];
	Trace_Show = new Fl_Check_Button**[Num_Scopes];
	Units_Div = new Fl_Input_Browser**[Num_Scopes];
	Trace_Color = new Fl_Button**[Num_Scopes];
	Trace_Pos = new Fl_Dial**[Num_Scopes];
	Trace_Width = new Fl_Dial**[Num_Scopes];
 	Trigger_Mode = new Fl_Choice*[Num_Scopes];

        Trace_Options = new Fl_Menu_Button**[Num_Scopes];

	Scope_Windows = new Fl_Scope_Window*[Num_Scopes];

	for (int i = 0; i < Num_Scopes; i++) {
		Save_Flag[i] = false;
		{ Fl_Tabs *o = Scopes_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-40);
		  o->new_page("General");
		  { Fl_Check_Button *o = Scope_Show[i] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
		    o->callback((Fl_Callback *)show_scope, (void *)i);
		  }
		  { Fl_Button *o = Scope_Pause[i] = new Fl_Button(10, 75, 90, 25, "Trigger");
		    o->value(0);
		    o->deactivate();
		    o->when(FL_WHEN_CHANGED);
		    o->callback((Fl_Callback *)pause_scope, (void *)i);
		  }
		  { Fl_Check_Button *o = Scope_OneShot[i] = new Fl_Check_Button(10, 50, 100, 20, "OneShot/Run");
		    o->deactivate();
		    o->callback((Fl_Callback *)oneshot_scope, (void *)i);
		  }
		  { Fl_Menu_Button *o = Scope_Options[i] = new Fl_Menu_Button(10, 105, 90, 25, "Options");
			o->menu(Scope_Opts);
			o->when(FL_WHEN_ENTER_KEY);
			o->child(0)->set_value();
		    	o->callback((Fl_Callback *)enter_options, (void *)i);
		  }
		  { Fl_Button *o = Grid_Color[i] = new Fl_Button(10, 135, 90, 25, "Grid Color");
		    o->callback((Fl_Callback *)select_grid_color, (void *)i);
		  }
		  { Fl_Button *o = Bg_Color[i] = new Fl_Button(10, 165, 90, 25, "Bg Color");
		    o->callback((Fl_Callback *)select_bg_color, (void *)i);
		  }
		  { Fl_Input_Browser *o = Sec_Div[i] = new Fl_Input_Browser(200, 25, 60, 20, "Sec/Div:  ");
		    o->add("0.001|0.005|0.01|0.05|0.1|0.5|1");
		    o->align(FL_ALIGN_LEFT);
		    o->value("0.1");
		    o->when(FL_WHEN_ENTER_KEY);
		    o->callback((Fl_Callback *)enter_secdiv, (void *)i);
		  }
		  { Fl_Check_Button *o = Save_Type[i] = new Fl_Check_Button(140, 50, 100, 20, "Points/Time");
		    o->value(1);
		    o->callback((Fl_Callback *)select_save, (void *)i);
		  }
		  { Fl_Int_Input *o = Save_Points[i] = new Fl_Int_Input(200, 75, 60, 20, "N Points: ");
		    o->align(FL_ALIGN_LEFT);
		    o->value("1000");
		  }
		  { Fl_Float_Input *o = Save_Time[i] = new Fl_Float_Input(200, 105, 60, 20, "Time [s]:  ");
		    o->align(FL_ALIGN_LEFT);
		    o->value("1.0");
		    o->deactivate();
		  }
		  { Fl_Input *o = Save_File[i] = new Fl_Input(200, 135, 100, 20, "Filename:");
		    char buf[100];
		    o->align(FL_ALIGN_LEFT);
		    sprintf(buf, "%s", Scopes[i].name);
		    o->value(buf);
		  }
		  { Fl_Light_Button *o = Save[i] = new Fl_Light_Button(140, 165, 90, 25, "Save");
		    o->selection_color(FL_BLACK);
		    o->callback((Fl_Callback *)enable_saving, (void *)i);
		  }
   		  {  Fl_Choice *o = Trigger_Mode[i] = new Fl_Choice(60, 200, 170, 25, "Trigger:");
                    o->add("Continuous Roling|Continuous Overwrite|Rising (-to+) CH1|Falling (+to-) CH1|Hold");
                    o->align(FL_ALIGN_LEFT);
                    o->value(0);
                    o->when(FL_WHEN_ENTER_KEY);
                    o->callback((Fl_Callback *)enter_trigger_mode, (void *)i);
                  }


		  Trace_Page[i] = new Fl_Group*[Scopes[i].ntraces];
		  Trace_Show[i] = new Fl_Check_Button*[Scopes[i].ntraces];
		  Units_Div[i] = new Fl_Input_Browser*[Scopes[i].ntraces];
		  Trace_Color[i] = new Fl_Button*[Scopes[i].ntraces];
		  Trace_Pos[i] = new Fl_Dial*[Scopes[i].ntraces];
  		  Trace_Width[i] = new Fl_Dial*[Scopes[i].ntraces];
		  Trace_Options[i] = new Fl_Menu_Button*[Scopes[i].ntraces];
		  

		  for (int j = 0; j < Scopes[i].ntraces; j++) {
			s_idx_T *idx = new s_idx_T;
			idx->scope_idx = i;
			idx->trace_idx = j;
		  	Trace_Page[i][j] = o->new_page(Scopes[i].traceName[j]);
			Trace_Page[i][j]->label_color(FL_WHITE);
			{ Fl_Check_Button *o = Trace_Show[i][j] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
			  o->value(1);
		    	  o->callback((Fl_Callback *)show_trace, (void *)idx);
		  	}
		  	{ Fl_Input_Browser *o = Units_Div[i][j] = new Fl_Input_Browser(77, 55, 60, 20, "Units/Div:  ");
		    	  o->align(FL_ALIGN_LEFT);
		    	  o->value("2.5");
			  o->add("0.001|0.002|0.005|0.01|0.02|0.05|0.1|0.2|0.5|1|2|5|10|50|100|1000");
		    	  o->when(FL_WHEN_ENTER_KEY);
		    	  o->callback((Fl_Callback *)enter_unitsdiv, (void *)idx);
		  	}
		  	{ Fl_Button *o = Trace_Color[i][j] = new Fl_Button(10, 90, 90, 25, "Trace Color");
		    	  o->callback((Fl_Callback *)select_trace_color, (void *)idx);
		  	}
			{ Fl_Dial *o = Trace_Pos[i][j] = new Fl_Dial(170, 40, 50, 50, "Trace Offset");
			  o->type(Fl_Dial::LINE);
			  o->minimum(0.0);
			  o->maximum(2.0);
			  o->value(1);
		    	  o->callback((Fl_Callback *)change_trace_pos, (void *)idx);
			}
			{ Fl_Dial *o = Trace_Width[i][j] = new Fl_Dial(250, 40, 50, 50, "Trace Width");
			  o->type(Fl_Dial::LINE);
			  o->minimum(0.1);
			  o->maximum(40.0);
			  o->value(0.1);
		    	  o->callback((Fl_Callback *)change_trace_width, (void *)idx);
			}
			{ Fl_Menu_Button *o = Trace_Options[i][j] = new Fl_Menu_Button(10, 130, 90, 25, "Options ");
			  int i;
			  o->menu(Trace_Opts);
			  o->when(FL_WHEN_ENTER_KEY);
		    	  o->callback((Fl_Callback *)enter_options, (void *)idx);
			 // for(i=0;i<o->children();i++) { // loop through all menu items, and add checked items to the value
	  		 //   o->child(i)->set_value(); 
			 // } 
		  	}
		  }
		  o->end();
		  Fl_Group::current()->resizable(w);
		}
	}
	for (int i = 1; i < Num_Scopes; i++) {
		Scopes_Tabs[i]->hide();
	}
	Scopes_Tabs[0]->show();
	Help = new Fl_Button(width-150, height-30, 70, 25, "Help");
	Close = new Fl_Button(width-75, height-30, 70, 25, "Close");
	Close->callback((Fl_Callback *)close);
	Fl_Browser *o = Scopes_Tree = new Fl_Browser(5, 5, 150, height-10);
	o->indented(1);
	o->callback((Fl_Callback *)select_scope);
	for (int i = 0; i < Num_Scopes; i++) {
		add_paper(Scopes_Tree, Scopes[i].name, Fl_Image::read_xpm(0, scope_icon));
	}

	w->view()->end();

	s->end();

	w->titlebar()->h(15);
	w->titlebar()->color(FL_BLACK);

	w->position(x, y);

	Fl::unlock();
}