Exemple #1
0
void cb_open_about() {
  { a_diag = new Fl_Double_Window(210, 165, "About");
    a_diag->color((Fl_Color)29);
    { a_mess = new Fl_Group(5, 10, 200, 45, "Calc 80");
      a_mess->box(FL_RFLAT_BOX);
      a_mess->color((Fl_Color)206);
      a_mess->labelsize(21);
      a_mess->align(Fl_Align(FL_ALIGN_CENTER));
      a_mess->end();
    } // Fl_Group* a_mess
    { Fl_Group* o = new Fl_Group(5, 70, 205, 25, "Version 0.04");
      o->align(Fl_Align(FL_ALIGN_CENTER));
      o->end();
    } // Fl_Group* o
    { Fl_Group* o = new Fl_Group(10, 95, 200, 25, "\302\251""2016, Patrik Wallander");
      o->align(Fl_Align(FL_ALIGN_CENTER));
      o->end();
    } // Fl_Group* o
    { Fl_Button* o = new Fl_Button(70, 135, 70, 20, "Close");
      o->box(FL_RFLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->callback((Fl_Callback*)cb_close_about);
    } // Fl_Button* o
    a_diag->show();
    a_diag->position(m_win->x(), m_win->y());
    a_diag->end();
  } // Fl_Double_Window* a_diag
}
Exemple #2
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;
}
Exemple #3
0
onelabWindow::onelabWindow(int deltaFontSize)
{
  FL_NORMAL_SIZE -= deltaFontSize;

  int width = 34 * FL_NORMAL_SIZE + WB;
  int height = 12 * BH + 4 * WB;

  win = new paletteWindow(width, height, CTX::instance()->nonModalWindows ? true : false);
  win->box(GMSH_WINDOW_BOX);
  win->label("ONELAB2");

  Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB);
  {
    Fl_Group *o = new Fl_Group(
      WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Network (server)");
    _listenOnUNIX = new Fl_Check_Button(2*WB, 2*WB + 1*BH, width-2*WB, BH, "Listen on UNIX socket");
    _sockUNIX = new Fl_Input(2*WB, 2*WB + 2*BH, width/2-2*WB, BH, "UNIX base socket name");
    _listenOnUNIX->callback(onelab_listen_unix_cb, _sockUNIX);
    _sockUNIX->align(FL_ALIGN_RIGHT);
    _listenOnTCP = new Fl_Check_Button(2*WB, 2*WB + 3*BH, width-2*WB, BH, "Listen on TCP socket");
    _sockTCP = new Fl_Input(2*WB, 2*WB + 4*BH, width/2-2*WB, BH, "TCP port (0 to let the system choose)");
    _listenOnTCP->callback(onelab_listen_tcp_cb, _sockTCP);
    _sockTCP->align(FL_ALIGN_RIGHT);
#ifdef HAVE_UDT
    _listenOnUDT = new Fl_Check_Button(2*WB, 2*WB + 5*BH, width-2*WB, BH, "Listen on UDT (UDP) socket");
    _sockUDT = new Fl_Input(2*WB, 2*WB + 6*BH, width/2-2*WB, BH, "UDP port (0 to let the system choose)");
    _listenOnUDT->callback(onelab_listen_udt_cb, _sockUDT);
    _sockUDT->align(FL_ALIGN_RIGHT);
#else
    _listenOnUDT = new Fl_Check_Button(2*WB, 2*WB + 5*BH, width-2*WB, BH, "Listen on UDT (UDP) socket");
    _sockUDT = new Fl_Input(2*WB, 2*WB + 6*BH, width/2-2*WB, BH, "UDP port (0 to let the system choose)");
    _sockUDT->align(FL_ALIGN_RIGHT);
#endif
    refreshServers();
    o->end();
  }
  {
    Fl_Group *o = new Fl_Group(
      0, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Clients (server)");
    _solvers = new Fl_Choice(2*WB, 2*WB + 1*BH, width/2-2*WB, BH, "Solver");
    _solvers->align(FL_ALIGN_RIGHT);
    rebuildSolverList();
    _clients = new Fl_Browser(2*WB, 2*WB + 3*BH, width/2-2*WB, 5*BH, "Connected clients");
    _clients->align(FL_ALIGN_RIGHT);
    o->end();
  }
  {
    Fl_Group *o = new Fl_Group(
      WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Network (client)");
    _remoteServer = new Fl_Input(2*WB, 2*WB + 1*BH, width/2-2*WB, BH, "Server address (IPv4:port)");
    _remoteServer->align(FL_ALIGN_RIGHT);
    _connectRemoteServer = new Fl_Button(2*WB, 3*WB + 2*BH, width/2-2*WB, BH, "Connect");
    _connectRemoteServer->callback(onelab_connect_remote_server_cb, _remoteServer);
  }
}
Exemple #4
0
void onelabGroup::addParameter(onelab::parameter &p)
{
  if(!p.getVisible() || CTX::instance()->solver.showInvisibleParameters) return;

  bool highlight = false;
  Fl_Color c;
  if(getFlColor(p.getAttribute("Highlight"), c)) highlight = true;
  Fl_Tree_Item *n = _tree->add(p.getName().c_str());
  if(!n) return;
  n->labelsize(FL_NORMAL_SIZE + 4);
  _tree->begin();
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  ww *= _widgetLabelRatio; // FIXME CHANGE THIS
  int hh = n->labelsize() + 4;
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  Fl_Widget *widget = _addParameterWidget(p, ww, hh, n, highlight, c);
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  widget->copy_label(p.getShortName().c_str());
  std::string help = p.getLabel().size() ? p.getLabel() : p.getShortName();
  if(p.getHelp().size()) help += ":\n" + p.getHelp();
  widget->copy_tooltip(help.c_str());
  n->widget(grp);
  _tree->end();
  if(p.getAttribute("Closed") == "1" && p.getPath().size()) _tree->close(p.getPath().c_str(), 0);
  _tree->redraw();
}
Exemple #5
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);
}
void FolderWindow::AddStructure(const char* filename, const int index)
{
    
    Fl_Pack* pack = folderPack;
    pack->begin();
    
    int vertPosn = pack->children() * 30 + pack->y();
    
    Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), 30);
    group->begin();
    
    Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
    label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    label->callback(FolderWindow::ShowFileCallback);
    label->user_data((void*)index);
    
    Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
    removeButton->callback(FolderWindow::RemoveCallback);
    removeButton->user_data((void*)index);
    removeButton->label("@1+");
    
    //printf("Added file: %s\n",label->label());
    
    group->resizable(label);
    group->end();
    pack->end();
        
    folderScroll->redraw();
}
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();
  }
}
Exemple #8
0
//----------------------------------------------------
// Constructor.  Creates all of the widgets.
// Add new widgets here
//----------------------------------------------------
ImpressionistUI::ImpressionistUI() {
	// Create the main window
	m_mainWindow = new Fl_Window(600, 300, "Impressionist");
		m_mainWindow->user_data((void*)(this));	// record self to be used by static callback functions
		// install menu bar
		m_menubar = new Fl_Menu_Bar(0, 0, 600, 25);
		m_menubar->menu(menuitems);

		// Create a group that will hold two sub windows inside the main
		// window
		Fl_Group* group = new Fl_Group(0, 25, 600, 275);

			// install paint view window
			m_paintView = new PaintView(300, 25, 300, 275, "This is the paint view");//0jon
			m_paintView->box(FL_DOWN_FRAME);

			// install original view window
			m_origView = new OriginalView(0, 25, 300, 275, "This is the orig view");//300jon
			m_origView->box(FL_DOWN_FRAME);
			m_origView->deactivate();

		group->end();
		Fl_Group::current()->resizable(group);
    m_mainWindow->end();

	// init values

	m_nSize = 10;

	// brush dialog definition
	m_brushDialog = new Fl_Window(400, 325, "Brush Dialog");
		// Add a brush type choice to the dialog
		m_BrushTypeChoice = new Fl_Choice(50,10,150,25,"&Brush");
		m_BrushTypeChoice->user_data((void*)(this));	// record self to be used by static callback functions
		m_BrushTypeChoice->menu(brushTypeMenu);
		m_BrushTypeChoice->callback(cb_brushChoice);

		m_ClearCanvasButton = new Fl_Button(240,10,150,25,"&Clear Canvas");
		m_ClearCanvasButton->user_data((void*)(this));
		m_ClearCanvasButton->callback(cb_clear_canvas_button);


		// Add brush size slider to the dialog 
		m_BrushSizeSlider = new Fl_Value_Slider(10, 80, 300, 20, "Size");
		m_BrushSizeSlider->user_data((void*)(this));	// record self to be used by static callback functions
		m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER);
        m_BrushSizeSlider->labelfont(FL_COURIER);
        m_BrushSizeSlider->labelsize(12);
		m_BrushSizeSlider->minimum(1);
		m_BrushSizeSlider->maximum(40);
		m_BrushSizeSlider->step(1);
		m_BrushSizeSlider->value(m_nSize);
		m_BrushSizeSlider->align(FL_ALIGN_RIGHT);
		m_BrushSizeSlider->callback(cb_sizeSlides);

    m_brushDialog->end();	

}
Exemple #9
0
int main(int argc, char **argv) {
  window = new Fl_Double_Window(400,400);

  input = new Fl_Input(25,375,350,25);
  input->static_value("The quick brown fox jumps over the lazy dog.");
  input->when(FL_WHEN_CHANGED);
  input->callback(input_cb);

  sizes= new Fl_Value_Slider(50,350,350,25,"Size:");
  sizes->type(Fl_Slider::HORIZONTAL);
  sizes->clear_flag(FL_ALIGN_MASK);
  sizes->set_flag(FL_ALIGN_LEFT);
  sizes->range(1,64);
  sizes->step(1);
  sizes->value(14);
  sizes->callback(size_cb);

  fonts=new Fl_Value_Slider(50,325,350,25,"Font:");
  fonts->type(Fl_Slider::HORIZONTAL);
  fonts->clear_flag(FL_ALIGN_MASK);
  fonts->set_flag(FL_ALIGN_LEFT);
  fonts->range(0,15);
  fonts->step(1);
  fonts->value(0);
  fonts->callback(font_cb);

  Fl_Group *g = new Fl_Group(25,300,350,25);

  leftb = new Fl_Toggle_Button(0,0,50,25,"left");
  leftb->callback(button_cb);
  rightb = new Fl_Toggle_Button(50,0,50,25,"right");
  rightb->callback(button_cb);
  topb = new Fl_Toggle_Button(100,0,50,25,"top");
  topb->callback(button_cb);
  bottomb = new Fl_Toggle_Button(150,0,50,25,"bottom");
  bottomb->callback(button_cb);
  insideb = new Fl_Toggle_Button(200,0,50,25,"inside");
  insideb->callback(button_cb);
  wrapb = new Fl_Toggle_Button(250,0,50,25,"wrap");
  wrapb->callback(button_cb);
  clipb = new Fl_Toggle_Button(300,0,50,25,"clip");
  clipb->callback(button_cb);
  g->end();

  Fl_Choice *c = new Fl_Choice(100,250,200,25);
  c->menu(choices);

  text= new Fl_Box(100,75,200,100,input->value());
  text->box(FL_ENGRAVED_BOX);
  text->clear_flag(FL_ALIGN_MASK);
  text->set_flag(FL_ALIGN_CENTER);
  window->resizable(text);
  window->end();
  window->show(argc,argv);
  return Fl::run();
}
Exemple #10
0
void make_form()
{
	const int LD = 606;
	//weight feathering
	start_weight = new Fl_Value_Slider(LD,0,200,20,"spectrum start weight");
	start_weight->type(FL_HOR_SLIDER);
	start_weight->bounds(0.3,30.0);
	start_weight->step(0.3*20.0);
	start_weight->value(0.0);
	start_weight->callback(drag_cb);
	
	feathering = new Fl_Value_Slider(LD,40,200,20,"feathering");
	feathering->type(FL_HOR_SLIDER);
	feathering->bounds(1.0,10.0);
	feathering->callback(drag_cb);
	feathering->value(1.0);
	
	//feather, no_feather_at_cap, no_feather_at_core
	feather		   = new Fl_Light_Button(LD,80,100,15,"feather");
	no_feather_at_cap  = new Fl_Light_Button(LD+50,95,150,15,"no_feather_at_cap");
	no_feather_at_core = new Fl_Light_Button(LD+50,110,150,15,"no_feather_at_core");
	feather		  ->value(1);
	no_feather_at_cap ->value(0);
	no_feather_at_core->value(0);
	feather		  ->callback(drag_cb);
	no_feather_at_cap ->callback(drag_cb);
	no_feather_at_core->callback(drag_cb);
	
	//cap type
	{
	Fl_Group* o = new Fl_Group(LD,160,200,30);
		new Fl_Box(LD,160,80,15,"cap type:");
		jc_butt   = new Fl_Radio_Light_Button(LD+20,175,40,15,"butt");
		jc_round  = new Fl_Radio_Light_Button(LD+60,175,50,15,"round");
		jc_square = new Fl_Radio_Light_Button(LD+110,175,50,15,"square");
		jc_rect   = new Fl_Radio_Light_Button(LD+160,175,40,15,"rect");
	o->end();
	jc_butt   ->value(1);
	jc_butt   ->callback(drag_cb);
	jc_round  ->callback(drag_cb);
	jc_square ->callback(drag_cb);
	jc_rect   ->callback(drag_cb);
	}
	
	//test options
	colored = new Fl_Light_Button(LD,250,60,15,"colored");
	colored->callback(drag_cb);
	colored->value(1);
	alphaed = new Fl_Light_Button(LD+60,250,70,15,"alpha-ed");
	alphaed->callback(drag_cb);
	alphaed->value(1);
	weighted = new Fl_Light_Button(LD+130,250,70,15,"weighted");
	weighted->callback(drag_cb);
}
Exemple #11
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 );

}
// Any new widgets added to the widget tree will be added to the parent of the group.
Scheme_Object* 
spark_fltk_group::end(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Group* group = _get_fl_group(argc, argv, 0);
  if (group)
    {
      group->end();
      _ret_ = scheme_true;
    }
  DEFAULT_RET_FINISH;
}
Exemple #13
0
Fl_Group* gdSampleEditor::createInfoBox(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 400, h);
  g->begin();
    info = new geBox(g->x(), g->y(), g->w(), g->h());
  g->end();	

  info->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_TOP);
  
  updateInfo();

  return g;
}
CAppManager::CAppManager()
{
    const int mainw = 560, mainh = 330;
    m_pMainWindow = new Fl_Window(mainw, mainh, "Nixstaller - App Manager");

    m_pAppList = new Fl_Hold_Browser(20, 40, 180, 240, "Installed applications");
    m_pAppList->align(FL_ALIGN_TOP);
    GetRegisterEntries(&m_AppVec);
    for (std::vector<app_entry_s *>::iterator it=m_AppVec.begin(); it!=m_AppVec.end(); it++)
        m_pAppList->add(MakeCString((*it)->name));
    m_pAppList->callback(AppListCB, this);
    m_pAppList->value(1);

    Fl_Tabs *pTabs = new Fl_Tabs((m_pAppList->x()+m_pAppList->w())+20, 20, 300, 260);
    
    Fl_Group *pInfoTab = new Fl_Group((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 260, "Info");
    m_pInfoOutput = new Fl_Help_View((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 240);
    m_pInfoOutput->align(FL_ALIGN_TOP);
    pInfoTab->end();
    
    Fl_Group *pFilesTab = new Fl_Group((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 260, "Files");
    m_pFilesTextDisplay = new Fl_Text_Display((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 240);
    m_pFilesTextBuffer = new Fl_Text_Buffer;
    m_pFilesTextDisplay->buffer(m_pFilesTextBuffer);
    
    pFilesTab->end();
    
    pTabs->end();
    m_pUninstallButton = new Fl_Button(20, (m_pAppList->y()+m_pAppList->h())+20, 120, 25, "Uninstall");
    m_pUninstallButton->callback(UninstallCB, this);
    m_pExitButton = new Fl_Button((mainw-140), (m_pAppList->y()+m_pAppList->h())+20, 120, 25, "Exit");
    m_pExitButton->callback(ExitCB);
    
    UpdateInfo(true);

    m_pUninstallWindow = new CUninstallWindow(this);
    
    m_pMainWindow->end();
}
Exemple #15
0
void onelabGroup::_addSolverMenu(int num)
{
  std::ostringstream path;
  path << "0Solver/View" << num;
  Fl_Tree_Item *n = _tree->add(path.str().c_str());
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  int hh = n->labelsize() + 4;
  _tree->begin();
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  new solverButton(1, 1, ww, hh, num, _tree->color());
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  n->widget(grp);
  _tree->end();
}
Exemple #16
0
ChannelChatTab::ChannelChatTab(int x, int y, int w, int h, std::string const & channelName,
                         ITabs& iTabs, Model & model, ChatSettingsDialog & chatSettingsDialog):
    Fl_Tile(x,y,w,h),
    iTabs_(iTabs),
    model_(model),
    chatSettingsDialog_(chatSettingsDialog),
    channelName_(channelName),
    logFile_("channel_" + channelName)
{
    callback(ChannelChatTab::callbackSplit, this);

    // make tab name unique
    std::string const tabName("#"+channelName);
    copy_label(tabName.c_str());

    // left side (text and input)
    int const leftW = 0.75*w;
    Fl_Group * left = new Fl_Group(x, y, leftW, h);
    int const ih = FL_NORMAL_SIZE*2; // input height
    text_ = new TextDisplay2(x, y, leftW, h-ih, &logFile_);
    input_ = new ChatInput(x, y+h-ih, leftW, ih);
    input_->connectText( boost::bind(&ChannelChatTab::onInput, this, _1) );
    input_->connectComplete( boost::bind(&ChannelChatTab::onComplete, this, _1, _2, _3, _4) );
    left->resizable(text_);
    left->end();

    // right side (user list)
    int const rightW = w - leftW;
    userList_ = new UserList(x+leftW, y, rightW, h, model_, iTabs_);

    // setup split
    position(userList_->x(), 0, iTabs.getSplitPos(), 0);

    end();

    chatSettingsDialog_.connectChatSettingsChanged( boost::bind(&ChannelChatTab::initChatSettings, this) );
    initChatSettings();

    // model signals
    model_.connectChannelTopicSignal( boost::bind(&ChannelChatTab::topic, this, _1, _2, _3, _4) );
    model_.connectChannelMessageSignal( boost::bind(&ChannelChatTab::message, this, _1, _2) );
    model_.connectChannelClients( boost::bind(&ChannelChatTab::clients, this, _1, _2) );
    model_.connectUserJoinedChannel( boost::bind(&ChannelChatTab::userJoined, this, _1, _2) );
    model_.connectUserLeftChannel( boost::bind(&ChannelChatTab::userLeft, this, _1, _2, _3) );
    model_.connectSaidChannel( boost::bind(&ChannelChatTab::said, this, _1, _2, _3) );
}
Exemple #17
0
Fl_Group* gdSampleEditor::createPreviewBox(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 110, h);
  g->begin();
    rewind = new geButton(g->x(), g->y()+(g->h()/2)-12, 25, 25, "", rewindOff_xpm, rewindOn_xpm);
    play   = new geButton(rewind->x()+rewind->w()+4, g->y()+(g->h()/2)-12, 25, 25, "", play_xpm, pause_xpm);
    loop   = new geCheck(play->x()+play->w()+6, g->y()+(g->h()/2)-6, 12, 12, "Loop");
  g->end();

  play->callback(cb_togglePreview, (void*)this);
  rewind->callback(cb_rewindPreview, (void*)this);

  ch->onPreviewEnd = [this] { 
  	play->value(0);
  };

  return g;
}
Exemple #18
0
NioUI::NioUI()
    :Fl_Window(200, 100, 400, 400, "New IO Controls")
{
    //hm, I appear to be leaking memory
    Fl_Group *settings = new Fl_Group(0, 20, 400, 400 - 35, "Settings");
    {
        audio = new Fl_Choice(60, 80, 100, 25, "Audio");
        audio->callback(audioCallback);
        midi = new Fl_Choice(60, 100, 100, 25, "Midi");
        midi->callback(midiCallback);
    }
    settings->end();

    //initialize midi list
    {
        set<string> midiList = Nio::getSources();
        string      source   = Nio::getSource();
        int midival = 0;
        for(set<string>::iterator itr = midiList.begin();
            itr != midiList.end(); ++itr) {
            midi->add(itr->c_str());
            if(*itr == source)
                midival = midi->size() - 2;
        }
        midi->value(midival);
    }

    //initialize audio list
    {
        set<string> audioList = Nio::getSinks();
        string      sink      = Nio::getSink();
        int audioval = 0;
        for(set<string>::iterator itr = audioList.begin();
            itr != audioList.end(); ++itr) {
            audio->add(itr->c_str());
            if(*itr == sink)
                audioval = audio->size() - 2;
        }
        audio->value(audioval);
    }
    resizable(this);
    size_range(400, 300);
}
Exemple #19
0
void FolderWindow::AddStructure(const char* filename, const int index)
{
    
    Fl_Pack* pack = folderPack;
    pack->begin();
    
    int vertPosn = pack->children() * NAVBUTTONS_BHEIGHT; //+ pack->y() + 15;
    
    Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), NAVBUTTONS_BHEIGHT);
    group->begin();
    
    Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
    label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    label->callback(FolderWindow::ShowFileCallback);
    label->user_data((void*)index);
    label->labelcolor(GUI_BTEXT_COLOR);
    char labelWithIcon[MAX_BUFFER_SIZE];

    std::string spaceBuffer = string("                                                    ");
    int curLabelLen = 0;
    char filePrefix[MAX_BUFFER_SIZE];
    size_t fileNameBytes = strlen(filename);
    snprintf(filePrefix, MAX_BUFFER_SIZE, "%-.20s%s", filename, 
	     fileNameBytes > MAX_FOLDER_LABEL_CHARS ? "..." : "");
    snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew   %s%s", 
	     filePrefix, spaceBuffer.substr(0, 
             MAX(0, MAX_FOLDER_LABEL_CHARS - ((int ) strlen(filePrefix)))).c_str());
    //strcat(labelWithIcon, "   @|>");
    label->copy_label(labelWithIcon);
    label->tooltip(filename); 
    
    Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
    removeButton->callback(FolderWindow::RemoveCallback);
    removeButton->user_data((void*)index);
    removeButton->label("@1+");
    removeButton->labelcolor(GUI_TEXT_COLOR);
    
    group->resizable(label);
    group->end();
    pack->end();
        
    folderScroll->redraw();
}
SwitchParamWidget::SwitchParamWidget(TuileWidget* widget, 
                                        MidiOscSwitchTuile* switchTuile):
                                            TuileParamWidget(widget,
                                                             switchTuile),
                                            m_switchTuile(switchTuile) {

    m_selectInput = new Fl_Simple_Counter(0, 0, 50, 20, "Selected Child");
    m_selectInput->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
    m_selectInput->callback(statTuileSwitchInputs,this);
    m_selectInput->labelsize(12);
    m_selectInput->step(1);
    m_selectInput->bounds(0,10);
    Fl_Group *tmpGroup = new Fl_Group(0,0,80,20,"");
    tmpGroup->end();
    tmpGroup->add(m_selectInput);
    tmpGroup->resizable(false);
    add(tmpGroup);
    end();
}
Exemple #21
0
ButtonSelectionDialog::ButtonSelectionDialog(int actionNumber_){
	actionNumber = actionNumber_;
	buttonReader = JoystickSingleton::Instance().CreateReader();
	buttonReader->callback(OnButtonSelected, this);

	win = new Fl_Window(550, 130, "Press Joystick Button");
	sprintf(labelText, "Press button for \"%s\" on joystick \"%s\"", ActionName(actionNumber), JoystickSingleton::Instance().Name());
	Fl_Group* label = new Fl_Group(10, 35, 530, 5, labelText);
	label->end();
	errorLabel = new Fl_Group(15, 70, 530, 5);
	errorLabel->labelcolor((Fl_Color)1);
	errorLabel->hide();
	errorLabel->end();
	Fl_Button* btn = new Fl_Button(435, 90, 100, 25, "Cancel");
	btn->callback(OnClose, this);
	win->callback(OnClose, this);
	win->end();
	win->set_modal();
	win->show();
}
CLuaDirSelector::CLuaDirSelector(const char *desc, const char *val) : CBaseLuaWidget(desc)
{
    const int dirinputh = 35, buttonh = 25;
    
    // Group for placing widgets next to eachother
    Fl_Group *dirgroup = new Fl_Group(0, 0, 0, dirinputh);
    dirgroup->resizable(NULL);
    GetGroup()->add(dirgroup);
    
    m_pDirInput = new Fl_File_Input(0, 0, 0, dirinputh);
    m_pDirInput->callback(InputChangedCB, this);
    
    if (val && *val)
        m_pDirInput->value(val);
    
    m_pBrowseButton = new Fl_Button(0, (dirinputh-buttonh)/2, 0, buttonh, GetTranslation("Browse"));
    m_pBrowseButton->callback(BrowseCB, this);
    
    dirgroup->end();
}
Exemple #23
0
void onelabGroup::_addViewMenu(int num)
{
  std::ostringstream path;
  path << "0Post-processing/View" << num;
  Fl_Tree_Item *n;
  if((n = _tree->find_item(path.str().c_str())) != NULL) { // check if the item already exists
    _tree->remove(n);
  }
  n = _tree->add(path.str().c_str());
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  int hh = n->labelsize() + 4;
  _tree->begin();
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  new viewButton(1, 1, ww, hh, num, _tree->color());
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  n->widget(grp);
  _tree->end();
}
Exemple #24
0
Fl_Group* gdSampleEditor::createBottomBar(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(8, waveTools->y()+waveTools->h()+8, w()-16, h);
  g->begin();
    Fl_Group* previewBox = createPreviewBox(g->x(), g->y(), g->h());

    geBox* divisor1 = new geBox(previewBox->x()+previewBox->w()+8, g->y(), 1, g->h());
    divisor1->box(FL_BORDER_BOX);

    Fl_Group* opTools = createOpTools(divisor1->x()+divisor1->w()+12, g->y(), g->h());

    geBox* divisor2 = new geBox(opTools->x()+opTools->w()+8, g->y(), 1, g->h());
    divisor2->box(FL_BORDER_BOX);

    createInfoBox(divisor2->x()+divisor2->w()+8, g->y(), g->h());

  g->end();
  g->resizable(0);

  return g;
}
Exemple #25
0
VDBWindow::VDBWindow() : Fl_Window(640+180,480,"vdb") {
	gl = new GLWindow(0, 0, w() - 180, h());
	
	Fl_Group * group = new Fl_Group(640,0,180,h());
	
	point_size = new Fl_Slider(640+10, 20, 160, 20, "Point Size");
	setupSlider(point_size,1,5,5,this);
	filter_value = new Fl_Slider(640+10, 60, 160 , 20, "Filter");
	setupSlider(filter_value,0,1,1,this);
	
	color_by = new Fl_Choice(640+30, 100, 110, 20, "Color By");
	color_by->align(FL_ALIGN_TOP);
	color_by->add("vdb_color",0,color_by_wrapper,this);
	color_by->add("vdb_label",0,color_by_wrapper,this);
	color_by->value(0);
	makePretty(color_by);
	
	clear_button = new Fl_Button(640+130, h() - 40, 40, 30, "Clear");
	clear_button->callback(clear_wrapper,gl);
	makePretty(clear_button);
	
	makePretty(this);
	for(int i = 0; i < N_CATEGORY_COLORS; i++) {
		Fl::set_color(i+8,category_colors[i][0],category_colors[i][1],category_colors[i][2]);
	}
	
	static int column_widths[] = { 30, 100, 0 };
	Fl_Browser * b = gl->legend = new Fl_Browser(640+10,130, 160, h() - 130 - 50);
	b->column_widths(column_widths);
	b->format_char('@');
	b->column_char('\t');
	b->hide();
	group->end();
	group->resizable(NULL);
	
	this->resizable(gl);
	this->size_range(500,480);
	
	this->end();
};
Exemple #26
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();
}
/* Creates the group for the timeline and its controls and returns it. */
Fl_Group* AnimatedSGWindow::makeFrameControlG(const int x, const int y)
{
	Fl_Group* frameControlG = new Fl_Group(x, y, 200, 50);
	
	/* Create the frame rate spinner. */
	this->framerateSpinner = new Fl_Spinner(x, y, 50, 25, "Frame rate");
	this->framerateSpinner->box(FL_UP_BOX);
	this->framerateSpinner->maximum(60);
	this->framerateSpinner->value(10);
	this->framerateSpinner->align(Fl_Align(FL_ALIGN_TOP));
	
	/* Create the number of frames spinner. */
	this->numFramesSpinner = new Fl_Spinner(x+100, y, 70, 25, "Number of Frames");
	this->numFramesSpinner->box(FL_UP_BOX);
	this->numFramesSpinner->maximum(999);
	this->numFramesSpinner->value(20);
	this->numFramesSpinner->align(Fl_Align(FL_ALIGN_TOP));
	this->numFramesSpinner->callback(AnimatedSGWindow::numFramesCB, this);
	
	frameControlG->end();
	return frameControlG;
}
Exemple #28
0
Fl_Group* gdSampleEditor::createUpperBar()
{
  using namespace giada::m;

  Fl_Group* g = new Fl_Group(G_GUI_OUTER_MARGIN, G_GUI_OUTER_MARGIN, w()-16, G_GUI_UNIT);
  g->begin();
    grid    = new geChoice(g->x(), g->y(), 50, G_GUI_UNIT);
    snap    = new geCheck(grid->x()+grid->w()+4, g->y()+3, 12, 12, "Snap");
    sep1    = new geBox(snap->x()+snap->w()+4, g->y(), 506, G_GUI_UNIT);
    zoomOut = new geButton(sep1->x()+sep1->w()+4, g->y(), G_GUI_UNIT, G_GUI_UNIT, "", zoomOutOff_xpm, zoomOutOn_xpm);
    zoomIn  = new geButton(zoomOut->x()+zoomOut->w()+4, g->y(), G_GUI_UNIT, G_GUI_UNIT, "", zoomInOff_xpm, zoomInOn_xpm);
  g->end();
  g->resizable(sep1);

  grid->add("(off)");
  grid->add("2");
  grid->add("3");
  grid->add("4");
  grid->add("6");
  grid->add("8");
  grid->add("16");
  grid->add("32");
  grid->add("64");
  if (conf::sampleEditorGridVal == 0)
    grid->value(0);
  else 
    grid->value(grid->find_item(u::string::iToString(conf::sampleEditorGridVal).c_str()));
  grid->callback(cb_changeGrid, (void*)this);

  snap->value(conf::sampleEditorGridOn);
  snap->callback(cb_enableSnap, (void*)this);

  /* TODO - redraw grid if != (off) */

  zoomOut->callback(cb_zoomOut, (void*)this);
  zoomIn->callback(cb_zoomIn, (void*)this);

  return g;
}
/* Creates the group for the timeline and its controls and returns it. */
Fl_Group* AnimatedSGWindow::makeTimelineG(const int x, const int y)
{
	Fl_Group* timelineG = new Fl_Group(x, y, 750, 70);
    
	/* Create the back buttons */
	this->backB = new Fl_Button(x, y+30, 40, 40, "<<");
    this->backB->box(FL_PLASTIC_UP_BOX);
    this->backB->callback(AnimatedSGWindow::backCB, this);	

	/* Create the play buttons */
	this->playB = new Fl_Button(x+50, y+30, 40, 40, "\342\226\272");
	this->playB->box(FL_PLASTIC_UP_BOX);
    this->playB->color((Fl_Color)2);
	this->playB->callback(AnimatedSGWindow::playbuttonCB, this);
    
	/* Create the forwards buttons */
	this->forwardB = new Fl_Button(x+100, y+30, 40, 40, ">>");
    this->forwardB->box(FL_PLASTIC_UP_BOX);
    this->forwardB->callback(AnimatedSGWindow::forwardCB, this);
    
	/* Create the timeline sliders. */
	this->timeline = new Fl_Value_Slider(x+150, y+30, 540, 40, "Timeline");
    this->timeline->type(5);
    this->timeline->box(FL_PLASTIC_UP_BOX);
    this->timeline->maximum(this->numFramesSpinner->value()-1);
    this->timeline->step(1);
    this->timeline->align(Fl_Align(FL_ALIGN_TOP));
	this->timeline->callback(AnimatedSGWindow::timelineCB, this);

	/* Create the loop buttons. */
	this->loopB = new Fl_Light_Button(x+700, y+30, 60, 40, "Loop");
    this->loopB->box(FL_PLASTIC_UP_BOX);
    this->loopB->selection_color(FL_GREEN);
	
	timelineG->end();

	return timelineG;
}
Exemple #30
0
Fl_Group* gdSampleEditor::createOpTools(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 572, h);
  g->begin();
  g->resizable(0);
    volumeTool = new geVolumeTool(g->x(), g->y(), ch);
    boostTool  = new geBoostTool(volumeTool->x()+volumeTool->w()+4, g->y(), ch);
    panTool    = new gePanTool(boostTool->x()+boostTool->w()+4, g->y(), ch);
   
    pitchTool = new gePitchTool(g->x(), panTool->y()+panTool->h()+8, ch);

    rangeTool = new geRangeTool(g->x(), pitchTool->y()+pitchTool->h()+8, ch);
    shiftTool = new geShiftTool(rangeTool->x()+rangeTool->w()+4, pitchTool->y()+pitchTool->h()+8, ch);
    reload    = new geButton(g->x()+g->w()-70, shiftTool->y(), 70, 20, "Reload");
  g->end();

  if (ch->wave->isLogical()) // Logical samples (aka takes) cannot be reloaded.
    reload->deactivate();

  reload->callback(cb_reload, (void*)this);

  return g;
}