/* Callback function for the render out button. */
void AnimatedSGWindow::timelineCB(Fl_Widget *w, void *data)
{
	VOID_TO_ASGWIN(data);
	Fl_Value_Slider* timeline = (Fl_Value_Slider*)(w);

	std::cout << "Frame #" << timeline->value() << std::endl;

	/* Change the dials to the current transformation values */
	aSGWin->setTransformationG();
	aSGWin->setColorChooser();

	/* Change the transformation num in the GLWindow */
	aSGWin->glWin->setTransformNum((unsigned int)timeline->value());
	aSGWin->glWin->redraw();
}
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
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.º 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;
}
/* Callback function for the render out button. */
void AnimatedSGWindow::backCB(Fl_Widget *w, void *data)
{
	VOID_TO_ASGWIN(data);
	Fl_Value_Slider* timeline = (Fl_Value_Slider*)(aSGWin->timelineG->child(3));
	
	int prevFrame = (int)(timeline->value() - 1);
	if(prevFrame >= timeline->minimum())
	{
		timeline->value(prevFrame);
		timelineCB(timeline, aSGWin);
	}
	else if(aSGWin->loopB->value())
	{
		timeline->value(timeline->maximum());
		timelineCB(timeline, aSGWin);
	}
}
/* Callback function for the render out button. */
void AnimatedSGWindow::forwardCB(Fl_Widget *w, void *data)
{
	VOID_TO_ASGWIN(data);
	Fl_Value_Slider* timeline = (Fl_Value_Slider*)(aSGWin->timelineG->child(3));

	int nextFrame = (int)(timeline->value() + 1);
	if(nextFrame <= timeline->maximum())
	{
		timeline->value(nextFrame);
		timelineCB(timeline, aSGWin);
	}
	else if(aSGWin->loopB->value())
	{
		timeline->value(timeline->minimum());
		timelineCB(timeline, aSGWin);
	}
	else
	{
		aSGWin->isPlaying = false;
	}
}
Exemplo n.º 8
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.º 9
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();
  }
}
Exemplo n.º 10
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.º 11
0
Fl_Double_Window* SUBnoteUI::make_window() {
  { SUBparameters = new Fl_Double_Window(735, 390, "SUBsynth Parameters");
    SUBparameters->user_data((void*)(this));
    { Fl_Scroll* o = new Fl_Scroll(5, 140, 435, 245);
      o->type(1);
      o->box(FL_THIN_UP_BOX);
      { Fl_Pack* o = harmonics = new Fl_Pack(10, 145, 425, 235);
        harmonics->type(1);
        for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars,i);}
        harmonics->end();
      } // Fl_Pack* harmonics
      o->end();
    } // Fl_Scroll* o
    { Fl_Button* o = new Fl_Button(625, 365, 105, 20, "Close");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(11);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Group* o = new Fl_Group(5, 5, 215, 135, "AMPLITUDE");
      o->box(FL_THIN_UP_FRAME);
      o->labeltype(FL_EMBOSSED_LABEL);
      o->labelfont(1);
      o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { Fl_Value_Slider* o = vol = new Fl_Value_Slider(10, 25, 140, 15, "Vol");
        vol->tooltip("Volume");
        vol->type(5);
        vol->box(FL_FLAT_BOX);
        vol->labelsize(11);
        vol->maximum(127);
        vol->step(1);
        vol->callback((Fl_Callback*)cb_vol);
        vol->align(FL_ALIGN_RIGHT);
        o->value(pars->PVolume);
      } // Fl_Value_Slider* vol
      { Fl_Value_Slider* o = vsns = new Fl_Value_Slider(10, 45, 140, 15, "V.Sns");
        vsns->tooltip("Velocity Sensing Function (rightmost to disable)");
        vsns->type(5);
        vsns->box(FL_FLAT_BOX);
        vsns->labelsize(11);
        vsns->maximum(127);
        vsns->step(1);
        vsns->callback((Fl_Callback*)cb_vsns);
        vsns->align(FL_ALIGN_RIGHT);
        o->value(pars->PAmpVelocityScaleFunction);
      } // Fl_Value_Slider* vsns
      { WidgetPDial* o = pan = new WidgetPDial(185, 20, 30, 30, "Pan");
        pan->tooltip("Panning (leftmost is Random)");
        pan->box(FL_ROUND_UP_BOX);
        pan->color(FL_BACKGROUND_COLOR);
        pan->selection_color(FL_INACTIVE_COLOR);
        pan->labeltype(FL_NORMAL_LABEL);
        pan->labelfont(0);
        pan->labelsize(10);
        pan->labelcolor(FL_FOREGROUND_COLOR);
        pan->maximum(127);
        pan->step(1);
        pan->callback((Fl_Callback*)cb_pan);
        pan->align(FL_ALIGN_BOTTOM);
        pan->when(FL_WHEN_CHANGED);
        o->value(pars->PPanning);
      } // WidgetPDial* pan
      { EnvelopeUI* o = ampenv = new EnvelopeUI(10, 65, 205, 70, "SUBsynth - Amplitude Envelope");
        ampenv->box(FL_FLAT_BOX);
        ampenv->color((Fl_Color)51);
        ampenv->selection_color(FL_BACKGROUND_COLOR);
        ampenv->labeltype(FL_NORMAL_LABEL);
        ampenv->labelfont(0);
        ampenv->labelsize(14);
        ampenv->labelcolor(FL_FOREGROUND_COLOR);
        ampenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        ampenv->when(FL_WHEN_RELEASE);
        o->init(pars->AmpEnvelope,master);
        ampenv->end();
      } // EnvelopeUI* ampenv
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(495, 325, 235, 35);
      o->box(FL_THIN_UP_FRAME);
      { Fl_Counter* o = filterstages = new Fl_Counter(515, 340, 45, 15, "Filter Stages");
        filterstages->tooltip("How many times the noise is filtered");
        filterstages->type(1);
        filterstages->labelfont(1);
        filterstages->labelsize(10);
        filterstages->minimum(1);
        filterstages->maximum(5);
        filterstages->step(1);
        filterstages->textsize(10);
        filterstages->callback((Fl_Callback*)cb_filterstages);
        filterstages->align(FL_ALIGN_TOP);
        o->value(pars->Pnumstages);
      } // Fl_Counter* filterstages
      { Fl_Choice* o = magtype = new Fl_Choice(585, 340, 65, 15, "Mag.Type");
        magtype->down_box(FL_BORDER_BOX);
        magtype->labelfont(1);
        magtype->labelsize(10);
        magtype->textsize(11);
        magtype->callback((Fl_Callback*)cb_magtype);
        magtype->align(FL_ALIGN_TOP);
        magtype->menu(menu_magtype);
        o->value(pars->Phmagtype);
      } // Fl_Choice* magtype
      { Fl_Choice* o = start = new Fl_Choice(670, 340, 50, 15, "Start");
        start->down_box(FL_BORDER_BOX);
        start->labelfont(1);
        start->labelsize(10);
        start->textsize(11);
        start->callback((Fl_Callback*)cb_start);
        start->align(FL_ALIGN_TOP);
        start->menu(menu_start);
        o->value(pars->Pstart);
      } // Fl_Choice* start
      o->end();
    } // Fl_Group* o
    { freqsettingsui = new Fl_Group(440, 5, 290, 135, "FREQUENCY");
      freqsettingsui->box(FL_THIN_UP_FRAME);
      freqsettingsui->labeltype(FL_EMBOSSED_LABEL);
      freqsettingsui->labelfont(1);
      freqsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = freqenvelopegroup = new EnvelopeUI(445, 65, 205, 70, "SUBsynth - Frequency Envelope");
        freqenvelopegroup->box(FL_FLAT_BOX);
        freqenvelopegroup->color((Fl_Color)51);
        freqenvelopegroup->selection_color(FL_BACKGROUND_COLOR);
        freqenvelopegroup->labeltype(FL_NORMAL_LABEL);
        freqenvelopegroup->labelfont(0);
        freqenvelopegroup->labelsize(14);
        freqenvelopegroup->labelcolor(FL_FOREGROUND_COLOR);
        freqenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        freqenvelopegroup->when(FL_WHEN_RELEASE);
        o->init(pars->FreqEnvelope,master);
        if (pars->PFreqEnvelopeEnabled==0) o->deactivate();
        freqenvelopegroup->end();
      } // EnvelopeUI* freqenvelopegroup
      { Fl_Check_Button* o = freqee = new Fl_Check_Button(445, 68, 55, 15, "Enabled");
        freqee->down_box(FL_DOWN_BOX);
        freqee->labelfont(1);
        freqee->labelsize(10);
        freqee->callback((Fl_Callback*)cb_freqee);
        o->value(pars->PFreqEnvelopeEnabled);
      } // Fl_Check_Button* freqee
      { Fl_Counter* o = octave = new Fl_Counter(670, 50, 45, 15, "Octave");
        octave->tooltip("Octave");
        octave->type(1);
        octave->labelsize(10);
        octave->minimum(-8);
        octave->maximum(7);
        octave->step(1);
        octave->textfont(1);
        octave->textsize(11);
        octave->callback((Fl_Callback*)cb_octave);
        octave->align(FL_ALIGN_TOP);
        int k=pars->PCoarseDetune/1024;if (k>=8) k-=16;
        o->value(k);
      } // Fl_Counter* octave
      { Fl_Counter* o = coarsedet = new Fl_Counter(655, 115, 60, 20, "Coarse Det.");
        coarsedet->tooltip("Coarse Detune");
        coarsedet->labelsize(10);
        coarsedet->minimum(-64);
        coarsedet->maximum(63);
        coarsedet->step(1);
        coarsedet->textfont(1);
        coarsedet->textsize(11);
        coarsedet->callback((Fl_Callback*)cb_coarsedet);
        coarsedet->align(FL_ALIGN_TOP);
        int k=pars->PCoarseDetune%1024;if (k>=512) k-=1024;
        o->value(k);
        o->lstep(10);
      } // Fl_Counter* coarsedet
      { Fl_Slider* o = detune = new Fl_Slider(495, 25, 230, 15);
        detune->tooltip("Fine Detune (cents)");
        detune->type(5);
        detune->box(FL_FLAT_BOX);
        detune->minimum(-8192);
        detune->maximum(8191);
        detune->step(1);
        detune->callback((Fl_Callback*)cb_detune);
        o->value(pars->PDetune-8192);
      } // Fl_Slider* detune
      { Fl_Value_Output* o = detunevalueoutput = new Fl_Value_Output(448, 25, 45, 15, "Detune");
        detunevalueoutput->labelsize(10);
        detunevalueoutput->minimum(-5000);
        detunevalueoutput->maximum(5000);
        detunevalueoutput->step(0.01);
        detunevalueoutput->textfont(1);
        detunevalueoutput->textsize(10);
        detunevalueoutput->callback((Fl_Callback*)cb_detunevalueoutput);
        detunevalueoutput->align(FL_ALIGN_TOP_LEFT);
        o->value(getdetune(pars->PDetuneType,0,pars->PDetune));
      } // Fl_Value_Output* detunevalueoutput
      { Fl_Check_Button* o = hz440 = new Fl_Check_Button(555, 45, 50, 15, "440Hz");
        hz440->tooltip("set the base frequency to 440Hz");
        hz440->down_box(FL_DOWN_BOX);
        hz440->labelfont(1);
        hz440->labelsize(10);
        hz440->callback((Fl_Callback*)cb_hz440);
        o->value(pars->Pfixedfreq);
      } // Fl_Check_Button* hz440
      { WidgetPDial* o = fixedfreqetdial = new WidgetPDial(610, 45, 15, 15, "Eq.T.");
        fixedfreqetdial->tooltip("How the frequency varies acording to the keyboard (leftmost for fixed frequen\
cy)");
        fixedfreqetdial->box(FL_ROUND_UP_BOX);
        fixedfreqetdial->color(FL_BACKGROUND_COLOR);
        fixedfreqetdial->selection_color(FL_INACTIVE_COLOR);
        fixedfreqetdial->labeltype(FL_NORMAL_LABEL);
        fixedfreqetdial->labelfont(0);
        fixedfreqetdial->labelsize(10);
        fixedfreqetdial->labelcolor(FL_FOREGROUND_COLOR);
        fixedfreqetdial->maximum(127);
        fixedfreqetdial->step(1);
        fixedfreqetdial->callback((Fl_Callback*)cb_fixedfreqetdial);
        fixedfreqetdial->align(FL_ALIGN_RIGHT);
        fixedfreqetdial->when(FL_WHEN_CHANGED);
        o->value(pars->PfixedfreqET);
        if (pars->Pfixedfreq==0) o->deactivate();
      } // WidgetPDial* fixedfreqetdial
      { Fl_Choice* o = detunetype = new Fl_Choice(655, 85, 70, 15, "Detune Type");
        detunetype->down_box(FL_BORDER_BOX);
        detunetype->labelsize(10);
        detunetype->textfont(1);
        detunetype->textsize(10);
        detunetype->callback((Fl_Callback*)cb_detunetype);
        detunetype->align(FL_ALIGN_TOP_LEFT);
        o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");
        o->value(pars->PDetuneType-1);
      } // Fl_Choice* detunetype
      freqsettingsui->end();
    } // Fl_Group* freqsettingsui
    { Fl_Check_Button* o = stereo = new Fl_Check_Button(440, 325, 55, 35, "Stereo");
      stereo->box(FL_THIN_UP_BOX);
      stereo->down_box(FL_DOWN_BOX);
      stereo->labelfont(1);
      stereo->labelsize(10);
      stereo->callback((Fl_Callback*)cb_stereo);
      o->value(pars->Pstereo);
    } // Fl_Check_Button* stereo
    { Fl_Button* o = new Fl_Button(445, 365, 70, 20, "Clear");
      o->tooltip("Clear the harmonics");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(11);
      o->callback((Fl_Callback*)cb_Clear);
    } // Fl_Button* o
    { bandwidthsettingsui = new Fl_Group(220, 5, 220, 135, "BANDWIDTH");
      bandwidthsettingsui->box(FL_THIN_UP_FRAME);
      bandwidthsettingsui->labeltype(FL_EMBOSSED_LABEL);
      bandwidthsettingsui->labelfont(1);
      bandwidthsettingsui->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = bandwidthenvelopegroup = new EnvelopeUI(225, 65, 205, 70, "SUBsynth - BandWidth Envelope");
        bandwidthenvelopegroup->box(FL_FLAT_BOX);
        bandwidthenvelopegroup->color((Fl_Color)51);
        bandwidthenvelopegroup->selection_color(FL_BACKGROUND_COLOR);
        bandwidthenvelopegroup->labeltype(FL_NORMAL_LABEL);
        bandwidthenvelopegroup->labelfont(0);
        bandwidthenvelopegroup->labelsize(14);
        bandwidthenvelopegroup->labelcolor(FL_FOREGROUND_COLOR);
        bandwidthenvelopegroup->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        bandwidthenvelopegroup->when(FL_WHEN_RELEASE);
        o->init(pars->BandWidthEnvelope,master);
        if (pars->PBandWidthEnvelopeEnabled==0) o->deactivate();
        bandwidthenvelopegroup->end();
      } // EnvelopeUI* bandwidthenvelopegroup
      { Fl_Check_Button* o = bwee = new Fl_Check_Button(225, 67, 55, 15, "Enabled");
        bwee->down_box(FL_DOWN_BOX);
        bwee->labelfont(1);
        bwee->labelsize(10);
        bwee->callback((Fl_Callback*)cb_bwee);
        o->value(pars->PBandWidthEnvelopeEnabled);
      } // Fl_Check_Button* bwee
      { Fl_Value_Slider* o = bandwidth = new Fl_Value_Slider(225, 40, 115, 15, "Band Width");
        bandwidth->type(5);
        bandwidth->box(FL_FLAT_BOX);
        bandwidth->labelsize(10);
        bandwidth->maximum(127);
        bandwidth->step(1);
        bandwidth->callback((Fl_Callback*)cb_bandwidth);
        bandwidth->align(FL_ALIGN_TOP);
        o->value(pars->Pbandwidth);
      } // Fl_Value_Slider* bandwidth
      { Fl_Value_Slider* o = bwidthscale = new Fl_Value_Slider(345, 40, 90, 15, "B.Width Scale");
        bwidthscale->tooltip("How much I increase the BandWidth according to lower/higher harmonics");
        bwidthscale->type(5);
        bwidthscale->box(FL_FLAT_BOX);
        bwidthscale->labelsize(10);
        bwidthscale->minimum(-64);
        bwidthscale->maximum(63);
        bwidthscale->step(1);
        bwidthscale->callback((Fl_Callback*)cb_bwidthscale);
        bwidthscale->align(FL_ALIGN_TOP);
        o->value(pars->Pbwscale-64);
      } // Fl_Value_Slider* bwidthscale
      bandwidthsettingsui->end();
    } // Fl_Group* bandwidthsettingsui
    { Fl_Group* o = globalfiltergroup = new Fl_Group(440, 140, 290, 185, "FILTER");
      globalfiltergroup->box(FL_THIN_UP_FRAME);
      globalfiltergroup->labeltype(FL_EMBOSSED_LABEL);
      globalfiltergroup->labelfont(1);
      globalfiltergroup->labelsize(13);
      globalfiltergroup->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
      { EnvelopeUI* o = filterenv = new EnvelopeUI(445, 250, 275, 70, "SUBsynth - Filter Envelope");
        filterenv->box(FL_FLAT_BOX);
        filterenv->color((Fl_Color)51);
        filterenv->selection_color(FL_BACKGROUND_COLOR);
        filterenv->labeltype(FL_NORMAL_LABEL);
        filterenv->labelfont(0);
        filterenv->labelsize(14);
        filterenv->labelcolor(FL_FOREGROUND_COLOR);
        filterenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        filterenv->when(FL_WHEN_RELEASE);
        o->init(pars->GlobalFilterEnvelope,master);
        filterenv->end();
      } // EnvelopeUI* filterenv
      { FilterUI* o = filterui = new FilterUI(445, 170, 275, 75, "SUBsynthl - Filter");
        filterui->box(FL_FLAT_BOX);
        filterui->color(FL_LIGHT1);
        filterui->selection_color(FL_BACKGROUND_COLOR);
        filterui->labeltype(FL_NORMAL_LABEL);
        filterui->labelfont(0);
        filterui->labelsize(14);
        filterui->labelcolor(FL_FOREGROUND_COLOR);
        filterui->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
        filterui->when(FL_WHEN_RELEASE);
        o->init(pars->GlobalFilter,&pars->PGlobalFilterVelocityScale,&pars->PGlobalFilterVelocityScaleFunction,master);
        filterui->end();
      } // FilterUI* filterui
      if (pars->PGlobalFilterEnabled==0) o->deactivate();
      globalfiltergroup->end();
    } // Fl_Group* globalfiltergroup
    { Fl_Check_Button* o = filtere = new Fl_Check_Button(445, 145, 85, 20, "Enabled");
      filtere->down_box(FL_DOWN_BOX);
      filtere->labelfont(1);
      filtere->labelsize(11);
      filtere->callback((Fl_Callback*)cb_filtere);
      o->value(pars->PGlobalFilterEnabled);
    } // Fl_Check_Button* filtere
    { Fl_Button* o = new Fl_Button(540, 370, 25, 15, "C");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_C);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(570, 370, 25, 15, "P");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_P);
    } // Fl_Button* o
    SUBparameters->end();
  } // Fl_Double_Window* SUBparameters
  return SUBparameters;
}
Exemplo n.º 12
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.º 13
0
//Get maze size
void sizeCB(Fl_Widget* o, void*) {
    Fl_Value_Slider* gettingValue = (Fl_Value_Slider*)o;
    theSize=gettingValue->value();
}
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();
}
Exemplo n.º 15
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;
}
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.º 17
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;
}
Exemplo n.º 18
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.º 19
0
edisplayconf::edisplayconf() {
  Fl_Window* w;
   {Fl_Window* o = win = new Fl_Window(265, 335, _("Display configuration"));
    w = o;
    o->callback((Fl_Callback*)cb_win, (void*)(this));
     {Fl_Tabs* o = new Fl_Tabs(5, 5, 255, 285);
       {Fl_Group* o = group_mouse = new Fl_Group(0, 20, 255, 265, _("Mouse"));
        o->align(FL_ALIGN_LEFT);
         {Fl_Value_Slider* o = slider_accel = new Fl_Value_Slider(25, 25, 220, 18, _("Acceleration"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(10);
          o->step(1);
          o->value(2);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_thresh = new Fl_Value_Slider(25, 65, 220, 18, _("Threshold (pixels)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(20);
          o->step(1);
          o->value(4);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_bell = new Fl_Group(0, 20, 255, 265, _("Bell"));
        o->hide();
         {Fl_Value_Slider* o = slider_volume = new Fl_Value_Slider(25, 25, 220, 18, _("Volume in %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_pitch = new Fl_Value_Slider(25, 70, 220, 18, _("Pitch in Hz"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(100);
          o->maximum(1000);
          o->step(1);
          o->value(440);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_duration = new Fl_Value_Slider(25, 115, 220, 18, _("Duration in ms"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(1000);
          o->step(1);
          o->value(200);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Button* o = new Fl_Button(180, 165, 60, 25, _("Test"));
          o->callback((Fl_Callback*)cb_Test);
        }
        o->end();
      }
       {Fl_Group* o = group_keyboard = new Fl_Group(0, 20, 255, 265, _("Keyboard"));
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
        o->hide();
         {Fl_Check_Button* o = check_autorepeat = new Fl_Check_Button(24, 25, 221, 20, _("  Repeat key activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
         {Fl_Value_Slider* o = slider_click = new Fl_Value_Slider(25, 65, 220, 18, _("Click volume %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_screen = new Fl_Group(0, 20, 255, 265, _("Screen"));
        o->hide();
         {Fl_Button* o = but_activate = new Fl_Button(165, 187, 80, 25, _("&Test"));
          o->callback((Fl_Callback*)cb_but_activate);
        }
        new Fl_Box(10, 1, 234, 55);
         {Fl_Value_Slider* o = slider_delay = new Fl_Value_Slider(25, 77, 220, 18, _("Activation delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(5);
          o->maximum(120);
          o->step(1);
          o->value(15);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Check_Button* o = check_blanking = new Fl_Check_Button(23, 25, 222, 20, _(" Screen blanker activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
        new Fl_Box(10, 100, 234, 37);
         {Fl_Value_Slider* o = slider_pattern = new Fl_Value_Slider(25, 152, 220, 18, _("Pattern change delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(1);
          o->maximum(5);
          o->step(0);
          o->value(2);
          o->align(FL_ALIGN_TOP);
          o->deactivate();
        }
         {Fl_Group* o = new Fl_Group(30, 105, 210, 25);
           {Fl_Round_Button* o = radio_blank = new Fl_Round_Button(0, 5, 105, 20, _("Blank"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->value(1);
            o->callback((Fl_Callback*)cb_radio_blank);
          }
           {Fl_Round_Button* o = radio_pattern = new Fl_Round_Button(115, 5, 95, 20, _("Pattern"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->callback((Fl_Callback*)cb_radio_pattern);
          }
          o->end();
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(190, 300, 70, 25, _("&Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
      o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    }
     {Fl_Button* o = but_kbd_apply = new Fl_Button(115, 300, 70, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_but_kbd_apply);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(40, 300, 70, 25, _("OK"));
      o->shortcut(0xd);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
}
Exemplo n.º 20
0
void ModelerUserInterface::pickGroupProperty(GroupProperty* group) {
	// Remove the event listeners for old controls
	// TODO: we really need to have a PropertyEditor class that handles this
	// automatically...
	if (currentGroup) {
		PropertyList* props = currentGroup->getProperties();
		for (PropertyList::iterator iter = props->begin();
			 iter != props->end();
			 iter++)
		{
			if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateRangeSlider);
			} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateColorChooser);
			} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateCheckbox);
			} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateChoice);
			}
		}

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

		currentGroup = NULL;
	}

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

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

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

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

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

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

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

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

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

			

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

			// Have the property update the choices when it changes
			prop->listen((SignalListener)updateChoice, (void*) pack);
		}
    }
	m_controlsScroll->redraw();
}
Exemplo n.º 21
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();
}