Ejemplo n.º 1
0
ct_image_window::ct_image_window( ) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = image_window = new Fl_Double_Window(421, 528);
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 30, 410, 410);
      o->box(FL_PLASTIC_DOWN_FRAME);
      { ct_draw_area* o = ct_image = new ct_draw_area(10, 35, 400, 400, "label");
        o->box(FL_FLAT_BOX);
        o->color(FL_DARK3);
        o->selection_color(FL_BACKGROUND_COLOR);
        o->labeltype(FL_NORMAL_LABEL);
        o->labelfont(0);
        o->labelsize(14);
        o->labelcolor(FL_BLACK);
        o->align(FL_ALIGN_CENTER);
        o->when(FL_WHEN_RELEASE);
      }
      o->end();
    }
    { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 100, 25);
      o->box(FL_FLAT_BOX);
      o->menu(menu_);
    }
    { Fl_Value_Slider* o = WL = new Fl_Value_Slider(40, 470, 375, 20, "WL");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(-2000);
      o->maximum(7000);
      o->step(1);
      o->value(40);
      o->callback((Fl_Callback*)cb_WL);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = WW = new Fl_Value_Slider(40, 495, 375, 20, "WW");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(1);
      o->maximum(4000);
      o->step(1);
      o->value(300);
      o->callback((Fl_Callback*)cb_WW);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = Indx = new Fl_Value_Slider(40, 445, 375, 20, "Indx");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->step(1);
      o->callback((Fl_Callback*)cb_Indx);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Progress* o = progress_bar = new Fl_Progress(115, 5, 300, 20);
      o->box(FL_PLASTIC_THIN_UP_BOX);
      o->selection_color((Fl_Color)1);
      o->hide();
    }
    o->end();
  }
}
Ejemplo n.º 2
0
void Fl_Help_Dialog::make_group(int w, int h)
{
	menubar_ = new Fl_Menu_Bar(0, 0, 595, 20); 
	menubar_->begin();
    {
		Fl_Item_Group *g = new Fl_Item_Group("&File");
        Fl_Item *i;
		
		i= new Fl_Item("Open");
		i->shortcut(FL_CTRL+'o');
		i->callback((Fl_Callback*)cb_open, this);
		
		i = new Fl_Item("Close");
		i->shortcut(FL_CTRL+'c');
		i->callback((Fl_Callback*)cb_close, this);
        g->end();
    }
	menubar_->end();

	{
		Fl_Group *g = new Fl_Group(0, 20, w, 30);
		g->box(FL_THIN_DOWN_BOX);
		
		Fl_Button *b;
     
		b = back = new Fl_Highlight_Button(35, 2, 30, 25, "@<-");        
		b->box(FL_HIGHLIGHT_UP_BOX);
		b->label_type(FL_SYMBOL_LABEL);
		b->label_color(FL_DARK3);
		b->highlight_label_color(FL_GRAY);
        b->callback((Fl_Callback*)cb_back, this);
        b->tooltip("Back");
		b->deactivate();
      
		b = next = new Fl_Highlight_Button(65, 2, 30, 25, "@->");
		b->box(FL_HIGHLIGHT_UP_BOX);

		b->label_type(FL_SYMBOL_LABEL);
		b->label_color(FL_DARK3);                
		b->highlight_label_color(FL_GRAY);
        b->callback((Fl_Callback*)cb_next, this);
        b->tooltip("Next");
		b->deactivate();

		b = new Fl_Highlight_Button(5, 2, 30, 25);
		b->image(Fl_Image::read(0, (uchar*)datas_open));
        b->box(FL_HIGHLIGHT_UP_BOX);
        b->callback((Fl_Callback*)cb_open, this);
        b->tooltip("Open");
		b->take_focus();

		g->end();
	}

        htmlWidget = new Fl_Simple_Html(0, 50, w, h-50);
        htmlWidget->callback(cb_html_link, this);
    htmlWidget->end();

	resizable(htmlWidget);
}
Ejemplo n.º 3
0
/*
  Initial creation of ui components.
*/
void SelectorGUI::create(){
  Fl_Window *window = new Fl_Window(400,460,"Stream Selector");
  x = 80;
  y = 10;
  char* participantList[100];
  test = "this is a member";
   
  window->size_range(400, 400, 600, 600);

  // Scroll window containing participants
  swindow = new Fl_Scroll(0, y, 400, 380);
  Fl_Group* o = new Fl_Group(x, y, 380, 280);
  o->box(FL_THIN_UP_FRAME);
  
  // Add buttons to scroll window
  update();
  
  // Apply and close button.
  y = 400;
  x = 150; 
  Fl_Button *applyButton = new Fl_Button(150, y, 60, 40, "Refresh");
  Fl_Button *closeButton = new Fl_Button(x + 70, y, 60, 40, "Close");
  
  // Callbacks.
  applyButton->callback(static_applyCB, this);
  closeButton->callback(static_closeCB, this);
  
  window->end();
  window->show();
    
 
  // For some reason, the idle callback causes a segfault.
  //Fl::add_idle(static_idleCB);
}
Ejemplo n.º 4
0
Fl_Window* make_about_panel(const char *copyright) {
  Fl_Window* w;
   {Fl_Window* o = about_panel = new Fl_Window(330, 276, _("About eFluid"));
    w = o;
    o->type(240);
    o->selection_color((Fl_Color)47);
    o->shortcut(0xff1b);
     {Fl_Group* o = display_group = new Fl_Group(0, 0, 330, 240);
       {Fl_Group* o = new Fl_Group(5, 5, 320, 55, _("eFluid"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(40);
        o->align(FL_ALIGN_INSIDE);
        o->end();
      }
       {Fl_Button* o = new Fl_Button(5, 165, 320, 70, _("\302\251""2002-2003\nClick here for more information"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->highlight_color((Fl_Color)0x9d9da700);
        o->highlight_label_color((Fl_Color)55);
        o->label_size(14);
        o->callback((Fl_Callback*)cb_2002);
        o->align(FL_ALIGN_WRAP);
      }
       {Fl_Box* o = new Fl_Box(5, 60, 320, 105, _("EFLTK User Interface Designer\nVersion 2.0.3"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(18);
      }
      o->end();
    }
     {Fl_Box* o = copyright_box = new Fl_Box(0, 0, 330, 240);
      o->label_size(10);
      o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP);
      o->hide();
      o->label(copyright);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(5, 245, 320, 25, _("OK"));
      o->label_size(10);
      o->shortcut(0xff0d);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
  return  w;
}
Ejemplo n.º 5
0
Flx_Calendar::Flx_Calendar() : 
	Fl_Window( 0, 0, 
			   TABLE_W + 2*MARGIN, 
			   BAR_H + TABLE_H + BUTTONGROUP_H + 2*MARGIN )
	
	, _isDragging(false) 
{
    //fl_register_images();
    box(FL_DOWN_BOX);
    clear_border();

    //make a gray bar as a replacement for the title bar,
    //containing 2 comboboxes for entering year and month
    Fl_Group *pBarGrp = new Fl_Group( MARGIN, MARGIN, TABLE_W, BAR_H );
    pBarGrp->box(FL_FLAT_BOX);
    pBarGrp->begin();

        _pMoCho = new Fl_Choice(18, 4, 55, BAR_H - 5);
        _pMoCho->box(FL_FLAT_BOX);
        _pMoCho->textsize(10);
		_pMoCho->visible_focus( 0 );

        _pYCho = new Fl_Choice(_pMoCho->x() + 2 + _pMoCho->w(), 4, 55, BAR_H - 5);
        _pYCho->textsize(10);
		_pYCho->visible_focus( 0 );
        
    pBarGrp->color(FL_DARK3);
    pBarGrp->end();

    _pDayTable = new DayTable( MARGIN, MARGIN + BAR_H, TABLE_W, TABLE_H );
    _pDayTable->end();
    
    _pBtnOk = new Fl_Return_Button( 2*MARGIN, 
			                        this->h() - 2*MARGIN - BUTTON_H, 
									70, 
									BUTTON_H, "OK" );
	_pBtnOk->labelsize( 10 );
	_pBtnOk->callback( staticOnOkCancel, this );
	_pBtnCancel = new Fl_Button( _pBtnOk->x() + _pBtnOk->w() + MARGIN,
			                        _pBtnOk->y(), _pBtnOk->w(), _pBtnOk->h(),
									"Abbrechen" );
	_pBtnCancel->labelsize( _pBtnOk->labelsize() );
	_pBtnCancel->callback( staticOnOkCancel, this );
    end();

	//controls all this stuff:
	_pCalCtrl = new CalendarController( *_pMoCho, *_pYCho, *_pDayTable );

	//make DayTable cells the right size:
	_pDayTable->col_width_all( COLWIDTH );
    _pDayTable->row_header_width( COLWIDTH );
	_pDayTable->row_height_all( ROWHEIGHT );

}
Ejemplo n.º 6
0
//-----------------------------------------------------------------------------
void TrspDlg::create_dlg()
{
	wnd = new Fl_Double_Window(220, 170, mgl_gettext("Transpose data"));
	Fl_Group *g = new Fl_Group(10, 30, 200, 90, mgl_gettext("Select new order of dimensions"));
	g->box(FL_DOWN_BOX);
	yxz = new Fl_Round_Button(20, 40, 75, 25, "y - x - z");	yxz->callback(trsp_rad_cb,this);
	zyx = new Fl_Round_Button(20, 65, 75, 25, "z - y - x");	zyx->callback(trsp_rad_cb,this);
	zxy = new Fl_Round_Button(20, 90, 75, 25, "z - x - y");	zxy->callback(trsp_rad_cb,this);
	yzx = new Fl_Round_Button(100, 40, 75, 25, "y - z - x");yzx->callback(trsp_rad_cb,this);
	xzy = new Fl_Round_Button(100, 65, 75, 25, "x - z - y");xzy->callback(trsp_rad_cb,this);
	xyz = new Fl_Round_Button(100, 90, 75, 25, "x - y - z");xyz->callback(trsp_rad_cb,this);
	g->end();

	Fl_Button *o;
	o = new Fl_Button(25, 130, 75, 25, mgl_gettext("Cancel"));	o->callback(close_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Do nothing and close this window"));
	o = new Fl_Return_Button(125, 130, 75, 25, mgl_gettext("Do"));	o->callback(trsp_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Change data values and close this window"));
	wnd->end();
}
Ejemplo n.º 7
0
void DelayGUI::CreateGUI(int xoff, int yoff, char *name)
{
	 Fl_Group* o = GUIDelayGroup = new Fl_Group(xoff, yoff, 300, 60, name);
      o->type(1);
	  o->color(GUIBG2_COLOUR);
	  o->box(FL_UP_BOX);
      o->labeltype(FL_ENGRAVED_LABEL);
      o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
	  o->user_data((void*)(this));
       	  
	  DelayA = new Fl_Knob(xoff+50, yoff+5, 40, 40, "Delay");
	  DelayA->color(GUI_COLOUR);
      DelayA->labelsize(10);
	  DelayA->maximum(1);
      DelayA->step(0.01);
      DelayA->value(0.5);
      DelayA->callback((Fl_Callback*)cb_Delay);
	  
	  Feedback = new Fl_Knob(xoff+100, yoff+5, 40, 40, "Feedback");
	  Feedback->color(GUI_COLOUR);
      Feedback->labelsize(10);
	  Feedback->maximum(1.0);
      Feedback->step(0.01);
      Feedback->value(0.5);
      Feedback->callback((Fl_Callback*)cb_Feedback);
	  
	  Bypass = new Fl_Button(xoff+5, yoff+25, 40, 20, "Bypass");
	  Bypass->color(GUIBG2_COLOUR);
	  Bypass->labelsize(10);
	  Bypass->type(1);
	  Bypass->value(1);
	  Bypass->callback((Fl_Callback*)cb_Bypass);
	  
      o->end();
    
}
Ejemplo n.º 8
0
void
Track::init ( void )
{
    _row = 0;
    _sequence = NULL;
    _name = NULL;
    _selected = false;
    _size = 1;

    record_ds = NULL;
    playback_ds = NULL;

    labeltype( FL_NO_LABEL );

//    clear_visible_focus();

    Fl_Group::size( timeline->w(), height() );

    Track *o = this;
    o->box( FL_FLAT_BOX );

    {
        Track_Header *o = new Track_Header( x(), y(), w(), h() );

        name_field = o->name_input;
        record_button = o->rec_button;
        mute_button = o->mute_button;
        solo_button = o->solo_button;
        menu_button = o->menu_button;
        show_all_takes_button = o->show_all_takes_button;
        overlay_controls_button = o->overlay_controls_button;
        
        name_field->callback( cb_button, this );
        record_button->callback( cb_button, this );
        mute_button->callback( cb_button, this );
        solo_button->callback( cb_button, this );

        show_all_takes_button->callback( cb_button, this );
        overlay_controls_button->callback( cb_button, this );
        menu_button->callback( cb_button, this );

        resizable( o );
//        o->color( (Fl_Color)53 );
    }
    
    {
        /* this pack holds the active sequence, annotation sequence, control sequences and takes */
        Fl_Pack *o = pack = new Fl_Pack( x(), y(), w(), h() );
        o->type( Fl_Pack::VERTICAL );
        o->labeltype( FL_NO_LABEL );
        /* o->resize( x() + width(), y(), w() - width(), h() ); */

        /* resizable( o ); */

        {
            Fl_Pack *o = annotation = new Fl_Pack( 0, 0, pack->w(), 1 );
            o->type( Fl_Pack::VERTICAL );
            o->end();
        }

        {
            {
                Fl_Group *o = controls_heading = new Fl_Group( 0, 0, pack->w(), 10 );
                o->box( FL_FLAT_BOX );
                o->color( fl_color_add_alpha( fl_rgb_color( 1,1,1 ), 127 ) );
                
                {
                    Fl_Box *o = new Fl_Box( 0,0, Track::width(), 10 );
                    o->label( "Controls" );
                    o->align( FL_ALIGN_RIGHT | FL_ALIGN_INSIDE );
                    o->labelsize( 10 );
                }

                o->hide();
                o->end();
                o->resizable( 0 );
            }

            {
                Fl_Sometimes_Pack *o = control = new Fl_Sometimes_Pack( 0, 0, pack->w(), 1 );
                o->spacing( 1 );
                o->box( FL_NO_BOX );
                o->color( FL_BACKGROUND_COLOR );
                o->type( Fl_Pack::VERTICAL );
                o->pack( true );
                o->hide();
                o->align( FL_ALIGN_TOP | FL_ALIGN_LEFT );
                o->end();
            }
        }

        {
            {
                Fl_Group *o = takes_heading = new Fl_Group( 0, 0, pack->w(), 10 );
                o->box( FL_FLAT_BOX );
                o->color( fl_color_add_alpha( fl_rgb_color( 1,1,1 ), 127 ) );
                
                {
                    Fl_Box *o = new Fl_Box( 0,0, Track::width(), 10 );
                    o->label( "Takes" );
                    o->align( FL_ALIGN_RIGHT | FL_ALIGN_INSIDE );
                    o->labelsize( 10 );
                }
                o->hide();
                o->end();
                o->resizable( 0 );
            }

        {
            Fl_Pack *o = takes = new Fl_Pack( 0, 0, pack->w(), 1 );
            o->type( Fl_Pack::VERTICAL );
            o->end();
            o->hide();
            o->align( FL_ALIGN_TOP | FL_ALIGN_LEFT );
        }
        }

        o->end();
    }
    end();
}
Ejemplo n.º 9
0
void createSystemArea(int32_t x, int32_t y, int32_t w, int32_t h){

    tsconf::GameConfig *conf = tsconf::GetGameConfig();
    int curH_L = y;

    if((x+(tsconf::smallPadding<<1)+tsconf::largeWidgetWidth)>w){ //Enter no-space mode



    }
    else{ //We got space.

        curH_L+=tsconf::smallPadding;
        Fl_Group *startupGroup = new Fl_Group(x+tsconf::smallPadding, curH_L, w-(tsconf::smallPadding*2), tsconf::largeWidgetHeight, "Startup Directory");
        startupGroup->box(FL_EMBOSSED_BOX);

        startupGroup->begin();
            Fl_Input *startupInput = new Fl_Input(x+tsconf::smallPadding+12, curH_L+12, (w-(tsconf::smallPadding*2))-76, tsconf::smallWidgetHeight);
            startupInput->value(conf->startupdir);
            startupInput->when(FL_WHEN_CHANGED);
            startupInput->callback(startupCallback);

            int newX = static_cast<Fl_Widget *>(startupInput)->x()+static_cast<Fl_Widget *>(startupInput)->w();
            Fl_Button *chooseStartupButton = new Fl_Button(newX+12, curH_L+12, 40, tsconf::smallWidgetHeight, "...");
            chooseStartupButton->callback(DirectoryChooser, startupInput);
        startupGroup->end();

        curH_L+=tsconf::smallPadding+tsconf::largeWidgetHeight;
        Fl_Group *sgmnameGroup = new Fl_Group(x+tsconf::smallPadding, curH_L, w-(tsconf::smallPadding*2), tsconf::largeWidgetHeight, "SGM File Name");
        sgmnameGroup->box(FL_EMBOSSED_BOX);

        sgmnameGroup->begin();
            Fl_Input *sgmnameInput = new Fl_Input(x+tsconf::smallPadding+12, curH_L+12, (w-(tsconf::smallPadding*2))-24, tsconf::smallWidgetHeight);
            sgmnameInput->value(conf->sgmname);
            sgmnameInput->when(FL_WHEN_CHANGED);
            sgmnameInput->callback(sgmnameCallback);

        sgmnameGroup->end();

        curH_L+=tsconf::smallPadding+tsconf::largeWidgetHeight;
        Fl_Group *tsgmnameGroup = new Fl_Group(x+tsconf::smallPadding, curH_L, w-(tsconf::smallPadding*2), tsconf::largeWidgetHeight, "TSGM File Name");
        tsgmnameGroup->box(FL_EMBOSSED_BOX);

        tsgmnameGroup->begin();
            Fl_Input *tsgmnameInput = new Fl_Input(x+tsconf::smallPadding+12, curH_L+12, (w-(tsconf::smallPadding*2))-24, tsconf::smallWidgetHeight);
            tsgmnameInput->value(conf->tsgmname);
            tsgmnameInput->when(FL_WHEN_CHANGED);
            tsgmnameInput->callback(tsgmnameCallback);


        tsgmnameGroup->end();

        curH_L+=tsconf::smallPadding+tsconf::largeWidgetHeight;
        Fl_Group *mainfuncGroup = new Fl_Group(x+tsconf::smallPadding, curH_L, w-(tsconf::smallPadding*2), tsconf::largeWidgetHeight, "Main Function");
        mainfuncGroup->box(FL_EMBOSSED_BOX);

        mainfuncGroup->begin();
            Fl_Input *mainfuncInput = new Fl_Input(x+tsconf::smallPadding+12, curH_L+12, (w-(tsconf::smallPadding*2))-24, tsconf::smallWidgetHeight);
            mainfuncInput->value(conf->gamefunc);
            mainfuncInput->when(FL_WHEN_CHANGED);
            mainfuncInput->callback(mainfuncCallback);


        mainfuncGroup->end();
    }


}
Ejemplo n.º 10
0
ClusterView2D::ClusterView2D(int x, int y, int w, int h, int inResolution, cxVolume * pVolume) : Fl_Gl_Window(x, y, w, h-COLOR_CHOOSER_HEIGHT){

	//mode(FL_ALPHA | FL_DEPTH | FL_DOUBLE | FL_RGB8 );
	//	Fl::add_idle(&idle_cp, (void*)this);
	opacityDisp = 0;
	histogram1D = 0;
	m_dataPts = NULL;
	m_cluster = NULL;
	m_ctrs = NULL;
	m_pVolume = pVolume;
	
	m_percentHeight = (float)COLOR_CHOOSER_HEIGHT / (float) h;
	m_percentWidth = (float)COLOR_CHOOSER_WIDTH / (float) w;
	ClusterView2D *ihateptrs = this; // this is necessary because &this doesnt work.
		
	//m_buttonA = new Fl_Button(x+MARGIN+COLOR_CHOOSER_WIDTH, y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN, BUTTON_WIDTH,BUTTON_HEIGHT, "Reset");
	//m_buttonA->callback((Fl_Callback*)cb_buttonA, this);
	//m_buttonA->resizable(0);
	

	Fl_Group* o = new Fl_Group(	2,
								y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN,
								COLOR_CHOOSER_WIDTH*3,
								COLOR_CHOOSER_HEIGHT*4,"K-Means settings");
    o->box(FL_ENGRAVED_FRAME);
    o->align(FL_ALIGN_TOP_LEFT);

	m_pInputA = new Fl_Input(	o->x()+3,
								o->y()+MARGIN,
								BUTTON_WIDTH*2 + 3*2,
								BUTTON_HEIGHT,"Filename");
    m_pInputA->value("");
	m_pInputA->align(FL_ALIGN_RIGHT);
	
	m_pButtonChooser = new Fl_Button(	(m_pInputA->x()+m_pInputA->w()),
										o->y()+ MARGIN, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Browse..");
    m_pButtonChooser->callback((Fl_Callback *)cb_ButtonChooser, this);
	
	m_pFileChooser = NULL;
	
	m_inp_tch = new Fl_Input(o->x() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, BUTTON_WIDTH, BUTTON_HEIGHT, "timesteps intervals");
	m_inp_tch->align(FL_ALIGN_TOP_LEFT);
	m_inp_tch->value("12");
	
	m_inp_t = new Fl_Input(o->x() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "algorithm");
    m_inp_t->align(FL_ALIGN_TOP_LEFT);
	m_inp_t->value("0");
	
	m_inp_k = new Fl_Input(m_inp_tch->x()+m_inp_tch->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, BUTTON_WIDTH, BUTTON_HEIGHT, "clusters");
	m_inp_k->align(FL_ALIGN_TOP_LEFT);
	m_inp_k->value("3");
	
	m_inp_s = new Fl_Input(m_inp_t->x()+m_inp_t->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "stages");
	m_inp_s->align(FL_ALIGN_TOP_LEFT);
	m_inp_s->value("300");
	
	m_inp_start_time = new Fl_Input(m_inp_k->x()+m_inp_k->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*2, 
									BUTTON_WIDTH, BUTTON_HEIGHT, "start timestep");
	m_inp_start_time->align(FL_ALIGN_TOP_LEFT);
	m_inp_start_time->value("0");

	m_inp_total_time = new Fl_Input(m_inp_s->x()+m_inp_s->w() + 3, m_pInputA->y()+ BUTTON_HEIGHT*3 + 
									MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT, "number of timesteps");
	m_inp_total_time->align(FL_ALIGN_TOP_LEFT);
	m_inp_total_time->value("120");


	Fl_Button* bt_save = new Fl_Button(	m_inp_tch->x()+m_inp_tch->w() + 3,
										m_pInputA->y()+ BUTTON_HEIGHT*5 + MARGIN*3, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Create new cluster");
	bt_save->callback((Fl_Callback *)cb_ButtonSave, this);

	Fl_Button* bt_load = new Fl_Button(	bt_save->x()+bt_save->w()+3,
										m_pInputA->y()+ BUTTON_HEIGHT*5 + MARGIN*3, 
										BUTTON_WIDTH, BUTTON_HEIGHT,"Load cluster");
	bt_load->callback((Fl_Callback *)cb_ButtonLoad, this);	

	
	o->end();
	m_pLB = new Fl_Light_Button(o->x() + o->w() + 3,
			 	    (y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN), 
				    BUTTON_WIDTH,BUTTON_HEIGHT, "Show all clusters");
    //m_pLB->labelsize(TEXTSIZE);
    m_pLB->callback((Fl_Callback *)cb_LB, this);
	m_pLB->set();
	m_bshowall = true; 

	m_pButtonNext = new Fl_Button(	o->x() + o->w() + 3,
									(y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN + BUTTON_HEIGHT + 3),
									BUTTON_WIDTH, BUTTON_HEIGHT,"Next Cluster");
    m_pButtonNext->callback((Fl_Callback *)cb_ButtonNext, this);

#ifdef CHANGES
	m_pButtonClear = new Fl_Light_Button(	o->x() + o->w() + 3,
									(y+(h-COLOR_CHOOSER_HEIGHT)+MARGIN + BUTTON_HEIGHT*2 + 6),
									BUTTON_WIDTH, BUTTON_HEIGHT,"Clear Cluster");
    m_pButtonClear->callback((Fl_Callback *)cb_ButtonClear, this);
	m_pButtonClear->set();
	m_bClear = true;
#endif	
/*
	int tch     = 0;        // use all timesteps in calculating KMeans (use only 1 chunk) -tch
int alg     = 0;        // use Lloyd by default  -t option
int	k		= 4;		// number of centers     -k option
int	dim		= 2;		// dimension            
int	stages		= 1000;		// number of stages  -s option

	strcpy(params[0],"");
	strcpy(params[1],"-t");
	strcpy(params[2],"3");
	strcpy(params[3],"-tch");
	strcpy(params[4],"12");
	strcpy(params[5],"-tac");
	strcpy(params[6],filename);
	strcpy(params[7],"-k");
	strcpy(params[8],"3");
	strcpy(params[9],"-s");
	strcpy(params[10],"300");
	main_cluster(nparams, params);
	*/

	m_total_size = 0;
	m_dim = 0;
	m_selcluster = 0;
	m_bInit = false;
	m_nClusters = 0;

	m_xblock = 1;
	m_yblock = 1;
	m_zblock = 1;

	m_datamin = -100;
	m_datamax = 100;
#ifdef SHOW_CLUSTER
	pVolume->SetClusterView(this);
#endif

	srand((unsigned)time( NULL ));
}
Ejemplo n.º 11
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;
}
Ejemplo n.º 12
0
Fl_Double_Window* UserInterface::make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_mainWindow = new Fl_Double_Window(797, 595, "Mesh viewer");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(0, 22, 125, 506, "Camera controls");
      o->box(FL_ENGRAVED_BOX);
      { Fl_Slider* o = m_sldZoom = new Fl_Slider(16, 29, 95, 25, "Zoom");
        o->tooltip("Zoom camera in and out");
        o->type(1);
        o->minimum(0.0001);
        o->maximum(0.999);
        o->step(0.01);
        o->value(0.5);
        o->slider_size(0.040404);
        o->callback((Fl_Callback*)cb_m_sldZoom);
      }
      { Fl_Roller* o = m_rolRotAmt = new Fl_Roller(45, 333, 75, 20, "Rot. ");
        o->tooltip("Set rotation amount for key (j,k,i,m,r,R)");
        o->type(1);
        o->value(0.2);
        o->callback((Fl_Callback*)cb_m_rolRotAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Dial* o = m_dialSpin = new Fl_Dial(74, 91, 31, 30, "Spin");
        o->tooltip("Spin camera");
        o->step(0.05);
        o->callback((Fl_Callback*)cb_m_dialSpin);
      }
      { Fl_Adjuster* o = m_adjXTrans = new Fl_Adjuster(5, 223, 105, 17, "Move horiz");
        o->tooltip("Pan left/right");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjXTrans);
      }
      { Fl_Adjuster* o = m_adjYTrans = new Fl_Adjuster(5, 257, 105, 17, "Move vertical");
        o->tooltip("Camera up/down");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjYTrans);
      }
      { Fl_Adjuster* o = m_adjInOut = new Fl_Adjuster(5, 296, 105, 17, "In/Out");
        o->tooltip("Move camera in and out");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjInOut);
      }
      { Fl_Roller* o = m_rolTransAmt = new Fl_Roller(45, 358, 75, 15, "Trans.");
        o->tooltip("Change translation amount");
        o->type(1);
        o->maximum(10);
        o->value(0.1);
        o->callback((Fl_Callback*)cb_m_rolTransAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Button* o = new Fl_Button(24, 378, 65, 25, "Reset");
        o->tooltip("Reset camera");
        o->callback((Fl_Callback*)cb_Reset);
      }
      { Fl_Roller* o = m_rolUpDown = new Fl_Roller(15, 68, 20, 70, "Up/down");
        o->tooltip("Rotate the camera up/down");
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolUpDown);
      }
      { Fl_Roller* o = m_rolLeftRight = new Fl_Roller(16, 158, 85, 20, "Rot left/rignt");
        o->tooltip("Rotate left to right");
        o->type(1);
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolLeftRight);
      }
      { Fl_Button* o = new Fl_Button(5, 194, 35, 25, "Zero");
        o->tooltip("Zero trans sliders");
        o->callback((Fl_Callback*)cb_Zero);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 462, 20, 25, "IBar");
        o->down_box(FL_DOWN_BOX);
        o->value(1);
        o->callback((Fl_Callback*)cb_IBar);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 483, 25, 20, "Center obj");
        o->down_box(FL_DOWN_BOX);
        o->callback((Fl_Callback*)cb_Center);
      }
      o->end();
    }
    { JofGTIBar* o = m_view = new JofGTIBar(135, 3, 560, 557);
      Fl_Group::current()->resizable(o);
    }
    o->end();
  }
  return w;
}
Ejemplo n.º 13
0
void MainWindow::createComponents()
{
    Fl_Group* grpSequence = new Fl_Group(10,20,150,120, "Sequence :");
    if ( grpSequence != NULL )
    {
        grpSequence->box(FL_DOWN_BOX);
        grpSequence->align(Fl_Align(FL_ALIGN_TOP_LEFT));
        grpSequence->labelsize(DEFAULT_FONT_SIZE);
        grpSequence->begin();

        seqPreparing = new Fl_Box(20,30,130,20,"1. Preparing update ...");
        if ( seqPreparing != NULL )
        {
            seqPreparing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
            seqPreparing->labelsize(DEFAULT_FONT_SIZE);
            seqPreparing->deactivate();
        }

        seqRetrieving = new Fl_Box(20,50,130,20,"2. Retrieving data ...");
        if ( seqRetrieving != NULL )
        {
            seqRetrieving->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
            seqRetrieving->labelsize(DEFAULT_FONT_SIZE);
            seqRetrieving->deactivate();
        }

        seqProcessing = new Fl_Box(20,70,130,20,"3. Processing data ...");
        if ( seqProcessing != NULL )
        {
            seqProcessing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
            seqProcessing->labelsize(DEFAULT_FONT_SIZE);
            seqProcessing->deactivate();
        }

        seqUpdating = new Fl_Box(20,90,130,20,"4. Updating ...");
        if ( seqUpdating != NULL )
        {
            seqUpdating->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
            seqUpdating->labelsize(DEFAULT_FONT_SIZE);
            seqUpdating->deactivate();
        }

        seqFinalizing = new Fl_Box(20,110,130,20,"5. Finalizing ...");
        if ( seqFinalizing != NULL )
        {
            seqFinalizing->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
            seqFinalizing->labelsize(DEFAULT_FONT_SIZE);
            seqFinalizing->deactivate();
        }

        grpSequence->end();

        progBar = new Fl_Progress(10,150,150,10);
        if ( progBar != NULL )
        {
            progBar->color2(FL_BLUE);
            progBar->maximum(5);
            progBar->minimum(0);
            progBar->value(0);
        }

        mli_info = new Fl_Box(170,20,220,140,"");
        if ( mli_info != NULL )
        {
            mli_info->box( FL_DOWN_BOX );
            mli_info->align( FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE );
            mli_info->labelsize(DEFAULT_FONT_SIZE);
        }

        Fl_Box* boxCopyright = new Fl_Box(10,165,380,35);
        if ( boxCopyright != NULL )
        {
            boxCopyright->box(FL_DOWN_BOX);
            boxCopyright->align( FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE );
            boxCopyright->labelsize(COPYRIGHT_FONT_SIZE);
            boxCopyright->label("Automatic Updater, (C)Copyright 2013 Rageworx freeware.\n"
                                "All rights reserved, [email protected]");
        }

    }
}
Ejemplo n.º 14
0
void CInstaller::Init(int argc, char **argv)
{
    const int buttonsy = WindowH()-ButtonHeight()-ButtonHSpacing();
    
    m_pMainWindow = new Fl_Double_Window(WindowW(), WindowH(), "Nixstaller");
    m_pMainWindow->callback(CancelCB, this);

    Fl_Group *maingroup = new Fl_Group(0, 0, WindowW(), WindowH());
    maingroup->resizable(NULL);
    maingroup->box(FL_FLAT_BOX);
    maingroup->color(fl_lighter(FL_BACKGROUND_COLOR));

    Fl_Pack *mainpack = new Fl_Pack(0, 0, WindowW(), WindowH()-90);
    mainpack->resizable(NULL);
    mainpack->type(Fl_Pack::VERTICAL);
    
    CreateHeader();
    
    m_pWizard = new Fl_Wizard(0, m_pHeaderGroup->h(), WindowW(),
                              (buttonsy-m_pHeaderGroup->h()-ButtonHSpacing()));
    m_pWizard->box(FL_ENGRAVED_BOX);
    m_pWizard->end();

    mainpack->end();

    m_pCancelButton = new Fl_Button(ButtonWOffset(), buttonsy, 0, ButtonHeight(), GetTranslation("Cancel"));
    SetButtonWidth(m_pCancelButton);
    m_pCancelButton->callback(CancelCB, this);
    
    m_pButtonPack = new Fl_Pack(0, buttonsy, 0, ButtonHeight());
    m_pButtonPack->type(Fl_Pack::HORIZONTAL);
    m_pButtonPack->spacing(ButtonWSpacing());
    
    m_pBackButton = new Fl_Button(0, buttonsy, 0, ButtonHeight(),
                                  CreateText("@<-    %s", GetTranslation("Back")));
    SetButtonWidth(m_pBackButton);
    m_pBackButton->callback(BackCB, this);
    
    m_pNextButton = new Fl_Button(0, buttonsy, 0, ButtonHeight(),
                                  CreateText("%s    @->", GetTranslation("Next")));
    SetButtonWidth(m_pNextButton);
    m_pNextButton->callback(NextCB, this);
    
    m_pButtonPack->end();
    UpdateButtonPack();
    
    maingroup->end();
    
    CBaseInstall::Init(argc, argv);
    
    Fl_Shared_Image *img = Fl_Shared_Image::get(GetLogoFName());
    if (img)
    {
        m_pLogoBox = new Fl_Box(HeaderSpacing(), HeaderSpacing(), img->w()+HeaderSpacing(), img->h());
        m_pLogoBox->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE);
        m_pLogoBox->image(img);
        m_pHeaderGroup->add(m_pLogoBox);
    }

    int size = m_pWizard->children();
    for (int i=0; i<size; i++)
    {
        CInstallScreen *screen = GetScreen(m_pWizard->child(i));
        if (screen->CanActivate())
        {
            ActivateScreen(screen);
            break;
        }
    }
    
    m_pMainWindow->end();
    m_pMainWindow->show(argc, argv);
}
Ejemplo n.º 15
0
Fl_Double_Window* ResonanceUI::make_window() {
  { resonancewindow = new Fl_Double_Window(780, 305, "Resonance");
    resonancewindow->user_data((void*)(this));
    { khzvalue = new Fl_Value_Output(415, 264, 45, 18, "kHz");
      khzvalue->labelsize(12);
      khzvalue->minimum(0.001);
      khzvalue->maximum(48);
      khzvalue->step(0.01);
      khzvalue->textfont(1);
      khzvalue->textsize(12);
      khzvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* khzvalue
    { dbvalue = new Fl_Value_Output(415, 282, 45, 18, "dB");
      dbvalue->labelsize(12);
      dbvalue->minimum(-150);
      dbvalue->maximum(150);
      dbvalue->step(0.1);
      dbvalue->textfont(1);
      dbvalue->textsize(12);
      dbvalue->align(FL_ALIGN_RIGHT);
      //this widget must be before the calling widgets
    } // Fl_Value_Output* dbvalue
    { Fl_Group* o = new Fl_Group(6, 5, 768, 256);
      o->box(FL_BORDER_BOX);
      rg=new ResonanceGraph(o->x(),o->y(),o->w(),o->h(),"");
      rg->init(respar,khzvalue,dbvalue);
      rg->show();
      o->end();
    } // Fl_Group* o
    { Fl_Button* o = new Fl_Button(690, 283, 84, 17, "Close");
      o->box(FL_THIN_UP_BOX);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 264, 66, 15, "Zero");
      o->tooltip("Clear the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Zero);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(491, 282, 66, 18, "Smooth");
      o->tooltip("Smooth the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(12);
      o->callback((Fl_Callback*)cb_Smooth);
    } // Fl_Button* o
    { Fl_Check_Button* o = enabled = new Fl_Check_Button(6, 270, 78, 27, "Enable");
      enabled->box(FL_THIN_UP_BOX);
      enabled->down_box(FL_DOWN_BOX);
      enabled->callback((Fl_Callback*)cb_enabled);
      o->value(respar->Penabled);
    } // Fl_Check_Button* enabled
    { maxdb = new Fl_Roller(90, 282, 84, 15);
      maxdb->type(1);
      maxdb->minimum(1);
      maxdb->maximum(90);
      maxdb->step(1);
      maxdb->value(30);
      maxdb->callback((Fl_Callback*)cb_maxdb);
    } // Fl_Roller* maxdb
    { Fl_Value_Output* o = maxdbvo = new Fl_Value_Output(126, 264, 24, 18, "Max.");
      maxdbvo->tooltip("The Maximum amplitude (dB)");
      maxdbvo->labelsize(12);
      maxdbvo->minimum(1);
      maxdbvo->maximum(127);
      maxdbvo->step(1);
      maxdbvo->value(30);
      maxdbvo->textfont(1);
      maxdbvo->textsize(12);
      maxdbvo->callback((Fl_Callback*)cb_maxdbvo);
      o->value(respar->PmaxdB);
    } // Fl_Value_Output* maxdbvo
    { new Fl_Box(150, 264, 24, 18, "dB");
    } // Fl_Box* o
    { Fl_Value_Output* o = centerfreqvo = new Fl_Value_Output(210, 264, 33, 18, "C.f.");
      centerfreqvo->tooltip("Center Frequency (kHz)");
      centerfreqvo->labelsize(12);
      centerfreqvo->minimum(1);
      centerfreqvo->maximum(10);
      centerfreqvo->step(0.01);
      centerfreqvo->value(1);
      centerfreqvo->textfont(1);
      centerfreqvo->textsize(12);
      centerfreqvo->callback((Fl_Callback*)cb_centerfreqvo);
      centerfreqvo->when(3);
      o->value(respar->getcenterfreq()/1000.0);
    } // Fl_Value_Output* centerfreqvo
    { Fl_Value_Output* o = octavesfreqvo = new Fl_Value_Output(210, 282, 33, 18, "Oct.");
      octavesfreqvo->tooltip("No. of octaves");
      octavesfreqvo->labelsize(12);
      octavesfreqvo->minimum(1);
      octavesfreqvo->maximum(127);
      octavesfreqvo->step(1);
      octavesfreqvo->value(30);
      octavesfreqvo->textfont(1);
      octavesfreqvo->textsize(12);
      octavesfreqvo->callback((Fl_Callback*)cb_octavesfreqvo);
      octavesfreqvo->when(3);
      o->value(respar->getoctavesfreq());
    } // Fl_Value_Output* octavesfreqvo
    { Fl_Button* o = new Fl_Button(566, 276, 42, 12, "RND2");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND2);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(566, 264, 42, 12, "RND1");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND1);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(566, 288, 42, 12, "RND3");
      o->tooltip("Randomize the resonance function");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_RND3);
    } // Fl_Button* o
    { Fl_Check_Button* o = p1st = new Fl_Check_Button(365, 285, 45, 15, "P.1st");
      p1st->tooltip("Protect the fundamental frequency (do not damp the first harmonic)");
      p1st->down_box(FL_DOWN_BOX);
      p1st->labelsize(10);
      p1st->callback((Fl_Callback*)cb_p1st);
      o->value(respar->Pprotectthefundamental);
    } // Fl_Check_Button* p1st
    { Fl_Button* o = new Fl_Button(365, 265, 46, 15, "InterpP");
      o->tooltip("Interpolate the peaks");
      o->box(FL_THIN_UP_BOX);
      o->labelfont(1);
      o->labelsize(10);
      o->callback((Fl_Callback*)cb_InterpP);
    } // Fl_Button* o
    { WidgetPDial* o = centerfreq = new WidgetPDial(master, 245, 265, 30, 30, "C.f.");
      centerfreq->box(FL_ROUND_UP_BOX);
      centerfreq->color(FL_BACKGROUND_COLOR);
      centerfreq->selection_color(FL_INACTIVE_COLOR);
      centerfreq->labeltype(FL_NORMAL_LABEL);
      centerfreq->labelfont(0);
      centerfreq->labelsize(10);
      centerfreq->labelcolor(FL_FOREGROUND_COLOR);
      centerfreq->maximum(127);
      centerfreq->step(1);
      centerfreq->callback((Fl_Callback*)cb_centerfreq);
      centerfreq->align(FL_ALIGN_BOTTOM);
      centerfreq->when(FL_WHEN_CHANGED);
      o->value(respar->Pcenterfreq);
    } // WidgetPDial* centerfreq
    { WidgetPDial* o = octavesfreq = new WidgetPDial(master, 280, 265, 30, 30, "Oct.");
      octavesfreq->box(FL_ROUND_UP_BOX);
      octavesfreq->color(FL_BACKGROUND_COLOR);
      octavesfreq->selection_color(FL_INACTIVE_COLOR);
      octavesfreq->labeltype(FL_NORMAL_LABEL);
      octavesfreq->labelfont(0);
      octavesfreq->labelsize(10);
      octavesfreq->labelcolor(FL_FOREGROUND_COLOR);
      octavesfreq->maximum(127);
      octavesfreq->step(1);
      octavesfreq->callback((Fl_Callback*)cb_octavesfreq);
      octavesfreq->align(FL_ALIGN_BOTTOM);
      octavesfreq->when(FL_WHEN_CHANGED);
      o->value(respar->Poctavesfreq);
    } // WidgetPDial* octavesfreq
    { Fl_Button* o = new Fl_Button(625, 275, 25, 15, "C");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_C);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(655, 275, 25, 15, "P");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_P);
    } // Fl_Button* o
    { applybutton = new Fl_Button(690, 265, 85, 15, "Apply");
      applybutton->box(FL_THIN_UP_BOX);
      applybutton->labelfont(1);
      applybutton->labelsize(11);
      applybutton->callback((Fl_Callback*)cb_applybutton);
    } // Fl_Button* applybutton
    resonancewindow->end();
  } // Fl_Double_Window* resonancewindow
  return resonancewindow;
}
Ejemplo n.º 16
0
Fl_Led_Window::Fl_Led_Window(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name, int n_leds)
{
	int N_Columns = 7;
	int N_Rows;
	int W, H;
	int xpos, ypos;

	num_leds = n_leds;
	color_index = FL_GREEN;
	Led_Mask = 0;

	if (num_leds <= N_Columns) {
		W = 10 + num_leds*(LED_WIDTH + 10) + 10;
		H = 5 + 10 + LED_HEIGHT + 20 + 5;
	} else {
		num_leds % N_Columns ? N_Rows = (int)(num_leds / N_Columns) + 1 : N_Rows = (int)(num_leds / N_Columns);
		W = 10 + N_Columns*(LED_WIDTH + 10) + 10;
		H = 5 + 10 + N_Rows*(LED_HEIGHT + 20) + 5;
	}

	Fl::lock();

	s->begin();

	Fl_MDI_Window *w = LWin = new Fl_MDI_Window(0, 0, W, H, name);

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

	Leds = new Fl_Led*[num_leds];
	{ Fl_Group *g = Led_Group = new Fl_Group(5, 5, W - 10, H - 10);
	  g->box(FL_ENGRAVED_BOX);
	  xpos = 0;
	  ypos = 0;
	  for (int i = 1; i <= num_leds; i++) {
		char led_label[10];
		sprintf(led_label, "%d\n", i);
		{ Fl_Led *o = Leds[i-1] = new Fl_Led(10 + (LED_WIDTH + 10)*xpos, 10 + (LED_HEIGHT + 20)*ypos, LED_WIDTH, LED_HEIGHT, strdup(led_label));
		  o->number(i-1);
		  o->color(fl_darker(fl_darker(color_index)));
		  o->selection_color(fl_darker(fl_darker(color_index)));
		  xpos++;
		  if (i >= N_Columns) {
		  	if ((N_Columns*(ypos + 1) % i) == 0) {
				xpos = 0;
				ypos++;
		  	}
		  }
		}
	  }  
	  g->end();
	}

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

	s->end();

	w->titlebar()->h(15);
	w->titlebar()->color(FL_BLACK);
	w->position(x, y);

	Fl::unlock();
}
Ejemplo n.º 17
0
Fl_Double_Window* FilterUI::make_formant_window() {
  { formantparswindow = new Fl_Double_Window(700, 205, "Formant Filter Parameters");
    formantparswindow->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(485, 47, 105, 113);
      o->box(FL_THIN_UP_BOX);
      { Fl_Counter* o = new Fl_Counter(545, 80, 40, 15, "Formant ");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textsize(10);
        o->callback((Fl_Callback*)cb_Formant);
        o->align(FL_ALIGN_LEFT);
        o->bounds(0,FF_MAX_FORMANTS-1);
        o->value(nformant);
      } // Fl_Counter* o
      { Fl_Counter* o = new Fl_Counter(545, 55, 40, 20, "Vowel no.");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textfont(1);
        o->textsize(11);
        o->callback((Fl_Callback*)cb_Vowel);
        o->align(FL_ALIGN_LEFT);
        o->bounds(0,FF_MAX_VOWELS-1);
        o->value(nvowel);
      } // Fl_Counter* o
      { formantparsgroup = new Fl_Group(490, 105, 95, 50);
        formantparsgroup->box(FL_ENGRAVED_FRAME);
        { formant_freq_dial = new WidgetPDial(495, 115, 25, 25, "freq");
          formant_freq_dial->tooltip("Formant frequency");
          formant_freq_dial->box(FL_ROUND_UP_BOX);
          formant_freq_dial->color(FL_BACKGROUND_COLOR);
          formant_freq_dial->selection_color(FL_INACTIVE_COLOR);
          formant_freq_dial->labeltype(FL_NORMAL_LABEL);
          formant_freq_dial->labelfont(0);
          formant_freq_dial->labelsize(10);
          formant_freq_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_freq_dial->maximum(127);
          formant_freq_dial->step(1);
          formant_freq_dial->callback((Fl_Callback*)cb_formant_freq_dial);
          formant_freq_dial->align(FL_ALIGN_BOTTOM);
          formant_freq_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_freq_dial
        { formant_q_dial = new WidgetPDial(525, 115, 24, 25, "Q");
          formant_q_dial->tooltip("Formant\'s Q");
          formant_q_dial->box(FL_ROUND_UP_BOX);
          formant_q_dial->color(FL_BACKGROUND_COLOR);
          formant_q_dial->selection_color(FL_INACTIVE_COLOR);
          formant_q_dial->labeltype(FL_NORMAL_LABEL);
          formant_q_dial->labelfont(0);
          formant_q_dial->labelsize(10);
          formant_q_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_q_dial->maximum(127);
          formant_q_dial->step(1);
          formant_q_dial->callback((Fl_Callback*)cb_formant_q_dial);
          formant_q_dial->align(FL_ALIGN_BOTTOM);
          formant_q_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_q_dial
        { formant_amp_dial = new WidgetPDial(555, 115, 24, 25, "amp");
          formant_amp_dial->tooltip("Formant amplitude");
          formant_amp_dial->box(FL_ROUND_UP_BOX);
          formant_amp_dial->color(FL_BACKGROUND_COLOR);
          formant_amp_dial->selection_color(FL_INACTIVE_COLOR);
          formant_amp_dial->labeltype(FL_NORMAL_LABEL);
          formant_amp_dial->labelfont(0);
          formant_amp_dial->labelsize(10);
          formant_amp_dial->labelcolor(FL_FOREGROUND_COLOR);
          formant_amp_dial->maximum(127);
          formant_amp_dial->step(1);
          formant_amp_dial->callback((Fl_Callback*)cb_formant_amp_dial);
          formant_amp_dial->align(FL_ALIGN_BOTTOM);
          formant_amp_dial->when(FL_WHEN_CHANGED);
        } // WidgetPDial* formant_amp_dial
        formantparsgroup->end();
      } // Fl_Group* formantparsgroup
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(590, 47, 100, 113);
      o->box(FL_THIN_UP_BOX);
      { Fl_Counter* o = new Fl_Counter(595, 62, 55, 20, "Seq.Size");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textfont(1);
        o->textsize(11);
        o->callback((Fl_Callback*)cb_Seq);
        o->align(FL_ALIGN_TOP_LEFT);
        o->bounds(1,FF_MAX_SEQUENCE-1);
        o->value(pars->Psequencesize);
      } // Fl_Counter* o
      { Fl_Counter* o = new Fl_Counter(595, 97, 40, 15, "S.Pos.");
        o->tooltip("Current position from the sequence");
        o->type(1);
        o->labelfont(1);
        o->labelsize(10);
        o->minimum(0);
        o->maximum(127);
        o->step(1);
        o->textsize(10);
        o->callback((Fl_Callback*)cb_S);
        o->align(FL_ALIGN_TOP_RIGHT);
        o->bounds(0,FF_MAX_SEQUENCE-2);
        o->value(nseqpos);
      } // Fl_Counter* o
      { Fl_Counter* o = vowel_counter = new Fl_Counter(640, 97, 40, 15, "Vowel");
        vowel_counter->type(1);
        vowel_counter->labelsize(10);
        vowel_counter->minimum(0);
        vowel_counter->maximum(127);
        vowel_counter->step(1);
        vowel_counter->textsize(10);
        vowel_counter->callback((Fl_Callback*)cb_vowel_counter);
        vowel_counter->align(FL_ALIGN_TOP);
        o->bounds(0,FF_MAX_VOWELS-1);
      } // Fl_Counter* vowel_counter
      { Fl_Check_Button* o = new Fl_Check_Button(625, 132, 60, 20, "Neg.Input");
        o->tooltip("Negate the input from LFO/envelopes/etc.");
        o->down_box(FL_DOWN_BOX);
        o->labelsize(10);
        o->callback((Fl_Callback*)cb_Neg);
        o->value(pars->Psequencereversed);
      } // Fl_Check_Button* o
      { WidgetPDial* o = strchdial = new WidgetPDial(595, 130, 25, 25, "Strch");
        strchdial->tooltip("Sequence Stretch");
        strchdial->box(FL_ROUND_UP_BOX);
        strchdial->color(FL_BACKGROUND_COLOR);
        strchdial->selection_color(FL_INACTIVE_COLOR);
        strchdial->labeltype(FL_NORMAL_LABEL);
        strchdial->labelfont(0);
        strchdial->labelsize(10);
        strchdial->labelcolor(FL_FOREGROUND_COLOR);
        strchdial->maximum(127);
        strchdial->step(1);
        strchdial->callback((Fl_Callback*)cb_strchdial);
        strchdial->align(FL_ALIGN_TOP);
        strchdial->when(FL_WHEN_CHANGED);
        o->value(pars->Psequencestretch);
      } // WidgetPDial* strchdial
      o->end();
    } // Fl_Group* o
    { Fl_Counter* o = new Fl_Counter(485, 15, 65, 20, "Num.Formants");
      o->type(1);
      o->labelfont(1);
      o->labelsize(10);
      o->minimum(0);
      o->maximum(127);
      o->step(1);
      o->callback((Fl_Callback*)cb_Num);
      o->align(FL_ALIGN_TOP_LEFT);
      o->bounds(1,FF_MAX_FORMANTS);
      o->value(pars->Pnumformants);
    } // Fl_Counter* o
    { WidgetPDial* o = frsldial = new WidgetPDial(565, 15, 25, 25, "Fr.Sl.");
      frsldial->tooltip("Formant\'s Slowness (Morphing)");
      frsldial->box(FL_ROUND_UP_BOX);
      frsldial->color(FL_BACKGROUND_COLOR);
      frsldial->selection_color(FL_INACTIVE_COLOR);
      frsldial->labeltype(FL_NORMAL_LABEL);
      frsldial->labelfont(1);
      frsldial->labelsize(10);
      frsldial->labelcolor(FL_FOREGROUND_COLOR);
      frsldial->maximum(127);
      frsldial->step(1);
      frsldial->callback((Fl_Callback*)cb_frsldial);
      frsldial->align(FL_ALIGN_TOP);
      frsldial->when(FL_WHEN_CHANGED);
      o->value(pars->Pformantslowness);
    } // WidgetPDial* frsldial
    { Fl_Value_Output* o = centerfreqvo = new Fl_Value_Output(515, 164, 33, 18, "C.f.");
      centerfreqvo->tooltip("Center Frequency (kHz)");
      centerfreqvo->minimum(1);
      centerfreqvo->maximum(10);
      centerfreqvo->step(0.01);
      centerfreqvo->value(1);
      centerfreqvo->textfont(1);
      centerfreqvo->callback((Fl_Callback*)cb_centerfreqvo);
      centerfreqvo->when(3);
      o->value(pars->getcenterfreq()/1000.0);
    } // Fl_Value_Output* centerfreqvo
    { Fl_Value_Output* o = octavesfreqvo = new Fl_Value_Output(515, 182, 33, 18, "Oct.");
      octavesfreqvo->tooltip("No. of octaves");
      octavesfreqvo->minimum(1);
      octavesfreqvo->maximum(127);
      octavesfreqvo->step(1);
      octavesfreqvo->value(5);
      octavesfreqvo->textfont(1);
      octavesfreqvo->callback((Fl_Callback*)cb_octavesfreqvo);
      octavesfreqvo->when(3);
      o->value(pars->getoctavesfreq());
    } // Fl_Value_Output* octavesfreqvo
    { Fl_Slider* o = cfknob = new Fl_Slider(551, 167, 84, 15);
      cfknob->type(5);
      cfknob->box(FL_FLAT_BOX);
      cfknob->maximum(127);
      cfknob->callback((Fl_Callback*)cb_cfknob);
      o->value(pars->Pcenterfreq);
    } // Fl_Slider* cfknob
    { Fl_Slider* o = octknob = new Fl_Slider(551, 185, 84, 15);
      octknob->type(5);
      octknob->box(FL_FLAT_BOX);
      octknob->maximum(127);
      octknob->callback((Fl_Callback*)cb_octknob);
      o->value(pars->Poctavesfreq);
    } // Fl_Slider* octknob
    { FormantFilterGraph* o = formantfiltergraph = new FormantFilterGraph(5, 5, 475, 195);
      formantfiltergraph->box(FL_BORDER_BOX);
      formantfiltergraph->color(FL_BACKGROUND_COLOR);
      formantfiltergraph->selection_color(FL_BACKGROUND_COLOR);
      formantfiltergraph->labeltype(FL_NORMAL_LABEL);
      formantfiltergraph->labelfont(0);
      formantfiltergraph->labelsize(14);
      formantfiltergraph->labelcolor(FL_FOREGROUND_COLOR);
      formantfiltergraph->align(FL_ALIGN_CENTER);
      formantfiltergraph->when(FL_WHEN_RELEASE);
      o->init(pars,&nvowel,&nformant);
    } // FormantFilterGraph* formantfiltergraph
    { WidgetPDial* o = wvknob = new WidgetPDial(600, 15, 25, 25, "Vw.Cl.");
      wvknob->tooltip("Vowel \"clearness\" (how the mixed vowels are avoided)");
      wvknob->box(FL_ROUND_UP_BOX);
      wvknob->color(FL_BACKGROUND_COLOR);
      wvknob->selection_color(FL_INACTIVE_COLOR);
      wvknob->labeltype(FL_NORMAL_LABEL);
      wvknob->labelfont(1);
      wvknob->labelsize(10);
      wvknob->labelcolor(FL_FOREGROUND_COLOR);
      wvknob->maximum(127);
      wvknob->step(1);
      wvknob->callback((Fl_Callback*)cb_wvknob);
      wvknob->align(FL_ALIGN_TOP);
      wvknob->when(FL_WHEN_CHANGED);
      o->value(pars->Pvowelclearness);
    } // WidgetPDial* wvknob
    { Fl_Button* o = new Fl_Button(645, 180, 50, 25, "Close");
      o->box(FL_THIN_UP_BOX);
      o->callback((Fl_Callback*)cb_Close);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(635, 25, 25, 15, "C");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_C1);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(665, 25, 25, 15, "P");
      o->box(FL_THIN_UP_BOX);
      o->color((Fl_Color)179);
      o->labelfont(1);
      o->labelsize(11);
      o->labelcolor(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_P1);
    } // Fl_Button* o
    { new Fl_Box(635, 10, 55, 15, "Vowel");
    } // Fl_Box* o
    formantparswindow->end();
  } // Fl_Double_Window* formantparswindow
  return formantparswindow;
}
Ejemplo n.º 18
0
SciCalc::SciCalc() {
  { win = new Fl_Double_Window(181, 262, "ecalc");
    win->user_data((void*)(this));
    { leddisplay = new Fl_Box(5, 3, 172, 24, "0 ");
      leddisplay->box(FL_DOWN_BOX);
      leddisplay->color((Fl_Color)207);
      leddisplay->labelfont(1);
      leddisplay->labelsize(16);
      leddisplay->labelcolor((Fl_Color)59);
      leddisplay->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
    } // Fl_Box* leddisplay
    { box_DEGRAD = new Fl_Box(24, 27, 35, 15, " ");
      box_DEGRAD->box(FL_ENGRAVED_BOX);
      box_DEGRAD->labelsize(9);
      box_DEGRAD->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    } // Fl_Box* box_DEGRAD
    { box_bracket = new Fl_Box(59, 27, 65, 15);
      box_bracket->box(FL_ENGRAVED_BOX);
      box_bracket->labelsize(9);
      box_bracket->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    } // Fl_Box* box_bracket
    { box_M = new Fl_Box(124, 27, 35, 15, "M");
      box_M->box(FL_ENGRAVED_BOX);
      box_M->labelsize(9);
      box_M->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    } // Fl_Box* box_M
    { Fl_Group* o = new Fl_Group(46, 44, 93, 22);
      o->color((Fl_Color)46);
      { radio_2 = new Fl_Button(49, 48, 20, 15, "2");
        radio_2->type(102);
        radio_2->labelsize(10);
        radio_2->labelcolor((Fl_Color)1);
        radio_2->callback((Fl_Callback*)cb_radio_2);
      } // Fl_Button* radio_2
      { radio_8 = new Fl_Button(70, 48, 21, 15, "8");
        radio_8->type(102);
        radio_8->labelsize(10);
        radio_8->labelcolor((Fl_Color)1);
        radio_8->callback((Fl_Callback*)cb_radio_8);
      } // Fl_Button* radio_8
      { radio_10 = new Fl_Button(92, 48, 21, 15, "10");
        radio_10->type(102);
        radio_10->value(1);
        radio_10->labelsize(10);
        radio_10->labelcolor((Fl_Color)1);
        radio_10->callback((Fl_Callback*)cb_radio_10);
      } // Fl_Button* radio_10
      { radio_16 = new Fl_Button(114, 48, 21, 15, "16");
        radio_16->type(102);
        radio_16->labelsize(10);
        radio_16->labelcolor((Fl_Color)1);
        radio_16->callback((Fl_Callback*)cb_radio_16);
      } // Fl_Button* radio_16
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(3, 163, 107, 94);
      o->box(FL_FLAT_BOX);
      o->color((Fl_Color)43);
      { but_7 = new Fl_Button(6, 167, 32, 20, "7");
        but_7->shortcut(0x37);
        but_7->labelfont(1);
        but_7->labelsize(16);
        but_7->callback((Fl_Callback*)cb_but_7);
      } // Fl_Button* but_7
      { but_8 = new Fl_Button(41, 167, 32, 20, "8");
        but_8->shortcut(0x38);
        but_8->labelfont(1);
        but_8->labelsize(16);
        but_8->callback((Fl_Callback*)cb_but_8);
      } // Fl_Button* but_8
      { but_9 = new Fl_Button(75, 167, 32, 20, "9");
        but_9->shortcut(0x39);
        but_9->labelfont(1);
        but_9->labelsize(16);
        but_9->callback((Fl_Callback*)cb_but_9);
      } // Fl_Button* but_9
      { but_4 = new Fl_Button(6, 189, 32, 20, "4");
        but_4->shortcut(0x34);
        but_4->labelfont(1);
        but_4->labelsize(16);
        but_4->callback((Fl_Callback*)cb_but_4);
      } // Fl_Button* but_4
      { but_5 = new Fl_Button(41, 189, 32, 20, "5");
        but_5->shortcut(0x35);
        but_5->labelfont(1);
        but_5->labelsize(16);
        but_5->callback((Fl_Callback*)cb_but_5);
      } // Fl_Button* but_5
      { but_6 = new Fl_Button(75, 189, 32, 20, "6");
        but_6->shortcut(0x36);
        but_6->labelfont(1);
        but_6->labelsize(16);
        but_6->callback((Fl_Callback*)cb_but_6);
      } // Fl_Button* but_6
      { but_1 = new Fl_Button(6, 211, 32, 20, "1");
        but_1->shortcut(0x31);
        but_1->labelfont(1);
        but_1->labelsize(16);
        but_1->callback((Fl_Callback*)cb_but_1);
      } // Fl_Button* but_1
      { but_2 = new Fl_Button(41, 211, 32, 20, "2");
        but_2->shortcut(0x32);
        but_2->labelfont(1);
        but_2->labelsize(16);
        but_2->callback((Fl_Callback*)cb_but_2);
      } // Fl_Button* but_2
      { but_3 = new Fl_Button(75, 211, 32, 20, "3");
        but_3->shortcut(0x33);
        but_3->labelfont(1);
        but_3->labelsize(16);
        but_3->callback((Fl_Callback*)cb_but_3);
      } // Fl_Button* but_3
      { but_0 = new Fl_Button(6, 233, 32, 20, "0");
        but_0->shortcut(0x30);
        but_0->labelfont(1);
        but_0->labelsize(16);
        but_0->callback((Fl_Callback*)cb_but_0);
      } // Fl_Button* but_0
      { but_dot = new Fl_Button(41, 233, 32, 20, ".");
        but_dot->shortcut(0x2e);
        but_dot->labelfont(1);
        but_dot->labelsize(16);
        but_dot->callback((Fl_Callback*)cb_but_dot);
      } // Fl_Button* but_dot
      { but_sign = new Fl_Button(75, 233, 32, 20, "+/-");
        but_sign->labelfont(1);
        but_sign->labelsize(16);
        but_sign->callback((Fl_Callback*)cb_but_sign);
      } // Fl_Button* but_sign
      o->end();
    } // Fl_Group* o
    { but_C = new Fl_Button(112, 167, 31, 20, "C");
      but_C->labelfont(1);
      but_C->labelsize(16);
      but_C->callback((Fl_Callback*)cb_but_C);
    } // Fl_Button* but_C
    { but_AC = new Fl_Button(146, 167, 30, 20, "AC");
      but_AC->labelfont(1);
      but_AC->labelsize(16);
      but_AC->callback((Fl_Callback*)cb_but_AC);
    } // Fl_Button* but_AC
    { but_X = new Fl_Button(112, 189, 31, 20, "x");
      but_X->shortcut(0x2a);
      but_X->labelfont(1);
      but_X->labelsize(16);
      but_X->callback((Fl_Callback*)cb_but_X);
    } // Fl_Button* but_X
    { but_div = new Fl_Button(146, 189, 30, 20, "/");
      but_div->shortcut(0x2f);
      but_div->labelfont(1);
      but_div->labelsize(16);
      but_div->callback((Fl_Callback*)cb_but_div);
    } // Fl_Button* but_div
    { but_plus = new Fl_Button(112, 211, 31, 20, "+");
      but_plus->shortcut(0x2b);
      but_plus->labelfont(1);
      but_plus->labelsize(16);
      but_plus->callback((Fl_Callback*)cb_but_plus);
    } // Fl_Button* but_plus
    { but_minus = new Fl_Button(146, 211, 30, 20, "-");
      but_minus->shortcut(0x2d);
      but_minus->labelfont(1);
      but_minus->labelsize(16);
      but_minus->callback((Fl_Callback*)cb_but_minus);
    } // Fl_Button* but_minus
    { but_pi = new Fl_Button(112, 233, 31, 20, "e/p");
      but_pi->labelfont(12);
      but_pi->labelsize(17);
      but_pi->callback((Fl_Callback*)cb_but_pi);
    } // Fl_Button* but_pi
    { but_eval = new Fl_Button(146, 233, 30, 20, "=");
      but_eval->shortcut(0x3d);
      but_eval->labelfont(1);
      but_eval->labelsize(16);
      but_eval->callback((Fl_Callback*)cb_but_eval);
    } // Fl_Button* but_eval
    { but_eval_hidden = new Fl_Button(147, 253, 6, 7);
      but_eval_hidden->box(FL_NO_BOX);
      but_eval_hidden->shortcut(0xff0d);
      but_eval_hidden->labelfont(1);
      but_eval_hidden->labelsize(16);
      but_eval_hidden->callback((Fl_Callback*)cb_but_eval_hidden);
    } // Fl_Button* but_eval_hidden
    { but_eval_hidden2 = new Fl_Button(157, 263, 6, 7);
      but_eval_hidden2->box(FL_NO_BOX);
      but_eval_hidden2->shortcut(0xff8d);
      but_eval_hidden2->labelfont(1);
      but_eval_hidden2->labelsize(16);
      but_eval_hidden2->callback((Fl_Callback*)cb_but_eval_hidden2);
    } // Fl_Button* but_eval_hidden2
    { but_sqrt = new Fl_Button(6, 70, 32, 21, "sqrt");
      but_sqrt->labelsize(11);
      but_sqrt->labelcolor((Fl_Color)4);
      but_sqrt->callback((Fl_Callback*)cb_but_sqrt);
    } // Fl_Button* but_sqrt
    { but_pow = new Fl_Button(41, 70, 32, 21, "x^y");
      but_pow->labelsize(11);
      but_pow->labelcolor((Fl_Color)4);
      but_pow->callback((Fl_Callback*)cb_but_pow);
    } // Fl_Button* but_pow
    { but_sin = new Fl_Button(76, 70, 31, 21, "sin");
      but_sin->labelsize(11);
      but_sin->labelcolor((Fl_Color)4);
      but_sin->callback((Fl_Callback*)cb_but_sin);
    } // Fl_Button* but_sin
    { but_cos = new Fl_Button(110, 70, 31, 21, "cos");
      but_cos->labelsize(11);
      but_cos->labelcolor((Fl_Color)4);
      but_cos->callback((Fl_Callback*)cb_but_cos);
    } // Fl_Button* but_cos
    { but_tan = new Fl_Button(144, 70, 30, 21, "tan");
      but_tan->labelsize(11);
      but_tan->labelcolor((Fl_Color)4);
      but_tan->callback((Fl_Callback*)cb_but_tan);
    } // Fl_Button* but_tan
    { but_log = new Fl_Button(6, 93, 32, 21, "log");
      but_log->labelsize(11);
      but_log->labelcolor((Fl_Color)4);
      but_log->callback((Fl_Callback*)cb_but_log);
    } // Fl_Button* but_log
    { but_ln = new Fl_Button(41, 93, 32, 21, "ln");
      but_ln->labelsize(11);
      but_ln->labelcolor((Fl_Color)4);
      but_ln->callback((Fl_Callback*)cb_but_ln);
    } // Fl_Button* but_ln
    { but_int = new Fl_Button(76, 93, 31, 21, "int");
      but_int->labelsize(11);
      but_int->labelcolor((Fl_Color)4);
      but_int->callback((Fl_Callback*)cb_but_int);
    } // Fl_Button* but_int
    { but_dr = new Fl_Button(110, 93, 31, 21, "d->r");
      but_dr->labelsize(10);
      but_dr->labelcolor((Fl_Color)4);
      but_dr->callback((Fl_Callback*)cb_but_dr);
    } // Fl_Button* but_dr
    { but_drg = new Fl_Button(144, 93, 30, 21, "d-r-g");
      but_drg->labelsize(9);
      but_drg->callback((Fl_Callback*)cb_but_drg);
    } // Fl_Button* but_drg
    { but_leftbr = new Fl_Button(6, 116, 32, 21, "[");
      but_leftbr->shortcut(0x28);
      but_leftbr->labelsize(11);
      but_leftbr->callback((Fl_Callback*)cb_but_leftbr);
    } // Fl_Button* but_leftbr
    { but_rightbr = new Fl_Button(41, 116, 32, 21, "]");
      but_rightbr->shortcut(0x29);
      but_rightbr->labelsize(11);
      but_rightbr->callback((Fl_Callback*)cb_but_rightbr);
    } // Fl_Button* but_rightbr
    { but_exch = new Fl_Button(76, 116, 31, 21, "exch");
      but_exch->labelsize(11);
      but_exch->callback((Fl_Callback*)cb_but_exch);
    } // Fl_Button* but_exch
    { but_invx = new Fl_Button(110, 116, 31, 21, "1/x");
      but_invx->labelsize(11);
      but_invx->callback((Fl_Callback*)cb_but_invx);
    } // Fl_Button* but_invx
    { but_fact = new Fl_Button(144, 116, 30, 21, "x!");
      but_fact->labelsize(11);
      but_fact->callback((Fl_Callback*)cb_but_fact);
    } // Fl_Button* but_fact
    { but_Mplus = new Fl_Button(6, 139, 32, 21, "M+");
      but_Mplus->color((Fl_Color)93);
      but_Mplus->labelcolor((Fl_Color)4);
      but_Mplus->callback((Fl_Callback*)cb_but_Mplus);
    } // Fl_Button* but_Mplus
    { but_Mmult = new Fl_Button(41, 139, 32, 21, "M*");
      but_Mmult->color((Fl_Color)93);
      but_Mmult->labelcolor((Fl_Color)4);
      but_Mmult->callback((Fl_Callback*)cb_but_Mmult);
    } // Fl_Button* but_Mmult
    { but_Mclear = new Fl_Button(76, 139, 31, 21, "MC");
      but_Mclear->color((Fl_Color)93);
      but_Mclear->labelcolor((Fl_Color)4);
      but_Mclear->callback((Fl_Callback*)cb_but_Mclear);
    } // Fl_Button* but_Mclear
    { but_Mst = new Fl_Button(110, 139, 31, 21, "Mst");
      but_Mst->color((Fl_Color)93);
      but_Mst->callback((Fl_Callback*)cb_but_Mst);
    } // Fl_Button* but_Mst
    { but_Mrc = new Fl_Button(144, 139, 30, 21, "Mrc");
      but_Mrc->color((Fl_Color)93);
      but_Mrc->callback((Fl_Callback*)cb_but_Mrc);
    } // Fl_Button* but_Mrc
    { check_inv = new Fl_Button(6, 44, 32, 21, "inv");
      check_inv->type(1);
      check_inv->labelsize(11);
      check_inv->labelcolor((Fl_Color)4);
      check_inv->callback((Fl_Callback*)cb_check_inv);
    } // Fl_Button* check_inv
    { but_quit = new Fl_Button(145, 44, 29, 21, "Exit");
      but_quit->labelfont(1);
      but_quit->labelcolor((Fl_Color)33);
      but_quit->callback((Fl_Callback*)cb_but_quit);
    } // Fl_Button* but_quit
    win->end();
  } // Fl_Double_Window* win
  init_value(0);
	drgmode = 1;
	base = 10;
	currentbrkt = 0;
	startbrkt[0] = 0;

	set_memdisp();
	set_brktdisp();
	radio_10->value(1);
	set_drgdisp();
	set_display(0.0,NONE);
}
Ejemplo n.º 19
0
FltDesignUI::FltDesignUI() {
  Fl_Window* w;
  { Fl_Window* o = mainWindow = new Fl_Window(439, 249, "Filter Design UI");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = kernel = new Fl_Group(0, 20, 272, 140, "Filter Kernel");
      o->box(FL_ENGRAVED_FRAME);
      o->when(FL_WHEN_CHANGED);
      { Fl_Value_Input* o = ele0 = new Fl_Value_Input(5, 26, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele0);
      }
      { Fl_Value_Input* o = ele1 = new Fl_Value_Input(58, 26, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele1);
      }
      { Fl_Value_Input* o = ele2 = new Fl_Value_Input(111, 26, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele2);
      }
      { Fl_Value_Input* o = ele3 = new Fl_Value_Input(164, 26, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele3);
      }
      { Fl_Value_Input* o = ele4 = new Fl_Value_Input(217, 26, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele4);
      }
      { Fl_Value_Input* o = ele5 = new Fl_Value_Input(5, 52, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele5);
      }
      { Fl_Value_Input* o = ele6 = new Fl_Value_Input(58, 52, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele6);
      }
      { Fl_Value_Input* o = ele7 = new Fl_Value_Input(111, 52, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele7);
      }
      { Fl_Value_Input* o = ele8 = new Fl_Value_Input(164, 52, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele8);
      }
      { Fl_Value_Input* o = ele9 = new Fl_Value_Input(217, 52, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele9);
      }
      { Fl_Value_Input* o = ele10 = new Fl_Value_Input(5, 78, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele10);
      }
      { Fl_Value_Input* o = ele11 = new Fl_Value_Input(58, 78, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele11);
      }
      { Fl_Value_Input* o = ele12 = new Fl_Value_Input(111, 78, 50, 25);
        o->maximum(255);
        o->value(1);
        o->callback((Fl_Callback*)cb_ele12);
      }
      { Fl_Value_Input* o = ele13 = new Fl_Value_Input(164, 78, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele13);
      }
      { Fl_Value_Input* o = ele14 = new Fl_Value_Input(217, 78, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele14);
      }
      { Fl_Value_Input* o = ele15 = new Fl_Value_Input(5, 104, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele15);
      }
      { Fl_Value_Input* o = ele16 = new Fl_Value_Input(58, 104, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele16);
      }
      { Fl_Value_Input* o = ele17 = new Fl_Value_Input(111, 104, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele17);
      }
      { Fl_Value_Input* o = ele18 = new Fl_Value_Input(164, 104, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele18);
      }
      { Fl_Value_Input* o = ele19 = new Fl_Value_Input(217, 104, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele19);
      }
      { Fl_Value_Input* o = ele20 = new Fl_Value_Input(5, 130, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele20);
      }
      { Fl_Value_Input* o = ele21 = new Fl_Value_Input(58, 130, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele21);
      }
      { Fl_Value_Input* o = ele22 = new Fl_Value_Input(111, 130, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele22);
      }
      { Fl_Value_Input* o = ele23 = new Fl_Value_Input(164, 130, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele23);
      }
      { Fl_Value_Input* o = ele24 = new Fl_Value_Input(217, 130, 50, 25);
        o->maximum(255);
        o->callback((Fl_Callback*)cb_ele24);
      }
      o->end();
    }
    { Fl_Value_Input* o = scale = new Fl_Value_Input(112, 163, 154, 25, "Divide by::");
      o->maximum(255);
      o->value(1);
      o->callback((Fl_Callback*)cb_scale);
    }
    { Fl_Value_Input* o = offset = new Fl_Value_Input(112, 191, 154, 25, "Offset:");
      o->maximum(255);
      o->callback((Fl_Callback*)cb_offset);
    }
    { Fl_Group* o = new Fl_Group(280, 20, 160, 64, "Filter Range");
      o->box(FL_ENGRAVED_FRAME);
      { Fl_Round_Button* o = image = new Fl_Round_Button(284, 27, 68, 28, "Whole Image");
        o->type(102);
        o->down_box(FL_ROUND_DOWN_BOX);
      }
      { Fl_Round_Button* o = selection = new Fl_Round_Button(284, 51, 68, 28, "Brush Selection");
        o->type(102);
        o->down_box(FL_ROUND_DOWN_BOX);
      }
      o->end();
    }
    { Fl_Button* o = new Fl_Button(4, 224, 124, 24, "Load");
      o->callback((Fl_Callback*)cb_Load);
    }
    { Fl_Button* o = new Fl_Button(144, 224, 124, 24, "Save");
      o->callback((Fl_Callback*)cb_Save);
    }
    { Fl_Button* o = new Fl_Button(280, 125, 156, 24, "Preview");
      o->callback((Fl_Callback*)cb_Preview);
    }
    { Fl_Button* o = new Fl_Button(280, 159, 156, 24, "Cancel");
      o->callback((Fl_Callback*)cb_Cancel);
    }
    { Fl_Button* o = new Fl_Button(280, 192, 156, 24, "Accept");
      o->callback((Fl_Callback*)cb_Accept);
    }
    { Fl_Button* o = new Fl_Button(280, 224, 156, 24, "Close");
      o->callback((Fl_Callback*)cb_Close);
    }
    o->end();
  }
}
Ejemplo n.º 20
0
int main(int argc, char* argv[]){
	Fl_Window *mainw = new Fl_Window(400, 380, "DoConfigure - Doukutsu Monotagari Settings");
	
	Fl_Group *movegroup = new Fl_Group(10, 10, 185, 50);
		movegroup->box(FL_THIN_DOWN_BOX);
		movear = new Fl_Radio_Round_Button(10, 10, 185, 20, "Arrows for Movement");
		movear->setonly();
		movegt = new Fl_Radio_Round_Button(10, 40, 185, 20, "<>? for Movement");
	movegroup->end();
	
	Fl_Group *buttongroup = new Fl_Group(10, 70, 185, 50);
		buttongroup->box(FL_THIN_DOWN_BOX);
		buttonxz = new Fl_Radio_Round_Button(10, 70, 185, 20, "Z=Jump; X=Attack");
		buttonxz->setonly();
		buttonzx = new Fl_Radio_Round_Button(10, 100, 185, 20, "X=Jump; Z=Attack");
	buttongroup->end();
	
	Fl_Group *okaygroup = new Fl_Group(205, 10, 185, 50);
		okaygroup->box(FL_THIN_DOWN_BOX);
		okayjump = new Fl_Radio_Round_Button(205, 10, 185, 20, "Jump=Okay");
		okayjump->setonly();
		okayattack = new Fl_Radio_Round_Button(205, 40, 185, 20, "Attack=Okay");
	okaygroup->end();
	
	displaychoice = new Fl_Choice(205, 70, 185, 20);
	Fl_Menu_Item screens[] = {
		{"Fullscreen 16-bit"},
		{"Windowed 320x240"},
 		{"Windowed 640x480"},
		{"Fullscreen 24-bit"},
		{"Fullscreen 32-bit"},
		{0}};
	displaychoice->menu(screens);
	joychoice = new Fl_Check_Button(205, 100, 185, 20, "Use Joypad");
	joychoice->callback(&activatejoy);
		
	joystuffcontainer = new Fl_Group(10, 130, 380, 200);
		joystuffcontainer->box(FL_THIN_DOWN_BOX);
		for(char i=0;i<8;i++){
			joyRows[i] = new RadioRow(i);
		}
		//There's no Label class alright? I'll switch it as soon as one is introduced.
		for (char i=0;i<6;i++) {
			Fl_Group *labeljump = new Fl_Group(10, 150+i*30, 10, 20);
			char* label=new char[strlen(ActionName(i+1))+2];
			sprintf(label, "%s:", ActionName(i+1));
			labeljump->label(label);
			labeljump->align(FL_ALIGN_RIGHT);
			labeljump->end();
		}
		
#ifdef HAVE_SDL
		if (JoystickSingleton::Instance().NumJoysticks() > 0){
			for (char i=0;i<6;i++){
				Fl_Button* btn = new Fl_Button(345, 150+30*i, 35, 20, "pick");
				btn->callback(&pickJsButton, (void*)(long)(i+1));
			}
		}
#endif

	joystuffcontainer->end();
	
	Fl_Button *okaybutton = new Fl_Button(10, 340, 185, 30, "Okay");
	okaybutton->callback(&write_Config);
	Fl_Button *cancelbutton = new Fl_Button(205, 340, 185, 30, "Cancel");
	cancelbutton->callback(&quit);
	
	mainw->end();
	mainw->show(argc, argv);
	
#ifdef HAVE_SDL
	char joystickLabel[100];
	sprintf(joystickLabel, "%s (%d found)", joychoice->label(), JoystickSingleton::Instance().NumJoysticks());
	joychoice->label(joystickLabel);
#endif

	read_Config();
	Fl::option(Fl::OPTION_VISIBLE_FOCUS, false);
	return Fl::run();
}
Ejemplo n.º 21
0
	Fl_Double_Window* make_mods_window() {
		if(mods_window != nullptr) {
			delete (Fl_Double_Window*)mods_window;
			mods_window = nullptr;
		}

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

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

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

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


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

		mods_window = w;

		return w;
	}
