Exemplo n.º 1
0
SL::Remote_Access_Library::UI::MainWindow::MainWindow(int x, int y, int w, int h, const char * l, std::function<void()> onToggleConnection) : Fl_Double_Window(x, y, w, h, l), _OnToggleConnection(onToggleConnection)
{
	resizable(this);
	
	scroller = new Fl_Scroll(0, 0, w, h);
	overb = new Fl_Button(5, 5, 100, 25, "Connect");
	img_box = new Fl_Box(5, 5, w - 5, h - 5);
	overb->callback(button_cb, this);
	resizable(img_box);
	resizable(scroller);
	end();
	Fl::visual(FL_RGB);
}
Exemplo n.º 2
0
solverButton::solverButton(int x, int y, int w, int h, int num, Fl_Color col)
  : Fl_Group(x,y,w,h)
{
  int popw = FL_NORMAL_SIZE + 2;

  _butt[0] = new Fl_Button(x, y, w - popw, h);
  _butt[0]->box(FL_FLAT_BOX);
  _butt[0]->color(col);
  _butt[0]->selection_color(col);
  _butt[0]->callback(solver_cb, (void *)num);
  _butt[0]->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);

  std::string name = opt_solver_name(num, GMSH_GET, "");
  _butt[0]->copy_label(name.c_str());
  std::string exe = opt_solver_executable(num, GMSH_GET, "");
  strcpy(_tooltip, exe.c_str());
  _butt[0]->tooltip(_tooltip);

  _butt[1] = new Fl_Button(x + w - popw, y, popw, h, "@>");
  _butt[1]->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
  _butt[1]->tooltip("Show solver option menu");
  _butt[1]->box(FL_FLAT_BOX);
  _butt[1]->color(col);
  _butt[1]->selection_color(col);
  _popup = new Fl_Menu_Button(x + w - popw, y, popw, h);
  _popup->type(Fl_Menu_Button::POPUP123);
  _popup->add("Remove", 0, (Fl_Callback *)solver_remove_cb, (void *)num, 0);

  end(); // close the group
  resizable(_butt[0]);
}
Exemplo n.º 3
0
 /** Adds window-related hints with default values. */
 WindowHints::WindowHints()
 {
     // set default values
     resizable(true);
     visible(true);
     decorated(true);
 }
