コード例 #1
0
ファイル: MolBrowser.C プロジェクト: quolc/VMDLeap
MolBrowser::MolBrowser(VMDApp *vmdapp, MainFltkMenu *mm,
                       int x, int y, int xw, int yw)
: Fl_Multi_Browser(x, y, xw, yw), app(vmdapp) {
  mainmenu = mm;
  dragpending = 0;  
  align(FL_ALIGN_TOP_LEFT);
  column_widths(widths);
  color(VMDMENU_BROWSER_BG);
  selection_color(VMDMENU_BROWSER_SEL);

  VMDFLTKTOOLTIP(this, "Select molecule, toggle top/active/drawn/fixed, \nload/save coordinates or trajectory frames, \ndouble-click to rename molecule")

  new Fl_Box(x,   y-20,30,20,"ID");
  new Fl_Box(x+32,y-20,18,20,"T");
  new Fl_Box(x+50,y-20,18,20,"A");
  new Fl_Box(x+68,y-20,18,20,"D");
  new Fl_Box(x+86,y-20,18,20,"F");
  Fl_Box *b = new Fl_Box(x+102,y-20,220,20,"Molecule");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+262,y-20,80,20,"Atoms");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+342,y-20,60,20,"Frames");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+412,y-20,30,20,"Vol");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  end();
}
コード例 #2
0
ファイル: usplit.cpp プロジェクト: Asher256/ultrasplitter
    //constructeur
    Fl_Progress_Window()  : Fl_Window(238,105,"Progression...")
    {
        // Progress 1 Label
        Fl_Box *label = new Fl_Box(10,10,215,15,"Pourcentage Général:");
        label->labelsize(12);
        label->labelfont(1);
        label->labelcolor((Fl_Color)136);
        label->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

        //Progress1
        progress1 = new Fl_Progress(10,28,215,20,"0%");
        progress1->selection_color((Fl_Color)175);
        progress1->maximum(100);
        progress1->minimum(0);
        progress1->labelsize(12);

        // Progress filename (label progress 2)
        progress_filename = new Fl_Box(10,52,215,15, "Fichier:");
        progress_filename->labelsize(12);
        progress_filename->labelfont(1);
        progress_filename->labelcolor((Fl_Color)136);
        progress_filename->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

        // Progress 2
        progress2 = new Fl_Progress(10,70,215,20,"0%");
        progress2->maximum(100);
        progress2->minimum(0);
        progress2->labelsize(12);
        progress2->selection_color((Fl_Color)175);

        //fin du window...
        this->set_modal();
        this->end();
    }
