Beispiel #1
0
void OnRenameCommunity(Fl_Widget* pWidget,void * pParam)
{
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    const char * scName=fl_input("Enter a new name", "");
    if(scName==NULL)
        return ;
    
    char * sName = new char[strlen(scName)*2];
    strcpy(sName,scName);
    Fl_Widget* pW = (Fl_Widget*)pTab->value();
    
    pW->label(scName);
}
Beispiel #2
0
//callback for save
void OnSave(Fl_Widget* pWidget,void * pParam)
{
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    std::ostringstream os;
    for(int i = 0;i<pTab->children();i++)
    {
        CScopeTabPane * pTabPane = (CScopeTabPane*)(pTab->child(i));
        std::string sHost;
        int nPort;
        pTabPane->GetMOOSInfo(sHost,nPort);
        os<<pTabPane->label()<<":"<<nPort<<"@"<<sHost<<",";
    }
    
    //here we try to load previous preferences
    Fl_Preferences app( Fl_Preferences::USER, "MOOS", "uMS" );
    app.set("Communities",os.str().c_str());
}
Beispiel #3
0
//callback for add Community
void OnAddCommunity(Fl_Widget* pWidget,void * pParam)
{
    const char * scName=fl_input("New Community Name", "");
    if(scName==NULL)
        return ;
    
    char * sName = new char[strlen(scName)*2];
    strcpy(sName,scName);
    
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    Fl_Group* pG = (Fl_Group*)pTab->value();
    
    pTab->begin();
    MakeCommunityPane(10,30,pG->w()-20,pG->h()-10,sName);
    pTab->end();
    
}
CAppManager::CAppManager()
{
    const int mainw = 560, mainh = 330;
    m_pMainWindow = new Fl_Window(mainw, mainh, "Nixstaller - App Manager");

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

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

    m_pUninstallWindow = new CUninstallWindow(this);
    
    m_pMainWindow->end();
}
Beispiel #5
0
//callback for delete
void OnRemoveCommunity(Fl_Widget* pWidget,void * pParam)
{
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    
    if(pTab->children()>1)
    {       
        if(fl_choice("Really delete Scope of \"%s\" ?", "No", "Yes", NULL, pTab->value()->label()))
        {
            Fl_Group* pG = (Fl_Group*)pTab->value();
            pG->clear();
            pTab->remove(pG);
            pTab->value(pTab->child(0));
            delete pG;
        }
    }
}
Beispiel #6
0
void icon_dialog_icon_edit(Desktop *self, DesktopIcon *d) {
	const char  *lbl = d ? _("Edit desktop icon") : _("Create desktop icon");
	DesktopFile *df  = NULL;
	char        *buf = NULL;
	old_desktop_path = "";
	curr_icon        = d;
	
	if(d) {
		df = new DesktopFile();
		if(!df->load(d->get_path())) {
			delete df;
			df = NULL;

			int ret = ask(_("Unable to load .desktop file for this icon. Would you like to create a new icon instead?"));
			if(!ret) return;

			/* force NULL on icon, so we can run dialog in 'create' mode */
			d = NULL;
		}
		
		buf = new char[BUFSIZE];
		old_desktop_path = d->get_path();
	}
	
	win = new Fl_Window(450, 220, lbl);
	Fl_Tabs *tabs = new Fl_Tabs(10, 10, 430, 165);
	tabs->begin();
		Fl_Group *g1 = new Fl_Group(15, 30, 415, 140, _("Basic"));
		g1->begin();
			img = new Fl_Button(20, 45, 80, 75);
			img->callback(img_browse_cb);
			img->tooltip(_("Click to select icon"));
			
			if(d) {
				E_ASSERT(df != NULL);
				if(df->icon(buf, BUFSIZE)) {
					IconLoader::set(img, buf, ICON_SIZE_HUGE);
					img_path = buf;
				} 
			}

			/* handles even the case when we are creating the new icon */
			if(!img->image()) {
				IconLoader::set(img, DEFAULT_ICON, ICON_SIZE_HUGE);
				img_path = DEFAULT_ICON;
			}
			
			name = new Fl_Input(210, 45, 215, 25, _("Name:"));
			if(d && df->name(buf, BUFSIZE)) name->value(buf);
			
			comment = new Fl_Input(210, 75, 215, 25, _("Comment:"));
			if(d && df->comment(buf, BUFSIZE)) comment->value(buf);
			
			execute = new Fl_Input(210, 105, 185, 25, _("Execute:"));
			if(d && df->exec(buf, BUFSIZE)) execute->value(buf);
			
			browse = new Fl_Button(400, 105, 25, 25, "...");
			browse->callback(file_browse_cb);
			
			icon_type = new Fl_Choice(210, 135, 215, 25, _("Type:"));
			icon_type->down_box(FL_BORDER_BOX);
			icon_type->menu(menu_items);
		g1->end();		   
		
		Fl_Group *g2 = new Fl_Group(15, 30, 420, 140, _("Details"));
		g2->hide();
		g2->begin();
			run_in_terminal = new Fl_Check_Button(195, 80, 235, 25, _("Run in terminal"));
			run_in_terminal->down_box(FL_DOWN_BOX);
			if(df) run_in_terminal->value(df->terminal());

			workdir = new Fl_Input(195, 45, 205, 25, _("Working directory:"));
			if(df && df->path(buf, BUFSIZE)) workdir->value(buf);

			Fl_Button *browsedir = new Fl_Button(405, 45, 25, 25, "...");
			browsedir->callback(dir_browse_cb);

			start_notify = new Fl_Check_Button(195, 110, 235, 25, _("Use startup notification"));
			start_notify->down_box(FL_DOWN_BOX);
			if(df) start_notify->value(df->startup_notify());
		g2->end();
	tabs->end();	

	ok = new Fl_Button(255, 185, 90, 25, _("&OK"));
	ok->callback(ok_cb, self);
	cancel = new Fl_Button(350, 185, 90, 25, _("&Cancel"));
	cancel->callback(cancel_cb);

	win->end();
	win->set_modal();
	
	delete df;
	delete buf;

	Fl::focus(name);
	win->show();
}
Beispiel #7
0
fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize)
{
  FL_NORMAL_SIZE -= deltaFontSize;

  int width0 = 34 * FL_NORMAL_SIZE + WB;
  int height0 = 12 * BH + 4 * WB;
  int width = (CTX::instance()->fieldSize[0] < width0) ? width0 :
    CTX::instance()->fieldSize[0];
  int height = (CTX::instance()->fieldSize[1] < height0) ? height0 :
    CTX::instance()->fieldSize[1];

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

  int x = WB, y = WB, w = (int)(1.5 * BB), h = height - 2 * WB - 3 * BH;

  Fl_Menu_Button *new_btn = new Fl_Menu_Button(x, y, w, BH, "New");
  FieldManager &fields = *GModel::current()->getFields();

  std::map<std::string, FieldFactory*>::iterator it;
  for(it = fields.map_type_name.begin(); it != fields.map_type_name.end(); it++)
    new_btn->add(it->first.c_str());
  new_btn->callback(field_new_cb);

  y += BH;
  browser = new Fl_Hold_Browser(x, y + WB, w, h - 2 * WB);
  browser->callback(field_browser_cb);

  y += h;
  delete_btn = new Fl_Button(x, y, w, BH, "Delete");
  delete_btn->callback(field_delete_cb, this);

  y += BH;
  put_on_view_btn = new Fl_Menu_Button(x, y, w, BH, "Visualize");
  put_on_view_btn->callback(field_put_on_view_cb, this);

  x += w + WB;
  y = WB;
  w = width - x - WB;
  h = height - y - WB;
  empty_message = new Fl_Box(x, y, w, h, "Create a new field\n\n"
                             "- or -\n\nSelect a field in the browser");
  empty_message->align(FL_ALIGN_CENTER);

  editor_group = new Fl_Group(x, y, w, h);

  title = new Fl_Box(x, y, w, BH, "field_name");
  title->labelfont(FL_BOLD);
  title->labelsize(FL_NORMAL_SIZE + 3);

  y += BH + WB;
  h -= BH + WB;
  Fl_Tabs *tabs = new Fl_Tabs(x, y , w, h);
  y += BH;
  h -= BH;
  x += WB;
  w -= 2 * WB;

  Fl_Group *options_tab = new Fl_Group(x, y, w, h, "Options");

  options_scroll = new Fl_Scroll(x, y + WB, w, h - BH - 3 * WB);
  options_scroll->end();

  Fl_Button *apply_btn = new Fl_Return_Button
    (x + w - BB, y + h - BH - WB, BB, BH, "Apply");
  apply_btn->callback(field_apply_cb, this);

  background_btn = new Fl_Round_Button
    (x, y + h - BH - WB, w - BB - WB, BH, "Set as background field");
  background_btn->tooltip("Only a single field can be set as background field.\n"
                          "To combine multiple fields use the Min or Max fields.");
  options_tab->end();

  Fl_Group *help_tab = new Fl_Group(x, y, w, h, "Help");
  help_display = new Fl_Help_View(x, y + WB, w, h - 2 * WB);
  help_display->textfont(FL_HELVETICA);
  help_display->textsize(FL_NORMAL_SIZE);
  help_tab->end();

  tabs->end();

  editor_group->end();

  win->resizable(new Fl_Box((int)(1.5 * BB) + 2 * WB, BH + 2 * WB,
                            width - 3 * WB - (int)(1.5 * BB),
                            height - 3 * BH - 5 * WB));
  editor_group->resizable(tabs);
  tabs->resizable(options_tab);
  options_tab->resizable(new Fl_Box(3 * BB + 4 * WB, BH + 2 * WB,
                                    width - 9 * WB - 5 * BB,
                                    height - 3 * BH - 5 * WB));
  win->size_range(width0, height0);
  win->position(CTX::instance()->fieldPosition[0], CTX::instance()->fieldPosition[1]);
  win->end();

  FL_NORMAL_SIZE += deltaFontSize;

  loadFieldViewList();
  editField(NULL);
}
int main(int argc, char ** argv)
{
  program=(char*)malloc(4096);
  params=(char*)malloc(40960);

  exe_root=(char*)malloc(4096);
  if( GetModuleFileName(NULL, exe_root, 4096)!=0)//os specific method win32
  {
    if(strrchr(exe_root, '\\')!=NULL)
      (strrchr(exe_root, '\\'))[0]=0;
  }
  else
  {
    puts("Failed to find exe_root");
    return 1;
  }

  enc_filename=(char*)malloc(4096);
  dec_filename=(char*)malloc(4096);

  enc_outname=(char*)malloc(4096);
  dec_outname=(char*)malloc(4096);

  enc_working=(char*)malloc(4096);
  dec_working=(char*)malloc(4096);

  memset(enc_filename, 0, 4096);
  memset(dec_filename, 0, 4096);

  memset(enc_outname, 0, 4096);
  memset(dec_outname, 0, 4096);

  memset(enc_working, 0, 4096);
  memset(dec_working, 0, 4096);

  window = new Fl_Window(640,480, "GPackGUI r1");/*lazy, rev goes here*/

  Fl_Tabs *tabs = new Fl_Tabs(0, 0, 640, 480);
  Fl_Group *dec_tab = new Fl_Group(0, 30, 640, 450, "Decode");
  Fl_Group *enc_tab = new Fl_Group(0, 30, 640, 450, "Encode");
  Fl_Group *help_tab = new Fl_Group(0, 30, 640, 450, "Help");
  tabs->add(dec_tab);
  tabs->add(enc_tab);
  tabs->add(help_tab);

  /*decode tab*****************************************************************/
  /*setup text display*/
  decode_buff = new Fl_Text_Buffer();
  d_disp = new Fl_Text_Display(0, 310, 640, 170, "");
  d_disp->buffer(decode_buff);
  //window->resizable(*d_disp);
  decode_buff->text(
"\n"
);
  dec_tab->add(d_disp);

  /*dec_filename description*/
  Fl_Box *d_filename_desc = new Fl_Box(20, 70, 600, 25, "1) Select a grp file from an existing merge");
  dec_tab->add(d_filename_desc);

  /*dec_filename button*/
  Fl_Button *d_filename_b = new Fl_Button(20, 100, 80, 25, "Browse");
  d_filename_b->callback(d_filename_f,0);
  dec_tab->add(d_filename_b);

  /*dec_filename path*/
  d_filename_box = new Fl_Box(105, 100, 535, 25, "No grp file selected");
  dec_tab->add(d_filename_box);

  /*dec_outname description*/
  Fl_Box *d_outname_desc = new Fl_Box(20, 160, 600, 25, "2) Select an output directory (optional)");
  dec_tab->add(d_outname_desc);

  /*dec_filename button*/
  Fl_Button *d_outname_b = new Fl_Button(20, 190, 80, 25, "Browse");
  d_outname_b->callback(d_outname_f,0);
  dec_tab->add(d_outname_b);

  /*dec_filename path*/
  dec_outname_box = new Fl_Box(105, 190, 535, 25, "Default to same directory as merged files");
  dec_tab->add(dec_outname_box);

  /*dec_exec description*/
  Fl_Box *d_exec_desc = new Fl_Box(20, 250, 600, 25, "3) Execute");
  dec_tab->add(d_exec_desc);

  /*dec_exec button*/
  d_exec_b = new Fl_Button(20, 280, 80, 25, "Make it so");
  d_exec_b->callback(d_exec_f,0);
  dec_tab->add(d_exec_b);

  /*encode tab*****************************************************************/
  /*setup text display*/
  encode_buff = new Fl_Text_Buffer();
  e_disp = new Fl_Text_Display(0, 400, 640, 80, "");
  e_disp->buffer(encode_buff);
  //window->resizable(*e_disp);
  encode_buff->text(
"\n"
);
  enc_tab->add(e_disp);

  /*enc_filename description*/
  Fl_Box *e_filename_desc = new Fl_Box(20, 70, 600, 25, "1) Select a directory containing images to merge");
  enc_tab->add(e_filename_desc);

  /*enc_filename button*/
  Fl_Button *e_filename_b = new Fl_Button(20, 100, 80, 25, "Browse");
  e_filename_b->callback(e_filename_f,0);
  enc_tab->add(e_filename_b);

  /*enc_filename path*/
  e_filename_box = new Fl_Box(105, 100, 535, 25, "No directory selected");
  enc_tab->add(e_filename_box);

  /*enc_outname description*/
  Fl_Box *e_outname_desc = new Fl_Box(20, 160, 600, 25, "2) Select an output directory (optional)");
  enc_tab->add(e_outname_desc);

  /*enc_outname button*/
  Fl_Button *e_outname_b = new Fl_Button(20, 190, 80, 25, "Browse");
  e_outname_b->callback(e_outname_f,0);
  enc_tab->add(e_outname_b);

  /*enc_outname path*/
  enc_outname_box = new Fl_Box(105, 190, 535, 25, "Default to same directory as merged files");
  enc_tab->add(enc_outname_box);

  /*compression option*/
  Fl_Box *e_comp_desc = new Fl_Box(20, 250, 600, 25, "3) Select a compression profile");
  enc_tab->add(e_comp_desc);

  /*enc_outname button*/
  e_comp_choice = new Fl_Choice(20, 280, 600,25);
  e_comp_choice->add("No compression (srep)");
  e_comp_choice->add("Quick compression (srep + 7zip (mx1) + tak)");
  e_comp_choice->add("Normal compression (srep + 7zip (mx5) + tak)");
  e_comp_choice->add("Slow compression (srep + 7zip (mx9) + tak)");
  e_comp_choice->value(COMP_NORMAL);
  enc_tab->add(e_comp_choice);

  /*enc_exec description*/
  Fl_Box *e_exec_desc = new Fl_Box(20, 340, 600, 25, "4) Execute");
  enc_tab->add(e_exec_desc);

  /*enc_exec button*/
  e_exec_b = new Fl_Button(20, 370, 80, 25, "Make it so");
  e_exec_b->callback(e_exec_f,0);
  enc_tab->add(e_exec_b);

  /*about tab******************************************************************/
  /*setup text display*/
  help_buff = new Fl_Text_Buffer();
  Fl_Text_Display *h_disp = new Fl_Text_Display(0, 65, 640, 415, "");
  h_disp->buffer(help_buff);
  //window->resizable(*h_disp);
  help_buff->text(
"GPack is a commandline compressor for related disc images, GPackGUI is a simple\n"
"GUI interface to GPack.\n"
"\n"
"This GUI does not expose every option available in GPack. For full functionality\n"
"use GPack from the commandline.\n"
);
  help_tab->add(h_disp);

  Fl_Button *about_gpackgui_b = new Fl_Button(5, 35, 150, 25, "About GPackGUI");
  about_gpackgui_b->callback(about_gpackgui_f,0);
  help_tab->add(about_gpackgui_b);

  Fl_Button *about_gpack_b = new Fl_Button(165, 35, 150, 25, "About GPack");
  about_gpack_b->callback(about_gpack_f,0);
  help_tab->add(about_gpack_b);

  Fl_Button *about_gparse_b = new Fl_Button(325, 35, 150, 25, "About GParse");
  about_gparse_b->callback(about_gparse_f,0);
  help_tab->add(about_gparse_b);

  Fl_Button *about_supportedformats_b = new Fl_Button(485, 35, 150, 25, "Supported Formats");
  about_supportedformats_b->callback(about_supportedformats_f,0);
  help_tab->add(about_supportedformats_b);

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

  Fl::lock();
  return Fl::run();
}
Beispiel #9
0
void show_icon_properties_dialog(DesktopIcon* dicon) {
	// fetch usefull data
	DesktopIconData data;
	study_and_fill(dicon, &data);

	// now construct dialog and fill it
	edelib::Window* win = new edelib::Window(315, 395, _("Icon properties"));
	win->begin();
		Fl_Tabs* tabs = new Fl_Tabs(10, 10, 295, 340);
		tabs->begin();
			Fl_Group* g1 = new Fl_Group(15, 35, 285, 310, _("General"));
			g1->begin();
				Fl_Button* icon_button = new Fl_Button(20, 50, 75, 75);
				icon_button->image(data.image);
				icon_button->callback((Fl_Callback*)icon_change_cb, &data);
				icon_button->tooltip(_("Click to change icon"));

				Fl_Input* prog_name = new Fl_Input(100, 75, 195, 25);
				prog_name->value(data.label);

				Fl_Output* prog_mime = new Fl_Output(100, 150, 195, 25, _("Type:"));
				prog_mime->box(FL_FLAT_BOX);
				prog_mime->color(FL_BACKGROUND_COLOR);
				prog_mime->value(data.type.c_str());

				Fl_Output* prog_location = new Fl_Output(100, 180, 195, 25, _("Location:"));
				prog_location->box(FL_FLAT_BOX);
				prog_location->color(FL_BACKGROUND_COLOR);
				prog_location->value(data.location);

				Fl_Output* prog_size  = new Fl_Output(100, 210, 195, 25, _("Size:"));
				prog_size->box(FL_FLAT_BOX);
				prog_size->color(FL_BACKGROUND_COLOR);
				prog_size->value(data.size.c_str());

				Fl_Output* prog_date_mod = new Fl_Output(100, 240, 195, 25, _("Modified:"));
				prog_date_mod->box(FL_FLAT_BOX);
				prog_date_mod->color(FL_BACKGROUND_COLOR);
				prog_date_mod->value(data.time_mod.c_str());

				Fl_Output* prog_date_acessed = new Fl_Output(100, 270, 195, 25, "Accessed:");
				prog_date_acessed->box(FL_FLAT_BOX);
				prog_date_acessed->color(FL_BACKGROUND_COLOR);
				prog_date_acessed->value(data.time_access.c_str());
			g1->end();

			Fl_Group* g2 = new Fl_Group(15, 35, 285, 310, _("URL"));
			g2->hide();
			g2->begin();
				Fl_Input* prog_url = new Fl_Input(20, 65, 245, 25, _("URL:"));
				prog_url->align(FL_ALIGN_TOP_LEFT);

				Fl_Button* prog_browse = new Fl_Button(270, 65, 25, 25);
				prog_browse->tooltip(_("Browse location"));

				// set icon for browse button
				if(!edelib::IconLoader::set(prog_browse, "document-open", edelib::ICON_SIZE_TINY))
					prog_browse->label("...");

			g2->end();
		tabs->end();

		Fl_Button* ok_button = new Fl_Button(120, 360, 90, 25, _("&OK"));
		ok_button->callback(ok_cb, win);
		Fl_Button* cancel_button = new Fl_Button(215, 360, 90, 25, _("&Cancel"));
		cancel_button->callback(close_cb, win);
    win->end();
	win->show();

	while(win->shown())
		Fl::wait();
}
ModelerUserInterface::ModelerUserInterface() {
	// Make this instance the current one
	instance = this;

	// Initialize pointers to NULL
	m_nativeChooser = NULL;
	model = NULL;
	currentGroup = NULL;
	renderGroup = NULL;
	defaultCam = NULL;
	ps = NULL;
	movieWidth = 720;
	movieHeight = 480;

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

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

	// We're not animating yet.
	animating = false;
	simulating = false;
	rendering = false;
	drawing = false;

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

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

		// Contains the controls on the left
		{ leftPane = new Fl_Group(0, 25, 250, 600);
			int tabSpace = 0, controlSpace = 0;
			int controlTop = 25 + 600 - controlSpace;

			// Modeler and Curves tabs
			{ Fl_Tabs* t = new Fl_Tabs(0, 25, 250, 600 - controlSpace);
				// Make the tab area stretch.
				leftPane->resizable(t);
				t->when(FL_WHEN_CHANGED);
				t->callback((Fl_Callback*)TabsCallback, this);
				// Curves tab
				{ Fl_Group* o = new Fl_Group(0, 50, 250, 575 - controlSpace, "Curves");
					o->box(FL_FLAT_BOX);
					o->color(FL_BACKGROUND_COLOR);
					{ Fl_Tree* o = curvesTree = new Fl_Tree(0, 50, 250, 575 - controlSpace);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)CurveTreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					o->end();
				}

				// Modeler tab
				{ Fl_Tile* o = m_controlSplitPane =
					new Fl_Tile(0, 50 + tabSpace, 250, 575 + tabSpace - controlSpace, "Modeler");
					// Make only the content area of the tabs resize.
					t->resizable(o);
					o->box(FL_FLAT_BOX);
					{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)TreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					{ Fl_Scroll* o = m_controlsScroll =
						new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
					  o->type(Fl_Scroll::VERTICAL);
					  o->when(FL_WHEN_CHANGED);
					  { Fl_Pack* o = m_controlsPack =
						  new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
						Fl_Group::current()->resizable(o);
						o->spacing(2);
						o->end();
					  }
					  o->end();
					}
					o->end();
				} // end Modeler group/tab
				t->end();
			} // end tabs
			leftPane->end();
		} // left pane
		{ // TODO: remove this extra brace!
			{ Fl_Group* o = m_viewPane = new Special_Tile(250, 25, 550, 600);
				o->box(FL_NO_BOX);
				o->color(FL_BACKGROUND_COLOR);
				// show a smaller modeler view
				m_modelerView = new ModelerView(250, 25, 550, 350, "");
				m_modelerView->resizable();
				// show a curve window with animation controls underneath
				{ curvePane = new Fl_Group(250, 375, 550, 250);
					

					// Row containing the curve options
					{ Fl_Group* o = new Fl_Group(255, 380, 540, 20, "Curve Editor");
						// Put particle system label inside
						o->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						o->labelfont(FL_HELVETICA_BOLD);

						// Curve type chooser
						chooserCurveType = new Fl_Choice(445, 380, 120, 20, "Curve Type: ");
						chooserCurveType->menu(curveTypeMenu);
						chooserCurveType->callback((Fl_Callback*)chooserCurveTypeCallback, this);
						chooserCurveType->deactivate();

						// Wrap checkbox
						checkboxWrap = new Fl_Check_Button(570, 380, 60, 20, "Wrap");
						checkboxWrap->callback((Fl_Callback*)checkboxWrapCallback, this);
						checkboxWrap->deactivate();

						// Zoom All button
						buttonZoomAll = new Fl_Button(640, 380, 80, 20, "Zoom All");
						buttonZoomAll->callback((Fl_Callback*)buttonZoomAllCallback, this);
						buttonZoomAll->deactivate();

						// No resizing
						o->resizable(NULL);

						o->end();
					}

					// The graph widget
					graph = new GraphWidget(255, 405, 540, 140);
					graph->callback((Fl_Callback*)graphCallback, this);
					curvePane->resizable(graph); // stretch the graph on resize

					// Camera buttons
					{ cameraPane = new Fl_Group(255, 550, 540, 20, "Camera");
						// Put camera label inside
						cameraPane->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						cameraPane->labelfont(FL_HELVETICA_BOLD);

						// Prevent internal widgets from resizing when the group is resized.
						cameraPane->resizable(NULL);

						// Use Camera button
						checkboxUseCamera = new Fl_Check_Button(315, 550, 165, 20, "Look Through Camera");
						checkboxUseCamera->callback((Fl_Callback*)checkboxUseCameraCallback);

						// Plot Camera checkbox
						Fl_Button* buttonPlotCamera = new Fl_Button(485, 550, 120, 20, "Plot Keyframe");
						buttonPlotCamera->callback((Fl_Callback*)buttonPlotCameraCallback);

						// Clear Plot button
						Fl_Button* buttonClearPlot = new Fl_Button(610, 550, 120, 20, "Clear Keyframe");
						buttonClearPlot->callback((Fl_Callback*)buttonClearCameraCallback);
						
						// End this group
						cameraPane->end();
					}

					// Particle system buttons
					{ particlePane = new Fl_Group(255, 575, 540, 20, "Particle System");
						// Put particle system label inside
						particlePane->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						particlePane->labelfont(FL_HELVETICA_BOLD);

						// Simulate button
						checkboxSimulate = new Fl_Check_Button(375, 575, 75, 20, "Simulate");
						checkboxSimulate->callback((Fl_Callback*)checkboxSimulateCallback);

						// Clear Particles button
						buttonClearParticles = new Fl_Button(455, 575, 50, 20, "Clear");
						buttonClearParticles->callback((Fl_Callback*)buttonClearParticlesCallback);

						// Particle "bake" indicator
						particleBakeIndicator = new IndicatorWindow(510, 575, 285, 20);
						// TODO: fix this:
						particleBakeIndicator->range(0, 20);
						particleBakeIndicator->deactivate();
						particlePane->resizable(particleBakeIndicator);

						// End this group
						particlePane->end();
					}

					// The playback controls
					{ Fl_Group* o = new Fl_Group(255, 600, 540, 20, "Playback");
						// Put particle system label inside
						o->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
						o->labelfont(FL_HELVETICA_BOLD);

						// Rewind button
						Fl_Button* rewind = new Fl_Button(335, 600, 20, 20, "@|<");
						rewind->labeltype(FL_SYMBOL_LABEL);
						rewind->callback((Fl_Callback*)buttonRewindCallback, this);

						// Play button
						buttonPlay = new Fl_Button(360, 600, 20, 20, "@>");
						buttonPlay->labeltype(FL_SYMBOL_LABEL);
						buttonPlay->callback((Fl_Callback*)buttonPlayCallback, this);
						buttonPlay->labelcolor(FL_GREEN);

						// Fast Forward button
						Fl_Button* fastForward = new Fl_Button(385, 600, 20, 20, "@>|");
						fastForward->labeltype(FL_SYMBOL_LABEL);
						fastForward->callback((Fl_Callback*)buttonFastForwardCallback, this);

						// Time slider
						sliderTime = new Fl_Value_Slider(455, 600, 340, 20, "Time:");
						sliderTime->type(FL_HORIZONTAL);
						sliderTime->align(FL_ALIGN_LEFT);
						sliderTime->callback((Fl_Callback*)sliderTimeCallback, this);
						sliderTime->bounds(0, 20);

						// Stretch the time slider on resize
						o->resizable(sliderTime);
						o->end();
					}
					curvePane->end();
				}
				w->resizable(m_modelerView);
				o->end();
				Fl_Group::current()->resizable(o);
			}
		}
		o->end();
	}
}
Beispiel #11
0
geometryContextWindow::geometryContextWindow(int deltaFontSize)
{
  FL_NORMAL_SIZE -= deltaFontSize;

  int width = 31 * FL_NORMAL_SIZE;
  int height = 4 * WB + 8 * BH;

  win = new paletteWindow(width, height, CTX::instance()->nonModalWindows ? true : false,
                          "Contextual Geometry Definitions");
  win->box(GMSH_WINDOW_BOX);
  {
    Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB);
    // 0: Parameter
    {
      group[0] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Parameter");
      input[0] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Name");
      input[0]->value("lc");
      input[1] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Value");
      input[1]->value("0.1");
      input[24] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Label");
      input[24]->value("");
      input[25] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Path");
      input[25]->value("Parameters");
      for(int i = 0; i < 2; i++)   input[i]->align(FL_ALIGN_RIGHT);
      for(int i = 24; i < 26; i++) input[i]->align(FL_ALIGN_RIGHT);
      {
        Fl_Return_Button *o = new Fl_Return_Button
          (width - BB - 2 * WB, 2 * WB + 7 * BH, BB, BH, "Add");
        o->callback(con_geometry_define_parameter_cb);
      }
      group[0]->end();
    }
    // 1: Point
    {
      group[1] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Point");
      input[2] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "X coordinate");
      input[2]->value("0");
      input[3] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Y coordinate");
      input[3]->value("0");
      input[4] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Z coordinate");
      input[4]->value("0");
      input[5] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Prescribed mesh element size at point");
      input[5]->value("1.0");
      for(int i = 2; i < 6; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      value[0] = new Fl_Value_Input(2 * WB, 2 * WB + 5 * BH, IW/3, BH);
      value[1] = new Fl_Value_Input(2 * WB + IW/3, 2 * WB + 5 * BH, IW/3, BH);
      value[2] = new Fl_Value_Input(2 * WB + 2*IW/3, 2 * WB + 5 * BH, IW/3, BH,
                                    "Snapping grid spacing");
      for(int i = 0; i < 3; i++) {
        value[i]->align(FL_ALIGN_RIGHT);
        value[i]->callback(con_geometry_snap_cb);
      }
      {
        Fl_Return_Button *o = new Fl_Return_Button
          (width - BB - 2 * WB, 2 * WB + 7 * BH, BB, BH, "Add");
        o->callback(con_geometry_define_point_cb);
      }
      group[1]->end();
    }
    // 2: Translation
    {
      group[2] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Translation");
      input[6] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "X component");
      input[6]->value("0");
      input[7] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Y component");
      input[7]->value("0");
      input[8] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Z component");
      input[8]->value("1");
      for(int i = 6; i < 9; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      group[2]->end();
    }
    // 3: Rotation
    {
      group[3] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Rotation");
      input[9] = new Fl_Input
        (2 * WB, 2 * WB + 1 * BH, IW, BH, "X coordinate of an axis point");
      input[9]->value("0");
      input[10] = new Fl_Input
        (2 * WB, 2 * WB + 2 * BH, IW, BH, "Y coordinate of an axis point");
      input[10]->value("0");
      input[11] = new Fl_Input
        (2 * WB, 2 * WB + 3 * BH, IW, BH, "Z coordinate of an axis point");
      input[11]->value("0");
      input[12] = new Fl_Input
        (2 * WB, 2 * WB + 4 * BH, IW, BH, "X component of axis direction");
      input[12]->value("0");
      input[13] = new Fl_Input
        (2 * WB, 2 * WB + 5 * BH, IW, BH, "Y component of axis direction");
      input[13]->value("1");
      input[14] = new Fl_Input
        (2 * WB, 2 * WB + 6 * BH, IW, BH, "Z component of axis direction");
      input[14]->value("0");
      input[15] = new Fl_Input
        (2 * WB, 2 * WB + 7 * BH, IW, BH, "Angle in radians");
      input[15]->value("Pi/4");
      for(int i = 9; i < 16; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      group[3]->end();
    }
    // 4: Scale
    {
      group[4] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Scale");
      input[16] = new Fl_Input
        (2 * WB, 2 * WB + 1 * BH, IW, BH, "X component of direction");
      input[16]->value("0");
      input[17] = new Fl_Input
        (2 * WB, 2 * WB + 2 * BH, IW, BH, "Y component of direction");
      input[17]->value("0");
      input[18] = new Fl_Input
        (2 * WB, 2 * WB + 3 * BH, IW, BH, "Z component of direction");
      input[18]->value("0");
      input[19] = new Fl_Input
        (2 * WB, 2 * WB + 4 * BH, IW, BH, "Factor");
      input[19]->value("0.5");
      for(int i = 16; i < 20; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      group[4]->end();
    }
    // 5: Symmetry
    {
      group[5] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Symmetry");
      input[20] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "A");
      input[20]->value("1");
      input[21] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "B");
      input[21]->value("0");
      input[22] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "C");
      input[22]->value("0");
      input[23] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "D");
      input[23]->value("1");
      for(int i = 20; i < 24; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      group[5]->end();
    }
    o->end();
  }

  win->position(CTX::instance()->ctxPosition[0], CTX::instance()->ctxPosition[1]);
  win->end();

  FL_NORMAL_SIZE += deltaFontSize;
}
Beispiel #12
0
//heres the money.....
int main(int argc, char* argv[])
{
    
    //make the frame
    Fl_Double_Window *w = new Fl_Double_Window( 820, 460, "uMS" );
    w->size_range(DEFAULT_WIDTH,DEFAULT_HEIGHT);
    
    //OK - lets build a whole set of panes
    std::string sWho;
    {
        //note scoping
        Fl_Preferences app( Fl_Preferences::USER, "MOOS", "uMS" );
        char Space[2048];
        app.get("Communities",Space,"Unnamed:9000@LOCALHOST",sizeof(Space));
        sWho = std::string(Space);
    }
    
    Fl_Tabs* pTab = new Fl_Tabs(10, 10, 800, 400);
    
    while(!sWho.empty())
    {
        std::string sChunk = MOOSChomp(sWho,",");
        std::string sName = MOOSChomp(sChunk,":");
        int nPort = atoi(MOOSChomp(sChunk,"@").c_str());
        std::string sHost = sChunk;
        if(!sChunk.empty() && nPort>0)
        {
            Fl_Group *pG  = MakeCommunityPane(10,30,800,390,(char*)sName.c_str());
            CScopeTabPane * pTabPane = (CScopeTabPane*)(pG);
            pTabPane->SetMOOSInfo(sHost,nPort);
            Fl_Group::current()->resizable(pG);
        }
    }
    if(pTab->children()==0)
    {
        MakeCommunityPane(10,30,800,390,"Unnamed");
    }
    
    w->end();
    
    
    //and add some buttons to control them....
    w->begin();
    {
        //add
        Fl_Button * pNewCommunityButton = new Fl_Button(10,420,160,30,"Add Community");
        pNewCommunityButton->callback(OnAddCommunity,pTab);
        
        //delete
        Fl_Button * pDelCommunityButton = new Fl_Button(180,420,160,30,"Remove Community");
        pDelCommunityButton->callback(OnRemoveCommunity,pTab);
        
        //save
        Fl_Button * pSaveButton = new Fl_Button(350,420,160,30,"Save Layout");
        pSaveButton->callback(OnSave,pTab);
        pSaveButton->callback();
        
        //rename
        Fl_Button * pRenameButton = new Fl_Button(520,420,160,30,"Rename");
        pRenameButton->callback(OnRenameCommunity,pTab);
        pRenameButton->callback();
        
    }
    w->end();
    
    
    //need to do more work on resizing       - maybe even read the manual
    w->resizable(pTab);
    
    
    //and GO!
    w->show(argc, argv);
    return Fl::run();
    
}
Beispiel #13
0
Fl_Window* make_codingstyle_window() {
  Fl_Window* w;
   {Fl_Window* o = new Fl_Window(310, 255);
    w = o;
    o->shortcut(0xff1b);
     {Fl_Tabs* o = new Fl_Tabs(0, 0, 303, 220);
      o->color((Fl_Color)0xfffffffe);
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Brace Style"));
         {Fl_Group* o = new Fl_Group(14, 22, 282, 122, _("Brace Style"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Box* o = new Fl_Box(20, 6, 47, 20, _("if ( x ) {"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 25, 45, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(20, 41, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(115, 42, 46, 20, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(114, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle1 = new Fl_Round_Button(16, 84, 66, 25, _("Style 1"));
            o->type(Fl_Round_Button::RADIO);
            o->value(1);
            o->callback((Fl_Callback*)cb_pStyle1);
          }
           {Fl_Box* o = new Fl_Box(201, 6, 47, 20, _("if ( x )"));
            o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 25, 36, 20, _("{"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(227, 42, 34, 22, _("++y;"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Box* o = new Fl_Box(201, 59, 36, 20, _("}"));
            o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
          }
           {Fl_Round_Button* o = pStyle2 = new Fl_Round_Button(109, 84, 66, 25, _("Style 2"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle2);
          }
           {Fl_Round_Button* o = pStyle3 = new Fl_Round_Button(200, 84, 66, 25, _("Style 3"));
            o->type(Fl_Round_Button::RADIO);
            o->callback((Fl_Callback*)cb_pStyle3);
          }
          o->end();
        }
         {Fl_Check_Button* o = pNoSpaceParens = new Fl_Check_Button(15, 147, 195, 22, _("No space before parentheses"));
          o->callback((Fl_Callback*)cb_pNoSpaceParens);
        }
         {Fl_Check_Button* o = pBraceFuncs = new Fl_Check_Button(15, 170, 174, 22, _("Apply to function braces"));
          o->value(1);
          o->callback((Fl_Callback*)cb_pBraceFuncs);
        }
        o->end();
      }
       {Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Other"));
        o->hide();
         {Fl_Group* o = new Fl_Group(11, 22, 284, 90, _("Indentation"));
          o->box(FL_ENGRAVED_BOX);
          o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
           {Fl_Value_Input* o = pTabSize = new Fl_Value_Input(129, 33, 60, 22, _("Tab size for indents"));
            o->maximum(12);
            o->value(2);
            o->callback((Fl_Callback*)cb_pTabSize);
          }
           {Fl_Check_Button* o = pIndentTabs = new Fl_Check_Button(13, 7, 114, 22, _("Indent with tabs"));
            o->callback((Fl_Callback*)cb_pIndentTabs);
          }
           {Fl_Check_Button* o = pIndentCode = new Fl_Check_Button(14, 58, 151, 22, _("Indent code blocks"));
            o->callback((Fl_Callback*)cb_pIndentCode);
          }
          o->end();
        }
         {Fl_Check_Button* o = pReturnParens = new Fl_Check_Button(10, 120, 220, 22, _("Always use parentheses on return"));
          o->callback((Fl_Callback*)cb_pReturnParens);
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(115, 227, 59, 23, _("Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
    }
     {Fl_Button* o = new Fl_Button(180, 227, 59, 23, _("Save"));
      o->callback((Fl_Callback*)cb_Save);
    }
     {Fl_Button* o = new Fl_Button(245, 227, 59, 23, _("Use"));
      o->callback((Fl_Callback*)cb_Use);
    }
    o->end();
    o->resizable(o);
  }
  return  w;
}
Beispiel #14
0
int main (int argc, char **argv) {

  Fl_Window* w;
  fl_init_locale_support("eiconsconf", PREFIX"/share/locale");
  readIconsConfiguration();
   {Fl_Window* o = iconsConfWindow = new Fl_Window(265, 314, _("Icons settings"));
    w = o;
    o->shortcut(0xff1b);
     {Fl_Button* o = new Fl_Button(25, 280, 75, 25, _("&OK"));
      o->callback((Fl_Callback*)cb_OK);
    }
     {Fl_Button* o = new Fl_Button(185, 280, 75, 25, _("&Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
    }
     {Fl_Button* o = new Fl_Button(105, 280, 75, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_Apply);
    }
     {Fl_Tabs* o = new Fl_Tabs(3, 5, 257, 265);
      o->color((Fl_Color)0xfffffffe);
       {Fl_Group* o = new Fl_Group(1, 23, 255, 241, _("Look&&feel"));
        o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
         {Fl_Button* o = colorButton = new Fl_Button(165, 17, 60, 18, _("Background color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_colorButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->color((Fl_Color) label_background);
          if(label_trans) o->deactivate();
        }
         {Fl_Button* o = colorButton1 = new Fl_Button(165, 47, 60, 18, _("Label color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_colorButton1);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->color((Fl_Color) label_foreground);
        }
         {Fl_Value_Slider* o = maxWidthSlider = new Fl_Value_Slider(115, 95, 125, 20, _("Maximum width: "));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(48);
          o->maximum(200);
          o->step(1);
          o->value(50);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_maxWidthSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_maxwidth);
        }
         {Fl_Value_Slider* o = fontsizeSlider = new Fl_Value_Slider(115, 125, 125, 20, _("Font height: "));
          o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
          o->minimum(8);
          o->maximum(48);
          o->step(1);
          o->value(10);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_fontsizeSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_fontsize);
        }
         {Fl_Value_Slider* o = gridspaceSlider = new Fl_Value_Slider(115, 155, 125, 20, _("Grid spacing: "));
          o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
          o->minimum(1);
          o->maximum(50);
          o->step(1);
          o->value(10);
          o->slider_size(10);
          o->callback((Fl_Callback*)cb_gridspaceSlider);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
          o->value(label_gridspacing);
        }
         {Fl_Check_Button* o = autoArrButton = new Fl_Check_Button(25, 215, 222, 20, _("Auto arrange icons"));
          o->callback((Fl_Callback*)cb_autoArrButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
          o->value(auto_arr);
        }
         {Fl_Check_Button* o = engageButton = new Fl_Check_Button(25, 190, 222, 20, _("Engage with just one click"));
          o->callback((Fl_Callback*)cb_engageButton);
          o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
          o->value(label_engage_1click);
        }
         {Fl_Check_Button* o = bg_color_check = new Fl_Check_Button(227, 17, 20, 18);
          o->callback((Fl_Callback*)cb_bg_color_check);
          o->tooltip(_("Clear this, to get transparent background."));
          if(!label_trans) o->set_value();
        }
        o->end();
      }
      o->end();
    }
    o->end();
    o->resizable(o);
  }
  w->show(argc, argv);
  return  Fl::run();
}
Beispiel #15
0
int main (int argc, char **argv) {

  Fl_Window* w;
  fl_init_locale_support("ewmconf", PREFIX"/share/locale");
  readConfiguration();
   {Fl_Window* o = new Fl_Window(320, 370, _("Window manager settings"));
    w = o;
     {Fl_Tabs* o = new Fl_Tabs(2, 5, 318, 325);
      o->color((Fl_Color)16);
       {Fl_Group* o = new Fl_Group(1, 29, 316, 295, _("&Titlebar"));
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
         {Fl_Choice* o = new Fl_Choice(83, 13, 105, 22, _("Text align:")); o->begin();
          o->callback((Fl_Callback*)cb_Text);
          new Fl_Item(_("Left"));
          new Fl_Item(_("Right"));
          new Fl_Item(_("Center"));
          o->value(title_align);
          o->end();
        }
         {Fl_Value_Input* o = new Fl_Value_Input(243, 13, 60, 22, _("Height:"));
          o->minimum(10);
          o->maximum(50);
          o->step(1);
          o->value(20);
          o->callback((Fl_Callback*)cb_Height);
          o->value(title_height);
        }
         {Fl_Button* o = titlebarLabelColorButton = new Fl_Button(85, 55, 60, 20, _("Titlebar label color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_titlebarLabelColorButton);
          o->align(132);
          o->color((Fl_Color)title_normal_color_text);
        }
         {Fl_Button* o = titlebarColorButton = new Fl_Button(85, 120, 60, 20, _("Titlebar color: "));
          o->box(FL_DOWN_BOX);
          o->callback((Fl_Callback*)cb_titlebarColorButton);
          o->align(132);
          o->color((Fl_Color) title_normal_color);
        }
         {Fl_Group* o = new Fl_Group(153, 45, 160, 110);
           {Fl_Button* o = titlebarActiveLabelColorButton = new Fl_Button(90, 10, 60, 20, _("Titlebar active label color: "));
            o->box(FL_DOWN_BOX);
            o->callback((Fl_Callback*)cb_titlebarActiveLabelColorButton);
            o->align(132);
            o->color((Fl_Color) title_active_color_text);
          }
           {Fl_Button* o = titlebarActiveColorButton = new Fl_Button(90, 75, 60, 20, _("Titlebar active color: "));
            o->box(FL_DOWN_BOX);
            o->callback((Fl_Callback*)cb_titlebarActiveColorButton);
            o->align(132);
            o->color((Fl_Color)title_active_color);
          }
          o->end();
        }
         {Fl_Choice* o = titlebarDrawGrad = new Fl_Choice(85, 157, 163, 23, _("Box type:")); o->begin();
          o->callback((Fl_Callback*)cb_titlebarDrawGrad);
          o->align(132);
          new Fl_Item(_("Flat"));
          new Fl_Item(_("Horizontal shade"));
          new Fl_Item(_("Thin down"));
          new Fl_Item(_("Up box"));
          new Fl_Item(_("Down box"));
          new Fl_Item(_("Plastic"));
          o->value(title_draw_grad);
          o->end();
        }
         {Fl_Check_Button* o = useThemeButton = new Fl_Check_Button(8, 220, 300, 20, _("&Use theme"));
          o->callback((Fl_Callback*)cb_useThemeButton);
          o->value(use_theme);
        }
         {Fl_Input* o = themePathInput = new Fl_Input(65, 247, 210, 23, _("Path:"));
          o->callback((Fl_Callback*)cb_themePathInput);
          o->deactivate();
          themePathInput->value(theme_path);
        }
         {Fl_Button* o = browse_btn = new Fl_Button(280, 247, 25, 23, _("..."));
          o->callback((Fl_Callback*)cb_browse_btn);
          o->deactivate();
        }
         {Fl_Divider* o = new Fl_Divider(8, 190, 300, 25, _("label"));
          o->color((Fl_Color)16);
        }
         {Fl_Divider* o = new Fl_Divider(8, 85, 297, 25, _("label"));
          o->color((Fl_Color)16);
        }
        o->end();
      }
       {Fl_Group* o = new Fl_Group(3, 20, 310, 305, _("&Resizing"));
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
        o->hide();
         {Fl_Check_Button* o = animateButton = new Fl_Check_Button(10, 10, 300, 20, _("Animate size changes"));
          o->value(1);
          o->callback((Fl_Callback*)cb_animateButton);
          o->value(animate);
        }
         {Fl_Value_Slider* o = animateSlider = new Fl_Value_Slider(70, 35, 235, 20, _("Speed:"));
          o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
          o->box(FL_DOWN_BOX);
          o->text_size(10);
          o->minimum(5);
          o->maximum(20);
          o->step(2);
          o->value(14);
          o->slider_size(8);
          o->callback((Fl_Callback*)cb_animateSlider);
          o->align(FL_ALIGN_LEFT);
          o->value(animate_speed);
          if(animate) o->activate(); else o->deactivate();
        }
        new Fl_Divider(0, 60, 300, 25, _("label"));
         {Fl_Check_Button* o = opaqueResize = new Fl_Check_Button(10, 85, 290, 20, _("Show window content while resizing"));
          o->callback((Fl_Callback*)cb_opaqueResize);
          o->value(opaque_resize);
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(67, 337, 80, 25, _("&OK"));
      o->shortcut(0xff0d);
      o->callback((Fl_Callback*)cb_OK);
    }
     {Fl_Button* o = new Fl_Button(152, 337, 80, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_Apply);
    }
     {Fl_Button* o = new Fl_Button(237, 337, 80, 25, _("&Cancel"));
      o->shortcut(0xff1b);
      o->callback((Fl_Callback*)cb_Cancel);
    }
    o->end();
  }
  useThemeButton->do_callback();
  w->show(argc, argv);
  return  Fl::run();
}
Beispiel #16
0
int main( int argc, char **argv )
{
    const char* facebaseopt="--facebase=";
    char* classifierbase = 0;
    char* aviname = 0;
    int auto_run = 0;
    
    if( argc > 1 && argv[argc-1][0] != '-' )
    {
        aviname = argv[argc-1];
        auto_run = 1;
        argc--;
    }
    
    if( argc > 1 && strncmp(argv[argc-1],facebaseopt,strlen(facebaseopt))==0 )
    {
        classifierbase=argv[argc-1] + strlen(facebaseopt);
        argc--;
    }
    
    if( !InitFaceDetect(classifierbase))
    {
        fprintf( stderr, "Could not locate face classifier base at %s\n"
                         "Use --facebase=<classifier base path> option to specify the base\n",
                 classifierbase );
        return -1;
    }
	
    cpu_freq = cvGetTickFrequency(); 
    printf("Tick frequency (*10^-6): %g\n", cpu_freq );
 
    Fl_Window* w;
    {
        Fl_Window* o = root_window = new Fl_Window( root_w, root_h );
        w = o;
        {
            Fl_Tabs* o = new Fl_Tabs( 10, 10, root_w - 20, root_h - 100 );
            // camera tab
            {
                Fl_Group* o = new Fl_Group( 10, 30, root_w - 20, root_h - 110, "Face Detection" );
                {
                    VideoWindow* o = new VideoWindow( 15, 35, root_w - 30, root_h - 120 );
                    video_window = o;
                    o->box( FL_BORDER_BOX );
                    o->color(0);
                }
                o->end();
            }
            o->end();
            Fl_Group::current()->resizable(o);
        }
        {
            const int bwidth = 30, bheight = 30;
            play_button = new Fl_Button( 10, root_h - 35, bwidth, bheight, "@>" );
            play_button->callback((Fl_Callback*)cb_PauseResume);
            play_button->deactivate();
            stop_button = new Fl_Button( 10 + bwidth, root_h - 35, bwidth, bheight, "@square" );
            stop_button->callback((Fl_Callback*)cb_Stop);
            stop_button->deactivate();
            video_button = new Fl_Button( 10 + bwidth*2, root_h - 35, bwidth, bheight, "..." );
            video_button->callback((Fl_Callback*)cb_Open);
            cam_button = new Fl_Button( 10 + bwidth*3, root_h - 35, bwidth, bheight, "[o]" );
            cam_button->callback((Fl_Callback*)cb_StartCam);
            video_pos = new Fl_Value_Slider( 10 + bwidth*4 + 10, root_h - 35, 200, 20, "Position" );
            video_pos->type( FL_HOR_NICE_SLIDER );
            record_button = new Fl_Button( 10 + bwidth*4 + 230, root_h - 35, bwidth, bheight, "@circle" );
            record_button->labelcolor(FL_RED);
            record_button->callback((Fl_Callback*)cb_StartStopRecord );
            record_button->deactivate();
            fps_box = new Fl_Box( 10, root_h - 75, bwidth*4, bheight, "<No data>" );
            fps_box->box( FL_DOWN_BOX );
        }
        o->end();
    }
    Fl::visual(FL_RGB);
    w->show(argc, argv);
    if( auto_run )
        Fl::add_timeout( 0.1, cb_AutoRun, aviname );
    Fl::run();
    cb_Exit(0,0);
    return 0;
}
Beispiel #17
0
int main(int argc, char **argv) {
#ifdef HAVE_XKBRULES
	/* must be opened first */
	fl_open_display();

	/* only apply what was written in config */
	if(argc > 1 && strcmp(argv[1], "--apply") == 0) {
		String layout;

		read_config(&layout);
		apply_changes_on_x(layout.c_str(), NULL);
		return 0;
	} else {
		read_config(NULL);
	}

	EDE_APPLICATION("ede-keyboard-conf");

	String cl;
	dialog_canceled = false;

	/* get layout X holds */
	fetch_current_layout(cl);

	/* construct GUI */
	win = new AppWindow(340, 320, _("Keyboard configuration tool"));
	win->begin();
		Fl_Tabs *tabs = new Fl_Tabs(10, 10, 320, 265);
		tabs->begin();
			Fl_Group *layout_group = new Fl_Group(15, 30, 310, 240, _("Layout"));
			layout_group->begin();
				layout_browser = new Fl_Hold_Browser(20, 40, 300, 190);

				/* so things can be nicely aligned per column */
				int cwidths [] = {100, 0};
				layout_browser->column_widths(cwidths);
				layout_browser->column_char('\t');

				layout_group->resizable(layout_browser);

				show_flag = new Fl_Check_Button(20, 240, 300, 25, _("Show country flag"));
				show_flag->tooltip(_("Display country flag in panel keyboard applet"));
				show_flag->down_box(FL_DOWN_BOX);
				show_flag->value(show_flag_value);
				show_flag->callback(show_flag_cb);
			layout_group->end();
			Fl_Group::current()->resizable(layout_group);

			Fl_Group *details_group = new Fl_Group(15, 30, 310, 240, _("Details"));
			details_group->hide();
			details_group->begin();
				repeat_press = new Fl_Check_Button(20, 45, 300, 25, _("Repeat pressed key"));
				repeat_press->tooltip(_("Allow pressed key to be repeated"));
				repeat_press->down_box(FL_DOWN_BOX);
				repeat_press->value(repeat_press_value);
				repeat_press->callback(repeat_press_cb);
			details_group->end();
		tabs->end();

		/* resizable box */
		Fl_Box *rbox = new Fl_Box(30, 163, 65, 52);
		Fl_Group::current()->resizable(rbox);

		Fl_Button *ok_button = new Fl_Button(145, 285, 90, 25, _("&OK"));
		ok_button->callback(ok_cb);

		Fl_Button *cancel_button = new Fl_Button(240, 285, 90, 25, _("&Cancel"));
		cancel_button->callback(cancel_cb);
	win->end();

	/* read all XKB layouts */
	XkbRF_RulesPtr xkb_rules = fetch_all_layouts(cl);

	window_center_on_screen(win);
	win->show(argc, argv);
	Fl::run();

	/* do not save configuration if was canceled */
	if(!dialog_canceled && xkb_rules && layout_browser->value()) {
		int  i = layout_browser->value();
		/* get the layout that matches browser row */
		char *n  = xkb_rules->layouts.desc[i - 1].name;

		save_config(n);
		apply_changes_on_x(n, &cl);
	}

	if(xkb_rules) 
		XkbRF_Free(xkb_rules, True);

#else
	alert(_("ede-keyboard-conf was compiled without XKB extension. Please recompile it again"));
#endif /* HAVE_XKBRULES */

	return 0;
}
Beispiel #18
0
edisplayconf::edisplayconf() {
  Fl_Window* w;
   {Fl_Window* o = win = new Fl_Window(265, 335, _("Display configuration"));
    w = o;
    o->callback((Fl_Callback*)cb_win, (void*)(this));
     {Fl_Tabs* o = new Fl_Tabs(5, 5, 255, 285);
       {Fl_Group* o = group_mouse = new Fl_Group(0, 20, 255, 265, _("Mouse"));
        o->align(FL_ALIGN_LEFT);
         {Fl_Value_Slider* o = slider_accel = new Fl_Value_Slider(25, 25, 220, 18, _("Acceleration"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(10);
          o->step(1);
          o->value(2);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_thresh = new Fl_Value_Slider(25, 65, 220, 18, _("Threshold (pixels)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(20);
          o->step(1);
          o->value(4);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_bell = new Fl_Group(0, 20, 255, 265, _("Bell"));
        o->hide();
         {Fl_Value_Slider* o = slider_volume = new Fl_Value_Slider(25, 25, 220, 18, _("Volume in %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_pitch = new Fl_Value_Slider(25, 70, 220, 18, _("Pitch in Hz"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(100);
          o->maximum(1000);
          o->step(1);
          o->value(440);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Value_Slider* o = slider_duration = new Fl_Value_Slider(25, 115, 220, 18, _("Duration in ms"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(1000);
          o->step(1);
          o->value(200);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Button* o = new Fl_Button(180, 165, 60, 25, _("Test"));
          o->callback((Fl_Callback*)cb_Test);
        }
        o->end();
      }
       {Fl_Group* o = group_keyboard = new Fl_Group(0, 20, 255, 265, _("Keyboard"));
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
        o->hide();
         {Fl_Check_Button* o = check_autorepeat = new Fl_Check_Button(24, 25, 221, 20, _("  Repeat key activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
         {Fl_Value_Slider* o = slider_click = new Fl_Value_Slider(25, 65, 220, 18, _("Click volume %"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->maximum(100);
          o->step(1);
          o->value(50);
          o->align(FL_ALIGN_TOP);
        }
        o->end();
      }
       {Fl_Group* o = group_screen = new Fl_Group(0, 20, 255, 265, _("Screen"));
        o->hide();
         {Fl_Button* o = but_activate = new Fl_Button(165, 187, 80, 25, _("&Test"));
          o->callback((Fl_Callback*)cb_but_activate);
        }
        new Fl_Box(10, 1, 234, 55);
         {Fl_Value_Slider* o = slider_delay = new Fl_Value_Slider(25, 77, 220, 18, _("Activation delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(5);
          o->maximum(120);
          o->step(1);
          o->value(15);
          o->align(FL_ALIGN_TOP);
        }
         {Fl_Check_Button* o = check_blanking = new Fl_Check_Button(23, 25, 222, 20, _(" Screen blanker activated"));
          o->selection_color((Fl_Color)2);
          o->value(1);
        }
        new Fl_Box(10, 100, 234, 37);
         {Fl_Value_Slider* o = slider_pattern = new Fl_Value_Slider(25, 152, 220, 18, _("Pattern change delay (min)"));
          o->type(Fl_Value_Slider::HORIZONTAL);
          o->minimum(1);
          o->maximum(5);
          o->step(0);
          o->value(2);
          o->align(FL_ALIGN_TOP);
          o->deactivate();
        }
         {Fl_Group* o = new Fl_Group(30, 105, 210, 25);
           {Fl_Round_Button* o = radio_blank = new Fl_Round_Button(0, 5, 105, 20, _("Blank"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->value(1);
            o->callback((Fl_Callback*)cb_radio_blank);
          }
           {Fl_Round_Button* o = radio_pattern = new Fl_Round_Button(115, 5, 95, 20, _("Pattern"));
            o->type(Fl_Round_Button::RADIO);
            o->selection_color((Fl_Color)1);
            o->callback((Fl_Callback*)cb_radio_pattern);
          }
          o->end();
        }
        o->end();
      }
      o->end();
    }
     {Fl_Button* o = new Fl_Button(190, 300, 70, 25, _("&Cancel"));
      o->callback((Fl_Callback*)cb_Cancel);
      o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
    }
     {Fl_Button* o = but_kbd_apply = new Fl_Button(115, 300, 70, 25, _("&Apply"));
      o->callback((Fl_Callback*)cb_but_kbd_apply);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(40, 300, 70, 25, _("OK"));
      o->shortcut(0xd);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
}
Beispiel #19
0
meshContextWindow::meshContextWindow(int deltaFontSize)
{
  FL_NORMAL_SIZE -= deltaFontSize;

  static Fl_Menu menu_transfinite_dir[] = {
    {"Left", 0, 0, 0},
    {"Right", 0, 0, 0},
    {"Alternated", 0, 0, 0},
    {0}
  };

  int width = 29 * FL_NORMAL_SIZE;
  int height = 4 * WB + 4 * BH;

  win = new paletteWindow
    (width, height, CTX::instance()->nonModalWindows, "Contextual Mesh Definitions");
  win->box(GMSH_WINDOW_BOX);
  {
    Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB);
    // 0: Element size at points
    {
      group[0] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Element size at points");
      input[0] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Value");
      input[0]->value("0.1");
      input[0]->align(FL_ALIGN_RIGHT);
      group[0]->end();
    }
    // 1: Transfinite line
    {
      group[1] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Transfinite Line");
      input[1] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Number of points");
      input[1]->value("10");
      input[2] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Parameter");
      input[2]->value("1");
      for(int i = 1; i < 3; i++) {
        input[i]->align(FL_ALIGN_RIGHT);
      }
      static Fl_Menu_Item menu_trsf_mesh[] = {
        {"Progression", 0, 0, 0},
        {"Bump", 0, 0, 0},
        {0}
      };
      choice[0] = new Fl_Choice(2 * WB, 2 * WB + 2 * BH, IW, BH, "Type");
      choice[0]->menu(menu_trsf_mesh);
      choice[0]->align(FL_ALIGN_RIGHT);
      group[1]->end();
    }

    // 2: Transfinite surface
    {
      group[2] = new Fl_Group
        (WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Transfinite Surface");

      choice[1] = new Fl_Choice
        (2 * WB, 2 * WB + 1 * BH, IW, BH, "Transfinite Arrangement");
      choice[1]->menu(menu_transfinite_dir);
      choice[1]->align(FL_ALIGN_RIGHT);

      group[2]->end();
    }
    o->end();
  }

  win->position(CTX::instance()->ctxPosition[0], CTX::instance()->ctxPosition[1]);
  win->end();

  FL_NORMAL_SIZE += deltaFontSize;
}
Fl_Parameters_Manager::Fl_Parameters_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name)
{
	Fl::lock();

	s->begin();
	Fl_MDI_Window *w = PWin = new Fl_MDI_Window(0, 0, width, height, name);
	w->user_data((void *)this);
	w->resizable(w->view());

	w->titlebar()->close_button()->hide();

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

	Parameters_Tabs = new Fl_Tabs*[Num_Tunable_Blocks];
	Input_Blocks = new Param_Input_Block_T [Num_Tunable_Parameters];

	for (int i = 0; i < Num_Tunable_Blocks; i++) {
		{ Fl_Tabs *o = Parameters_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-70);
		  o->new_page("Block Parameters");
		  int tot_rows = 0;
		  if (i == Num_Tunable_Blocks - 1) {
		  	for (int j = 0; j < Num_Tunable_Parameters - Tunable_Blocks[i].offset; j++) {
				char scalar_val[20];
				char param_label[MAX_NAMES_SIZE + 10];
				int val_idx;
				unsigned int ncols = Tunable_Parameters[Tunable_Blocks[i].offset+j].n_cols;
				unsigned int nrows = Tunable_Parameters[Tunable_Blocks[i].offset+j].n_rows;
				Input_Blocks[Tunable_Blocks[i].offset+j].inputW = new Fl_Float_Input*[nrows*ncols];

				sprintf(param_label, "%s", Tunable_Parameters[Tunable_Blocks[i].offset+j].param_name);
				for (unsigned int nr = 0; nr < nrows; nr++) {
					for (unsigned int nc = 0; nc < ncols; nc++) {
		  				{ Fl_Float_Input *o = new Fl_Float_Input(10 + nc*110, 30 + (j+nr+tot_rows)*40, 100, 20, strdup(param_label));
						  param_label[0] = '\0';
			    	  		  o->align(FL_ALIGN_LEFT|FL_ALIGN_TOP);
				  		  o->when(FL_WHEN_ENTER_KEY);
						  sprintf(scalar_val, "%G", get_parameter(Tunable_Parameters[Tunable_Blocks[i].offset+j], nr, nc, &val_idx));
			    	  		  o->value(strdup(scalar_val));
						  p_idx_T *idx = new p_idx_T;
						  idx->block_idx = i;
						  idx->param_idx = j;
						  idx->val_idx = val_idx;
				  		  o->callback((Fl_Callback *)rlg_update_parameters_cb, (void *)idx);
						  Input_Blocks[Tunable_Blocks[i].offset+j].inputW[val_idx]=o;
						}
					}
				}
				tot_rows = tot_rows + nrows - 1;
			}
		  } else {
		  	for (int j = 0; j < Tunable_Blocks[i+1].offset-Tunable_Blocks[i].offset; j++) {
				char scalar_val[20];
				char param_label[MAX_NAMES_SIZE + 10];
				int val_idx;
				unsigned int ncols = Tunable_Parameters[Tunable_Blocks[i].offset+j].n_cols;
				unsigned int nrows = Tunable_Parameters[Tunable_Blocks[i].offset+j].n_rows;
				Input_Blocks[Tunable_Blocks[i].offset+j].inputW = new Fl_Float_Input*[nrows*ncols];
				sprintf(param_label, "%s", Tunable_Parameters[Tunable_Blocks[i].offset+j].param_name);
				for (unsigned int nr = 0; nr < nrows; nr++) {
					for (unsigned int nc = 0; nc < ncols; nc++) {
		  				{ Fl_Float_Input *o = new Fl_Float_Input(10 + nc*110, 30 + (j+nr+tot_rows)*40, 100, 20, strdup(param_label));
						  param_label[0] = '\0';
			    	  		  o->align(FL_ALIGN_LEFT|FL_ALIGN_TOP);
				  		  o->when(FL_WHEN_ENTER_KEY);
						  sprintf(scalar_val, "%G", get_parameter(Tunable_Parameters[Tunable_Blocks[i].offset+j], nr, nc, &val_idx));
			    	  		  o->value(strdup(scalar_val));
						  p_idx_T *idx = new p_idx_T;
						  idx->block_idx = i;
						  idx->param_idx = j;
						  idx->val_idx = val_idx;
						  o->callback((Fl_Callback *)rlg_update_parameters_cb, (void *)idx);
						  Input_Blocks[Tunable_Blocks[i].offset+j].inputW[val_idx]=o;
						}
					}
				}
				tot_rows = tot_rows + nrows - 1;
			}
		  }
		  o->end();
		  Fl_Group::current()->resizable(w);
		}
	}
	for (int i = 1; i < Num_Tunable_Blocks; i++) {
		Parameters_Tabs[i]->hide();
	}
	Parameters_Tabs[0]->show();

	Batch_Download = new Fl_Check_Button(width-270, height-60, 120, 25, "Batch Download");
	Batch_Download->callback((Fl_Callback *)batch_download_cb);
	Download = new Fl_Button(width-150, height-60, 70, 25, "Download");
	Download->callback((Fl_Callback *)rlg_batch_update_parameters_cb);
	Download->deactivate();
	Upload = new Fl_Button(width-75, height-60, 70, 25, "Upload");
	Upload->callback((Fl_Callback *)rlg_upload_parameters_cb);
//	Upload->deactivate();
	Help = new Fl_Button(width-150, height-30, 70, 25, "Help");
	Close = new Fl_Button(width-75, height-30, 70, 25, "Close");
	Close->callback((Fl_Callback *)close);

	Fl_Browser *o = Parameters_Tree = new Fl_Browser(5, 5, 150, height-10);
	o->indented(1);
	o->callback((Fl_Callback *)select_block);
	for (int i = 0; i < Num_Tunable_Blocks; i++) {
		add_paper(Parameters_Tree, Tunable_Blocks[i].name, Fl_Image::read_xpm(0, block_icon));
	}

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

	s->end();

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

	Fl::unlock();
}
Beispiel #21
0
void ColorFltkMenu::make_window() {
  size(400, 305);
  { 
    { Fl_Hold_Browser* o = categorybrowser = new Fl_Hold_Browser(10, 55, 125, 100, "Categories");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(category_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    { Fl_Hold_Browser* o = itembrowser = new Fl_Hold_Browser(140, 55, 120, 100, "Names");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(item_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    { Fl_Hold_Browser* o = colorbrowser = new Fl_Hold_Browser(265, 55, 125, 100, "Colors");
      o->align(FL_ALIGN_TOP);
      o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
      o->callback(color_cb, this);
      VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
    }
    new Fl_Box(10, 10, 190, 25, "Assign colors to categories:");
    { Fl_Tabs* o = new Fl_Tabs(0, 165, 400, 150);
#if defined(VMDMENU_WINDOW)
      o->color(VMDMENU_WINDOW, FL_GRAY);
      o->selection_color(VMDMENU_WINDOW);
#endif

      { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Definitions");
#if defined(VMDMENU_WINDOW)
        o->color(VMDMENU_WINDOW, FL_GRAY);
        o->selection_color(VMDMENU_WINDOW);
#endif
        { Fl_Hold_Browser* o = colordefbrowser = new Fl_Hold_Browser(15, 195, 135, 100);
          o->labeltype(FL_NO_LABEL);
          o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
          o->callback(colordef_cb, this);
          VMDFLTKTOOLTIP(o, "Select color name to adjust RGB color definition")
        }
        { Fl_Value_Slider* o = redscale = new Fl_Value_Slider(160, 195, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_RSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Value_Slider* o = greenscale = new Fl_Value_Slider(160, 215, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_GSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Value_Slider* o = bluescale = new Fl_Value_Slider(160, 235, 225, 20);
          o->type(FL_HORIZONTAL);
          o->color(VMDMENU_COLOR_BSLIDER);
          o->callback(rgb_cb, this);
          VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
        }
        { Fl_Button* o = grayscalebutton = new Fl_Button(165, 265, 85, 25, "Grayscale");
          o->type(FL_TOGGLE_BUTTON);
#if defined(VMDMENU_WINDOW)
          o->color(VMDMENU_WINDOW, FL_GRAY);
#endif
          VMDFLTKTOOLTIP(o, "Lock sliders for grayscale color")
        }
        defaultbutton = new Fl_Button(290, 265, 85, 25, "Default");
#if defined(VMDMENU_WINDOW)
        defaultbutton->color(VMDMENU_WINDOW, FL_GRAY);
#endif
        defaultbutton->callback(default_cb, this);
        VMDFLTKTOOLTIP(defaultbutton, "Reset to original RGB color")
        o->end();
      }
      { Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Scale");
#if defined(VMDMENU_WINDOW)
        o->color(VMDMENU_WINDOW, FL_GRAY);
        o->selection_color(VMDMENU_WINDOW);
#endif
        o->hide();
        { Fl_Choice* o = scalemethod = new Fl_Choice(15, 220, 80, 25, "Method");
          o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
          o->down_box(FL_BORDER_BOX);
          o->align(FL_ALIGN_TOP);
          o->callback(scalemethod_cb, this);
        }
        offsetvalue = new Fl_Value_Slider(160, 205, 180, 20, "Offset");
        offsetvalue->type(FL_HORIZONTAL);
        offsetvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
        offsetvalue->align(FL_ALIGN_LEFT);
        offsetvalue->range(-1.0, 1.0);
        offsetvalue->callback(scalesettings_cb, this);
        { Fl_Value_Slider* o = midpointvalue = new Fl_Value_Slider(160, 235, 180, 20, "Midpoint");
          o->type(FL_HORIZONTAL);
          midpointvalue->align(FL_ALIGN_LEFT);
          midpointvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
          o->range(0.0, 1.0);
          o->callback(scalesettings_cb, this);
        }
        image = new ColorscaleImage(10, 265, 380, 25, app);
        o->end();
      }
      o->end();
    }
    end();
  }
}
Beispiel #22
0
Fl_Scopes_Manager::Fl_Scopes_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name)
{
	Fl::lock();

	s->begin();
	Fl_MDI_Window *w = SWin = new Fl_MDI_Window(0, 0, width, height, name);
	w->user_data((void *)this);
	w->resizable(w->view());

	w->titlebar()->close_button()->hide();

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

	Scopes_Tabs = new Fl_Tabs*[Num_Scopes];
	Scope_Show = new Fl_Check_Button*[Num_Scopes];
	Scope_Pause = new Fl_Button*[Num_Scopes];
	Scope_OneShot = new Fl_Check_Button*[Num_Scopes];
	Scope_Options = new Fl_Menu_Button*[Num_Scopes];
	Grid_Color = new Fl_Button*[Num_Scopes];
	Bg_Color = new Fl_Button*[Num_Scopes];
	Sec_Div = new Fl_Input_Browser*[Num_Scopes];
	Save_Type = new Fl_Check_Button*[Num_Scopes];
	Save_Points = new Fl_Int_Input*[Num_Scopes];
	Save_Time = new Fl_Float_Input*[Num_Scopes];
	Save_File = new Fl_Input*[Num_Scopes];
	Save = new Fl_Light_Button*[Num_Scopes];
	Save_Flag = new int[Num_Scopes];
	Save_File_Pointer = new FILE*[Num_Scopes];

	Trace_Page = new Fl_Group**[Num_Scopes];
	Trace_Show = new Fl_Check_Button**[Num_Scopes];
	Units_Div = new Fl_Input_Browser**[Num_Scopes];
	Trace_Color = new Fl_Button**[Num_Scopes];
	Trace_Pos = new Fl_Dial**[Num_Scopes];
	Trace_Width = new Fl_Dial**[Num_Scopes];
 	Trigger_Mode = new Fl_Choice*[Num_Scopes];

        Trace_Options = new Fl_Menu_Button**[Num_Scopes];

	Scope_Windows = new Fl_Scope_Window*[Num_Scopes];

	for (int i = 0; i < Num_Scopes; i++) {
		Save_Flag[i] = false;
		{ Fl_Tabs *o = Scopes_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-40);
		  o->new_page("General");
		  { Fl_Check_Button *o = Scope_Show[i] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
		    o->callback((Fl_Callback *)show_scope, (void *)i);
		  }
		  { Fl_Button *o = Scope_Pause[i] = new Fl_Button(10, 75, 90, 25, "Trigger");
		    o->value(0);
		    o->deactivate();
		    o->when(FL_WHEN_CHANGED);
		    o->callback((Fl_Callback *)pause_scope, (void *)i);
		  }
		  { Fl_Check_Button *o = Scope_OneShot[i] = new Fl_Check_Button(10, 50, 100, 20, "OneShot/Run");
		    o->deactivate();
		    o->callback((Fl_Callback *)oneshot_scope, (void *)i);
		  }
		  { Fl_Menu_Button *o = Scope_Options[i] = new Fl_Menu_Button(10, 105, 90, 25, "Options");
			o->menu(Scope_Opts);
			o->when(FL_WHEN_ENTER_KEY);
			o->child(0)->set_value();
		    	o->callback((Fl_Callback *)enter_options, (void *)i);
		  }
		  { Fl_Button *o = Grid_Color[i] = new Fl_Button(10, 135, 90, 25, "Grid Color");
		    o->callback((Fl_Callback *)select_grid_color, (void *)i);
		  }
		  { Fl_Button *o = Bg_Color[i] = new Fl_Button(10, 165, 90, 25, "Bg Color");
		    o->callback((Fl_Callback *)select_bg_color, (void *)i);
		  }
		  { Fl_Input_Browser *o = Sec_Div[i] = new Fl_Input_Browser(200, 25, 60, 20, "Sec/Div:  ");
		    o->add("0.001|0.005|0.01|0.05|0.1|0.5|1");
		    o->align(FL_ALIGN_LEFT);
		    o->value("0.1");
		    o->when(FL_WHEN_ENTER_KEY);
		    o->callback((Fl_Callback *)enter_secdiv, (void *)i);
		  }
		  { Fl_Check_Button *o = Save_Type[i] = new Fl_Check_Button(140, 50, 100, 20, "Points/Time");
		    o->value(1);
		    o->callback((Fl_Callback *)select_save, (void *)i);
		  }
		  { Fl_Int_Input *o = Save_Points[i] = new Fl_Int_Input(200, 75, 60, 20, "N Points: ");
		    o->align(FL_ALIGN_LEFT);
		    o->value("1000");
		  }
		  { Fl_Float_Input *o = Save_Time[i] = new Fl_Float_Input(200, 105, 60, 20, "Time [s]:  ");
		    o->align(FL_ALIGN_LEFT);
		    o->value("1.0");
		    o->deactivate();
		  }
		  { Fl_Input *o = Save_File[i] = new Fl_Input(200, 135, 100, 20, "Filename:");
		    char buf[100];
		    o->align(FL_ALIGN_LEFT);
		    sprintf(buf, "%s", Scopes[i].name);
		    o->value(buf);
		  }
		  { Fl_Light_Button *o = Save[i] = new Fl_Light_Button(140, 165, 90, 25, "Save");
		    o->selection_color(FL_BLACK);
		    o->callback((Fl_Callback *)enable_saving, (void *)i);
		  }
   		  {  Fl_Choice *o = Trigger_Mode[i] = new Fl_Choice(60, 200, 170, 25, "Trigger:");
                    o->add("Continuous Roling|Continuous Overwrite|Rising (-to+) CH1|Falling (+to-) CH1|Hold");
                    o->align(FL_ALIGN_LEFT);
                    o->value(0);
                    o->when(FL_WHEN_ENTER_KEY);
                    o->callback((Fl_Callback *)enter_trigger_mode, (void *)i);
                  }


		  Trace_Page[i] = new Fl_Group*[Scopes[i].ntraces];
		  Trace_Show[i] = new Fl_Check_Button*[Scopes[i].ntraces];
		  Units_Div[i] = new Fl_Input_Browser*[Scopes[i].ntraces];
		  Trace_Color[i] = new Fl_Button*[Scopes[i].ntraces];
		  Trace_Pos[i] = new Fl_Dial*[Scopes[i].ntraces];
  		  Trace_Width[i] = new Fl_Dial*[Scopes[i].ntraces];
		  Trace_Options[i] = new Fl_Menu_Button*[Scopes[i].ntraces];
		  

		  for (int j = 0; j < Scopes[i].ntraces; j++) {
			s_idx_T *idx = new s_idx_T;
			idx->scope_idx = i;
			idx->trace_idx = j;
		  	Trace_Page[i][j] = o->new_page(Scopes[i].traceName[j]);
			Trace_Page[i][j]->label_color(FL_WHITE);
			{ Fl_Check_Button *o = Trace_Show[i][j] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
			  o->value(1);
		    	  o->callback((Fl_Callback *)show_trace, (void *)idx);
		  	}
		  	{ Fl_Input_Browser *o = Units_Div[i][j] = new Fl_Input_Browser(77, 55, 60, 20, "Units/Div:  ");
		    	  o->align(FL_ALIGN_LEFT);
		    	  o->value("2.5");
			  o->add("0.001|0.002|0.005|0.01|0.02|0.05|0.1|0.2|0.5|1|2|5|10|50|100|1000");
		    	  o->when(FL_WHEN_ENTER_KEY);
		    	  o->callback((Fl_Callback *)enter_unitsdiv, (void *)idx);
		  	}
		  	{ Fl_Button *o = Trace_Color[i][j] = new Fl_Button(10, 90, 90, 25, "Trace Color");
		    	  o->callback((Fl_Callback *)select_trace_color, (void *)idx);
		  	}
			{ Fl_Dial *o = Trace_Pos[i][j] = new Fl_Dial(170, 40, 50, 50, "Trace Offset");
			  o->type(Fl_Dial::LINE);
			  o->minimum(0.0);
			  o->maximum(2.0);
			  o->value(1);
		    	  o->callback((Fl_Callback *)change_trace_pos, (void *)idx);
			}
			{ Fl_Dial *o = Trace_Width[i][j] = new Fl_Dial(250, 40, 50, 50, "Trace Width");
			  o->type(Fl_Dial::LINE);
			  o->minimum(0.1);
			  o->maximum(40.0);
			  o->value(0.1);
		    	  o->callback((Fl_Callback *)change_trace_width, (void *)idx);
			}
			{ Fl_Menu_Button *o = Trace_Options[i][j] = new Fl_Menu_Button(10, 130, 90, 25, "Options ");
			  int i;
			  o->menu(Trace_Opts);
			  o->when(FL_WHEN_ENTER_KEY);
		    	  o->callback((Fl_Callback *)enter_options, (void *)idx);
			 // for(i=0;i<o->children();i++) { // loop through all menu items, and add checked items to the value
	  		 //   o->child(i)->set_value(); 
			 // } 
		  	}
		  }
		  o->end();
		  Fl_Group::current()->resizable(w);
		}
	}
	for (int i = 1; i < Num_Scopes; i++) {
		Scopes_Tabs[i]->hide();
	}
	Scopes_Tabs[0]->show();
	Help = new Fl_Button(width-150, height-30, 70, 25, "Help");
	Close = new Fl_Button(width-75, height-30, 70, 25, "Close");
	Close->callback((Fl_Callback *)close);
	Fl_Browser *o = Scopes_Tree = new Fl_Browser(5, 5, 150, height-10);
	o->indented(1);
	o->callback((Fl_Callback *)select_scope);
	for (int i = 0; i < Num_Scopes; i++) {
		add_paper(Scopes_Tree, Scopes[i].name, Fl_Image::read_xpm(0, scope_icon));
	}

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

	s->end();

	w->titlebar()->h(15);
	w->titlebar()->color(FL_BLACK);

	w->position(x, y);

	Fl::unlock();
}