Exemplo n.º 4
0
gTiming::gTiming(int x, int y)
	: Fl_Group(x, y, 170, 15)
{
	begin();

	quantizer  = new gChoice(x, y, 40, 15, "", false);
	bpm        = new gClick (quantizer->x()+quantizer->w()+4,  y, 40, 15);
	meter      = new gClick (bpm->x()+bpm->w()+8,  y, 40, 15, "4/1");
	multiplier = new gClick (meter->x()+meter->w()+4, y, 15, 15, "", beatsMultiplyOff_xpm, beatsMultiplyOn_xpm);
	divider    = new gClick (multiplier->x()+multiplier->w()+4, y, 15, 15, "÷", beatsDivideOff_xpm, beatsDivideOn_xpm);

	end();

	resizable(NULL);   // don't resize any widget

	char buf[6]; snprintf(buf, 6, "%f", G_Mixer.bpm);
	bpm->copy_label(buf);

	bpm->callback(cb_bpm, (void*)this);
	meter->callback(cb_meter, (void*)this);
	multiplier->callback(cb_multiplier, (void*)this);
	divider->callback(cb_divider, (void*)this);

	quantizer->add("off", 0, cb_quantizer, (void*)this);
	quantizer->add("1b",  0, cb_quantizer, (void*)this);
	quantizer->add("2b",  0, cb_quantizer, (void*)this);
	quantizer->add("3b",  0, cb_quantizer, (void*)this);
	quantizer->add("4b",  0, cb_quantizer, (void*)this);
	quantizer->add("6b",  0, cb_quantizer, (void*)this);
	quantizer->add("8b",  0, cb_quantizer, (void*)this);
	quantizer->value(0); //  "off" by default
}
Exemplo n.º 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);
}
Exemplo n.º 6
0
// ctor
EDE_Browser::EDE_Browser(int X,int Y,int W,int H,const char *L) : Fl_Icon_Browser(X,Y,W,H),
	  totalwidth_(0), column_header_(0), sort_column(0), sort_type(NO_SORT), sort_direction(false) {

	thegroup = new Fl_Group(X,Y,W,H);
	thegroup->begin();
		heading = new Heading(0,0,W,buttonheight);
 		heading->box(FL_FLAT_BOX); // draw heading background
		heading->align(FL_ALIGN_CLIP);
		heading->end();
		heading->hide();
		heading->parent(this); // for callback
	
		hscrollbar = new Fl_Scrollbar(1, H-Fl::scrollbar_size(), W-Fl::scrollbar_size()-3, Fl::scrollbar_size()); // take account for edges
		hscrollbar->type(FL_HORIZONTAL);
		hscrollbar->hide();
		hscrollbar->parent(this); // for callback
		hscrollbar->callback(scroll_cb);
	thegroup->end();
	thegroup->add(this);

	has_scrollbar(VERTICAL);

	resizable(0);
	thegroup->resizable(this);
	thegroup->align(FL_ALIGN_CLIP);

	// EDE_Browser is always a multiple-selection browser 
	type(FL_MULTI_BROWSER);

	column_sort_types_ = new SortType[256]; // 256 columns should be enough for anyone (tm)
	for (int i=0; i<256; i++) column_sort_types_[i]=NO_SORT;
}
Exemplo n.º 7
0
void select_monitor_widget_t::populate(console_window_t *console_window)
{
	label("Select a running coLinux");

	console = console_window;

	browser = new Fl_Hold_Browser(0, 0, 400, 200);
	Fl_Button *button;

	button = new Fl_Button(0, 200, 200, 20);
	button->label("Select");
	button->when(FL_WHEN_RELEASE);
	button->callback((Fl_Callback *)console_select_monitor, this);
	select_button = button;

	button = new Fl_Button(200, 200, 200, 20);
	button->label("Cancel");
	button->when(FL_WHEN_RELEASE);
	button->callback((Fl_Callback *)console_select_monitor, this);
	cancel_button = button;

	resizable(browser);

	end();
	show();

	load_monitors_list();
}
Exemplo n.º 8
0
ced::ced (int w, int h) : fltk::Window(fltk::USEDEFAULT, fltk::USEDEFAULT, w, h)
{
	char buffer[30];
	callback (window_cb);
	begin (); // draw the window
		// Here starts the menu
		menubar = new fltk::MenuBar (0, 0, w, 30);

		menubar->begin ();
			menubar->add ("File/Open", 0, open_cb, (void*)this);
			menubar->add ("File/Exit", 0, exitthis_cb, (void*)this);
		menubar->end (); // here ends the menu

		ed = new fltk::TextEditor (0, 30, w, h); // the editor window
	end (); // end draw the window

	resizable (ed);
	ed->linenumber_width (60);
	ed->wrap_mode (true, 0);
	textbuf = new fltk::TextBuffer(0);
	ed->buffer (textbuf);
    ed->textfont(fltk::COURIER);

	sprintf (buffer, "%d", this);
	textbuf->text (buffer);
}
Exemplo n.º 9
0
BattleInfo::BattleInfo(int x, int y, int w, int h, Model & model, Cache & cache):
    Fl_Group(x,y,w,h),
    model_(model),
    cache_(cache),
    battleId_(-1)
{
    // heigth should be 128
    assert(h == 128);

    // TODO remove ? box(FL_FLAT_BOX);

    mapImageBox_ = new Fl_Box(x,y, h, h);
    mapImageBox_->box(FL_FLAT_BOX);

    x += 128;
    headerText_ = new Fl_Multiline_Output(x, y, w-h, h);
    headerText_->box(FL_THIN_DOWN_BOX);
    headerText_->wrap(1);

    resizable(headerText_);
    end();

    // model signal handlers
    model_.connectBattleChanged( boost::bind(&BattleInfo::battleChanged, this, _1) );
    model_.connectBattleClosed( boost::bind(&BattleInfo::battleClosed, this, _1) );
    model_.connectUserJoinedBattle( boost::bind(&BattleInfo::userJoinedBattle, this, _1, _2) );
    model_.connectUserLeftBattle( boost::bind(&BattleInfo::userLeftBattle, this, _1, _2) );
    model_.connectUserChanged( boost::bind(&BattleInfo::userChanged, this, _1) );

    reset();
}
Exemplo n.º 10
0
IconChooser::IconChooser() : Fl_Double_Window(355, 305, _("Choose icon...")), ret("") {
	begin();
	path = new Fl_Input(10, 10, 240, 25);
	bbrowse = new Fl_Button(255, 10, 90, 25, _("&Browse..."));
	bbrowse->callback(browse_cb, this);

	/* invisible resizable box */
	Fl_Box* ibox = new Fl_Box(15, 160, 115, 95);
	resizable(ibox);

	icongrp = new ExpandableGroup(10, 40, 335, 220);
	icongrp->box(FL_DOWN_BOX);
	icongrp->color(FL_WHITE);
	icongrp->end();

	progress = new Fl_Progress(10, 270, 125, 25);
	progress->minimum(0);
	progress->hide();

	bok = new Fl_Button(160, 270, 90, 25, _("&OK"));
	bok->callback(ok_cb, this);
	bcancel = new Fl_Button(255, 270, 90, 25, _("&Cancel"));
	bcancel->callback(cancel_cb, this);

	end();
}
Exemplo n.º 11
0
YabSplitView::YabSplitView(int x, int y, int w, int h, const char* id, int vert, int style)
	:Fl_Tile(x, y, w, h), YabWidget(id)
{
	min1 = 0;
	min2 = 0;
	movement = true;
	vertical = vert;

	int x1, x2, y1, y2, w1, w2, h1, h2;
	if (vertical)
	{
		x1 = x; y1 = y;
		w1 = w/2; h1 = h;

		x2 = x+(w/2); y2 = y;
		w2 = w/2; h2 = h;
	}
	else
	{
		x1 = x; y1 = y;
		w1 = w; h1 = h/2;

		x2 = x; y2 = y+(h/2);
		w2 = w; h2 = h/2;
	}
	group1 = new Fl_Group(x1, y1, w1, h1);
	group2 = new Fl_Group(x2, y2, w2, h2);
	add(group1);
	add(group2);
	end();

	resizebox = new Fl_Box(x, y, w, h);
	resizable(resizebox);
}
Exemplo n.º 12
0
Parameter::Parameter(int id, Plugin *p, int X, int Y, int W)
    : Fl_Group(X,Y,W-24,20), id(id), pPlugin(p)
{
    begin();

    label = new gBox(x(), y(), 60, 20);
    char name[kVstMaxParamStrLen];
    pPlugin->getParamName(id, name);
    label->copy_label(name);
    label->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);

    slider = new gSlider(label->x()+label->w()+8, y(), W-200, 20);
    slider->value(pPlugin->getParam(id));
    slider->callback(cb_setValue, (void *)this);

    value = new gBox(slider->x()+slider->w()+8, y(), 100, 20);
    char disp[kVstMaxParamStrLen];
    char labl[kVstMaxParamStrLen];
    char str [256];
    pPlugin->getParamDisplay(id, disp);
    pPlugin->getParamLabel(id, labl);
    sprintf(str, "%s %s", disp, labl);
    value->copy_label(str);
    value->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
    value->box(G_BOX);

    resizable(slider);

    end();
}
Exemplo n.º 13
0
gdPluginWindow::gdPluginWindow(Plugin *pPlugin)
    : gWindow(400, 156), pPlugin(pPlugin) // 350
{
    set_non_modal();

    gLiquidScroll *list = new gLiquidScroll(8, 8, w()-16, h()-16);
    list->type(Fl_Scroll::VERTICAL_ALWAYS);
    list->begin();

    int numParams = pPlugin->getNumParams();
    for (int i=0; i<numParams; i++)
        new Parameter(i, pPlugin, list->x(), list->y()+(i*24), list->w());
    list->end();

    end();

    char name[256];
    pPlugin->getProduct(name);
    if (strcmp(name, " ")==0)
        pPlugin->getName(name);
    label(name);

    size_range(400, (24*1)+12);
    resizable(list);

    gu_setFavicon(this);
    show();

}
Exemplo n.º 14
0
void
GcWindow::mousePressEvent(QMouseEvent *e)
{
    if (!resizable() || e->button() == Qt::NoButton || isHidden()) {
        setDragState(None);
        return;
    }

    DragState h = spotHotSpot(e);

    // is it on the close icon?
    if (h == Close) {
        setDragState(None);
        //hide();
        //emit exit();
        return;
    } else if (h == Flip) {
        setDragState(None);
        //flip();
    }

    // get current window state
    oWidth = width();
    oHeight = height();
    oWidthFactor = widthFactor();
    oHeightFactor = heightFactor();
    oX = pos().x();
    oY = pos().y();
    mX = mapFromGlobal(QCursor::pos()).x();
    mY = mapFromGlobal(QCursor::pos()).y();

    setDragState(h); // set drag state then!

    repaint();
}
Exemplo n.º 15
0
DisassemblyWindow::DisassemblyWindow() : Fl_Double_Window(480, 560)
{
	{
		//Setup the menu
		pMainMenu = new Fl_Menu_Bar(0, 0, w(), 28);
		pMainMenu->copy(MenuItems, this);
		//Setup the disassembly display
		pTextDisplay = new ReadOnlyEditorX(0, 28, w(), h()-28*2, StyleTable, sizeof(StyleTable)/sizeof(StyleTable[0]));
		pTextDisplay->pTextBuffer->add_modify_callback(UpdateStyleCB, this);
		//Setup the status bar
		pStatus = new Fl_Output(0, h()-28, w(), 28);
		pStatus->box(FL_PLASTIC_UP_BOX);
		//Setup the pop-up menu
		pPopupMenu = new Fl_Menu_Button(0, 28, 0, 0);
		pPopupMenu->copy(PopupItems, this);
		pPopupMenu->type(Fl_Menu_Button::POPUP3);
	}
	end();
	resizable(pTextDisplay);
	callback(CloseCB, this);

	show();
	SetTitle();
	Init();
}
Exemplo n.º 16
0
gController::gController(int x, int y)
	: Fl_Group(x, y, 131, 25)
{
	begin();

	rewind    = new gClick(x,  y, 25, 25, "", rewindOff_xpm, rewindOn_xpm);
	play      = new gClick(rewind->x()+rewind->w()+4, y, 25, 25, "", play_xpm, pause_xpm);
	recAction = new gClick(play->x()+play->w()+4, y, 25, 25, "", recOff_xpm, recOn_xpm);
	recInput  = new gClick(recAction->x()+recAction->w()+4, y, 25, 25, "", inputRecOff_xpm, inputRecOn_xpm);
	metronome = new gClick(recInput->x()+recInput->w()+4, y+10, 15, 15, "", metronomeOff_xpm, metronomeOn_xpm);

	end();

	resizable(NULL);   // don't resize any widget

	rewind->callback(cb_rewind, (void*)this);

	play->callback(cb_play);
	play->type(FL_TOGGLE_BUTTON);

	recAction->callback(cb_recAction, (void*)this);
	recAction->type(FL_TOGGLE_BUTTON);

	recInput->callback(cb_recInput, (void*)this);
	recInput->type(FL_TOGGLE_BUTTON);

	metronome->callback(cb_metronome);
	metronome->type(FL_TOGGLE_BUTTON);
}
Exemplo n.º 17
0
// ctor initializer - used in both ctors
void Fl_Color_Chooser::ctor_init(int X, int Y, int W, int H) {
    style(Fl_Color_Chooser::default_style);

    nrgroup.end();
    choice.begin();
    new Fl_Item("rgb");
    new Fl_Item("byte");
    new Fl_Item("hex");
    new Fl_Item("hsv");
    choice.end();
    end();
    resizable(huebox);
    store_sizes();
    resize(X,Y,W,H);
    r_ = g_ = b_ = 0;
    hue_ = 0.0;
    saturation_ = 0.0;
    value_ = 0.0;
    set_valuators();

    rvalue.callback((Fl_Callback*)rgb_cb, this);
    gvalue.callback((Fl_Callback*)rgb_cb, this);
    bvalue.callback((Fl_Callback*)rgb_cb, this);
    choice.callback((Fl_Callback*)mode_cb, this);

    rvalue.step(0.01);
    gvalue.step(0.01);
    bvalue.step(0.01);
}
Exemplo n.º 18
0
YabColorControl::YabColorControl(int x, int y, int w, int h, const char* id)
	:Fl_Group(x, y, w, h), YabWidget(id)
{
	min=0; max=255;
	bc[0] = fl_rgb_color(254, 100, 100);
	bc[1] = fl_rgb_color(100, 254, 100);
	bc[2] = fl_rgb_color(100, 100, 254);

	int tw = 30;
	int sh=h/3;
	
	for (int i=0; i<3; i++)
	{
		data[i] = i;
		slider[i] = new Fl_Slider(x, y+(i*sh), w-tw, sh);
		slider[i]->type(FL_HORIZONTAL);
		slider[i]->slider_size(0.05);
		slider[i]->minimum(min);
		slider[i]->maximum(max);
		slider[i]->step(1);
		slider[i]->value(0);
		slider[i]->color(bc[i]);
		slider[i]->callback(cb_common, (void *)data[i]);

		txt[i] = new Fl_Input(x+w-tw, y+(i*sh), tw, sh);
		txt[i]->type(FL_INT_INPUT);
		txt[i]->value("0");
		txt[i]->textsize(12);
		txt[i]->when(FL_WHEN_ENTER_KEY);
		txt[i]->callback(cb_common, (void *)data[i]);
	}
	end();
	resizable(NULL);
	redraw();
}
Exemplo n.º 19
0
void DiagramWindow::Construct(int w, int h, const std::vector<int>& structures)
{
    m_offscreenImage[0] = fl_create_offscreen(2048, 2048);
    m_imageData[0] = new uchar[2048 * 2048 * 3];
    memset(m_imageData[0], 0, 2048 * 2048 * 3);
    m_offscreenImage[1] = fl_create_offscreen(1024, 1024);
    m_imageData[1] = new uchar[1024 * 1024 * 3];
    memset(m_imageData[1], 0, 1024 * 1024 * 3);

    m_glWindow = new GLWindow(0, 120, w, h - 120);
    m_glWindow->SetTextureData(m_imageData[0], 2048);
    m_glWindow->SetTextureData(m_imageData[1], 1024);

    m_menus[0] = m_menus[1] = m_menus[2] = 0;
    m_menuItems = 0;
    m_menuItemsSize = 0;

    color(FL_BLACK);
    size_range(600, 720);
    box(FL_NO_BOX);

    Fl_Box* resizeBox = new Fl_Box(0, 120, w, h - 120);
    resizable(resizeBox);

    SetStructures(structures);
}
Exemplo n.º 20
0
		TestWin(int w, int h, const char* title)
			: Fl_Double_Window(w, h, title),
			m_menuBar(0, 0, w, 25),
			m_pane(0),
			m_scroll(0),
			m_fullScreenImage(false)
		{
			m_menuBar.menu(mainMenu);
			m_menuBar.box(FL_THIN_UP_BOX);
			m_pane = new Pane(0, m_menuBar.h(), w, h - m_menuBar.h(), 0.2);

//			Fl_Pack* pack = new Fl_Pack(0, 0, 1, 1);
//			pack->type(FL_VERTICAL);
			Fl_Browser* browser = new Fl_Select_Browser(0, 0, 1, 100);
			browser->add("blah.tif");
			browser->add("blah1.tif");
			browser->add("blah2.tif");
			browser->add("blah3.tif");
			browser->box(FL_THIN_DOWN_BOX);
			m_pane->add1(browser);
//				pack->resizable(browser);
//			pack->end();
//			m_pane->add1(pack);

			m_scroll = new CenterScroll(0, m_menuBar.h(), w, h - m_menuBar.h());
			m_pane->add2(m_scroll);

			resizable(m_pane);
			end();
		}