コード例 #3
0
ファイル: SUBnoteUI.c プロジェクト: ishkabbible/ZASF
Fl_Group* SUBnoteharmonic::make_window() {
  { harmonic = new Fl_Group(0, 0, 90, 225);
    harmonic->box(FL_FLAT_BOX);
    harmonic->color(FL_BACKGROUND_COLOR);
    harmonic->selection_color(FL_BACKGROUND_COLOR);
    harmonic->labeltype(FL_NO_LABEL);
    harmonic->labelfont(0);
    harmonic->labelsize(14);
    harmonic->labelcolor(FL_FOREGROUND_COLOR);
    harmonic->user_data((void*)(this));
    harmonic->align(FL_ALIGN_TOP);
    harmonic->when(FL_WHEN_RELEASE);
    { Fl_Slider* o = mag = new Fl_Slider(0, 15, 10, 115);
      mag->tooltip("harmonic\'s magnitude");
      mag->type(4);
      mag->box(FL_FLAT_BOX);
      mag->selection_color((Fl_Color)222);
      mag->maximum(127);
      mag->step(1);
      mag->value(127);
      mag->callback((Fl_Callback*)cb_mag);
      o->value(127-pars->Phmag[n]);
      if (pars->Phmag[n]==0) o->selection_color(0);
    } // Fl_Slider* mag
    { Fl_Slider* o = bw = new Fl_Slider(0, 135, 10, 75);
      bw->tooltip("harmonic\'s bandwidth");
      bw->type(4);
      bw->box(FL_FLAT_BOX);
      bw->selection_color((Fl_Color)222);
      bw->maximum(127);
      bw->step(1);
      bw->value(64);
      bw->callback((Fl_Callback*)cb_bw);
      o->value(127-pars->Phrelbw[n]);
    } // Fl_Slider* bw
    { Fl_Box* o = new Fl_Box(10, 170, 5, 5);
      o->box(FL_FLAT_BOX);
      o->color(FL_DARK2);
      if (n+1==MAX_SUB_HARMONICS) o->hide();
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 210, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 0, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    harmonic->end();
  } // Fl_Group* harmonic
  return harmonic;
}
コード例 #4
0
ImageWindow::ImageWindow() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(930, 580, "Total Counts");
    w = o;
    o->user_data((void*)(this));
    { new Fl_Button(30, 190, 285, 30, "Save Image");
    } // Fl_Button* o
    { new Fl_Button(30, 240, 285, 30, "Reset Image");
    } // Fl_Button* o
    { new Fl_Light_Button(85, 492, 175, 40, "Analyze Pointing");
    } // Fl_Light_Button* o
    { new Fl_Value_Output(127, 384, 115, 25, "RA");
    } // Fl_Value_Output* o
    { new Fl_Value_Output(127, 419, 115, 25, "Dec");
    } // Fl_Value_Output* o
    { new Fl_Value_Output(127, 455, 115, 25, "Roll");
    } // Fl_Value_Output* o
    { Fl_Box* o = new Fl_Box(25, 359, 300, 214, "Current Pointing");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { Fl_Choice* o = new Fl_Choice(456, 535, 155, 25, "Image Scaling");
      o->down_box(FL_BORDER_BOX);
    } // Fl_Choice* o
    { new Fl_Value_Output(199, 55, 115, 25, "Total Counts");
    } // Fl_Value_Output* o
    { Fl_Value_Output* o = new Fl_Value_Output(199, 97, 115, 25, "Average Count Rate");
      o->align(Fl_Align(132));
    } // Fl_Value_Output* o
    { Fl_Value_Output* o = new Fl_Value_Output(199, 140, 115, 25, "Bright Pixel Count Rate");
      o->align(Fl_Align(132));
    } // Fl_Value_Output* o
    { Fl_Box* o = new Fl_Box(23, 37, 300, 258, "Image Statistics");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { new Fl_Progress(30, 540, 290, 30);
    } // Fl_Progress* o
    { Fl_Box* o = new Fl_Box(365, 40, 530, 475, "Detector Image");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { Fl_Choice* o = new Fl_Choice(760, 535, 155, 25, "Pixel Arrangement");
      o->down_box(FL_BORDER_BOX);
    } // Fl_Choice* o
	plot = new plotWindow (100,100,500,500);
    o->end();
    w->show();
  } // Fl_Double_Window* o
}
コード例 #5
0
CLuaImage::CLuaImage(const char *file) : CBaseLuaWidget(""), m_iImageW(0), m_iImageH(0)
{
    Fl_Shared_Image *img = Fl_Shared_Image::get(file);
    
    if (img)
    {
        if ((img->w() > MaxImageW()) || (img->h() > MaxImageH()))
        {
            int neww, newh;
            GetScaledImageSize(img->w(), img->h(), MaxImageW(), MaxImageH(), neww, newh);
            Fl_Image *temp = img->copy(neww, newh);
            img->release();
            img = (Fl_Shared_Image *)temp;
        }

        Fl_Box *imgbox = new Fl_Box(0, 0, img->w(), img->h());
        imgbox->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
        imgbox->image(img);
        GetGroup()->add(imgbox);
        
        m_iImageW = img->w();
        m_iImageH = img->h();
    }
    else
        GetGroup()->hide();
}
コード例 #6
0
ファイル: bookmarks.cpp プロジェクト: BertieJim/fifth
void editbookmark(bookmark * const ptr) {

	if (!bookedit_win) {
		bookedit_win = new Fl_Double_Window(350, 180, _("Edit bookmark"));
		{ bookedit_name = new Fl_Input(60, 20, 265, 25, _("Name:"));
		} // Fl_Input* bookedit_name
		{ bookedit_url = new Fl_Input(60, 55, 265, 25, _("URL:"));
		} // Fl_Input* bookedit_url
		{ Fl_Box* o = new Fl_Box(60, 80, 265, 50, _("The changes get applied immediately."));
			o->align(FL_ALIGN_WRAP);
		} // Fl_Box* o
		{ Fl_Button * o = new Fl_Button(60, 130, 115, 30, _("OK"));
			o->callback(bookedit_ok);
			bookedit_okbtn = o;
		} // Fl_Button* o
		{ Fl_Button* o = new Fl_Button(195, 130, 115, 30, _("Cancel"));
			o->callback(bookedit_cancel);
		} // Fl_Button* o
		bookedit_win->end();
	} // Fl_Double_Window* bookedit_win

	bookedit_name->value(ptr->name);
	bookedit_url->value(ptr->url);
	bookedit_url->activate();

	if (!ptr->url)
		bookedit_url->deactivate();

	bookedit_okbtn->user_data(ptr);

	bookedit_win->show();
}
コード例 #7
0
ファイル: FolderWindow.cpp プロジェクト: themize/RNAStructViz
FolderWindow::FolderWindow(int x, int y, int wid, int hgt, const char *label, int folderIndex): Fl_Group(x, y, wid, hgt, label)
{
    
    Fl_Button* diagramButton = new Fl_Button(x+20,y+10,90,30,"Diagram");
    diagramButton->callback(DiagramCallback);
    Fl_Button* statsButton = new Fl_Button(x+120,y+10,90,30,"Statistics");
    statsButton->callback(StatsCallback);
    
    Fl_Button* closeButton = new Fl_Button(x+wid-25,y+5,20,20,"");
    closeButton->callback(FolderWindow::CloseFolderCallback);
    closeButton->label("@1+");
    
    Fl_Box* fileLabel = new Fl_Box(x+20,y+40,120,30,"Files");
    fileLabel->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    
    folderScroll = new Fl_Scroll(x+10, y+70, 280, 310);
    folderScroll->type(Fl_Scroll::VERTICAL_ALWAYS);
    folderPack = new Fl_Pack(x+10, y+70, 260, 310);
    folderPack->type(Fl_Pack::VERTICAL);
    
    folderScroll->color(FL_WHITE);
    folderPack->color(FL_WHITE);
    
    this->resizable(folderScroll);
    this->color(FL_WHITE);
    this->selection_color(FL_WHITE);
    //size_range(300, 400, 300);
    
    //title = (char*)malloc(sizeof(char) * 64);
    SetStructures(folderIndex);
}
コード例 #8
0
ファイル: csv2html_gui.cpp プロジェクト: limingjie/csv2html
    window(int x, int y, int w, int h, const char *label = 0)
        : Fl_Window(x, y, w, h, label)
    {
        Fl_Box *o = new Fl_Box(10, 10, 300, 25,
            "Open CSV file to convert to HTML -->");
        o->box(FL_BORDER_BOX);
        o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER);
        o->color((Fl_Color)215);
        o->labelfont(FL_HELVETICA_BOLD);

        Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files");
        but->callback(on_pick_button_click, this);

        encode_check = new Fl_Check_Button(10, 40, 280, 25,
            "Escape special HTML characters.");
        encode_check->value(1);

        open_file_check = new Fl_Check_Button(10, 65, 280, 25,
            "Open HTML in browser.");
        open_file_check->value(1);

        Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li");
        author->box(FL_FLAT_BOX);
        author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
        author->labelsize(12);
        author->labelcolor(fl_rgb_color(128, 128, 128));
        author->callback(on_author_click, this);
    }
コード例 #9
0
ファイル: ede-launch.cpp プロジェクト: edeproject/svn
static int start_dialog(int argc, char** argv) {
	LaunchWindow* win = new LaunchWindow(370, 195, _("Run Command"));
	win->begin();
		Fl_Box* icon = new Fl_Box(10, 10, 55, 55);
		icon->image(image_run);

		Fl_Box* txt = new Fl_Box(70, 10, 290, 69, _("Enter the name of the application "
													"you would like to run or the URL you would like to view"));
		txt->align(132|FL_ALIGN_INSIDE);

		dialog_input = new Fl_Input(70, 90, 290, 25, _("Open:"));

		Resource rc;
		char     buf[128];

		if(rc.load("ede-launch-history") && rc.get("History", "open", buf, sizeof(buf))) {
			dialog_input->value(buf);

			/* make text appear selected */
			dialog_input->position(0, dialog_input->size());
		}

		in_term = new Fl_Check_Button(70, 125, 290, 25, _("Run in terminal"));
		in_term->down_box(FL_DOWN_BOX);

		Fl_Button* ok = new Fl_Button(175, 160, 90, 25, _("&OK"));
		ok->callback(ok_cb, win);
		Fl_Button* cancel = new Fl_Button(270, 160, 90, 25, _("&Cancel"));
		cancel->callback(cancel_cb, win);
	win->end();
	win->window_icon(run_xpm);
	win->show(argc, argv);

	return Fl::run();
}
コード例 #10
0
ファイル: about_panel.cpp プロジェクト: GustavoMOG/efltk
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;
}
コード例 #11
0
ファイル: symbols.cpp プロジェクト: edeproject/efltk
void bt(const char *name)
{
  int x = N%COLS;
  int y = N/COLS;
  N++;
  x = x*W+10;
  y = y*H+10;

  Fl_Box *a = new Fl_Box(x,y,W-20,H-20,name);
  a->user_data((void*)(name+1));
  a->align(FL_ALIGN_BOTTOM);
  a->label_size(11);

  Fl_Box *b = new Fl_Box(x,y,W-20,H-20,name);
  b->user_data((void*)(name+1));
  b->align(FL_ALIGN_CLIP);
  b->box(FL_THIN_UP_BOX);
  b->label_type(FL_SYMBOL_LABEL);
  b->label_color(FL_DARK3);
}
コード例 #12
0
ファイル: notify.cpp プロジェクト: GustavoMOG/ede
int main() {
	fl_open_display();

	Fl_Double_Window* win = new Fl_Double_Window(295, 144, "Notify test");
	win->begin();
		txt = new Fl_Input(10, 15, 275, 25);
		txt->align(FL_ALIGN_TOP_LEFT);

		color_button = new Fl_Button(260, 50, 25, 25, "Color");
		color_button->align(FL_ALIGN_LEFT);
		color_button->callback(color_cb);
		Fl_Box* bx = new Fl_Box(10, 50, 164, 85, "Type some text and choose color, then press Send. "
		"Desktop should get notified about this.");
		bx->align(FL_ALIGN_WRAP);

		Fl_Button* send_button = new Fl_Button(195, 110, 90, 25, "&Send");
		send_button->callback(send_cb);
	win->end();
	win->show();
	return Fl::run();
}
コード例 #13
0
ファイル: table.cpp プロジェクト: ClinicalGraphics/MathGL
//-----------------------------------------------------------------------------
void XYZDlg::create_dlg()
{
	wnd = new Fl_Double_Window(325, 125, mgl_gettext("Change data sizes"));
	box = new Fl_Box(10, 10, 305, 40);
	box->box(UDAV_THIN_UP_BOX);
	box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

	mx = new Fl_Spinner(30, 55, 75, 25, "mx");
	mx->tooltip(mgl_gettext("New size of data on 1st dimension (x-direction)"));
	my = new Fl_Spinner(135, 55, 75, 25, "my");
	my->tooltip(mgl_gettext("New size of data on 2nd dimension (y-direction)"));
	mz = new Fl_Spinner(240, 55, 75, 25, "mz");
	mz->tooltip(mgl_gettext("New size of data on 3d dimension (z-direction)"));
	ch = new Fl_Check_Button(15, 90, 95, 25);

	Fl_Button *o;
	o = new Fl_Button(125, 90, 85, 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(230, 90, 85, 25, mgl_gettext("Change"));o->callback(xyz_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Change (resize) data"));
	wnd->end();
}
コード例 #14
0
void ModelerUserInterface::pickGroupProperty(GroupProperty* group) {
	// Remove the event listeners for old controls
	// TODO: we really need to have a PropertyEditor class that handles this
	// automatically...
	if (currentGroup) {
		PropertyList* props = currentGroup->getProperties();
		for (PropertyList::iterator iter = props->begin();
			 iter != props->end();
			 iter++)
		{
			if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateRangeSlider);
			} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateColorChooser);
			} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateCheckbox);
			} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateChoice);
			}
		}

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

		currentGroup = NULL;
	}

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

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

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

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

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

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

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

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

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

			

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

			// Have the property update the choices when it changes
			prop->listen((SignalListener)updateChoice, (void*) pack);
		}
    }
	m_controlsScroll->redraw();
}
コード例 #15
0
ファイル: etip.cpp プロジェクト: GustavoMOG/ede12
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();
}
コード例 #16
0
highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
{
  getMeshInfoForHighOrder(GModel::current(), meshOrder, complete, CAD);
  FL_NORMAL_SIZE -= deltaFontSize;

  int width = 3 * IW + 4 * WB;
  int height = 24 * BH;

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

  int y = WB;
  int x = 2 * WB;

  box[0] = new Fl_Box(x, y, width - 4 * WB, BH);
  box[0]->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

  y += BH;

  butt[1] = new Fl_Check_Button
    (x, y, width - 4 * WB, BH, "Only apply high order tools to visible entities");
  butt[1]->type(FL_TOGGLE_BUTTON);
  butt[1]->value(1);

  y += BH;

  butt[3] = new Fl_Check_Button
    (x, y, width - 4 * WB, BH, "Show detailed log messages");
  butt[3]->type(FL_TOGGLE_BUTTON);
  butt[3]->value(1);

  {
    y += BH / 2;
    Fl_Box* b = new Fl_Box(x, y + BH - WB, width - 4 * WB, 2);
    b->box(FL_ENGRAVED_FRAME);
    b->labeltype(FL_NO_LABEL);
  }

  {
    y += BH;
    Fl_Box *b = new Fl_Box
      (x - WB, y, width, BH, "1. Generation of high order vertices");
    b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  }

  y += BH;

  value[0] = new Fl_Value_Input
    (x, y, IW, BH, "Polynomial order");
  value[0]->minimum(1);
  value[0]->maximum(10);
  value[0]->step(1);
  value[0]->align(FL_ALIGN_RIGHT);
  value[0]->value(meshOrder);

  y += BH;

  butt[0] = new Fl_Check_Button
    (x, y, width - 4 * WB, BH, "Use incomplete elements");
  butt[0]->type(FL_TOGGLE_BUTTON);
  butt[0]->value(!complete);
  butt[0]->callback(change_completeness_cb);

  y += BH;

  butt[2] = new Fl_Check_Button
    (x, y, width - 4 * WB, BH, "Use CAD model to curve mesh");
  butt[2]->type(FL_TOGGLE_BUTTON);
  butt[2]->value(1);

  y += BH;

  push[0] = new Fl_Button
    (width - BB - 2 * WB, y, BB, BH, "Generate");
  push[0]->callback(highordertools_runp_cb);

  {
    y += BH / 2;
    Fl_Box* b = new Fl_Box(x, y + BH - WB, width - 4 * WB, 2);
    b->box(FL_ENGRAVED_FRAME);
    b->labeltype(FL_NO_LABEL);
  }

  {
    y += BH;
    Fl_Box *b = new Fl_Box
      (x - WB, y, width, BH, "2. Regularization of high order elements");
    b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  }

  y += BH;
  static Fl_Menu_Item menu_method[] = {
    {"Optimization", 0, 0, 0},
    {"Elastic Analogy", 0, 0, 0},
    {"Fast Curving", 0, 0, 0},
    {0}
  };
  choice[2] = new Fl_Choice
    (x, y, IW, BH, "Algorithm");
  choice[2]->align(FL_ALIGN_RIGHT);
  choice[2]->menu(menu_method);
  choice[2]->callback(chooseopti_cb);

  y += BH;
  value[1] = new Fl_Value_Input
    (x, y, IW/2.0, BH);
  value[1]->minimum(0);
  value[1]->maximum(1);
  value[1]->step(.01);
  value[1]->align(FL_ALIGN_RIGHT);
  value[1]->value(CTX::instance()->mesh.hoThresholdMin);

  value[8] = new Fl_Value_Input
    (x+IW/2.0,y, IW/2.0, BH, "Target Jacobian range");
  value[8]->minimum(1);
  value[8]->maximum(10);
  value[8]->step(.01);
  value[8]->align(FL_ALIGN_RIGHT);
  value[8]->value(CTX::instance()->mesh.hoThresholdMax);

  y += BH;
  value[2] = new Fl_Value_Input
    (x, y, IW, BH, "Number of layers");
  value[2]->minimum(1);
  value[2]->maximum(20);
  value[2]->step(1);
  value[2]->align(FL_ALIGN_RIGHT);
  value[2]->value(CTX::instance()->mesh.hoNLayers);

  y += BH;
  value[7] = new Fl_Value_Input
    (x, y, IW, BH, "Distance factor");
  value[7]->minimum(1);
  value[7]->maximum(20000);
  value[7]->step(1);
  value[7]->align(FL_ALIGN_RIGHT);
  value[7]->value(12);

  y += BH;
  static Fl_Menu_Item menu_objf[] = {
    {"Fixed", 0, 0, 0},
    {"Free", 0, 0, 0},
    {0}
  };
  choice[0] = new Fl_Choice
    (x, y, IW, BH, "Boundary vertices");
  choice[0]->menu(menu_objf);
  choice[0]->align(FL_ALIGN_RIGHT);

  y += BH;
  value[5] = new Fl_Value_Input
    (x, y, IW/2, BH);
  value[5]->align(FL_ALIGN_RIGHT);
  value[5]->value(1000.);
  value[6] = new Fl_Value_Input
    (x+IW/2,y, IW/2, BH, "W fixed / W free");
  value[6]->align(FL_ALIGN_RIGHT);
  value[6]->value(1.);

  y += BH;
  value[3] = new Fl_Value_Input
    (x, y, IW, BH, "Maximum number of iterations");
  value[3]->minimum(1);
  value[3]->maximum(10000);
  value[3]->step(10);
  value[3]->align(FL_ALIGN_RIGHT);
  value[3]->value(300);

  y += BH;
  value[4] = new Fl_Value_Input
    (x, y, IW, BH, "Max. number of optimization passes");
  value[4]->minimum(1);
  value[4]->maximum(100);
  value[4]->step(1);
  value[4]->align(FL_ALIGN_RIGHT);
  value[4]->value(50);

  static Fl_Menu_Item menu_strategy[] = {
    {"Connected blobs", 0, 0, 0},
    {"Adaptive one-by-one", 0, 0, 0},
    {0}
  };

  y += BH;
  choice[3] = new Fl_Choice
    (x, y, IW, BH, "Strategy");
  choice[3]->menu(menu_strategy);
  choice[3]->align(FL_ALIGN_RIGHT);
  choice[3]->callback(chooseopti_strategy);

  y += BH;
  value[9] = new Fl_Value_Input
    (x, y, IW, BH, "Max. number of blob adaptation iter.");
  value[9]->minimum(1);
  value[9]->maximum(100);
  value[9]->step(1);
  value[9]->align(FL_ALIGN_RIGHT);
  value[9]->value(2);
  value[9]->deactivate();

  y += BH;
  value[10] = new Fl_Value_Input
    (x, y, IW, BH, "Num. layer adaptation factor");
  value[10]->align(FL_ALIGN_RIGHT);
  value[10]->minimum(1);
  value[10]->maximum(100);
  value[10]->step(1);
  value[10]->value(2);
  value[10]->deactivate();

  y += BH;
  value[11] = new Fl_Value_Input
    (x, y, IW, BH, "Distance adaptation factor");
  value[11]->align(FL_ALIGN_RIGHT);
  value[11]->minimum(1.);
  value[11]->maximum(100.);
  value[11]->value(2.);
  value[11]->deactivate();

  y += 1.5*BH;
  push[1] = new Fl_Button
    (width - BB - 2 * WB, y, BB, BH, "Regularize");
  push[1]->callback(highordertools_runopti_cb);

  // win->resizable(o);
  win->position(CTX::instance()->hotPosition[0], CTX::instance()->hotPosition[1]);
  win->end();
  FL_NORMAL_SIZE += deltaFontSize;
}
コード例 #17
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
}
コード例 #18
0
ファイル: Main.cpp プロジェクト: aib/glito
void edit_formula_cb( Fl_Widget* w, void* ) {
    const int heightInput = 28;
    const int heightText = 18;
    const int wideLabel = 50;
    const int wideInput = 450;
    const int Ybetween = 3;
    const int YbetweenMore = 6;
    const int alignStyle = FL_ALIGN_INSIDE | FL_ALIGN_RIGHT;
    const int textStyle = FL_ALIGN_INSIDE | FL_ALIGN_LEFT;
    const Fl_Boxtype inputStyle = FL_PLASTIC_DOWN_BOX;
    int x = 10;
    int y = 10;
    const int wide = x+wideLabel+wideInput+x;
    const int height = y + 3*heightText + Ybetween + 3*(heightInput+Ybetween)
	- Ybetween + YbetweenMore + y;
    Fl_Window* win = new Fl_Window( wide, height, _("Formulas editor") );
    Fl_Group* win2 = new Fl_Group( 0, 0, wide, height );
    win->resizable(win2);
    {
	Fl_Box* o =
	    new Fl_Box( x, y, wideLabel+wideInput, heightText,
			_("Enter the formulas of x(n+1) and y(n+1) using prefix notation.") );
	o->align( textStyle );
    }
    y += heightText;
    {
	Fl_Box* o =  new Fl_Box( x, y, wideLabel+wideInput, heightText,
				 _("Variables: x y x1 x2 y1 y2 xc yc rand, and any number.") );
	o->align( textStyle );
    }
    y += heightText;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel+wideInput, heightText, _("Functions: ") );
	o->align( textStyle );
    }
    {
	Fl_Box* o = new Fl_Box( x + (int)( fl_width(_("Functions: ")) ), y,
				wideLabel+wideInput, heightText,
				"+ - * / < pow abs atan2 sin cos tan atan ln sign square sqrt." );
	o->align( textStyle );
    }
    y += heightText + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, "x <- " );
	o->align( alignStyle );
    }
    {
	Fl_Input* o = new Fl_Input( x+wideLabel, y, wideInput, heightInput );
	o->box(inputStyle);
	o->value( Function::formulaPoint.getStringX().c_str() );
    }
    y += heightInput + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, "y <- " );
	o->align( alignStyle );
    }
    {
	Fl_Input* o = new Fl_Input( x+wideLabel, y, wideInput, heightInput );
	o->box(inputStyle);
	o->value( Function::formulaPoint.getStringY().c_str() );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Return_Button* o = new Fl_Return_Button( wide - x - 150, y, 150, heightInput,
						    _("Set formulas") );
	o->box(FL_PLASTIC_UP_BOX);
	o->callback( (Fl_Callback*)set_formula, glito );
    }
    win2->end();
    win->end();
    win->show();
}
コード例 #19
0
co_rc_t console_window_t::start()
{
	window = new console_main_window_t(this);
	window->callback(console_window_cb, this);

	Fl_Menu_Item console_menuitems[] = {
		{ "File", 0, 0, 0, FL_SUBMENU },
		{ "Quit", 0, (Fl_Callback *)console_quit_cb, this },
		{ 0 },

		{ "Monitor", 0, 0, 0, FL_SUBMENU },
		{ "Select", 0, (Fl_Callback *)console_select_cb, this, FL_MENU_DIVIDER },
		{ "Attach", 0, (Fl_Callback *)console_attach_cb, this, },
		{ "Detach", 0, (Fl_Callback *)console_detach_cb, this, FL_MENU_DIVIDER },
		{ "Pause", 0, (Fl_Callback *)console_pause_cb, this,  },
		{ "Resume", 0, (Fl_Callback *)console_resume_cb, this, },
		{ "Terminate", 0, (Fl_Callback *)console_terminate_cb, this, },
		{ "Send Ctrl-Alt-Del", 0, (Fl_Callback *)console_send_ctrl_alt_del_cb, this, },
		{ 0 },

		{ "Inspect", 0, 0, 0, FL_SUBMENU },
		{ 0 },

		{ "Help", 0, 0, 0, FL_SUBMENU },
		{ "About", 0, (Fl_Callback *)console_about_cb, this, },
		{ 0 },

		{ 0 }
	};

	unsigned int i;
	for (i=0; i < sizeof(console_menuitems)/sizeof(console_menuitems[0]); i++)
		console_menuitems[i].user_data((void *)this);

	int swidth = 640;
	int sheight = 480;

	menu = new Fl_Menu_Bar(0, 0, swidth, 30);
	menu->box(FL_UP_BOX);
	menu->align(FL_ALIGN_CENTER);
	menu->when(FL_WHEN_RELEASE_ALWAYS);
	menu->copy(console_menuitems, window);

	Fl_Group *tile = new Fl_Group(0, 30, swidth, sheight-30);
	widget = new console_widget_t(0, 30, swidth, sheight-120);
	text_widget = new Fl_Text_Display(0, sheight-120+30, swidth, 70);

	Fl_Group *tile2 = new Fl_Group(0, sheight-120+30, swidth, 90);
	text_widget->buffer(new Fl_Text_Buffer());
	text_widget->insert_position(0);

	Fl_Box *box = new Fl_Box(0, sheight-20, swidth, 20);
	box->label("");
	box->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); 
	tile2->end();

	tile->resizable(widget);
	tile->end();
	
	window->resizable(tile);
	window->end();
	window->show();

	menu_item_activate(console_select_cb);
	menu_item_deactivate(console_pause_cb);
	menu_item_deactivate(console_resume_cb);
	menu_item_deactivate(console_terminate_cb);
	menu_item_deactivate(console_detach_cb);
	menu_item_deactivate(console_attach_cb);

	log("Cooperative Linux console started\n");
	
	if (start_parameters.attach_id != CO_INVALID_ID)
		attached_id = start_parameters.attach_id;

	if (attached_id != CO_INVALID_ID)
		return attach();
	
	return CO_RC(OK);
}
コード例 #20
0
ファイル: gamepadWindow.cpp プロジェクト: kevinr2763/gmsh
gamepadWindow::gamepadWindow()
{
    if(!CTX::instance()->gamepad) return;

    frequency = CTX::instance()->gamepad->frequency;

    //  FL_NORMAL_SIZE -= deltaFontSize;

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

    win = new paletteWindow
    (width, height, CTX::instance()->nonModalWindows ? true : false);
    win->box(GMSH_WINDOW_BOX);
    win->label("Gamepad Configuration Tool (in work)");

    Fl_Box *bt = new Fl_Box(FL_NO_BOX, L , L-.3*BH , IW, BH, "Gamepad buttons:");
    bt->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);

    gamepad.butt[0] = new Fl_Check_Button(L          , L+BH , BH, WB, "0" );
    gamepad.butt[1] = new Fl_Check_Button(L +1*BB*.35 , L+BH , BH, WB, "1" );
    gamepad.butt[2] = new Fl_Check_Button(L +2*BB*.35 , L+BH , BH, WB, "2" );
    gamepad.butt[3] = new Fl_Check_Button(L +3*BB*.35 , L+BH , BH, WB, "3" );
    gamepad.butt[4] = new Fl_Check_Button(L +4*BB*.35 , L+BH , BH, WB, "4" );
    gamepad.butt[5] = new Fl_Check_Button(L +5*BB*.35 , L+BH , BH, WB, "5" );
    gamepad.butt[6] = new Fl_Check_Button(L +6*BB*.35 , L+BH , BH, WB, "6" );
    gamepad.butt[7] = new Fl_Check_Button(L +7*BB*.35 , L+BH , BH, WB, "7" );
    gamepad.butt[8] = new Fl_Check_Button(L +8*BB*.35 , L+BH , BH, WB, "8" );
    gamepad.butt[9] = new Fl_Check_Button(L +9*BB*.35 , L+BH , BH, WB, "9" );
    gamepad.butt[10] = new Fl_Check_Button(L +10*BB*.35 , L+BH , BH, WB, "10" );
    gamepad.butt[11] = new Fl_Check_Button(L +11*BB*.35 , L+BH , BH, WB, "11" );
    gamepad.butt[12] = new Fl_Check_Button(L +12*BB*.35 , L+BH , BH, WB, "12" );
    for (int i=0; i<13; i++)    gamepad.butt[i]->deactivate();

    Fl_Box *bta = new Fl_Box(FL_NO_BOX, L , L+1.7*BH , IW, BH, "Gamepad axes:");
    bta->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);

    gamepad.axe[0] = new Fl_Check_Button(L          , L+3.*BH , BH, WB, "0" );
    gamepad.axe[1] = new Fl_Check_Button(L +1*BB*.4 , L+3.*BH , BH, WB, "1" );
    gamepad.axe[2] = new Fl_Check_Button(L +2*BB*.4 , L+3.*BH , BH, WB, "2" );
    gamepad.axe[3] = new Fl_Check_Button(L +3*BB*.4 , L+3.*BH , BH, WB, "3" );
    gamepad.axe[4] = new Fl_Check_Button(L +4*BB*.4 , L+3.*BH , BH, WB, "4" );
    gamepad.axe[5] = new Fl_Check_Button(L +5*BB*.4 , L+3.*BH , BH, WB, "5" );
    gamepad.axe[6] = new Fl_Check_Button(L +6*BB*.4 , L+3.*BH , BH, WB, "6" );
    gamepad.axe[7] = new Fl_Check_Button(L +7*BB*.4 , L+3.*BH , BH, WB, "7" );
    gamepad.axe[8] = new Fl_Check_Button(L +8*BB*.4 , L+3.*BH , BH, WB, "8" );
    for (int i=0; i<9; i++)    gamepad.axe[i]->deactivate();

    Fl_Box *btt1 = new Fl_Box(FL_NO_BOX, L , L+3.7*BH , IW, BH, "Preferences:");
    btt1->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
    Fl_Box *btt2 = new Fl_Box(FL_NO_BOX, L , L+4.7*BH , IW, BH, "Action Axes:");
    btt2->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
    Fl_Box *btt3 = new Fl_Box(FL_NO_BOX, L +width/2+BH/2, L+4.7*BH , IW, BH, "Action buttons:");
    btt3->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);

    GamePad* pad = CTX::instance()->gamepad;

    gamepad.mapping[0] = new Fl_Value_Input( L+width/2+BH/2, L+5.7*BH , IW/5,BH, "1:1");
    gamepad.mapping[1] = new Fl_Value_Input( L+width/2+BH/2, L+6.7*BH , IW/5,BH, "permute axes");
    gamepad.mapping[2] = new Fl_Value_Input( L+width/2+BH/2, L+7.7*BH , IW/5,BH, "reset/invers up axis");
    gamepad.mapping[3] = new Fl_Value_Input( L+width/2+BH/2, L+8.7*BH , IW/5,BH, "change nav-mode");
    gamepad.mapping[4] = new Fl_Value_Input( L+width/2+BH/2, L+9.7*BH, IW/5,BH, "(*) move head");
    gamepad.mapping[5] = new Fl_Value_Input( L+width/2+BH/2, L+10.7*BH, IW/5,BH, " ");
    gamepad.mapping[6] = new Fl_Value_Input( L+width/2+BH/2, L+11.7*BH, IW/5,BH, "walk / swimm");
    gamepad.mapping[7] = new Fl_Value_Input( L+width/2+BH/2, L+12.7*BH, IW/5,BH, " ");
    gamepad.mapping[8] = new Fl_Value_Input( L+width/2+BH/2, L+13.7*BH, IW/5,BH, "1:1 ; reset speed");

    for (int i=0; i<9; i++) {
        gamepad.mapping[i]->align(FL_ALIGN_RIGHT);
        gamepad.mapping[i]->callback(gamepad_update_cb);
        gamepad.mapping[i]->value(pad->button_map[i]);
    }

    gamepad.mapping[10] = new Fl_Value_Input( L, L+5.7*BH , IW/5, BH, "head right/left with button (*)");
    gamepad.mapping[11] = new Fl_Value_Input( L, L+6.7*BH , IW/5, BH, "head up/down with button (*)");
    gamepad.mapping[12] = new Fl_Value_Input( L, L+7.7*BH , IW/5, BH, "turn left/right");
    gamepad.mapping[13] = new Fl_Value_Input( L, L+8.7*BH, IW/5, BH, "for/backward or up/down ");
    gamepad.mapping[14] = new Fl_Value_Input( L, L+9.7*BH, IW/5, BH, "move aside left/right");
    gamepad.mapping[15] = new Fl_Value_Input( L, L+10.7*BH, IW/5, BH, "move up/down");
    gamepad.mapping[16] = new Fl_Value_Input( L, L+11.7*BH , IW/5, BH, "speed up/slow down");

    for (int i=0; i<7; i++) {
        gamepad.mapping[10+i]->align(FL_ALIGN_RIGHT);
        gamepad.mapping[10+i]->callback(gamepad_update_cb);
        gamepad.mapping[10+i]->value(pad->axe_map[i]);
    }

    // add external reader for gamepad events
    if (CTX::instance()->gamepad && CTX::instance()->gamepad->active) {
        Fl::add_timeout(frequency, gamepadWindow_handler, (void*)this);
    }

    win->position(CTX::instance()->optPosition[0], CTX::instance()->optPosition[1]);
    win->end();
}
コード例 #21
0
ファイル: image_loader.cpp プロジェクト: GustavoMOG/efltk
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;
}
コード例 #22
0
ファイル: Splash.cpp プロジェクト: edeproject/svn
void Splash::run(void) {
	E_ASSERT(slist != NULL);

	if(!show_splash) {
		while(next_client_nosplash()) 
			;
		return;
	}

	fl_register_images();

	String path, splash_theme_path;

#ifdef USE_LOCAL_CONFIG
	splash_theme_path = "splash-themes/";
#else
	splash_theme_path = Resource::find_data("themes/splash-themes", RES_SYS_ONLY);
	if(splash_theme_path.empty()) {
		E_WARNING(E_STRLOC ": Unable to locate splash themes in $XDG_DATA_DIRS directories\n");
		return;
	}
#endif
	splash_theme_path += E_DIR_SEPARATOR;
	splash_theme_path += *splash_theme;

	if(!file_test(splash_theme_path.c_str(), FILE_TEST_IS_DIR)) {
		E_WARNING(E_STRLOC ": Unable to locate '%s' in '%s' theme directory\n", 
				splash_theme->c_str(), splash_theme_path.c_str());
		return;
	}

	/* setup widgets */
	begin();
		Fl_Box* bimg = new Fl_Box(0, 0, w(), h());
		Fl_Image* splash_img = 0;

		path = build_filename(splash_theme_path.c_str(), "background.png");
		splash_img = Fl_Shared_Image::get(path.c_str());

		if(splash_img) {
			int W = splash_img->w();
			int H = splash_img->h();
			/* update window and Box sizes */
			size(W, H);
			bimg->size(W, H);

			bimg->image(splash_img);
		}

		/*
		 * place message box at the bottom with
		 * nice offset (10 px) from window borders
		 */
		msgbox = new Fl_Box(10, h() - 25 - 10, w() - 20, 25);

		/*
		 * Setup icons positions, based on position of msgbox assuming someone 
		 * will not abuse splash to start hundrets of programs, since icons will 
		 * be placed only in horizontal order, one line, so in case their large
		 * number, some of them will go out of window borders.
		 *
		 * Icon box will be 64x64 so larger icons can fit too.
		 *
		 * This code will use Fl_Group (moving group, later, will move all icons
		 * saving me from code mess), but will not update it's w() for two reasons:
		 * icons does not use it, and will be drawn correctly, and second, setting
		 * width will initiate fltk layout engine which will mess everything up.
		 */
		Fl_Group* icon_group = new Fl_Group(10, msgbox->y() - 10 - 64, 0, 64);
		int X = icon_group->x();
		int Y = icon_group->y();

		/* offset between icons */
		int ioffset = 5;

		/* FIXME: use malloc/something instead this */
		icons = new Fl_Box*[slist->size()];

		icon_group->begin();
			int         i = 0;
			const char* imgpath;
			Fl_Image*   iconimg = 0;

			for(StartupItemListIter it = slist->begin(); it != slist->end(); ++it, ++i) {
				Fl_Box* bb = new Fl_Box(X, Y, 64, 64);

				path = build_filename(splash_theme_path.c_str(), (*it)->icon.c_str());
				imgpath = path.c_str();
				iconimg = Fl_Shared_Image::get(imgpath);

				if(!iconimg) {
					bb->label(_("No image"));
					bb->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP);
				} else 
					bb->image(iconimg);

				bb->hide();

				X += bb->w() + ioffset;
				icons[i] = bb;
			}
		icon_group->end();

		/* see X as width of all icons */
		int gx = w()/2 - X/2;
		/* gx can be negative */
		gx = (gx > 10) ? gx : 10;
		icon_group->position(gx, Y);
	end();

	clear_border();

	/*
	 * If set_override() is used, message boxes will be
	 * popped behind splash. Using it or not ???
	 */
	set_override();

	// make sure window is centered
	int sw = DisplayWidth(fl_display, fl_screen);
	int sh = DisplayHeight(fl_display, fl_screen);
	position(sw/2 - w()/2, sh/2 - h()/2);

	show();
	Fl::add_timeout(TIMEOUT_START, runner_cb, this);

	// to keep splash at the top