Ejemplo n.º 22
0
int main(int argc, char** argv)
{
	// Check config option, if showing is disabled, exit
	Fl_Config conf("EDE Team", "etip");
	if(argc == 2 && (!strcmp(argv[1], "-f") || !strcmp(argv[1], "--force")))
	{
		// nothing, to simplify omiting those '!'
	}
	else
	{
		bool show = true;
		conf.set_section("Tips");
		conf.read("Show", show, true);
		if (!show)
			return 0;
	}
	
	conf_global = &conf;
	srand(time(NULL));
	fl_init_locale_support("etip", PREFIX"/share/locale");

	Fl_Window* win = new Fl_Window(420, 169, _("Tips..."));
	win->shortcut(0xff1b);
	win->begin();

	Fl_Group* gr = new Fl_Group(5, 5, 410, 130);
	gr->box(FL_DOWN_BOX);
	Fl_Box* img = new Fl_Box(5, 5, 70, 65);
	Fl_Image pix(hint_xpm);
	img->image(pix);

	Fl_Box* title = new Fl_Box(80, 10, 320, 25, random_txt(title_tips, TITLE_TIPS_NUM));
	title->label_font(fl_fonts+1);
	title->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
	title->box(FL_FLAT_BOX);

	Fl_Box* tiptxt = new Fl_Box(80, 45, 320, 75, random_txt(tiplist, TIPS_NUM));
	tiptxt->align(FL_ALIGN_LEFT|FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
	tiptxt->box(FL_FLAT_BOX);
	gr->end();

	Fl_Check_Button* ch = new Fl_Check_Button(5, 140, 150, 25, _(" Do not bother me"));
	show_check = ch;

	Fl_Button* prev = new Fl_Button(160, 140, 80, 25, "<-");
	prev->label_font(fl_fonts+1);
	prev->callback(prev_cb, tiptxt);

	Fl_Button* next = new Fl_Button(245, 140, 80, 25, "->");
	next->label_font(fl_fonts+1);
	next->callback(next_cb, tiptxt);
	
	Fl_Button* close = new Fl_Button(335, 140, 80, 25, _("&Close"));
	close->callback(close_cb, win);

	win->end();

	win->set_modal();
	win->show();
	return Fl::run();
}
KeyboardPluginGUI::KeyboardPluginGUI(int w, int h,KeyboardPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
SpiralPluginGUI(w,h,o,ch),
m_Last(-1),
m_Oct(4)
{
	Fl_Scroll *Scroll = new Fl_Scroll(2,20,w-4,h-20);
	Fl_Group *Group = new Fl_Group(0,20,500,h-40);
	Group->box(FL_FLAT_BOX);
	Group->user_data(this);
	Scroll->add(Group);

	int KeyWidth=10,Note,Pos=0,Count=0;

	for (int n=0; n<NUM_KEYS; n++)
	{
		m_Num[n]=n;

		Note = n%12;
		if (Note!=1 && Note!=3 && Note!=6 && Note!=8 && Note!=10)
		{
			Pos=Count*KeyWidth;
			Count++;
			m_Key[n] = new Fl_Button(Pos,20,KeyWidth,50,"");
			m_Key[n]->box(FL_THIN_UP_BOX);
			m_Key[n]->labelsize(10);
			m_Key[n]->when(FL_WHEN_CHANGED);

			if (Note==0)
			{
				int Num=n/12;
				sprintf(m_Label[n],"%d",Num);
				m_Key[n]->label(m_Label[n]);
				m_Key[n]->align(FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE);
			}
			m_Key[n]->color(FL_WHITE);
			m_Key[n]->selection_color(FL_WHITE);
			m_Key[n]->callback((Fl_Callback*)cb_Key, &m_Num[n]);
			Group->add(m_Key[n]);
		}
	}

	Count=0;
	for (int n=0; n<NUM_KEYS; n++)
	{
		Note = n%12;
		if (Note==1 || Note==3 || Note==6 || Note==8 || Note==10)
		{
			m_Key[n] = new Fl_Button(Pos+5,20,KeyWidth,30,"");
			m_Key[n]->box(FL_THIN_UP_BOX);
			m_Key[n]->labelsize(10);
			m_Key[n]->when(FL_WHEN_CHANGED);
			m_Key[n]->color(FL_BLACK);
			m_Key[n]->selection_color(FL_BLACK);
			m_Key[n]->callback((Fl_Callback*)cb_Key, &m_Num[n]);
			Group->add(m_Key[n]);
		}
		else
		{
			Pos=Count*KeyWidth;
			Count++;
		}
	}
	Group->position(-100,20);
	Group->end();
	Scroll->end();
}
Ejemplo n.º 24
0
helpWindow::helpWindow()
{
  {
    int width = 28 * FL_NORMAL_SIZE;
    int height = 19 * BH;

    about = new paletteWindow
      (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh");
    about->box(GMSH_WINDOW_BOX);

    Fl_Help_View *o = new Fl_Help_View(0, 0, width, height);
    o->textfont(FL_HELVETICA);
    o->textsize(FL_NORMAL_SIZE);
    o->box(FL_FLAT_BOX);
    std::ostringstream sstream;
    sstream << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion()
            << "<p>Copyright (C) 1997-2015"
            << "<br>Christophe Geuzaine and Jean-Francois Remacle"
            << "<p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> "
            << "and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing "
            << "information</a>"
            << "<p>Please send all questions and bug reports to the public mailing list "
            << "<a href=\"mailto:[email protected]\">[email protected]</a></center>"
            << "<ul>"
            << "<li><i>Build OS:</i> " << GetGmshBuildOS()
            << "<li><i>Build date:</i> " << GetGmshBuildDate()
            << "<li><i>Build host:</i> " << GetGmshBuildHost()
            << "<li><i>Build options:</i>" << GetGmshBuildOptions()
            << "<li><i>FLTK version:</i> "
            << FL_MAJOR_VERSION << "." << FL_MINOR_VERSION << "." << FL_PATCH_VERSION
#if defined(HAVE_PETSC)
            << "<li><i>PETSc version:</i> " << PETSC_VERSION_MAJOR << "."
            << PETSC_VERSION_MINOR << "." << PETSC_VERSION_SUBMINOR
#if defined(PETSC_USE_COMPLEX)
            << " (complex arithmetic)"
#else
            << " (real arithmetic)"
#endif
#endif
#if defined(HAVE_OCC)
            << "<li><i>OCC version:</i> " << OCC_VERSION_MAJOR << "."
            << OCC_VERSION_MINOR << "." << OCC_VERSION_MAINTENANCE
#endif
#if defined(HAVE_MED)
            << "<li><i>MED version:</i> " << MED_NUM_MAJEUR << "."
            << MED_NUM_MINEUR << "." << MED_NUM_RELEASE
#endif
            << "<li><i>Packaged by:</i> " << GetGmshPackager()
            << "</ul>"
            << "<center>Visit <a href=\"http://geuz.org/gmsh/\">http://geuz.org/gmsh/</a> "
            << "for more information</center>";
    o->value(sstream.str().c_str());
    o->link(help_link);
    about->position(Fl::x() + Fl::w()/2 - width / 2,
                    Fl::y() + Fl::h()/2 - height / 2);
    about->end();
  }

  {
    int width = 40 * FL_NORMAL_SIZE;
    int height = 18 * BH;

    basic = new paletteWindow
      (width, height, CTX::instance()->nonModalWindows ? true : false,
       "Keyboard and Mouse Usage");
    basic->box(GMSH_WINDOW_BOX);

    Fl_Help_View *o = new Fl_Help_View(0, 0, width, height);
    o->textfont(FL_HELVETICA);
    o->textsize(FL_NORMAL_SIZE - 1);
    o->box(FL_FLAT_BOX);

    std::string s;
    s += "<h3>Keyboard Shortcuts</h3>";
    s += "<table border=1>";
    {
      std::vector<std::pair<std::string, std::string> > s0 = GetShortcutsUsage();
      for(unsigned int i = 0; i < s0.size(); i++)
        s += "<tr><td>" + s0[i].first + "</td><td>" + s0[i].second + "</td></tr>";
    }
    s += "</table>";

    s += "<h3>Mouse Actions</h3>";
    s += "<table border=1>";
    {
      std::vector<std::pair<std::string, std::string> > s0 = GetMouseUsage();
      for(unsigned int i = 0; i < s0.size(); i++)
        s += "<tr><td>" + s0[i].first + "</td><td>" + s0[i].second + "</td></tr>";
    }
    s += "</table>";
    s += "For a 2 button mouse, Middle button = Shift+Left button.<p>";
    s += "For a 1 button mouse, Middle button = Shift+Left button, "
         "Right button = Alt+Left button.";


    s += "<h3>Command Line Switches</h3>";
    s += "<table border=1>";
    {
      std::vector<std::pair<std::string, std::string> > s0 = GetUsage();
      for(unsigned int i = 0; i < s0.size(); i++)
        if(s0[i].first.size() && s0[i].second.size())
          s += "<tr><td>" + s0[i].first + "</td><td>" + s0[i].second + "</td></tr>";
        else if(s0[i].first.size() && s0[i].second.empty())
          s += "</table>" + s0[i].first + "<table border=1>";
    }
    s += "</table>";

    o->value(s.c_str());

    basic->resizable(o);
    basic->position(Fl::x() + Fl::w()/2 - width / 2,
                    Fl::y() + Fl::h()/2 - height / 2);
    basic->end();
  }

  {
    int width = 40 * FL_NORMAL_SIZE;
    int height = 18 * BH;

    options = new paletteWindow
      (width, height, CTX::instance()->nonModalWindows ? true : false,
       "Current Options and Workspace");
    options->box(GMSH_WINDOW_BOX);

    int BW = (width - 4 * WB) / 3;

    modified = new Fl_Check_Button
      (WB, WB, BW, BH, "Only show modified");
    modified->type(FL_TOGGLE_BUTTON);
    modified->callback(help_options_cb);
    modified->tooltip("Show only values different from defaults");

    showhelp = new Fl_Check_Button
      (2 * WB + BW, WB, BW, BH, "Show help");
    showhelp->type(FL_TOGGLE_BUTTON);
    showhelp->callback(help_options_cb);
    showhelp->tooltip("Show help strings");

    Fl_Group* o = new Fl_Group(3 * WB + 2 * BW, WB, BW, BH);
    o->tooltip("Filter values");
    o->box(FL_DOWN_BOX);
    o->color(FL_BACKGROUND2_COLOR);
    search = new Fl_Input
      (3 * WB + 2 * BW + BH, WB + 2, BW - BH - 2, BH - 4, "@gmsh_search");
    search->box(FL_FLAT_BOX);
    search->callback(help_options_cb);
    search->when(FL_WHEN_CHANGED);
    //search->take_focus(); cannot call this here - it triggers show() on Linux in fltk 1.3.3
    o->resizable(search);
    o->end();

    browser = new Fl_Browser(0, BH + 2 * WB, width, height - BH - 2 * WB);
    browser->box(GMSH_SIMPLE_TOP_BOX);
    browser->textfont(FL_SCREEN);
    browser->textsize(FL_NORMAL_SIZE - 2);
    browser->type(FL_MULTI_BROWSER);
    browser->callback(browser_cb);
    browser->tooltip("Double-click to edit value");
    browser->scrollbar_size(std::max(10, FL_NORMAL_SIZE - 2)); // thinner scrollbars

    options->resizable(browser);
    options->position(Fl::x() + Fl::w()/2 - width / 2,
                      Fl::y() + Fl::h()/2 - height / 2);
    options->size_range(width, height);
    options->end();
  }

}
Ejemplo n.º 25
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;
}
Ejemplo n.º 26
0
int main(int argc, char **argv)
{
	signal(SIGCHLD, SIG_IGN);
	signal(SIGSEGV, terminationHandler);
	fl_init_locale_support("eworkpanel", PREFIX"/share/locale");
	fl_init_images_lib();

	int X=0,Y=0,W=Fl::w(),H=Fl::h();
	int substract;

	// Get current workarea
	Fl_WM::get_workarea(X,Y,W,H);

	//printf("Free area: %d %d %d %d\n", X,Y,W,H);

	// We expect that other docks are moving away from panel :)
	mPanelWindow = new Fl_Update_Window(X, Y+H-30, W, 30, "Workpanel");
	mPanelWindow->layout_spacing(0);
	// Panel is type DOCK
	mPanelWindow->window_type(Fl_WM::DOCK);
	mPanelWindow->setAutoHide(0);

	// Read config
	bool doShowDesktop;
	pGlobalConfig.get("Panel", "ShowDesktop", doShowDesktop, false);
	bool doWorkspaces;
	pGlobalConfig.get("Panel", "Workspaces", doWorkspaces, true);
	bool doQLB;
	pGlobalConfig.get("Panel", "QuickLaunchBar", doQLB, true);
	bool doRunBrowser;
	pGlobalConfig.get("Panel", "RunBrowser", doRunBrowser, true);	 
	bool doSoundMixer;
	pGlobalConfig.get("Panel", "SoundMixer", doSoundMixer, true);
	bool doCpuMonitor;
	pGlobalConfig.get("Panel", "CPUMonitor", doCpuMonitor, true);
	bool doBatteryMonitor;
	doBatteryMonitor=true;	// blah
	
	// Group that holds everything..
	Fl_Group *g = new Fl_Group(0,0,0,0);
	g->box(FL_DIV_UP_BOX);
	g->layout_spacing(2);
	g->layout_align(FL_ALIGN_CLIENT);
	g->begin();

	mSystemMenu = new MainMenu();

	Fl_VertDivider *v = new Fl_VertDivider(0, 0, 5, 18, "");
	v->layout_align(FL_ALIGN_LEFT);
	substract = 5;

	//this kind of if-else block is ugly
	// - but users demand such features so...
	if ((doShowDesktop) || (doWorkspaces) || (doQLB)) {

	int size=0;
	if ((doShowDesktop) && (doWorkspaces)) { size=48; } else { size=24; }
	// Add size for QLB:
	if (doQLB && qlb_create_toolbuttons(0)) size += (qlb_numbuttons * 24);

	Fl_Group *g2 = new Fl_Group(0,0,size,22);
	g2->box(FL_FLAT_BOX);
	g2->layout_spacing(0);
	g2->layout_align(FL_ALIGN_LEFT);

	// Show desktop button
	if (doShowDesktop) {
		PanelButton *mShowDesktop;
		mShowDesktop = new PanelButton(0, 0, 24, 22, FL_NO_BOX, FL_DOWN_BOX, "ShowDesktop");
		mShowDesktop->layout_align(FL_ALIGN_LEFT);
		mShowDesktop->label_type(FL_NO_LABEL);
		mShowDesktop->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
		mShowDesktop->image(showdesktop_pix);
		mShowDesktop->tooltip(_("Show desktop"));
		mShowDesktop->callback( (Fl_Callback*)cb_showdesktop);
		mShowDesktop->show();
		
		substract += 26;
	}
	
	// Workspaces panel
	mWorkspace=0; // so we can detect it later
	if (doWorkspaces) {
		mWorkspace = new PanelMenu(0, 0, 24, 22, FL_NO_BOX, FL_DOWN_BOX, "WSMenu");
		mWorkspace->layout_align(FL_ALIGN_LEFT);
		mWorkspace->label_type(FL_NO_LABEL);
		mWorkspace->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
		mWorkspace->image(desktop_pix);
		mWorkspace->tooltip(_("Workspaces"));
		mWorkspace->end();
		
		substract += 26;
	}

	// "Quick Lunch" buttons
	for (int count=0; count<qlb_numbuttons; count++) {
		qlb_buttons[count] = new PanelButton(0, 0, 24, 22, FL_NO_BOX, FL_DOWN_BOX, qlb_tooltips[count]);
		qlb_buttons[count]->layout_align(FL_ALIGN_LEFT);
		qlb_buttons[count]->label_type(FL_NO_LABEL);
		qlb_buttons[count]->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
		qlb_images[count] = NULL;
		qlb_images[count] = Fl_Image::read(qlb_icons[count]);
		if (!qlb_images[count])
			fprintf(stderr, "skipping icon: %s\n", qlb_icons[count]);
		else
			qlb_buttons[count]->image(qlb_images[count]);
		qlb_buttons[count]->tooltip(qlb_tooltips[count]);
		qlb_buttons[count]->callback((Fl_Callback*)cb_qlb_taskbutton, (void *)qlb_commands[count]);
		qlb_buttons[count]->show();

		substract += 26;
  	}
	


	g2->end();
	g2->show();
	g2->resizable();

	v = new Fl_VertDivider(0, 0, 5, 18, "");
		v->layout_align(FL_ALIGN_LEFT);
	substract += 5;
	}
	
	// Run browser
	if (doRunBrowser) {
		Fl_Group *g3 = new Fl_Group(0,0,100,20);
		g3->box(FL_FLAT_BOX);
		g3->layout_spacing(0);
		g3->layout_align(FL_ALIGN_LEFT);
		runBrowser = new Fl_Input_Browser("",100,FL_ALIGN_LEFT,30);
		//runBrowser->image(run_pix);
		runBrowser->box(FL_THIN_DOWN_BOX); // This is the only box type which works :(

		// Added _ALWAYS so callback is in case:
		// 1) select old command from input browser
		// 2) press enter to execute. (this won't work w/o _ALWAYS)
//		  runBrowser->input()->when(FL_WHEN_ENTER_KEY_ALWAYS | FL_WHEN_RELEASE_ALWAYS); 
		// Vedran: HOWEVER, with _ALWAYS cb_run_app will be called way
		// too many times, causing fork-attack
		runBrowser->input()->when(FL_WHEN_ENTER_KEY); 
		runBrowser->input()->callback((Fl_Callback*)cb_run_app);
		runBrowser->callback((Fl_Callback*)cb_run_app2);
		g3->end();
		g3->show();
		g3->resizable();

		v = new Fl_VertDivider(0, 0, 5, 18, "");
		v->layout_align(FL_ALIGN_LEFT);
	substract += 105;
	}


	// Popup menu for the whole taskbar
	Fl_Menu_Button *mPopupPanelProp = new Fl_Menu_Button( 0, 0, W, 28 );
	mPopupPanelProp->type( Fl_Menu_Button::POPUP3 );
	mPopupPanelProp->anim_flags(Fl_Menu_::LEFT_TO_RIGHT);
	mPopupPanelProp->anim_speed(0.8);
	mPopupPanelProp->begin();

	Fl_Item *mPanelSettings = new Fl_Item(_("Settings"));
	mPanelSettings->x_offset(12);
	mPanelSettings->callback( (Fl_Callback*)runUtility, (void*)"epanelconf" );
	new Fl_Divider(10, 5);

	Fl_Item *mAboutItem = new Fl_Item(_("About EDE..."));
	mAboutItem->x_offset(12);
	mAboutItem->callback( (Fl_Callback *)AboutDialog );

	mPopupPanelProp->end();

	// Taskbar...
	tasks = new TaskBar();

	// Dock and various entries...
	dock = new Dock();

	v = new Fl_VertDivider(0, 0, 5, 18, "");
	v->layout_align(FL_ALIGN_RIGHT);

	{
		// MODEM
		mModemLeds = new Fl_Group(0, 0, 25, 18);
		mModemLeds->box(FL_FLAT_BOX);
		mModemLeds->hide();
		mLedIn = new Fl_Box(2, 5, 10, 10);
		mLedIn->box( FL_OVAL_BOX );
		mLedIn->color( (Fl_Color)968701184);
		mLedOut = new Fl_Box(12, 5, 10, 10);
		mLedOut->box( FL_OVAL_BOX);
		mLedOut->color( (Fl_Color)968701184);
		mModemLeds->end();
	}

	{
		// KEYBOARD SELECT
		mKbdSelect = new KeyboardChooser(0, 0, 20, 18, FL_NO_BOX, FL_DOWN_BOX, "us");
		mKbdSelect->hide();
		mKbdSelect->anim_speed(4);
		mKbdSelect->label_font(mKbdSelect->label_font()->bold());
		mKbdSelect->highlight_color(mKbdSelect->selection_color());
		mKbdSelect->highlight_label_color( mKbdSelect->selection_text_color());
	}

	{
		// CLOCK
		mClockBox = new Fl_Button(0, 0, 50, 20);
		mClockBox->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
		mClockBox->hide();
		mClockBox->box(FL_FLAT_BOX);
		mClockBox->callback( (Fl_Callback*)startUtility, (void*)"Time and date");
	}

	// SOUND applet
	if (doSoundMixer) {
		mSoundMixer = new Fl_Button(0, 0, 20, 18);
		mSoundMixer->hide();
		mSoundMixer->box(FL_NO_BOX);
		mSoundMixer->focus_box(FL_NO_BOX);
		mSoundMixer->image(sound_pix);
		mSoundMixer->tooltip(_("Volume control"));
		mSoundMixer->align(FL_ALIGN_INSIDE);
		mSoundMixer->callback( (Fl_Callback*)startUtility, (void*)"Volume Control" );
	}

	// CPU monitor
	if (doCpuMonitor) {
		cpumon = new CPUMonitor();
		cpumon->hide();
	}

	// Battery monitor
	if (doBatteryMonitor) {
		batmon = new BatteryMonitor(dock);
		batmon->hide();
	}


	dock->add_to_tray(new Fl_Box(0, 0, 5, 20));
	dock->add_to_tray(mClockBox);
	dock->add_to_tray(mKbdSelect);
	dock->add_to_tray(mSoundMixer);
	dock->add_to_tray(cpumon);
	dock->add_to_tray(batmon);

	// end Dock


	Fl::focus(mSystemMenu);

	mPanelWindow->end();
	mPanelWindow->show(argc, argv);

	Fl_WM::callback(FL_WM_handler, 0, Fl_WM::DESKTOP_COUNT | 
								   Fl_WM::DESKTOP_NAMES |
							   Fl_WM::DESKTOP_CHANGED|
							   Fl_WM::WINDOW_LIST|
							   Fl_WM::WINDOW_DESKTOP|
							   Fl_WM::WINDOW_ACTIVE|
							   Fl_WM::WINDOW_NAME|
							   Fl_WM::WINDOW_ICONNAME);

	updateWorkspaces(0,0);
	tasks->update();

	Fl::add_timeout(0, clockRefresh);
	Fl::add_timeout(0, updateStats);

	while(mPanelWindow->shown())
		Fl::wait();
}
Ejemplo n.º 27
0
ModelerUserInterface::ModelerUserInterface() {
	// Make this instance the current one
	instance = this;

	// Initialize pointers to NULL
	m_nativeChooser = NULL;
	model = NULL;
	currentGroup = NULL;

	// Set appearance to GTK+ for a nice look
	Fl::scheme("gtk+");

	// Set the animation speed to 24 frames/second
	framesPerSecond = 24;

	// We're not animating yet.
	animating = false;

	// Set the color scheme
	Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
	Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
	Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
	Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
	Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);

	// Create all of the UI elements
	// (autogenerated by FLUID, the FLTK UI Designer)
	Fl_Double_Window* w;
	//const char* title = "CSEP457 Modeler";
	const char* title = "CSEP557 Modeler";
	{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
		w = o;
		o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
		o->when(FL_WHEN_NEVER);
		{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
		  o->menu(menu_m_controlsMenuBar);
		}

		// Contains the controls on the left
		{ leftPane = new Fl_Group(0, 25, 250, 600);
			int tabSpace = -25, controlSpace = 0;
				{ Fl_Tile* o = m_controlSplitPane = new Fl_Tile(0, 50 + tabSpace, 250, 575 - tabSpace);
					o->box(FL_FLAT_BOX);
					{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)TreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					{ Fl_Scroll* o = m_controlsScroll =
						new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
					  o->type(Fl_Scroll::VERTICAL);
					  o->when(FL_WHEN_CHANGED);
					  { Fl_Pack* o = m_controlsPack =
						  new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
						Fl_Group::current()->resizable(o);
						o->spacing(2);
						o->end();
					  }
					  o->end();
					}
					o->end();
				} // end Modeler group/tab
			leftPane->end();
		} // left pane
		{ // TODO: remove this extra brace!
			{ Fl_Group* o = m_viewPane = new Fl_Group(250, 25, 550, 600);
				o->box(FL_NO_BOX);
				o->color(FL_BACKGROUND_COLOR);
				m_modelerView = new ModelerView(250, 25, 550, 600, "");
				w->resizable(m_modelerView);
				o->end();
				Fl_Group::current()->resizable(o);
			}
		}
		o->end();
	}
}
SaveTrajectoryFltkMenu::SaveTrajectoryFltkMenu(VMDApp *vmdapp)
: VMDFltkMenu("save", "Save Trajectory", vmdapp) {
  
  size(450, 250);
    { Fl_Choice* o = molchooser = new Fl_Choice(120, 10, 320, 25, "Save data from: ");
      o->box(FL_THIN_UP_BOX);
      o->down_box(FL_BORDER_BOX);
      o->color(VMDMENU_CHOOSER_BG);
      o->selection_color(VMDMENU_CHOOSER_SEL);
      o->callback(molchooser_cb, this);
    }
    { Fl_Input *o = selectinput = new Fl_Input(120, 45, 295, 25, "Selected atoms:");
      o->selection_color(VMDMENU_VALUE_SEL);
    }
    { Fl_Choice* o = repchooser = new Fl_Choice(415, 45, 25, 25);
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
      o->callback(repchooser_cb, this);
    }
    { Fl_Choice* o = filetypechooser = new Fl_Choice(20, 90, 115, 25, "File type:");
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
    }
    savebutton = new Fl_Return_Button(345, 90, 95, 25, "Save...");
    savebutton->callback(save_cb, this);
    { Fl_Group* o = timestepgroup = new Fl_Group(20, 145, 165, 95, "Frames: ");
      o->box(FL_ENGRAVED_FRAME);
      o->align(FL_ALIGN_TOP_LEFT);
      { Fl_Button* o = saveinbackgroundbutton = new Fl_Round_Button(30, 215, 150, 20, "Save in background");
        o->down_box(FL_ROUND_DOWN_BOX);
        o->type(FL_RADIO_BUTTON);
      }
      { Fl_Button* o = allatoncebutton = new Fl_Round_Button(30, 195, 150, 20, "Save all at once");
        o->down_box(FL_ROUND_DOWN_BOX);
        o->type(FL_RADIO_BUTTON);
      }
      { Fl_Input* o = firstinput = new Fl_Int_Input(25, 170, 45, 20, "First:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      { Fl_Input* o = lastinput = new Fl_Int_Input(80, 170, 45, 20, "Last:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      { Fl_Input* o = strideinput = new Fl_Int_Input(135, 170, 45, 20, "Stride:");
        o->align(FL_ALIGN_TOP);
        o->selection_color(VMDMENU_VALUE_SEL);
      }
      o->end();
      datasetbrowser = new Fl_Multi_Browser(195, 145, 240, 95, "Volumetric Datasets");
      datasetbrowser->align(5);
      datasetbrowser->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
    } 
    end();

  allatoncebutton->value(1);
  selected_molid = -1;
  datasetbrowser->deactivate();
  
  command_wanted(Command::PLUGIN_UPDATE);
  command_wanted(Command::MOL_NEW);
  command_wanted(Command::MOL_RENAME);
  command_wanted(Command::MOL_DEL);
  command_wanted(Command::MOL_ADDREP);
  command_wanted(Command::MOL_DELREP);
  command_wanted(Command::MOL_MODREP);
  command_wanted(Command::MOL_MODREPITEM);
  command_wanted(Command::ANIM_DELETE);
}
Ejemplo n.º 29
0
/*     Fl_Group( X, Y, W, H, L) */
Chain::Chain ( ) : Fl_Group( 0, 0, 100, 100, "")

{
    /* not really deleting here, but reusing this variable */
    _deleting = true;

    int X = 0;
    int Y = 0;
    int W = 100;
    int H = 100;

/*     _outs = 1; */
/*     _ins = 1; */

    _configure_outputs_callback = NULL;

    _strip = NULL;

    _name = NULL;

    labelsize( 10 );
    align( FL_ALIGN_TOP );

    { Fl_Flip_Button* o  = tab_button = new Fl_Flip_Button( X, Y, W, 16, "chain/controls");
        o->type(1);
        o->labelsize( 12 );
        o->callback( cb_handle, this );
    }

    Y += 18;
    H -= 18;

    { Fl_Group *o = chain_tab = new Fl_Group( X, Y, W, H, "" );
        o->labeltype( FL_NO_LABEL );
        o->box( FL_FLAT_BOX );
//        o->color( fl_darker( FL_BACKGROUND_COLOR ) );
//        o->color( FL_BACKGROUND_COLOR );
//        o->box( FL_NO_BOX );
        { Fl_Packscroller *o = new Fl_Packscroller( X, Y, W, H );
            o->color( FL_BACKGROUND_COLOR );
//            o->box( FL_FLAT_BOX );
            o->box( FL_THIN_UP_BOX );
            o->type( Fl_Scroll::VERTICAL );
            { Fl_Pack *o = modules_pack = new Fl_Pack( X, Y, W, H );
                o->type( Fl_Pack::VERTICAL );
                o->spacing( 6 );
                o->end();
                Fl_Group::current()->resizable( o );
            }
            o->end();
        }
        o->end();
    }
    { Fl_Group *o = control_tab = new Fl_Group( X, Y, W, H, "" );
        o->box( FL_FLAT_BOX );
        o->color( FL_BACKGROUND_COLOR );
        o->labeltype( FL_NO_LABEL );
        o->hide();
        { Fl_Scroll *o = new Fl_Scroll( X, Y, W, H );
            o->color( FL_BACKGROUND_COLOR );
            o->box( FL_NO_BOX );
            o->type( Fl_Scroll::VERTICAL );
            { Fl_Pack *o = controls_pack = new Fl_Pack( X, Y, W, H );
                o->type( Fl_Pack::VERTICAL );
                o->spacing( 5 );
//            o->color( FL_RED );
                o->end();
                Fl_Group::current()->resizable( o );
            }
            o->end();
            Fl_Group::current()->resizable( o );
        }
        o->end();
        o->hide();
        Fl_Group::current()->resizable( o );
    }
    end();

    log_create();

    _deleting = false;
}
Ejemplo n.º 30
0
Fl_Font_Browser::Fl_Font_Browser():Fl_Window(100,100,550-60,332-5,"Font Browser") 
{
      lst_Font = new Fl_Browser(15, 55-5, 195, 159);
      lst_Font->labelsize(12);
      lst_Font->textsize(12);
      lst_Font->callback((Fl_Callback*)cb_FontName_Selected, (void*)(lst_Font->parent()));
      lst_Font->type(FL_HOLD_BROWSER);
    
      txt_InputFont = new Fl_Input(15, 31-5, 195, 24, "Font:");
      txt_InputFont->labelsize(12);
      txt_InputFont->textsize(12);
      txt_InputFont->align(FL_ALIGN_TOP_LEFT);
      txt_InputFont->when(FL_WHEN_ENTER_KEY);
      txt_InputFont->callback((Fl_Callback*)cb_txtInputFontName, (void*)(txt_InputFont->parent()));
    
      lst_Style = new Fl_Browser(215, 56-5, 155-60, 159);
      lst_Style->labelsize(12);
      lst_Style->type(FL_HOLD_BROWSER);
      lst_Style->textsize(12); 
      lst_Style->callback((Fl_Callback*)cb_StyleSelected, (void*)(lst_Style->parent()));   
       
      txt_InputStyle = new Fl_Input(215, 32-5, 155-60, 24, "Syle:");
      txt_InputStyle->labelsize(12);
      txt_InputStyle->align(FL_ALIGN_TOP_LEFT);
      txt_InputStyle->textsize(12);    
      txt_InputStyle->callback((Fl_Callback*)cb_txtInputFontStyle, (void*)(txt_InputStyle->parent()));
      
      lst_Size = new Fl_Browser(375-60, 56-5, 75, 159);
      lst_Size->labelsize(12);
      lst_Size->type(FL_HOLD_BROWSER);
      lst_Size->textsize(12); 
      lst_Size->callback((Fl_Callback*)cb_FontSize_Selected, (void*)(lst_Size->parent()));   
      
      txt_InputSize = new Fl_Input(375-60, 32-5, 75, 24, "Size:");
      txt_InputSize->labelsize(12);
      txt_InputSize->align(FL_ALIGN_TOP_LEFT);
      txt_InputSize->textsize(12);    
      txt_InputSize->callback((Fl_Callback*)cb_txtInputFontSize, (void*)(txt_InputSize->parent()));
      
      btn_OK =new Fl_Button(475-60, 35-5, 64, 20, "&OK");
      btn_OK->shortcut(0x8006f);
      btn_OK->labelfont(1);
      btn_OK->labelsize(12);
      btn_OK->callback((Fl_Callback*)cb_okBtn_Red );
         
      btn_Cancel =new Fl_Button(475-60, 60-5, 64, 20, "Cancel");
      btn_Cancel->labelsize(12);
      btn_Cancel->callback((Fl_Callback*)cb_Cancel, (void *)(btn_Cancel->parent()));
    
    
       Fl_Box* o = new Fl_Box(15, 220-5, 20, 10, "Properties");
       
       o->box(FL_BORDER_FRAME);
       o->labelsize(12);
       o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
      
        btn_Check1= new Fl_Check_Button(40-20, 250-5-5, 100, 15, "Strikethrough");
        btn_Check1->down_box(FL_DOWN_BOX);
        btn_Check1->labelsize(12);
        btn_Check1->callback((Fl_Callback*)cb_Strikethrough, (void *)(btn_Check1->parent()));
      
        btn_Check2 = new Fl_Check_Button(40-20, 270-5-5, 100, 15, "Underline");
        btn_Check2->down_box(FL_DOWN_BOX);
        btn_Check2->labelsize(12);
        btn_Check2->callback((Fl_Callback*)cb_UnderLine, (void *)(btn_Check2->parent()));
    
        btn_Color = new Fl_Button(40-20, 307-10-5, 90, 23, "Color:");
        btn_Color->down_box(FL_BORDER_BOX);
        btn_Color->labelsize(12);
        btn_Color->align(FL_ALIGN_TOP_LEFT);
        btn_Color->color(FL_BLACK);
        btn_Color->callback((Fl_Callback*)cb_Color_Select, (void *)(lst_Size->parent()));

     
    { Fl_Group* o = new Fl_Group(130, 220-5, 256+180, 82, "Example");
      o->box(FL_BORDER_FRAME);
      o->labelsize(12);
      o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
      { box_Example = new Fl_Font_Preview_Box(132-10, 241-5, 227+50+35+10, 48, "AaBbCcDdEeFfGgHhIi");
        box_Example->box(FL_DOWN_BOX);
        box_Example->labelsize(12);
        box_Example->align(FL_ALIGN_WRAP|FL_ALIGN_CLIP|FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
      }
      o->end();
    }
     set_modal();
     end();
 // Initializations 
  pickedsize = 14; // Font Size to be used
          //
  int k =   Fl::set_fonts(0); // Nr of fonts available on the server
  
  for(int i= 0; i < k; i++) 
  {
    int t;
    const char *name = Fl::get_font_name((Fl_Font)i,&t);
    char buffer[128];

// Load the font list .. Ignore the bold and italic types of the font
     if(!((t & FL_BOLD) ||(t & FL_ITALIC)))
     {
        sprintf(buffer, "%s",name);
        lst_Font->add(buffer);
     }
  }
     /* FL_Browser uses the symbol "@" as a formating char. There are some fonts that there 
      names starts with char "@".       We need to disable this     
   */  
     lst_Font->format_char(0);
       
  
  // Sort the font Alphabetically
  ForwardSort(lst_Font);
  
  lst_Font->value(1); // Select the first font in the list
  lst_Style->value(1);  
  lst_Font->do_callback();  // Do font selected callback .. to draw the preview
  lst_Style->do_callback();
  this->callback_ = 0;  // Initialize Widgets callback 
  this->data_ = 0;      // And the data
}