Exemplo n.º 21
0
Fl_DeviceGUI::Fl_DeviceGUI(const DeviceGUIInfo& Info, SpiralGUIType *PW, Fl_Pixmap *Icon, bool Terminal) :
Fl_Group (Info.XPos, Info.YPos, Info.Width+(PortGroupWidth*2), Info.Height+TitleBarHeight, ""),
m_PluginWindow (NULL),
m_Icon (NULL),
m_Name (Info.Name),
m_ID (-1),
m_DelMe (false),
m_IsTerminal (Terminal),
m_Minimised (true)
{
	for (int n=0; n<512; n++) Numbers[n]=n;

	type(1);
	box((Fl_Boxtype)SpiralInfo::GUIDEVICE_Box);
    labeltype(FL_ENGRAVED_LABEL);
    align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
	color(SpiralInfo::GUICOL_Device);

	m_Icon=Icon;
	m_MiniWidth=w();
	m_MiniHeight=h();

	m_DragBar = new Fl_DragBar(Info.XPos, Info.YPos, Info.Width+PortGroupWidth*2, TitleBarHeight, m_Name.c_str());
	m_DragBar->labelsize(10);
	m_DragBar->type(Fl_DragBar::FLDRAG);
	m_DragBar->color(SpiralInfo::GUICOL_Device);

	m_Menu = new Fl_Menu_Button(x(),y(),w(),h(),"");
	m_Menu->type(Fl_Menu_Button::POPUP3);
	m_Menu->textsize(8);

	m_Menu->add("rename", 0, (Fl_Callback*)cb_Rename,this);
	m_Menu->add("delete", 0, (Fl_Callback*)cb_Delete,this);

	int Centx=x()+w()/2;
	int Centy=y()+h()/2;

	if (m_Icon)
	{
		m_IconButton = new Fl_Button(Centx-m_Icon->w()/2,Centy-m_Icon->h()/2,m_Icon->w(),m_Icon->h());
		m_IconButton->box(FL_NO_BOX);
	    m_IconButton->image(m_Icon);
	}
	else
	{
		m_IconButton = NULL;
	}

	m_PluginWindow = PW;
	if (m_PluginWindow) {
           m_PluginWindow->hide();
           add (m_PluginWindow);
           m_PluginWindow->SetResizeCallback (&cb_Resize, this);
	}
	resizable(NULL);
	//Add the input/output ports
	Setup(Info, true);
}
Exemplo n.º 22
0
		void resize(int width,int height) 
		{
			if(!resizable())
			{
				limeThrow(errc::resize_error, "can't resize the window: %s",_name.c_str());
			}

			onresize(width, height);
		}