#ifndef EDEWM_HAVE_NET_SPLASH
	global_splash = this;
	XSelectInput(fl_display, RootWindow(fl_display, fl_screen), SubstructureNotifyMask);
	Fl::add_handler(splash_xmessage_handler);
#endif
	
	while(shown())
		Fl::wait();

#ifndef EDEWM_HAVE_NET_SPLASH
	Fl::remove_handler(splash_xmessage_handler);
#endif
}
コード例 #23
0
ファイル: mainwindow.cpp プロジェクト: rageworx/autoupgrader
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]");
        }

    }
}
コード例 #24
0
ファイル: Mixer.C プロジェクト: imv/non
Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :
    Fl_Group( X, Y, W, H, L )
{
    Loggable::dirty_callback( &Mixer::handle_dirty, this );

    _rows = 1;
    box( FL_FLAT_BOX );
    labelsize( 96 );
    { Fl_Group *o = new Fl_Group( X, Y, W, 24 );

        { Fl_Menu_Bar *o = menubar = new Fl_Menu_Bar( X, Y, W, 24 );
            o->add( "&Project/&New" );
            o->add( "&Project/&Open" );
            o->add( "&Project/&Save", FL_CTRL + 's', 0, 0 );
            o->add( "&Project/&Quit", FL_CTRL + 'q', 0, 0 );
            o->add( "&Mixer/&Add Strip", 'a', 0, 0 );
            o->add( "&Mixer/Add &N Strips" );
            o->add( "&Mixer/&Import Strip" );
            o->add( "&Mixer/&Rows/One", '1', 0, 0 );
            o->add( "&Mixer/&Rows/Two", '2', 0, 0 );
            o->add( "&Mixer/&Rows/Three", '3', 0, 0 );
            o->add( "&View/&Theme", 0, 0, 0 );
            o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO   );
            o->add( "_&Options/&Display/&Knobs/&Burnished", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
            o->add( "_&Options/&Display/&Sliders/&Nice", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE );
            o->add( "_&Options/&Display/&Sliders/&Fill", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Sliders/&Simple", 0, 0, 0, FL_MENU_RADIO );
            o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO );
            o->add( "&Help/&Manual" );
            o->add( "&Help/&About" );
            o->callback( cb_menu, this );
        }
        { Fl_Box *o = project_name = new Fl_Box( X + 150, Y, W, 24 );
            o->labelfont( FL_HELVETICA_ITALIC );
            o->label( 0 );
            o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
            o->labeltype( FL_SHADOW_LABEL );
            Fl_Group::current()->resizable( o );
        }
        { sm_blinker = new Fl_Button( ( X + W) - 37, Y + 4, 35, 15, "SM");
            sm_blinker->box(FL_ROUNDED_BOX);
            sm_blinker->down_box(FL_ROUNDED_BOX);
            sm_blinker->color(FL_DARK2);
            sm_blinker->selection_color((Fl_Color)93);
            sm_blinker->labeltype(FL_NORMAL_LABEL);
            sm_blinker->labelfont(3);
            sm_blinker->labelsize(14);
            sm_blinker->labelcolor(FL_DARK3);
            sm_blinker->align(Fl_Align(FL_ALIGN_CENTER));
            sm_blinker->when(FL_WHEN_RELEASE);
            sm_blinker->deactivate();

        } // Fl_Blink_Button* sm_blinker
        o->end();
    }
    { Fl_Scroll *o = scroll = new Fl_Scroll( X, Y + 24, W, H - 24 );
        o->box( FL_FLAT_BOX );
//        o->type( Fl_Scroll::HORIZONTAL_ALWAYS );
//        o->box( Fl_Scroll::BOTH );
        {
            Fl_Flowpack *o = mixer_strips = new Fl_Flowpack( X, Y + 24, W, H - 18 - 24 );
//            label( "Non-Mixer" );
            align( (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE) );
            o->box( FL_FLAT_BOX );
            o->type( Fl_Pack::HORIZONTAL );
            o->hspacing( 2 );
            o->vspacing( 2 );
            o->end();
            Fl_Group::current()->resizable( o );
        }
        o->end();
        Fl_Group::current()->resizable( o );
    }

    end();

//    Fl::add_timeout( STATUS_UPDATE_FREQ, update_cb, this );

    update_menu();

    load_options();
}
コード例 #25
0
void SynthModular::LoadPlugins (string pluginPath) {
     int Width  = 35;
     int Height = 35;
     int SWidth  = 256;
     int SHeight = 256;
     Fl_Pixmap pic (SSM_xpm);
     Fl_Double_Window* Splash = new Fl_Double_Window ((Fl::w()/2) - (SWidth/2), (Fl::h()/2) - (SHeight/2),
                                                       SWidth, SHeight, "SSM");
     Splash->border(0);
     Fl_Box* pbut = new Fl_Box (0, 8, SWidth, SHeight, "");
     pbut->box (FL_NO_BOX);
     pic.label (pbut);
     Fl_Box *splashtext = new Fl_Box (5, SHeight-20, 200, 20, "Loading...");
     splashtext->labelsize (10);
     splashtext->box (FL_NO_BOX);
     splashtext->align (FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
     Splash->add (pbut);
     Splash->add (splashtext);
     Splash->show();
     int ID=-1;
     vector<string> PluginVector;
     if (SpiralInfo::USEPLUGINLIST) PluginVector = SpiralInfo::PLUGINVEC;
     else {
        if (pluginPath.empty()) PluginVector = BuildPluginList (SpiralInfo::PLUGIN_PATH);
        else {
           string::iterator i = pluginPath.end() - 1;
           if (*i != '/') pluginPath += '/';
           PluginVector = BuildPluginList (pluginPath);
        }
     }
     for (vector<string>::iterator i=PluginVector.begin(); i!=PluginVector.end(); i++) {
         string Fullpath;
         if (pluginPath=="") Fullpath=SpiralInfo::PLUGIN_PATH+*i;
         else Fullpath = pluginPath + *"/" + *i;
         ID = PluginManager::Get()->LoadPlugin (Fullpath.c_str());
         if (ID!=PluginError) {
            #ifdef DEBUG_PLUGINS
            cerr << ID << " = Plugin [" << *i << "]" << endl;
            #endif
            Fl_ToolButton *NewButton = new Fl_ToolButton (0, 0, Width, Height, "");
            // we can't set user data, because the callback uses it
            // NewButton->user_data ((void*)(this));
            NewButton->labelsize (1);
            Fl_Pixmap *tPix = new Fl_Pixmap (PluginManager::Get()->GetPlugin(ID)->GetIcon());
            NewButton->image(tPix->copy(tPix->w(),tPix->h()));
            delete tPix;
            const char * gName = PluginManager::Get()->GetPlugin(ID)->GetGroupName();
            string GroupName(gName);
            Fl_Pack* the_group=NULL;
            // find or create this group, and add an icon
            map<string,Fl_Pack*>::iterator gi = m_PluginGroupMap.find (GroupName);
            if (gi == m_PluginGroupMap.end()) {
               the_group = new Fl_Pack (m_GroupTab->x(), 16, m_GroupTab->w(), m_GroupTab->h() - 15, gName);
               the_group->type(FL_HORIZONTAL);
               the_group->labelsize(8);
               the_group->color(SpiralInfo::GUICOL_Button);
               the_group->user_data((void*)(this));
               //m_GroupTab->add(the_group);
               m_GroupTab->value(the_group);
               m_PluginGroupMap[GroupName]=the_group;
            }
            else the_group = gi->second;
            NewButton->type (0);
            NewButton->box (FL_NO_BOX);
            NewButton->down_box (FL_NO_BOX);
            //NewButton->color(SpiralInfo::GUICOL_Button);
            //NewButton->selection_color(SpiralInfo::GUICOL_Button);
            the_group->add (NewButton);

            // we need to keep tooltips stored outside their widgets - widgets just have a pointer
            // I haven't done anything about cleaning up these strings - which may cause memory leaks?
            // But m_DeviceVec - which, I assume, would be used to keep track of / clean up the dynamicly
            //     created NewButton widgets isn't cleaned up either, so we might have 2 memory leaks
            //     involved? - but then again, they might be automatically deallocated because they're
            //     in another widget, in which case there's just one memory leak to deal with. (andy)
            string* PluginName = new string (*i);
            // find the first slash, if there is one, and get rid of everything before and including it
            unsigned int p = PluginName->find ('/');
            if (p < PluginName->length()) PluginName->erase (0, p);
            // find last . and get rid of everything after and including it
            p = PluginName->rfind ('.');
            unsigned int l = PluginName->length ();
            if (p < l) PluginName->erase (p, l);
            NewButton->tooltip (PluginName->c_str());
            // Slashes have significance to the menu widgets, remove them from the GroupName
            while ((p = GroupName.find ('/')) < PluginName->length())
                  GroupName = GroupName.replace (p, 1, " and ");
            string MenuEntry = "Plugins/" + GroupName + "/" + *PluginName;
            m_MainMenu->add (MenuEntry.c_str(), 0, cb_NewDeviceFromMenu, &Numbers[ID], 0);
            // when help is working better - this will put the plugins into the help menu
            // MenuEntry = "Help/" + MenuEntry;
            // m_MainMenu->add (MenuEntry.c_str(), 0, NULL, &Numbers[ID], 0);

            // Add the plugins to the canvas menu
            m_Canvas->AddPluginName (MenuEntry, PluginManager::Get()->GetPlugin(ID)->ID);
            // this overwrites the widget's user_data with that specified for the callback
            // so we can't use it for other purposes
            NewButton->callback ((Fl_Callback*)cb_NewDevice, &Numbers[ID]);
            NewButton->show();
            // Nothing else ever touches m_DeviceVec - is this right??? (andy)
            m_DeviceVec.push_back (NewButton);
            the_group->redraw();
            // m_NextPluginButton++;
            Fl::check();
            splashtext->label (PluginName->c_str());
            Splash->redraw();
         }
     }
     map<string,Fl_Pack*>::iterator PlugGrp;
     for (PlugGrp = m_PluginGroupMap.begin(); PlugGrp!= m_PluginGroupMap.end(); ++PlugGrp) {
         m_GroupTab->add (PlugGrp->second);
         PlugGrp->second->add (new Fl_Box (0, 0, 600, 100, ""));
     }
     // try to show the SpiralSound group
     PlugGrp = m_PluginGroupMap.find("SpiralSound");
     // can't find it - show the first plugin group
     if (PlugGrp==m_PluginGroupMap.end()) PlugGrp=m_PluginGroupMap.begin();
     m_GroupTab->value(PlugGrp->second);
     bool found_dummy;
     int i;
     do {
        found_dummy = false;
        for (i=0; i<m_MainMenu->size(); i++) {
            if (m_MainMenu->text (i) != NULL) {
               found_dummy = (strcmp ("dummy", m_MainMenu->text (i)) == 0);
               if (found_dummy) break;
            }
        }
        if (found_dummy) m_MainMenu->remove (i);
     } while (found_dummy);
     Splash->hide();
     delete Splash;
}
コード例 #26
0
co_rc_t console_window_t::start()
{
	window = new console_main_window_t(this);
	window->callback(console_window_cb, this);

	Fl_Menu_Item console_menuitems[] = {
		{ "File", 0, 0, 0, FL_SUBMENU },
		{ "Quit", 0, (Fl_Callback *)console_quit_cb, this },
		{ 0 },

		{ "Monitor", 0, 0, 0, FL_SUBMENU },
		{ "Select", 0, (Fl_Callback *)console_select_cb, this, FL_MENU_DIVIDER },
		{ "Attach", 0, (Fl_Callback *)console_attach_cb, this, },
		{ "Detach", 0, (Fl_Callback *)console_detach_cb, this, FL_MENU_DIVIDER },
		{ "Pause", 0, (Fl_Callback *)console_pause_cb, this,  },
		{ "Resume", 0, (Fl_Callback *)console_resume_cb, this, },
		{ "Terminate", 0, (Fl_Callback *)console_terminate_cb, this, },
		{ "Send Ctrl-Alt-Del", 0, (Fl_Callback *)console_send_ctrl_alt_del_cb, this, },
		{ 0 },

		{ "Inspect", 0, 0, 0, FL_SUBMENU },
		{ 0 },

		{ "Help", 0, 0, 0, FL_SUBMENU },
		{ "About", 0, (Fl_Callback *)console_about_cb, this, },
		{ 0 },

		{ 0 }
	};

	unsigned int i;
	for (i=0; i < sizeof(console_menuitems)/sizeof(console_menuitems[0]); i++)
		console_menuitems[i].user_data((void *)this);

	int swidth = 640;
	int sheight = 480;

	menu = new Fl_Menu_Bar(0, 0, swidth, 30);
	menu->box(FL_UP_BOX);
	menu->align(FL_ALIGN_CENTER);
	menu->when(FL_WHEN_RELEASE_ALWAYS);
	menu->copy(console_menuitems, window);

	Fl_Group *tile = new Fl_Group(0, 30, swidth, sheight-30);
	widget = new console_widget_t(0, 30, swidth, sheight-120);
	text_widget = new Fl_Text_Display(0, sheight-120+30, swidth, 70);

	Fl_Group *tile2 = new Fl_Group(0, sheight-120+30, swidth, 90);
	text_widget->buffer(new Fl_Text_Buffer());
	text_widget->insert_position(0);

	Fl_Box *box = new Fl_Box(0, sheight-20, swidth, 20);
	box->label("");
	box->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); 
	tile2->end();

	tile->resizable(widget);
	tile->end();

	window->resizable(tile);
	window->end();
	window->show();

	menu_item_activate(console_select_cb);
	menu_item_deactivate(console_pause_cb);
	menu_item_deactivate(console_resume_cb);
	menu_item_deactivate(console_terminate_cb);
	menu_item_deactivate(console_detach_cb);
	menu_item_deactivate(console_attach_cb);

	// Default Font is "Terminal" with size 18
	// Sample WinNT environment: set COLINUX_CONSOLE_FONT=Lucida Console:12
	// Change only font size:    set COLINUX_CONSOLE_FONT=:12
	char * env_font = getenv ("COLINUX_CONSOLE_FONT");
	if (env_font) {
		char *p = strchr (env_font, ':');

		if (p) {
			int size = atoi (p+1);
			if (size >= 4 && size <= 24) {
				// Set size
				widget->set_font_size(size);
			}
			*p = 0; // End for Fontname
		}
		
		// Set new font style
		if (strlen (env_font)) {
			// Remember: set_font need a non stack buffer!
			// Environment is global static.
			Fl::set_font(FL_SCREEN, env_font);

			// Now check font width
			fl_font(FL_SCREEN, 18); // Use default High for test here
			if ((int)fl_width('i') != (int)fl_width('W')) {
				Fl::set_font(FL_SCREEN, "Terminal"); // Restore standard font
				log("%s: is not fixed font. Using 'Terminal'\n", env_font);
			}
		}
	}

	log("Cooperative Linux console started\n");
	
	if (start_parameters.attach_id != CO_INVALID_ID)
		attached_id = start_parameters.attach_id;

	if (attached_id == CO_INVALID_ID)
		attached_id = find_first_monitor();

	if (attached_id != CO_INVALID_ID)
		attach(); /* Ignore errors, as we can attach latter */

	return CO_RC(OK);
}
コード例 #27
0
MainWindow *
makeMainWindow (const char imageFile[],
                const char channel[],
                bool preview,
                int lx,
                int ly,
                bool noDisplayWindow,
                bool noAspect,
                bool zeroOneExposure,
                bool normalize,
                bool swap,
                bool bloom,
                bool continuousUpdate,
                bool useFragmentShader,
                const char * fragmentShaderName)
{
    MainWindow *mainWindow = new MainWindow;

    //
    // Read the image file.
    //

    Box2i displayWindow;
    Box2i dataWindow;
    float pixelAspect;

    if (preview)
    {
        loadPreviewImage (imageFile,
                          displayWindow,
                          dataWindow,
                          pixelAspect,
                          mainWindow->pixels);
    }
    else if (lx >= 0 || ly >= 0)
    {
        if (channel)
        {
            loadTiledImageChannel (imageFile,
                                   channel,
                                   lx, ly,
                                   displayWindow,
                                   dataWindow,
                                   pixelAspect,
                                   mainWindow->pixels);
        }
        else
        {
            loadTiledImage (imageFile,
                            lx, ly,
                            displayWindow,
                            dataWindow,
                            pixelAspect,
                            mainWindow->pixels);
        }
    }
    else
    {
        if (channel)
        {
            loadImageChannel (imageFile,
                              channel,
                              displayWindow,
                              dataWindow,
                              pixelAspect,
                              mainWindow->pixels);
        }
        else
        {
            loadImage (imageFile,
                       displayWindow,
                       dataWindow,
                       pixelAspect,
                       mainWindow->pixels);
        }
    }

    int w  = displayWindow.max.x - displayWindow.min.x + 1;
    int h  = displayWindow.max.y - displayWindow.min.y + 1;
    int dw = dataWindow.max.x - dataWindow.min.x + 1;
    int dh = dataWindow.max.y - dataWindow.min.y + 1;
    int dx = dataWindow.min.x - displayWindow.min.x;
    int dy = dataWindow.min.y - displayWindow.min.y;

    if (noDisplayWindow)
    {
        w = dw;
        h = dh;
        dx = 0;
        dy = 0;
    }

    if (noAspect)
    {
        pixelAspect = 1;
    }

    //
    // Normalize the pixel data if necessary.
    //

    if (normalize)
        normalizePixels (dw, dh, mainWindow->pixels);

    //
    // If necessary, swap the top and bottom half and then the
    // left and right half of the image.
    //

    if (swap)
        swapPixels (dw, dh, mainWindow->pixels);

    //
    // Stretch the image horizontally or vertically to make the
    // pixels square (assuming that we are going to display the
    // image on a screen with square pixels).
    //

    if (pixelAspect > 1)
        scaleX (pixelAspect, w, h, dw, dh, dx, dy, mainWindow->pixels);
    else
        scaleY (1 / pixelAspect, w, h, dw, dh, dx, dy, mainWindow->pixels);

    //
    // If necessary, simulate blooming.
    //

    if (bloom)
        addBlooming (dw, dh, mainWindow->pixels);

    //
    // Build main window
    //

    int mw = max (200, w);

    Fl::set_color (FL_GRAY, 150, 150, 150);

    mainWindow->window =
        new Fl_Window (mw + 10, h + 135, imageFile);

    //
    // Add exposure slider
    //

    mainWindow->exposureLabel =
        new Fl_Box (5, 5, 60, 20, "exposure");

    mainWindow->exposureSlider =
        new Fl_Value_Slider (70, 5, mw - 65, 20, "");

    enum Fl_When when = (useFragmentShader || continuousUpdate)?
                        FL_WHEN_CHANGED : FL_WHEN_RELEASE;

    mainWindow->exposureSlider->type (FL_HORIZONTAL);
    mainWindow->exposureSlider->range (-10.0, +10.0);
    mainWindow->exposureSlider->step (1, 8);
    mainWindow->exposureSlider->value (zeroOneExposure? 1.02607: 0.0);
    mainWindow->exposureSlider->when (when);

    mainWindow->exposureSlider->callback
    (MainWindow::exposureSliderCallback, mainWindow);

    //
    // Add defog slider
    //

    mainWindow->defogLabel =
        new Fl_Box (5, 30, 60, 20, "defog");

    mainWindow->defogSlider =
        new Fl_Value_Slider (70, 30, mw - 65, 20, "");

    mainWindow->defogSlider->type (FL_HORIZONTAL);
    mainWindow->defogSlider->range (0.0, 0.01);
    mainWindow->defogSlider->step (1, 10000);
    mainWindow->defogSlider->value (0.0);
    mainWindow->defogSlider->when (when);

    mainWindow->defogSlider->callback
    (MainWindow::defogSliderCallback, mainWindow);

    //
    // Add kneeLow slider
    //

    mainWindow->kneeLowLabel =
        new Fl_Box (5, 55, 60, 20, "knee low");

    mainWindow->kneeLowSlider =
        new Fl_Value_Slider (70, 55, mw - 65, 20, "");

    mainWindow->kneeLowSlider->type (FL_HORIZONTAL);
    mainWindow->kneeLowSlider->range (-3.0, 3.0);
    mainWindow->kneeLowSlider->step (1, 8);
    mainWindow->kneeLowSlider->value (0.0);
    mainWindow->kneeLowSlider->when (when);

    mainWindow->kneeLowSlider->callback
    (MainWindow::kneeLowSliderCallback, mainWindow);

    //
    // Add kneeHigh slider
    //

    mainWindow->kneeHighLabel =
        new Fl_Box (5, 80, 60, 20, "knee high");

    mainWindow->kneeHighSlider =
        new Fl_Value_Slider (70, 80, mw - 65, 20, "");

    mainWindow->kneeHighSlider->type (FL_HORIZONTAL);
    mainWindow->kneeHighSlider->range (3.5, 7.5);
    mainWindow->kneeHighSlider->step (1, 8);
    mainWindow->kneeHighSlider->value ((preview | zeroOneExposure)? 3.5: 5.0);
    mainWindow->kneeHighSlider->when (when);

    mainWindow->kneeHighSlider->callback
    (MainWindow::kneeHighSliderCallback, mainWindow);

    //
    // Add RGB value display
    //

    Fl_Box *rgbaBox = new Fl_Box (80, 105, mw - 65, 20, "");
    rgbaBox->align (FL_ALIGN_LEFT | FL_ALIGN_INSIDE);

    //
    // Add image view:
    //
    // w, h		width and height of the display window
    //
    // dw, dh		width and height of the data window
    //
    // dx, dy		offset of the data window's upper left
    // 			corner from the display window's upper
    // 			left corner
    //

#ifdef HAVE_FRAGMENT_SHADERS
    if (useFragmentShader)
    {
        mainWindow->image =
            new ImageViewFragShader (5 + (mw - w) / 2, 130,
                                     w, h,
                                     "",
                                     mainWindow->pixels,
                                     dw, dh,
                                     dx, dy,
                                     rgbaBox,
                                     mainWindow->exposureSlider->value(),
                                     mainWindow->defogSlider->value(),
                                     mainWindow->kneeLowSlider->value(),
                                     mainWindow->kneeHighSlider->value(),
                                     fragmentShaderName);
    }
    else
    {
        mainWindow->image =
            new ImageView (5 + (mw - w) / 2, 130,
                           w, h,
                           "",
                           mainWindow->pixels,
                           dw, dh,
                           dx, dy,
                           rgbaBox,
                           mainWindow->exposureSlider->value(),
                           mainWindow->defogSlider->value(),
                           mainWindow->kneeLowSlider->value(),
                           mainWindow->kneeHighSlider->value());
    }
#else
    mainWindow->image =
        new ImageView (5 + (mw - w) / 2, 130,
                       w, h,
                       "",
                       mainWindow->pixels,
                       dw, dh,
                       dx, dy,
                       rgbaBox,
                       mainWindow->exposureSlider->value(),
                       mainWindow->defogSlider->value(),
                       mainWindow->kneeLowSlider->value(),
                       mainWindow->kneeHighSlider->value());
#endif

    mainWindow->image->box (FL_ENGRAVED_BOX);

    mainWindow->window->end();

    return mainWindow;
}
コード例 #28
0
ファイル: Track.C プロジェクト: shanipribadi/non
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();
}
コード例 #29
0
ファイル: Main.cpp プロジェクト: aib/glito
void initParamWindow() {
    const int heightInput = 28;
    const int wideLabel = 205;
    const int wideInput = 130;
    const int between = 5;
    const int Ybetween = 3;
    const int YbetweenMore = 6;
    const int alignStyle = FL_ALIGN_INSIDE | FL_ALIGN_RIGHT;
    const Fl_Boxtype inputStyle = FL_PLASTIC_DOWN_BOX;
    int x = 10;
    int y = 10;
    const int wide = x+wideLabel+between+wideInput+x;
    const int height =  y + 14*(heightInput+Ybetween) - Ybetween + 9*YbetweenMore + y;
    paramWindow = new Fl_Window( wide, height, _("Parameters") );
    Fl_Group* win2 = new Fl_Group( 0, 0, wide, height );
    paramWindow->resizable(win2);
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Schema size:") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0);
	o->maximum(1);
	o->value(glito->getCloseEdge());
	o->step(0.01);
	o->callback( (Fl_Callback*)closeEdge_param, glito );
    }
    y += heightInput + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Preview Size:") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0);
	o->maximum(1);
	o->value(glito->getPreviewSize());
	o->step(0.01);
	o->callback( (Fl_Callback*)previewSize_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Rotation shift (rad):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(0.002);
	o->maximum(0.2);
	o->value(glito->rotationShift);
	o->step(0.001);
	o->callback( (Fl_Callback*)rotationShift_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of saved images:") );
	o->align( alignStyle );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->imageSavedWidth).c_str());
	o->callback( (Fl_Callback*)imageSavedWidth_param, glito );
    }
    {
	Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y,
					    wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->imageSavedHeight).c_str());
	o->callback( (Fl_Callback*)imageSavedHeight_param, glito );
    }
    y += heightInput + Ybetween;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Size of animations:") );
	o->align( alignStyle );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between, y, wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->animationSavedWidth).c_str());
	o->callback( (Fl_Callback*)animationSavedWidth_param, glito );
    }
    {
	Fl_Box* o = new Fl_Box( x+wideLabel+between+wideInput/2-5, y, 10, heightInput, "x" );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
    }
    {
	Fl_Int_Input* o = new Fl_Int_Input( x+wideLabel+between+wideInput/2+5, y,
					    wideInput/2-5, heightInput );
	o->box(inputStyle);
	o->value(IS::translate(glito->animationSavedHeight).c_str());
	o->callback( (Fl_Callback*)animationSavedHeight_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Frames per cycle (>1):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Input* o = new Fl_Value_Input( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->minimum(10);
	o->maximum(100);
	o->value(glito->framesPerCycle);
	o->step(1);
	o->callback( (Fl_Callback*)framesPerCycle_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, _("Motion detection (ms):") );
	o->align( alignStyle );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	o->type(FL_HORIZONTAL);
	o->minimum(1);
	o->maximum(200);
	o->value(glito->intervalMotionDetection);
	o->step(1);
	o->callback( (Fl_Callback*)intervalMotionDetection_param, glito );
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	{
	    Fl_Button* o = new Fl_Button( x, y, 70, heightInput, _("Density") );
	    o->box(FL_PLASTIC_UP_BOX);
	    o->value( glito->trueDensity );
	    o->callback( (Fl_Callback*)trueDensity_param, glito );
	}
	{
	    Fl_Box* o = new Fl_Box( x, y, wideLabel+30, heightInput, _("or pseudo-density:") );
	    o->align( alignStyle );
	    if ( glito->trueDensity ) o->deactivate();
	}
	{
	    Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+30+between, y,
						      100, heightInput );
	    o->box(inputStyle);
	    if ( glito->trueDensity ) o->deactivate();
	    o->type(FL_HORIZONTAL);
	    o->minimum(0);
	    o->maximum(1);
	    o->value( ImagePseudoDensity::pseudoDensity.getProba() );
	    o->step(0.01);
	    o->callback( (Fl_Callback*)logProbaHitMax_param );
	}
    }
    y += heightInput + Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wideInput, heightInput, _("Points for framing:") );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
    }
    y += heightInput;
    {
	int xLine = 0;
	{
	    Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput );
	    o->box(inputStyle);
	    o->value(IS::translate(glito->pointsForFraming).c_str());
	    o->callback( (Fl_Callback*)pointsForFraming_param, glito );
	}
	xLine += 80;
	{
	    Fl_Box* o = new Fl_Box( x+xLine, y, 20, heightInput, " (x " );
	    o->align( FL_ALIGN_INSIDE | FL_ALIGN_CENTER );
	}
	xLine += 20;
	{
	    Fl_Value_Slider* o = new Fl_Value_Slider( x+xLine, y, 100, heightInput );
	    o->box(inputStyle);
	    o->type(FL_HORIZONTAL);
	    o->minimum(0);
	    o->maximum(1);
	    o->box(inputStyle);
	    o->value(glito->animationFraming);
	    o->step(0.01);
	    o->callback( (Fl_Callback*)animationFraming_param, glito );
	}
	xLine += 100;
	{
	    Fl_Box* o = new Fl_Box( x+xLine, y, 110, heightInput, _(" for animation)") );
	    o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
	}
    }
    y += heightInput + 2*Ybetween + YbetweenMore;
    {
	Fl_Box* o = new Fl_Box( x, y, wide-20, heightInput,
				_("Number of iterations limited by:") );
	o->align( FL_ALIGN_INSIDE | FL_ALIGN_LEFT );
    }
    y += heightInput;
    {
	Fl_Round_Button* o = new Fl_Round_Button( x, y, wideInput, heightInput,
						  _("Interval per frame (ms)") );
	o->box(FL_NO_BOX);
	o->type(FL_RADIO_BUTTON);
	o->when(FL_WHEN_CHANGED);
	o->value(glito->clockNumber);
	o->callback( (Fl_Callback*)clockNumber_param, glito );
    }
    {
	Fl_Value_Slider* o = new Fl_Value_Slider( x+wideLabel+between, y, wideInput, heightInput );
	o->box(inputStyle);
	if ( !glito->clockNumber ) o->deactivate();
	o->type(FL_HORIZONTAL);
	o->minimum(1);
	o->maximum(200);
	o->value(glito->intervalFrame);
	o->step(1);
	o->callback( (Fl_Callback*)intervalFrame_param, glito );
    }
    y += heightInput + Ybetween;
    {
	int xLine = 0;
	{
	    Fl_Round_Button* o = new Fl_Round_Button( x, y, 127, heightInput,
						      _("Points per frame") );
	    o->box(FL_NO_BOX);
	    o->type(FL_RADIO_BUTTON);
	    o->when(FL_WHEN_CHANGED);
	    o->value(!glito->clockNumber);
	    o->callback( (Fl_Callback*)clockNumber_param, glito );
	}
	xLine += 127 + between;
	{
	    Fl_Int_Input* o = new Fl_Int_Input( x+xLine, y, 80, heightInput );
	    o->box(inputStyle);
	    if ( glito->clockNumber ) o->deactivate();
	    o->value(IS::translate(glito->pointsPerFrame).c_str());
	    o->callback( (Fl_Callback*)pointsPerFrame_param, glito );
	}
	xLine += 80 + 2;
	{
	    Fl_Button* o = new Fl_Button( x+xLine, y, wide - (x+xLine) - 10,
					  heightInput, _("Calibrate") );
	    o->box(FL_PLASTIC_UP_BOX);
	    if ( glito->clockNumber ) o->deactivate();
	    o->callback( (Fl_Callback*)calibrate_param, glito );
	}
    }
    y += heightInput + Ybetween + 2*YbetweenMore;
    {
	int xLine = 0;
	{
	    Fl_Button* o = new Fl_Button( x, y, 90, heightInput, _("Black/White") );
	    o->box(FL_PLASTIC_UP_BOX);
	    o->value( !ImageGray::background.isBlack() );
	    o->callback( (Fl_Callback*)blackWhite_param );
	}
	xLine += 90 + 2*between + 5;
	{
	    Fl_Choice* o = new Fl_Choice( x+xLine+110, y, 95, heightInput,
					  _("Transparency:") );
	    o->add( ImageGray::transparency.stringNone().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)0 );
	    o->add( ImageGray::transparency.stringSimple().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)1 );
	    o->add( ImageGray::transparency.stringAlpha().c_str(),
		    0, (Fl_Callback*)transparency_param, (void*)2 );
	    if ( ImageGray::transparency.useAlphaTransparency() ) {
		o->value(2);
	    } else if ( ImageGray::transparency.useSimpleTransparency() ) {
		o->value(1);
	    } else {
		o->value(0);
	    }
	}
    }
    y += heightInput + Ybetween;
    {
	// invisible box to allow correct resizing
	Fl_Box* o = new Fl_Box( 0, y, 100, 0 );
	win2->resizable(*o);
    }
    win2->end();
    paramWindow->end();
}
コード例 #30
0
MatrixPluginGUI::MatrixPluginGUI(int w, int h,MatrixPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
SpiralPluginGUI(w,h,o,ch),
m_LastLight(0),
m_LastPatSeqLight(0)
{
	//size_range(10,10);
	m_Pattern = new Fl_Counter (5, 20, 40, 20, "View");
        m_Pattern->labelsize (10);
	m_Pattern->type (FL_SIMPLE_COUNTER);
        m_Pattern->box (FL_PLASTIC_UP_BOX);
        m_Pattern->color (Info->GUI_COLOUR);
        m_Pattern->step (1);
        m_Pattern->minimum (0);
        m_Pattern->maximum (NUM_PATTERNS-1);
	m_Pattern->value (0);
	m_Pattern->callback ((Fl_Callback*)cb_Pattern);
	add (m_Pattern);

	m_PlayPattern = new Fl_Counter (50, 20, 40, 20, "Play");
        m_PlayPattern->labelsize (10);
	m_PlayPattern->type (FL_SIMPLE_COUNTER);
        m_PlayPattern->box (FL_PLASTIC_UP_BOX);
        m_PlayPattern->color (Info->GUI_COLOUR);
	m_PlayPattern->step (1);
        m_PlayPattern->minimum (0);
        m_PlayPattern->maximum (NUM_PATTERNS-1);
	m_PlayPattern->value (0);
	m_PlayPattern->callback ((Fl_Callback*)cb_PlayPattern);
	add (m_PlayPattern);

        m_Length = new Fl_Counter (5, 55, 40, 20, "Length");
        m_Length->labelsize (10);
	m_Length->type (FL_SIMPLE_COUNTER);
        m_Length->box (FL_PLASTIC_UP_BOX);
        m_Length->color (Info->GUI_COLOUR);
	m_Length->step (1);
	m_Length->value (64);
	m_Length->minimum (1);
	m_Length->maximum (64);
	m_Length->callback ((Fl_Callback*)cb_Length);
	add (m_Length);

	m_Octave = new Fl_Counter(5, 90, 40, 20, "Octave");
        m_Octave->labelsize(10);
	m_Octave->type (FL_SIMPLE_COUNTER);
        m_Octave->box (FL_PLASTIC_UP_BOX);
        m_Octave->color (Info->GUI_COLOUR);
        m_Octave->minimum (0);
        m_Octave->maximum (6);
	m_Octave->step (1);
	m_Octave->value (0);
	m_Octave->callback((Fl_Callback*)cb_Octave);
	add (m_Octave);

        m_Speed = new Fl_Knob (50, 60, 40, 40, "Speed");
        m_Speed->color (Info->GUI_COLOUR);
	m_Speed->type (Fl_Knob::DOTLIN);
        m_Speed->labelsize (10);
        m_Speed->minimum (0);
        m_Speed->maximum (400);
        m_Speed->step (0.01);
        m_Speed->value (8);
	m_Speed->callback ((Fl_Callback*)cb_Speed);
	add (m_Speed);

	m_SpeedVal = new Fl_Counter (5, 125, 85, 20, "");
	m_SpeedVal->labelsize (10);
	m_SpeedVal->value (10);
	m_SpeedVal->type (FL_SIMPLE_COUNTER);
        m_SpeedVal->box (FL_PLASTIC_UP_BOX);
        m_SpeedVal->color (Info->GUI_COLOUR);
	m_SpeedVal->step (1);
	m_SpeedVal->maximum (400);
	m_SpeedVal->minimum (0);
        m_SpeedVal->value (8);
	m_SpeedVal->callback ((Fl_Callback*)cb_SpeedVal);
	add (m_SpeedVal);

        m_CopyBtn = new Fl_Button (5, 150, 40, 20, "Copy");
	m_CopyBtn->labelsize (10);
        m_CopyBtn->box (FL_PLASTIC_UP_BOX);
        m_CopyBtn->color (Info->GUI_COLOUR);
        m_CopyBtn->selection_color (Info->GUI_COLOUR);
        m_CopyBtn->callback ((Fl_Callback*)cb_CopyBtn);
	add (m_CopyBtn);

	m_PasteBtn = new Fl_Button (50, 150, 40, 20, "Paste");
	m_PasteBtn->labelsize (10);
        m_PasteBtn->box (FL_PLASTIC_UP_BOX);
        m_PasteBtn->color (Info->GUI_COLOUR);
        m_PasteBtn->selection_color (Info->GUI_COLOUR);
	m_PasteBtn->deactivate();
	m_PasteBtn->callback ((Fl_Callback*)cb_PasteBtn);
	add (m_PasteBtn);

	m_ClearBtn = new Fl_Button (5, 175, 85, 20, "Clear");
	m_ClearBtn->labelsize (10);
        m_ClearBtn->box (FL_PLASTIC_UP_BOX);
        m_ClearBtn->color (Info->GUI_COLOUR);
        m_ClearBtn->selection_color (Info->GUI_COLOUR);
	m_ClearBtn->callback ((Fl_Callback*)cb_ClearBtn);
	add (m_ClearBtn);

	m_TransUpBtn = new Fl_Button (5, 200, 40, 20, "Up");
	m_TransUpBtn->labelsize (10);
        m_TransUpBtn->box (FL_PLASTIC_UP_BOX);
        m_TransUpBtn->color (Info->GUI_COLOUR);
        m_TransUpBtn->selection_color (Info->GUI_COLOUR);
	m_TransUpBtn->callback ((Fl_Callback*)cb_TransUpBtn);
	add (m_TransUpBtn);

	m_TransDnBtn = new Fl_Button (50, 200, 40, 20, "Down");
	m_TransDnBtn->labelsize (10);
        m_TransDnBtn->box (FL_PLASTIC_UP_BOX);
        m_TransDnBtn->color (Info->GUI_COLOUR);
        m_TransDnBtn->selection_color (Info->GUI_COLOUR);
	m_TransDnBtn->callback ((Fl_Callback*)cb_TransDnBtn);
	add (m_TransDnBtn);

	m_TransLbl = new Fl_Box (5, 216, 85, 20, "Transpose");
	m_TransLbl->labelsize(10);
	add (m_TransLbl);

      	m_NoteCut = new Fl_Button (5, h-30, 85, 20, "NoteCut");
	m_NoteCut->type (FL_TOGGLE_BUTTON);
        m_NoteCut->box (FL_PLASTIC_UP_BOX);
        m_NoteCut->color (Info->GUI_COLOUR);
        m_NoteCut->selection_color (Info->GUI_COLOUR);
	m_NoteCut->labelsize (10);
	m_NoteCut->value (0);
	m_NoteCut->callback ((Fl_Callback*)cb_NoteCut);
	add (m_NoteCut);

        int xoff=105;
	int yoff=40;
	int butsize=7;
	int n=0;

	fl_color(150,150,150);
	int markercol=fl_color();

	fl_color(170,170,170);
	int blcolour=fl_color();

	for(int x=0; x<MATX; x++)
	for(int y=0; y<MATY; y++)
	{
		Numbers[n]=n;
		m_Matrix[x][y] = new Fl_MatrixButton(xoff+x*butsize,yoff+((MATY-1)*butsize)-(y*butsize),butsize+1,butsize+1,"");
		m_Matrix[x][y]->type(1);
		m_Matrix[x][y]->box(FL_BORDER_BOX);
                m_Matrix[x][y]->SetSelColour (Info->GUI_COLOUR);
		if ((x%8)==0) m_Matrix[x][y]->color(markercol);
		else if ((y%12)==1 || (y%12)==3 || (y%12)==6 || (y%12)==8 || (y%12)==10) m_Matrix[x][y]->color(blcolour);
		else m_Matrix[x][y]->color(FL_GRAY);

		m_Matrix[x][y]->selection_color(FL_WHITE);
		m_Matrix[x][y]->callback((Fl_Callback*)cb_Matrix,(void*)&Numbers[n]);
		m_Matrix[x][y]->SetVolCallback((Fl_Callback*)cb_MatVol,(void*)&Numbers[n]);
		add(m_Matrix[x][y]);
		n++;
	}

	yoff=37;
	for(int y=0; y<MATY; y++)
	{
		Fl_Box *box = new Fl_Box(90,yoff+((MATY-1)*butsize)-(y*butsize),15,15,NoteText[y%12]);
		box->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
		box->labelsize(8);
	}

	xoff=103;
	for(int x=0; x<MATX; x++)
	{
		m_Flash[x] = new Fl_LED_Button(xoff+x*butsize,20,15,15,"");
		m_Flash[x]->selection_color(FL_WHITE);
		add(m_Flash[x]);
	}

	xoff=560;
	yoff=40;
	int height=12,gap=2;

	Fl_Box *patseqlabel = new Fl_Box(xoff,yoff-15,30,10,"Pat Seq");
	patseqlabel->labelsize(10);
	add(patseqlabel);

	for(int y=0; y<NUM_PATSEQ; y++)
	{
		m_PatSeq[y]= new Fl_Counter(xoff,yoff+y*(height+gap),25,height);
		m_PatSeq[y]->type(FL_SIMPLE_COUNTER);
		m_PatSeq[y]->step(1);
		m_PatSeq[y]->textsize(8);
                if (y==0) m_PatSeq[y]->minimum (0);
                else m_PatSeq[y]->minimum (-1);
                m_PatSeq[y]->value (m_PatSeq[y]->minimum ());
                m_PatSeq[y]->maximum (NUM_PATTERNS-1);
		m_PatSeq[y]->callback((Fl_Callback*)cb_PatSeq,(void*)&Numbers[y]);
		add(m_PatSeq[y]);

		m_PatSeqFlash[y] = new Fl_LED_Button(xoff+25,yoff+y*(height+gap),15,15,"");
		m_PatSeqFlash[y]->selection_color(FL_WHITE);
		add(m_PatSeqFlash[y]);
	}

	end();
}