Exemplo n.º 1
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.º 2
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.º 3
0
Fl_Window* make_codingstyle_window() {
  Fl_Window* w;
   {Fl_Window* o = new Fl_Window(310, 255);
    w = o;
    o->shortcut(0xff1b);
     {Fl_Tabs* o = new Fl_Tabs(0, 0, 303, 220);
      o->color((Fl_Color)0xfffffffe);
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Brace Style"));
         {Fl_Group* o = new Fl_Group(14, 22, 282, 122, _("Brace Style"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Box* o = new Fl_Box(20, 6, 47, 20, _("if ( x ) {"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 25, 45, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 41, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(115, 42, 46, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle1 = new Fl_Round_Button(16, 84, 66, 25, _("Style 1"));
            o->type(Fl_Round_Button::RADIO);
            o->value(1);
            o->callback((Fl_Callback*)cb_pStyle1);
          }
           {Fl_Box* o = new Fl_Box(201, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(227, 42, 34, 22, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle2 = new Fl_Round_Button(109, 84, 66, 25, _("Style 2"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle2);
          }
           {Fl_Round_Button* o = pStyle3 = new Fl_Round_Button(200, 84, 66, 25, _("Style 3"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle3);
          }
          o->end();
        }
         {Fl_Check_Button* o = pNoSpaceParens = new Fl_Check_Button(15, 147, 195, 22, _("No space before parentheses"));
          o->callback((Fl_Callback*)cb_pNoSpaceParens);
        }
         {Fl_Check_Button* o = pBraceFuncs = new Fl_Check_Button(15, 170, 174, 22, _("Apply to function braces"));
          o->value(1);
          o->callback((Fl_Callback*)cb_pBraceFuncs);
        }
        o->end();
      }
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Other"));
        o->hide();
         {Fl_Group* o = new Fl_Group(11, 22, 284, 90, _("Indentation"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Value_Input* o = pTabSize = new Fl_Value_Input(129, 33, 60, 22, _("Tab size for indents"));
            o->maximum(12);
            o->value(2);
            o->callback((Fl_Callback*)cb_pTabSize);
          }
           {Fl_Check_Button* o = pIndentTabs = new Fl_Check_Button(13, 7, 114, 22, _("Indent with tabs"));
            o->callback((Fl_Callback*)cb_pIndentTabs);
          }
           {Fl_Check_Button* o = pIndentCode = new Fl_Check_Button(14, 58, 151, 22, _("Indent code blocks"));
            o->callback((Fl_Callback*)cb_pIndentCode);
          }
          o->end();
        }
         {Fl_Check_Button* o = pReturnParens = new Fl_Check_Button(10, 120, 220, 22, _("Always use parentheses on return"));
          o->callback((Fl_Callback*)cb_pReturnParens);
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(115, 227, 59, 23, _("Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
    }
     {Fl_Button* o = new Fl_Button(180, 227, 59, 23, _("Save"));
      o->callback((Fl_Callback*)cb_Save);
    }
     {Fl_Button* o = new Fl_Button(245, 227, 59, 23, _("Use"));
      o->callback((Fl_Callback*)cb_Use);
    }
    o->end();
    o->resizable(o);
  }
  return  w;
}