Exemplo n.º 23
0
/**
 * Class constructor.
 */
console_log_window::console_log_window( int w, int h, const char* label )
    : super_( w,h, label )
{
    wText_ = new Fl_Text_Display( 0,0, w,h );
    wText_->buffer( new Fl_Text_Buffer() );
    wText_->insert_position( 0 );

    resizable( wText_ );
    end();
}
void renderspuSetVBoxConfiguration( RenderSPU *render_spu )
{
    CRConnection *conn;
    int a;

    for (a=0; a<256; a++)
    {
        render_spu->lut8[0][a] = 
        render_spu->lut8[1][a] = 
        render_spu->lut8[2][a] = a;
    }
    render_spu->use_lut8 = 0;

    set_title(render_spu, "Chromium Render SPU");
    set_window_geometry(render_spu, "[0, 0, 0, 0]");
    set_fullscreen(render_spu, "0");
    resizable(render_spu, "0");
    set_on_top(render_spu, "1");
    set_borderless(render_spu, "1");
    set_default_visual(render_spu, "rgb, double, depth");
#if defined(GLX)
    set_try_direct(render_spu, "1");
    set_force_direct(render_spu, "0");
#endif
    render_to_app_window(render_spu, "0");
    render_to_crut_window(render_spu, "0");
    set_cursor(render_spu, "0");
    set_system_gl_path(render_spu, "");
    set_display_string(render_spu, "DEFAULT");
    gather_url(render_spu, "");
    gather_userbuf(render_spu, "0");
    set_lut8(render_spu, "");
    set_master_url(render_spu, "");
    set_is_master(render_spu, "0");
    set_num_clients(render_spu, "1");
    set_use_osmesa(render_spu, "0");
    set_nv_swap_group(render_spu, "0");
    set_ignore_papi(render_spu, "0");
    set_ignore_window_moves(render_spu, "0");
    set_pbuffer_size(render_spu, "[0, 0]");
    set_use_glxchoosevisual(render_spu, "1");
    set_draw_bbox(render_spu, "0");

    render_spu->swap_mtu = 1024 * 500;

    /* Some initialization that doesn't really have anything to do
     * with configuration but which was done here before:
     */
    render_spu->use_L2 = 0;
    render_spu->cursorX = 0;
    render_spu->cursorY = 0;
#if defined(GLX)
    render_spu->sync = 0;
#endif
}
Exemplo n.º 25
0
ElevatorSimWindow::ElevatorSimWindow() :
   Fl_Window(WINDOW_WIDTH,  WINDOW_HEIGHT, WINDOW_TITLE) {
      renderWindow = new ElevatorSimRenderWindow(
         ElevatorSimRenderWindow::LEFT_MARGIN,
         ElevatorSimRenderWindow::TOP_MARGIN,
         WINDOW_WIDTH -
            (ElevatorSimRenderWindow::LEFT_MARGIN +
            ElevatorSimRenderWindow::RIGHT_MARGIN),
         WINDOW_HEIGHT -
            (ElevatorSimRenderWindow::TOP_MARGIN +
            ElevatorSimRenderWindow::BOTTOM_MARGIN));

      resizable(*renderWindow);
      buildMenu();
      buildButtons();

      /* add more widgets to main window here */

      end();

      buildDialogs();

      welcomeWin = new ElevatorSimWelcomeWindow();
      startWin = new ElevatorSimStartWindow();
      resultsWin = new ElevatorSimResultsWindow();

      /* some hackery to set the application icon in windows */
      #ifdef _ES_WINNT
      HANDLE iconImage = LoadImage(
         GetModuleHandle(NULL),
         MAKEINTRESOURCE(IDI_ELEVATOR_SIM_ICON),
         IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);

      if(iconImage == NULL) {
         std::cout << "warning: failed to load application icon!" << std::endl;
      } else {
         if(isDebugBuild()) {
            std::stringstream dbgSS;
            dbgSS << "loaded app icon OK @ " << (void*)iconImage << std::endl;
            LOG_INFO( Logger::SUB_FLTK, sstreamToBuffer(dbgSS) );
         }

         icon( (const void*) iconImage );
      }
      #endif

      callback((Fl_Callback*)windowCloseCB, this);

      /* add more callbacks to main window here */

      /* initialize any other main window member variables here */
}
Exemplo n.º 26
0
gSampleChannel::gSampleChannel(int X, int Y, int W, int H, class SampleChannel *ch)
	: gChannel(X, Y, W, H, CHANNEL_SAMPLE), ch(ch)
{
	begin();

#if defined(WITH_VST)
  int delta = 168; 
#else
	int delta = 144; 
#endif

	button       = new gButton(x(), y(), 20, 20, "", channelStop_xpm, channelPlay_xpm);
	status       = new gStatus(button->x()+button->w()+4, y(), 20, 20, ch);
	mainButton   = new gSampleChannelButton(status->x()+status->w()+4, y(), w() - delta, 20, "-- no sample --");
	modeBox      = new gModeBox(mainButton->x()+mainButton->w()+4, y(), 20, 20, ch);
	mute         = new gClick(modeBox->x()+modeBox->w()+4, y(), 20, 20, "", muteOff_xpm, muteOn_xpm);
	solo         = new gClick(mute->x()+mute->w()+4, y(), 20, 20, "", soloOff_xpm, soloOn_xpm);
	readActions  = NULL; 

#if defined(WITH_VST)
	fx           = new gFxButton(solo->x()+solo->w()+4, y(), 20, 20, fxOff_xpm, fxOn_xpm);
	vol          = new gDial(fx->x()+fx->w()+4, y(), 20, 20);
#else
	vol          = new gDial(solo->x()+solo->w()+4, y(), 20, 20);
#endif

	end();

  resizable(mainButton);

	update();

	button->callback(cb_button, (void*)this);
	button->when(FL_WHEN_CHANGED);   

#ifdef WITH_VST
	fx->callback(cb_openFxWindow, (void*)this);
#endif

	mute->type(FL_TOGGLE_BUTTON);
	mute->callback(cb_mute, (void*)this);

	solo->type(FL_TOGGLE_BUTTON);
	solo->callback(cb_solo, (void*)this);

	mainButton->callback(cb_openMenu, (void*)this);

	vol->callback(cb_changeVol, (void*)this);

	ch->guiChannel = this;
}
Exemplo n.º 27
0
geMidiChannel::geMidiChannel(int X, int Y, int W, int H, MidiChannel *ch)
	: geChannel(X, Y, W, H, CHANNEL_MIDI, ch)
{
	begin();

#if defined(WITH_VST)
  int delta = 144; // (6 widgets * 20) + (6 paddings * 4)
#else
	int delta = 120; // (5 widgets * 20) + (5 paddings * 4)
#endif

	button     = new gButton(x(), y(), 20, 20, "", channelStop_xpm, channelPlay_xpm);
	arm        = new gClick(button->x()+button->w()+4, y(), 20, 20, "", armOff_xpm, armOn_xpm);
	mainButton = new geMidiChannelButton(arm->x()+arm->w()+4, y(), w() - delta, 20, "-- MIDI --");
	mute       = new gClick(mainButton->x()+mainButton->w()+4, y(), 20, 20, "", muteOff_xpm, muteOn_xpm);
	solo       = new gClick(mute->x()+mute->w()+4, y(), 20, 20, "", soloOff_xpm, soloOn_xpm);
#if defined(WITH_VST)
	fx         = new gFxButton(solo->x()+solo->w()+4, y(), 20, 20, fxOff_xpm, fxOn_xpm);
	vol        = new gDial(fx->x()+fx->w()+4, y(), 20, 20);
#else
	vol        = new gDial(solo->x()+solo->w()+4, y(), 20, 20);
#endif

	end();

  resizable(mainButton);

	update();

	button->callback(cb_button, (void*)this);
	button->when(FL_WHEN_CHANGED);   // do callback on keypress && on keyrelease

	arm->type(FL_TOGGLE_BUTTON);
	arm->callback(cb_arm, (void*)this);

#ifdef WITH_VST
	fx->callback(cb_openFxWindow, (void*)this);
#endif

	mute->type(FL_TOGGLE_BUTTON);
	mute->callback(cb_mute, (void*)this);

	solo->type(FL_TOGGLE_BUTTON);
	solo->callback(cb_solo, (void*)this);

	mainButton->callback(cb_openMenu, (void*)this);

	vol->callback(cb_changeVol, (void*)this);

	ch->guiChannel = this;
}
Exemplo n.º 28
0
text_editor::text_editor() : Fl_Double_Window(360, 480, "Whitelist")
{
	buffer = new Fl_Text_Buffer();

	editor = new Fl_Text_Editor(5, 5, 350, 440);
	editor->textfont(FL_COURIER);
	editor->buffer(buffer);
	resizable(editor);

	button_save = new Fl_Button(5, 445, 350, 30, "Save changes");
	button_save->callback(cb_save, this);

	icon((char *)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)));
	end();
}
Exemplo n.º 29
0
void
Controller_Module::maybe_create_panner ( void )
{
    if ( _type != SPATIALIZATION )
    {
        clear();

        Panner *o = new Panner( 0,0, 92,92 );

        o->box(FL_FLAT_BOX);
        o->color(FL_GRAY0);
        o->selection_color(FL_BACKGROUND_COLOR);
        o->labeltype(FL_NORMAL_LABEL);
        o->labelfont(0);
        o->labelcolor(FL_FOREGROUND_COLOR);
        o->align(FL_ALIGN_TOP);
        o->when(FL_WHEN_CHANGED);
        label( "Spatialization" );

        o->align(FL_ALIGN_TOP);
        o->labelsize( 10 );
//        o->callback( cb_panner_value_handle, new callback_data( this, azimuth_port_number, elevation_port_number ) );

       
        o->callback( cb_spatializer_handle, this );

        control = (Fl_Valuator*)o;

        if ( _pad )
        {
            Fl_Labelpad_Group *flg = new Fl_Labelpad_Group( o );
            flg->position( x(), y() );
            flg->set_visible_focus();
            size( flg->w(), flg->h() );
            add( flg );
        }
        else
        {
//            o->clear_visible_focus();
            o->resize( x(), y(), w(), h() );
            add( o );
            resizable( o );
            init_sizes();
        }

        _type = SPATIALIZATION;
    }
}
Exemplo n.º 30
0
gdMainWindow::gdMainWindow(int W, int H, const char *title, int argc, char **argv)
	: gWindow(W, H, title)
{
	Fl::visible_focus(0);
	Fl::background(25, 25, 25);
	Fl::set_boxtype(G_BOX, gDrawBox, 1, 1, 2, 2);    // custom box G_BOX

	size_range(GUI_WIDTH, GUI_HEIGHT);

	menu       = new gMenu(8, -1);
	inOut      = new gInOut(408, 8);
	controller = new gController(8, 39);
	timing     = new gTiming(632, 39);
	beatMeter  = new gBeatMeter(100, 83, 609, 20);
	keyboard   = new gKeyboard(8, 122, w()-16, 380);

	/* zone 1 - menus, and I/O tools */

	Fl_Group *zone1 = new Fl_Group(8, 8, W-16, 20);
	zone1->add(menu);
	zone1->resizable(new Fl_Box(300, 8, 80, 20));
	zone1->add(inOut);

	/* zone 2 - controller and timing tools */

	Fl_Group *zone2 = new Fl_Group(8, controller->y(), W-16, controller->h());
	zone2->add(controller);
	zone2->resizable(new Fl_Box(controller->x()+controller->w()+4, zone2->y(), 80, 20));
	zone2->add(timing);

	/* zone 3 - beat meter */

	Fl_Group *zone3 = new Fl_Group(8, beatMeter->y(), W-16, beatMeter->h());
	zone3->add(beatMeter);

	/* zone 4 - the keyboard (Fl_Group is unnecessary here, keyboard is
	 * a group by itself) */

	resizable(keyboard);

	add(zone1);
	add(zone2);
	add(zone3);
	add(keyboard);
	callback(cb_endprogram);
	gu_setFavicon(this);
	show(argc, argv);
}