Exemplo n.º 1
0
ct_image_window::ct_image_window( ) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = image_window = new Fl_Double_Window(421, 528);
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 30, 410, 410);
      o->box(FL_PLASTIC_DOWN_FRAME);
      { ct_draw_area* o = ct_image = new ct_draw_area(10, 35, 400, 400, "label");
        o->box(FL_FLAT_BOX);
        o->color(FL_DARK3);
        o->selection_color(FL_BACKGROUND_COLOR);
        o->labeltype(FL_NORMAL_LABEL);
        o->labelfont(0);
        o->labelsize(14);
        o->labelcolor(FL_BLACK);
        o->align(FL_ALIGN_CENTER);
        o->when(FL_WHEN_RELEASE);
      }
      o->end();
    }
    { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 100, 25);
      o->box(FL_FLAT_BOX);
      o->menu(menu_);
    }
    { Fl_Value_Slider* o = WL = new Fl_Value_Slider(40, 470, 375, 20, "WL");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(-2000);
      o->maximum(7000);
      o->step(1);
      o->value(40);
      o->callback((Fl_Callback*)cb_WL);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = WW = new Fl_Value_Slider(40, 495, 375, 20, "WW");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(1);
      o->maximum(4000);
      o->step(1);
      o->value(300);
      o->callback((Fl_Callback*)cb_WW);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = Indx = new Fl_Value_Slider(40, 445, 375, 20, "Indx");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->step(1);
      o->callback((Fl_Callback*)cb_Indx);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Progress* o = progress_bar = new Fl_Progress(115, 5, 300, 20);
      o->box(FL_PLASTIC_THIN_UP_BOX);
      o->selection_color((Fl_Color)1);
      o->hide();
    }
    o->end();
  }
}
void ModelerApplication::Init(ModelerViewCreator_f createView, 
                              const ModelerControl controls[], unsigned numControls)
{
    int i;

	m_animating   = false;
	m_numControls = numControls;

    // ********************************************************
    // Create the FLTK user interface
    // ********************************************************
    
    m_ui = new ModelerUserInterface();
    
    // Store pointers to the controls for manipulation
    m_controlLabelBoxes   = new Fl_Box*[numControls];
    m_controlValueSliders = new Fl_Value_Slider*[numControls];
    
    // Constants for user interface setup
    const int textHeight    = 20;
    const int sliderHeight  = 20;
    const int packWidth     = m_ui->m_controlsPack->w();

	m_ui->m_controlsPack->begin();
    // For each control, add appropriate objects to the user interface
    for (i=0; i<m_numControls; i++)
    {
        // Add the entry to the selection box
        m_ui->m_controlsBrowser->add(controls[i].m_name);

        // Add the label (but make it invisible for now)
        Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, controls[i].m_name);
		box->labelsize(10);
		box->hide();
		box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
        m_controlLabelBoxes[i] = box;

        // Add the slider (but make it invisible for now)
        Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight,0);
        slider->type(1);
        slider->range(controls[i].m_minimum, controls[i].m_maximum);
        slider->step(controls[i].m_stepsize);
        slider->value(controls[i].m_value);
        slider->hide(); 
        m_controlValueSliders[i] = slider;
        slider->callback((Fl_Callback*)ModelerApplication::SliderCallback);
    }
    m_ui->m_controlsPack->end();

	// Make sure that we remove the view from the
	// Fl_Group, otherwise, it'll blow up 
	// THIS BUG FIXED 04-18-01 ehsu
	m_ui->m_modelerWindow->remove(*(m_ui->m_modelerView));
	delete m_ui->m_modelerView;

	m_ui->m_modelerWindow->begin();
	m_ui->m_modelerView = createView(0, 0, m_ui->m_modelerWindow->w(), m_ui->m_modelerWindow->h() ,NULL);
	Fl_Group::current()->resizable(m_ui->m_modelerView);
	m_ui->m_modelerWindow->end();
}
Exemplo n.º 3
0
int main(int argc, char **argv) {
 Fl_Window *w;
 {Fl_Window* o = new Fl_Window(365, 525);
  w = o;
  scroll = new Fl_Scroll(10,10,345,285);
  {Fl_Pack* o = new Fl_Pack(10, 10, 345, 285);
   pack = o;
   o->box(FL_DOWN_BOX);
   //o->box(FL_ENGRAVED_FRAME);
   (void) new Fl_Button(35, 35, 25, 25, "b1");
   (void) new Fl_Button(45, 45, 25, 25, "b2");
   (void) new Fl_Button(55, 55, 25, 25, "b3");
   (void) new Fl_Button(65, 65, 25, 25, "b4");
   (void) new Fl_Button(75, 75, 25, 25, "b5");
   (void) new Fl_Button(85, 85, 25, 25, "b6");
   (void) new Fl_Button(95, 95, 25, 25, "b7");
   (void) new Fl_Button(105, 105, 25, 25, "b8");
   (void) new Fl_Button(115, 115, 25, 25, "b9");
   (void) new Fl_Button(125, 125, 25, 25, "b10");
   (void) new Fl_Button(135, 135, 25, 25, "b11");
   (void) new Fl_Button(145, 145, 25, 25, "b12");
   (void) new Fl_Button(155, 155, 25, 25, "b13");
   (void) new Fl_Button(165, 165, 25, 25, "b14");
   (void) new Fl_Button(175, 175, 25, 25, "b15");
   (void) new Fl_Button(185, 185, 25, 25, "b16");
   (void) new Fl_Button(195, 195, 25, 25, "b17");
   (void) new Fl_Button(205, 205, 25, 25, "b18");
   (void) new Fl_Button(215, 215, 25, 25, "b19");
   (void) new Fl_Button(225, 225, 25, 25, "b20");
   (void) new Fl_Button(235, 235, 25, 25, "b21");
   (void) new Fl_Button(245, 245, 25, 25, "b22");
   (void) new Fl_Button(255, 255, 25, 25, "b23");
   (void) new Fl_Button(265, 265, 25, 25, "b24");
   o->end();
   w->resizable(o);
  }
  scroll->end();
  {Fl_Light_Button* o = new Fl_Light_Button(10, 325, 175, 25, "HORIZONTAL");
   o->type(FL_RADIO_BUTTON);
   o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::HORIZONTAL));
  }
  {Fl_Light_Button* o = new Fl_Light_Button(10, 350, 175, 25, "VERTICAL");
   o->type(FL_RADIO_BUTTON);
   o->value(1);
   o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::VERTICAL));
  }
  {Fl_Value_Slider* o = new Fl_Value_Slider(50,375, 295,25,"spacing:");
   o->clear_flag(FL_ALIGN_MASK);
   o->set_flag(FL_ALIGN_LEFT);
   o->type(Fl_Slider::HORIZONTAL);
   o->range(0,30);
   o->step(1);
   o->callback((Fl_Callback*)spacing_cb);
  }
  w->end();
 }
 w->show(argc, argv);
 return Fl::run();
}
Exemplo n.º 4
0
BrushConfigUI::BrushConfigUI() {
  Fl_Window* w;
  { Fl_Window* o = mainWindow = new Fl_Window(234, 116, "Brush Property");
    w = o;
    o->user_data((void*)(this));
    /*{ Fl_Group* o = new Fl_Group(5, 25, 120, 55, "Brush Type:");
      o->box(FL_ENGRAVED_FRAME);
      { Fl_Round_Button* o = round = new Fl_Round_Button(9, 30, 111, 25, "Round Brush");
        o->type(102);
        o->down_box(FL_ROUND_DOWN_BOX);
        o->callback((Fl_Callback*)cb_round);
      }
      { Fl_Check_Button* o = square = new Fl_Check_Button(6, 50, 111, 28, "Square Brush");
        o->type(102);
        o->down_box(FL_DIAMOND_DOWN_BOX);
        o->callback((Fl_Callback*)cb_square);
      }
      o->end();
    }*/
    { Fl_Value_Slider* o = brushSize = new Fl_Value_Slider(70, 25, 90, 20, "Brush Size:");
      o->type(1);
      o->maximum(20);
      o->step(1);
      o->value(10);
      o->callback((Fl_Callback*)cb_brushSize);
      o->align(FL_ALIGN_TOP);
      o->when(FL_WHEN_RELEASE);
    }
    { Fl_Value_Slider* o = brushOpacity = new Fl_Value_Slider(70, 60, 90, 19, "Brush Opacity:");
      o->type(1);
      o->value(1);
      o->callback((Fl_Callback*)cb_brushOpacity);
      o->align(FL_ALIGN_TOP);
      o->when(FL_WHEN_RELEASE);
    }
    { Fl_Button* o = new Fl_Button(5, 90, 107, 25, "Clean All");
      o->callback((Fl_Callback*)cb_Clean);
    }
    { Fl_Button* o = new Fl_Button(128, 90, 102, 25, "Close");
      o->callback((Fl_Callback*)cb_Close);
    }
    o->end();
  }
}
Exemplo n.º 5
0
int main(int argc, char** argv) {
    temp = argc;
    temp2 = argv;

    //All the FLTK controls
    Fl_Window win (500,500, "window");

    //Title Box
    Fl_Box title(-5,-5,510,50,"Teapot Finder!");
    title.box(FL_UP_BOX);
    title.labelsize(36);
    title.labelfont(FL_BOLD+FL_ITALIC);

    //Description section
    Fl_Multiline_Output desc(0,45,500,250,"");
    desc.value(
        " Welcome to Teapot Finder. This is a maze game, find the spinning teapot!\n\nControls:\n\t~Drag the mouse along the x axis (side to side) to control the camera.\n\t~Use the arrow keys to navigate the maze\n\t~Click the right mouse button for a bird's eye view\n\nSetup:\n\t~Choose the level of difficulty on the slider below (5=easy, 20=hard).\n\t  Then, choose your player!\n\nDescription:\n\t~In this game you must navigate through a maze and find the spinning\n\t  teapot. But be aware! Every time you find the teapot, it changes\n\t  location and maze regenerates! Find the teapot 5 times to win!");

    //Maze size slider, still getting a seg fault if never moved
    Fl_Value_Slider sizeSlider (100,300,300,50,"Maze Size (Must Slide To Prevent Seg Fault)");
    sizeSlider.type(FL_HORIZONTAL);
    sizeSlider.value(5);
    sizeSlider.minimum(5);
    sizeSlider.maximum(20);
    sizeSlider.step(1);
    sizeSlider.callback(sizeCB);

    //Buttons for different player shapes
    Fl_Button sphereButton (50,400,120,25,"Super Sphere");
    sphereButton.callback (sphereCB);
    Fl_Button cubeButton (200, 400, 120, 25, "Courageous Cube");
    cubeButton.callback (cubeCB);
    Fl_Button donughtButton (350, 400, 120, 25, "Doughnut!");
    donughtButton.callback (donughtCB);

    win.end();
    win.show();
    return Fl::run();

    return 0;
}
Exemplo n.º 6
0
void ModelerUI::addControl(const char* szName, float fMin, float fMax, float fStepSize, float fInitVal) 
{
	Fl_Group* pgrpCurrBak = Fl_Group::current();
	Fl_Group::current(m_ppckPack);
	
	const int k_iTextHeight = 20;
	const int k_iSliderHeight = 20;

	// Setup the label box
	Fl_Box* box = new Fl_Box(0, 0, m_ppckPack->w(), k_iTextHeight, szName);
	box->labelsize(10);
	box->hide();
	box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
		
	// Setup the slider
	Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, m_ppckPack->w(), k_iSliderHeight, 0);
	slider->type(1);
	slider->hide();
	slider->user_data(this);
	slider->callback(cb_sliders);
	slider->range(fMin, fMax);
	slider->step(fStepSize);
	slider->value(fInitVal);

	Fl_Group::current(pgrpCurrBak);

	// Add this entry to the browser
	string strName = "@C0"; // FLTK color encoding, we'll use @C0~@C6
	strName += szName;
	m_pbrsBrowser->add(strName.c_str());
	
	// Setup the curve
	m_pwndGraphWidget->addCurve(fInitVal, fMin, fMax);

	++m_iCurrControlCount;
}
Exemplo n.º 7
0
int main(int argc, char** argv) {
  Fl_Double_Window window(300,500);
  Drawing drawing(10,10,280,280);
  d = &drawing;

  int y = 300;
  for (int n = 0; n<7; n++) {
      Fl_Value_Slider* s = new Fl_Value_Slider(50,y,240,25,name[n]); y += 25;
      s->type(Fl_Slider::HORIZONTAL);
    if (n<4) {s->minimum(0); s->maximum(300);}
    else if (n==6) {s->minimum(0); s->maximum(360);}
    else {s->minimum(-360); s->maximum(360);}
    s->type(Fl_Slider::HORIZONTAL | Fl_Slider::TICK_ABOVE);
    s->step(1);
    s->value(args[n]);
    s->clear_flag(FL_ALIGN_MASK);
    s->set_flag(FL_ALIGN_LEFT);
    s->callback(slider_cb, (void*)n);
  }

  window.end();
  window.show(argc,argv);
  return Fl::run();
}
Exemplo n.º 8
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();
}
Exemplo n.º 9
0
void ColorFltkMenu::make_window() {
  size(400, 305);
  { 
    { Fl_Hold_Browser* o = categorybrowser = new Fl_Hold_Browser(10, 55, 125, 100, "Categories");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(category_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    { Fl_Hold_Browser* o = itembrowser = new Fl_Hold_Browser(140, 55, 120, 100, "Names");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(item_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    { Fl_Hold_Browser* o = colorbrowser = new Fl_Hold_Browser(265, 55, 125, 100, "Colors");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(color_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    new Fl_Box(10, 10, 190, 25, "Assign colors to categories:");
    { Fl_Tabs* o = new Fl_Tabs(0, 165, 400, 150);
#if defined(VMDMENU_WINDOW)
      o->color(VMDMENU_WINDOW, FL_GRAY);
      o->selection_color(VMDMENU_WINDOW);
#endif

      { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Definitions");
#if defined(VMDMENU_WINDOW)
        o->color(VMDMENU_WINDOW, FL_GRAY);
        o->selection_color(VMDMENU_WINDOW);
#endif
        { Fl_Hold_Browser* o = colordefbrowser = new Fl_Hold_Browser(15, 195, 135, 100);
          o->labeltype(FL_NO_LABEL);
          o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
          o->callback(colordef_cb, this);
          VMDFLTKTOOLTIP(o, "Select color name to adjust RGB color definition")
        }
        { Fl_Value_Slider* o = redscale = new Fl_Value_Slider(160, 195, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_RSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Value_Slider* o = greenscale = new Fl_Value_Slider(160, 215, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_GSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Value_Slider* o = bluescale = new Fl_Value_Slider(160, 235, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_BSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Button* o = grayscalebutton = new Fl_Button(165, 265, 85, 25, "Grayscale");
          o->type(FL_TOGGLE_BUTTON);
#if defined(VMDMENU_WINDOW)
          o->color(VMDMENU_WINDOW, FL_GRAY);
#endif
          VMDFLTKTOOLTIP(o, "Lock sliders for grayscale color")
        }
        defaultbutton = new Fl_Button(290, 265, 85, 25, "Default");
#if defined(VMDMENU_WINDOW)
        defaultbutton->color(VMDMENU_WINDOW, FL_GRAY);
#endif
        defaultbutton->callback(default_cb, this);
        VMDFLTKTOOLTIP(defaultbutton, "Reset to original RGB color")
        o->end();
      }
      { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Scale");
#if defined(VMDMENU_WINDOW)
        o->color(VMDMENU_WINDOW, FL_GRAY);
        o->selection_color(VMDMENU_WINDOW);
#endif
        o->hide();
        { Fl_Choice* o = scalemethod = new Fl_Choice(15, 220, 80, 25, "Method");
          o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
          o->down_box(FL_BORDER_BOX);
          o->align(FL_ALIGN_TOP);
          o->callback(scalemethod_cb, this);
        }
        offsetvalue = new Fl_Value_Slider(160, 205, 180, 20, "Offset");
        offsetvalue->type(FL_HORIZONTAL);
        offsetvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
        offsetvalue->align(FL_ALIGN_LEFT);
        offsetvalue->range(-1.0, 1.0);
        offsetvalue->callback(scalesettings_cb, this);
        { Fl_Value_Slider* o = midpointvalue = new Fl_Value_Slider(160, 235, 180, 20, "Midpoint");
          o->type(FL_HORIZONTAL);
          midpointvalue->align(FL_ALIGN_LEFT);
          midpointvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
          o->range(0.0, 1.0);
          o->callback(scalesettings_cb, this);
        }
        image = new ColorscaleImage(10, 265, 380, 25, app);
        o->end();
      }
      o->end();
    }
    end();
  }
}
Exemplo n.º 10
0
Arquivo: Main.cpp Projeto: aib/glito
void initParamWindow() {
    const int heightInput = 28;
    const int wideLabel = 205;
    const int wideInput = 130;
    const int between = 5;
    const int Ybetween = 3;
    const int YbetweenMore = 6;
    const int alignStyle = FL_ALIGN_INSIDE | FL_ALIGN_RIGHT;
    const Fl_Boxtype inputStyle = FL_PLASTIC_DOWN_BOX;
    int x = 10;
    int y = 10;
    const int wide = x+wideLabel+between+wideInput+x;
    const int height =  y + 14*(heightInput+Ybetween) - Ybetween + 9*YbetweenMore + y;
    paramWindow = new Fl_Window( wide, height, _("Parameters") );
    Fl_Group* win2 = new Fl_Group( 0, 0, wide, height );
    paramWindow->resizable(win2);
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Schema size:") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0);
	o->maximum(1);
	o->value(glito->getCloseEdge());
	o->step(0.01);
	o->callback( (Fl_Callback*)closeEdge_param, glito );
    }
    y += heightInput + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Preview Size:") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0);
	o->maximum(1);
	o->value(glito->getPreviewSize());
	o->step(0.01);
	o->callback( (Fl_Callback*)previewSize_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Rotation shift (rad):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0.002);
	o->maximum(0.2);
	o->value(glito->rotationShift);
	o->step(0.001);
	o->callback( (Fl_Callback*)rotationShift_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of saved images:") );
	o->align( alignStyle );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->imageSavedWidth).c_str());
	o->callback( (Fl_Callback*)imageSavedWidth_param, glito );
    }
    {
	Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y,
					    wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->imageSavedHeight).c_str());
	o->callback( (Fl_Callback*)imageSavedHeight_param, glito );
    }
    y += heightInput + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of animations:") );
	o->align( alignStyle );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->animationSavedWidth).c_str());
	o->callback( (Fl_Callback*)animationSavedWidth_param, glito );
    }
    {
	Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y,
					    wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->animationSavedHeight).c_str());
	o->callback( (Fl_Callback*)animationSavedHeight_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Frames per cycle (>1):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Input* o = new Fl_Value_Input( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->minimum(10);
	o->maximum(100);
	o->value(glito->framesPerCycle);
	o->step(1);
	o->callback( (Fl_Callback*)framesPerCycle_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Motion detection (ms):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(1);
	o->maximum(200);
	o->value(glito->intervalMotionDetection);
	o->step(1);
	o->callback( (Fl_Callback*)intervalMotionDetection_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	{
	    Fl_Button* o = new Fl_Button( x, y, 70, heightInput, _("Density") );
	    o->box(FL_PLASTIC_UP_BOX);
	    o->value( glito->trueDensity );
	    o->callback( (Fl_Callback*)trueDensity_param, glito );
	}
	{
	    Fl_Box* o = new Fl_Box( x, y, wideLabel+30, heightInput, _("or pseudo-density:") );
	    o->align( alignStyle );
	    if ( glito->trueDensity ) o->deactivate();
	}
	{
	    Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+30+between, y,
						      100, heightInput );
	    o->box(inputStyle);
	    if ( glito->trueDensity ) o->deactivate();
	    o->type(FL_HORIZONTAL);
	    o->minimum(0);
	    o->maximum(1);
	    o->value( ImagePseudoDensity::pseudoDensity.getProba() );
	    o->step(0.01);
	    o->callback( (Fl_Callback*)logProbaHitMax_param );
	}
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideInput, heightInput, _("Points for framing:") );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
    }
    y += heightInput;
    {
	int xLine = 0;
	{
	    Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput );
	    o->box(inputStyle);
	    o->value(IS::translate(glito->pointsForFraming).c_str());
	    o->callback( (Fl_Callback*)pointsForFraming_param, glito );
	}
	xLine += 80;
	{
	    Fl_Box* o = new Fl_Box( x+xLine, y, 20, heightInput, " (x " );
	    o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
	}
	xLine += 20;
	{
	    Fl_Value_Slider* o = new Fl_Value_Slider( x+xLine, y, 100, heightInput );
	    o->box(inputStyle);
	    o->type(FL_HORIZONTAL);
	    o->minimum(0);
	    o->maximum(1);
	    o->box(inputStyle);
	    o->value(glito->animationFraming);
	    o->step(0.01);
	    o->callback( (Fl_Callback*)animationFraming_param, glito );
	}
	xLine += 100;
	{
	    Fl_Box* o = new Fl_Box( x+xLine, y, 110, heightInput, _(" for animation)") );
	    o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
	}
    }
    y += heightInput + 2*Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wide-20, heightInput,
				_("Number of iterations limited by:") );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
    }
    y += heightInput;
    {
	Fl_Round_Button* o = new Fl_Round_Button( x, y, wideInput, heightInput,
						  _("Interval per frame (ms)") );
	o->box(FL_NO_BOX);
	o->type(FL_RADIO_BUTTON);
	o->when(FL_WHEN_CHANGED);
	o->value(glito->clockNumber);
	o->callback( (Fl_Callback*)clockNumber_param, glito );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	if ( !glito->clockNumber ) o->deactivate();
	o->type(FL_HORIZONTAL);
	o->minimum(1);
	o->maximum(200);
	o->value(glito->intervalFrame);
	o->step(1);
	o->callback( (Fl_Callback*)intervalFrame_param, glito );
    }
    y += heightInput + Ybetween;
    {
	int xLine = 0;
	{
	    Fl_Round_Button* o = new Fl_Round_Button( x, y, 127, heightInput,
						      _("Points per frame") );
	    o->box(FL_NO_BOX);
	    o->type(FL_RADIO_BUTTON);
	    o->when(FL_WHEN_CHANGED);
	    o->value(!glito->clockNumber);
	    o->callback( (Fl_Callback*)clockNumber_param, glito );
	}
	xLine += 127 + between;
	{
	    Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput );
	    o->box(inputStyle);
	    if ( glito->clockNumber ) o->deactivate();
	    o->value(IS::translate(glito->pointsPerFrame).c_str());
	    o->callback( (Fl_Callback*)pointsPerFrame_param, glito );
	}
	xLine += 80 + 2;
	{
	    Fl_Button* o = new Fl_Button( x+xLine, y, wide - (x+xLine) - 10,
					  heightInput, _("Calibrate") );
	    o->box(FL_PLASTIC_UP_BOX);
	    if ( glito->clockNumber ) o->deactivate();
	    o->callback( (Fl_Callback*)calibrate_param, glito );
	}
    }
    y += heightInput + Ybetween + 2*YbetweenMore;
    {
	int xLine = 0;
	{
	    Fl_Button* o = new Fl_Button( x, y, 90, heightInput, _("Black/White") );
	    o->box(FL_PLASTIC_UP_BOX);
	    o->value( !ImageGray::background.isBlack() );
	    o->callback( (Fl_Callback*)blackWhite_param );
	}
	xLine += 90 + 2*between + 5;
	{
	    Fl_Choice* o = new Fl_Choice( x+xLine+110, y, 95, heightInput,
					  _("Transparency:") );
	    o->add( ImageGray::transparency.stringNone().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)0 );
	    o->add( ImageGray::transparency.stringSimple().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)1 );
	    o->add( ImageGray::transparency.stringAlpha().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)2 );
	    if ( ImageGray::transparency.useAlphaTransparency() ) {
		o->value(2);
	    } else if ( ImageGray::transparency.useSimpleTransparency() ) {
		o->value(1);
	    } else {
		o->value(0);
	    }
	}
    }
    y += heightInput + Ybetween;
    {
	// invisible box to allow correct resizing
	Fl_Box* o = new Fl_Box( 0, y, 100, 0 );
	win2->resizable(*o);
    }
    win2->end();
    paramWindow->end();
}
Exemplo n.º 11
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();
}
Exemplo n.º 12
0
Fl_Window * make_window() 
{
  Fl_Window * w;
  { 
    Fl_Window * o = main_window = new Fl_Window(741, 622, "ASF/AMC Motion Capture Player");
    w = o;
    { 
      Fl_Group * o = new Fl_Group(10, 485, 615, 140);
      { 
        Fl_Button * o = loadSkeleton_button = new Fl_Button(10, 495, 120, 40, "Load Skeleton");//***
        o->callback((Fl_Callback *)load_callback);
      }

      { 
        Fl_Button * o = loadMotion_button = new Fl_Button(140, 495, 120, 40, "Load Motion"); //***
        o->callback((Fl_Callback *)load_callback);
      }

      // "Reload motion" always reload the last skeleton loaded
      { 
        Fl_Button * o = reloadMotion_button = new Fl_Button(270, 495, 120, 40, "Reload Motion");//***
        o->callback((Fl_Callback *)reload_callback);
      }

      { 
        Fl_Button * o = resetScene_button = new Fl_Button(400, 495, 120, 40, "Reset Scene");
        o->callback((Fl_Callback *)resetScene_callback);
      }

      { 
        Fl_Light_Button* o = record_button = new Fl_Light_Button(380, 575, 40, 25, "R");
        o->callback((Fl_Callback *)record_callback, (void*)(0));
      }

      { 
        Fl_Button * o = screenShot_button = new Fl_Button(280, 575, 90, 25, "ScreenShot");
        o->callback((Fl_Callback *)saveScreenToFile_callback);
      }

      { 
        Fl_Button * o = pause_button = new Fl_Button(430, 575, 35, 25, "@||");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback);
      }
      { 
        Fl_Button* o = rewind_button = new Fl_Button(465, 575, 35, 25, "@|<");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback);
      }
      { 
        Fl_Button* o = play_button = new Fl_Button(500, 575, 35, 25, "@>");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback, (void*)(0));
      }
      { 
        Fl_Button* o = minusOne_button = new Fl_Button(535, 575, 35, 25, "-1");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback, (void*)(0));
      }
      { 
        Fl_Button* o = plusOne_button = new Fl_Button(570, 575, 35, 25, "+1");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback, (void*)(0));
      }
      { 
        Fl_Button* o = repeat_button = new Fl_Button(605, 575, 35, 25, "@<->");
        o->labeltype(FL_SYMBOL_LABEL);
        o->labelsize(12);
        o->callback((Fl_Callback *)play_callback, (void*)(0));
      }
      o->end();
    }  // FL_group

    { 
      Player_Gl_Window * o = glwindow = new Player_Gl_Window(5, 5, 640, 480, "label");
      o->box(FL_DOWN_FRAME);
      o->labeltype(FL_NO_LABEL);
    }

    { 
      Fl_Value_Slider* o = frame_slider = new Fl_Value_Slider(10, 545, 630, 20);  // slider
      o->type(5);
      o->labelsize(18);
      o->minimum(1);
      o->maximum(60000);
      o->step(1);
      o->callback((Fl_Callback*)fslider_callback, (void*)(0));
      o->align(197);
    }

    { 
      Fl_Value_Input* o = speedUp = new Fl_Value_Input(65, 575, 40, 25, "Speed");
      o->minimum(0);
      o->value(1);
      o->callback((Fl_Callback*)playSpeed_callback);
    }
    
    { 
      Fl_Value_Input * o = sub_input = new Fl_Value_Input(690, 55, 45, 25, "Skeleton ID:");
      o->callback((Fl_Callback*)skeletonID_callback);
      sub_input->align(Fl_Align(FL_ALIGN_TOP_RIGHT));
    }
	  { 
      Fl_Value_Input * o = tx_input = new Fl_Value_Input(690, 95, 45, 25, "tx:");
      o->callback((Fl_Callback*)tx_callback);
    }
	  { 
      Fl_Value_Input * o = ty_input = new Fl_Value_Input(690, 122, 45, 25, "ty:");
      o->callback((Fl_Callback*)ty_callback);
    }
	  { 
      Fl_Value_Input * o = tz_input = new Fl_Value_Input(690, 152, 45, 25, "tz:");
      o->callback((Fl_Callback*)tz_callback);
    }
	  { 
      Fl_Value_Input * o = rx_input = new Fl_Value_Input(690, 190, 45, 25, "rx:");
      o->callback((Fl_Callback*)rx_callback);
    }
	  { 
      Fl_Value_Input * o = ry_input = new Fl_Value_Input(690, 217, 45, 25, "ry:");
      o->callback((Fl_Callback*)ry_callback);
    }
	  { 
      Fl_Value_Input * o = rz_input = new Fl_Value_Input(690, 247, 45, 25, "rz:");
      o->callback((Fl_Callback*)rz_callback);
    }

    { 
      Fl_Value_Input * o = joint_idx = new Fl_Value_Input(195, 575, 45, 25, "Show Joint");
      o->maximum(30);
      o->step(1);
      o->value(-1);
      o->callback((Fl_Callback*)spotJoint_callback);
    }

    { 
      Fl_Light_Button * o = groundPlane_button = new Fl_Light_Button(650, 315, 85, 25, "Ground");
      o->callback((Fl_Callback*)renderGroundPlane_callback, (void*)(0));
      o->align(FL_ALIGN_INSIDE);
    }

    { 
      Fl_Light_Button * o = fog_button = new Fl_Light_Button(650, 345, 85, 25, "Fog");
      o->callback((Fl_Callback*)useFog_callback, (void*)(0));
      o->align(FL_ALIGN_INSIDE);
    }

    { 
      Fl_Light_Button * o = worldAxes_button = new Fl_Light_Button(650, 375, 85, 25, "Axes");
      o->callback((Fl_Callback*)renderWorldAxes_callback, (void*)(0));
      o->align(FL_ALIGN_INSIDE);
    }

    { 
      Fl_Button * o = aboutPlayer_button = new Fl_Button(650, 420, 85, 25, "About");
      o->callback((Fl_Callback *)aboutPlayer_callback);
      o->align(FL_ALIGN_INSIDE);
    }
    o->end();
  }
  return w;
}
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;
}
Exemplo n.º 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();
}