Пример #1
0
int main( int argc, char **argv )
{
  Fl_Double_Window *win = new Fl_Double_Window( 100, 100, 300, 300, "Flu_Spinner_Try" );

  Flu_Spinner *c = new Flu_Spinner( 100, 30, 70, 25, "Float Spinner" );
  c->callback( update );
  //c->deactivate();

  c = new Flu_Spinner( 100, 70, 70, 25, "Int Spinner" );
  //c->editable( false );
  c->callback( update );
  c->step( 1 );
  c->range( 0, 10 );

  c = new Flu_Spinner( 100, 110, 70, 25, "X: " );
  c->callback( update );
  c->align( FL_ALIGN_INSIDE );
  c->value( 0.5f );

  c = new Flu_Spinner( 100, 150, 70, 25, "Wrap Spinner" );
  c->callback( update );
  c->wrap_range( true );
  c->step( 1 );
  c->range( 0, 10 );

  win->end();
  win->resizable( win );

  win->show();

  return( Fl::run() );
}
Пример #2
0
	void ShowModsGUI() {
		Fl_Double_Window* wind = make_mods_window();

		wind->callback([](Fl_Widget* window) {
			if(visible_callback) {
				visible_callback(false);
			}

			if(window) {
				delete (Fl_Double_Window*)window;
				mods_window = nullptr;
			}

			if(appended_ai_tree) {
				Fl_Tree_Item* first = appended_ai_tree->first();
				if(first) {
					for(int i = 0; i < first->children(); i++) {
						delete (int*)(first->child(i)->user_data());
					}
				}
				appended_ai_tree = nullptr;
			}
		});
		wind->show();

		visible_callback(true);
	}
Пример #3
0
int main() {
    Fl_Double_Window *win = new Fl_Double_Window(720,486);
    Fl_Scroll *scroll = new Fl_Scroll(10,10,win->w()-20,win->h()-20);
    scroll->box(FL_DOWN_BOX);
    {
        const int deskw = 15000;
        const int deskh = 15000;
        Fl_OpDesk *opdesk = new Fl_OpDesk(0,0,deskw,deskh);
        opdesk->begin();
        {
            printf("Creating %d boxes\n", (deskw/200)*(deskh/200));
            for ( int x=30; x<deskw; x+=200 ) {
                for ( int y=30; y<deskh; y+=200 ) {
                    char s[80];
                    sprintf(s,"Box %d/%d",x,y);
                    Fl_OpBox *opbox = new Fl_OpBox(x,y,180,120,strdup(s));
                    opbox->begin();
                    {
                        /*Fl_OpButton *a =*/ new Fl_OpButton("A", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *b =*/ new Fl_OpButton("B", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *c =*/ new Fl_OpButton("CCC", FL_OP_INPUT_BUTTON);
                        /*Fl_OpButton *d =*/ new Fl_OpButton("OUT1", FL_OP_OUTPUT_BUTTON);
                        /*Fl_OpButton *e =*/ new Fl_OpButton("OUT2", FL_OP_OUTPUT_BUTTON);
                    }
                    opbox->end();
                }
            }
        }
        opdesk->end();
    }
    scroll->end();
    win->resizable(win);
    win->show();
    return(Fl::run());
}
Пример #4
0
int main(int argc, char **argv)
{
    //Fl::get_system_colors();

	Fl::background(0xEE,0xEE,0xEE);
	Fl::background2(0xFF,0xFF,0xFF);

	Fl::scheme("gtk+");

    CrashHandlerDlg dlg;
    Fl_Double_Window* window = dlg.create_window();

    dlg.stack_output->buffer(&buffer);

#ifndef _WIN32
    std::string path = getenv("HOME");
    path += "/.neoeditor/logfile.txt";

    buffer.loadfile(path.c_str());
#else
    std::string path = getenv("APPDATA");
    path += "\\neoeditor\\logfile.txt";

    buffer.loadfile(path.c_str());
#endif
    window->show();
    return Fl::run();
}
Пример #5
0
ct_image_window::ct_image_window( ) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = image_window = new Fl_Double_Window(421, 528);
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 30, 410, 410);
      o->box(FL_PLASTIC_DOWN_FRAME);
      { ct_draw_area* o = ct_image = new ct_draw_area(10, 35, 400, 400, "label");
        o->box(FL_FLAT_BOX);
        o->color(FL_DARK3);
        o->selection_color(FL_BACKGROUND_COLOR);
        o->labeltype(FL_NORMAL_LABEL);
        o->labelfont(0);
        o->labelsize(14);
        o->labelcolor(FL_BLACK);
        o->align(FL_ALIGN_CENTER);
        o->when(FL_WHEN_RELEASE);
      }
      o->end();
    }
    { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 100, 25);
      o->box(FL_FLAT_BOX);
      o->menu(menu_);
    }
    { Fl_Value_Slider* o = WL = new Fl_Value_Slider(40, 470, 375, 20, "WL");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(-2000);
      o->maximum(7000);
      o->step(1);
      o->value(40);
      o->callback((Fl_Callback*)cb_WL);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = WW = new Fl_Value_Slider(40, 495, 375, 20, "WW");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->minimum(1);
      o->maximum(4000);
      o->step(1);
      o->value(300);
      o->callback((Fl_Callback*)cb_WW);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Value_Slider* o = Indx = new Fl_Value_Slider(40, 445, 375, 20, "Indx");
      o->type(1);
      o->box(FL_PLASTIC_THIN_DOWN_BOX);
      o->step(1);
      o->callback((Fl_Callback*)cb_Indx);
      o->align(FL_ALIGN_LEFT);
    }
    { Fl_Progress* o = progress_bar = new Fl_Progress(115, 5, 300, 20);
      o->box(FL_PLASTIC_THIN_UP_BOX);
      o->selection_color((Fl_Color)1);
      o->hide();
    }
    o->end();
  }
}
Пример #6
0
Fl_Double_Window* make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = controls = new Fl_Double_Window(255, 60, "Rotation Angle");
    w = o;
    { Fl_Value_Input* o = angle_value = new Fl_Value_Input(180, 5, 70, 25, "Angle");
      o->minimum(-65000);
      o->maximum(65000);
      o->callback((Fl_Callback*)cb_angle_value);
      o->when(FL_WHEN_ENTER_KEY);
    }
    { Fl_Roller* o = angle_roller = new Fl_Roller(5, 35, 245, 20);
      o->type(1);
      o->minimum(65000);
      o->maximum(-65000);
      o->step(0.1);
      o->callback((Fl_Callback*)cb_angle_roller);
    }
    { Fl_Button* o = new Fl_Button(70, 5, 55, 25, "next");
      o->shortcut(0x66);
      o->callback((Fl_Callback*)cb_next);
    }
    { Fl_Button* o = new Fl_Button(5, 5, 55, 25, "prev");
      o->shortcut(0x64);
      o->callback((Fl_Callback*)cb_prev);
    }
    o->end();
    o->resizable(o);
  }
  { ImageWindow* o = iw1 = new ImageWindow(100, 100);
    w = o;
    o->box(FL_FLAT_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    o->end();
  }
  { ImageWindow* o = iw2 = new ImageWindow(100, 100);
    w = o;
    o->box(FL_FLAT_BOX);
    o->color(FL_BACKGROUND_COLOR);
    o->selection_color(FL_BACKGROUND_COLOR);
    o->labeltype(FL_NO_LABEL);
    o->labelfont(0);
    o->labelsize(14);
    o->labelcolor(FL_FOREGROUND_COLOR);
    o->align(FL_ALIGN_TOP);
    o->when(FL_WHEN_RELEASE);
    o->end();
  }
  return w;
}
Пример #7
0
co_rc_t console_window_t::about()
{
	Fl_Double_Window *win = new Fl_Double_Window(400, 300);

	/* TODO: Add some text here :) */

	win->end();

	return CO_RC(OK);
}
Пример #8
0
int main(int argc, char* argv[])
{
    Fl_Double_Window *w = new Fl_Double_Window( 340, 160, "uPlayBack" );
    Fl_Group *pG = new CPlaybackWindow(0,0,340,160,"");
    w->end();


    w->resizable(pG);
    w->show(argc, argv);
    return Fl::run();
}
Пример #9
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
}
Пример #10
0
void MainWindow::Execute(void* p)
{
    Fl_Double_Window* window = new Fl_Double_Window(ALIAS_WINDOW);

    if ( window != NULL )
    {
        extern HINSTANCE fl_display;
        window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON_MAIN)));

        window->label("Automatic Upgrader WIN32");
        window->labelsize(DEFAULT_FONT_SIZE);
        window->begin();

        createComponents();

        window->end();
        window->show( _argc, _argv );
        window->callback(window_callback);

        Fl::add_timeout(0.5f, timer_cb, this);

        Fl::scheme("plastic");

        returnCode = Fl::run();
    }

    stillAlive = false;
}
Пример #11
0
int main(int argc, char **argv) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = window_main = new Fl_Double_Window(305, 135, "FLTK window");
    w = o;
    o->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE);
    input = new Fl_Input(145, 10, 150, 25, "Please enter value:");
    { Fl_Button* o = btnTest = new Fl_Button(10, 100, 100, 25, "Test");
      o->callback((Fl_Callback*)bt_callback, (void*)("test"));
    }
    { Fl_Return_Button* o = btnClose = new Fl_Return_Button(195, 100, 100, 25, "Close");
      o->callback((Fl_Callback*)bt_callback, (void*)("close"));
    }
    o->end();
  }
  w->show(argc, argv);
  return Fl::run();
}
Пример #12
0
int main( int argc, char **argv )
{
  Fl_Double_Window *win = new Fl_Double_Window( 100, 100, 300, 300, "Flu_Progress_Try" );
  Flu_Progress *p1 = new Flu_Progress( 80, 40, 150, 20, "Progress" );
  p1->value( 0.25 );
  Flu_Progress *p2 = new Flu_Progress( 80, 100, 150, 30, "Progress" );
  p2->value( 0.5 );
  Flu_Progress *p3 = new Flu_Progress( 80, 170, 150, 20, "Progress" );
  p3->value( 0.75 );
  Fl_Button *b = new Fl_Button( 130, 220, 40, 30, "Go" );
  b->callback( go );
  win->end();
  win->resizable( win );

  win->show();

  return( Fl::run() );
}
int main( int argc, char **argv )
{
  Fl_Double_Window *win = new Fl_Double_Window( 100, 100, 400, 300, "Flu_Chat_Buffer_Try" );
  Flu_Chat_Buffer *b = new Flu_Chat_Buffer( 0, 0, 400, 200 );
  Fl_Input *in = new Fl_Input( 80, 210, 100, 30, "Send:" );
  in->when( FL_WHEN_ENTER_KEY_ALWAYS );
  in->callback( sendMsg, b );
  win->end();
  win->resizable( win );

  b->addSystemMessage( "System message" );
  b->addRemoteMessage( "<Remote User> ", "Remote user's message" );
  b->addLocalMessage( "<Local User> ", "Local user's message" );

  win->show();

  return( Fl::run() );
}
Пример #14
0
int main(int argc, char **argv)
{
	Fl::background(0xEE,0xEE,0xEE);
	Fl::background2(0xFF,0xFF,0xFF);

	//Fl::get_system_colors();
    Fl::scheme("gtk+");

#ifdef WIN32
	WSADATA wsa;
	if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
	{
		cout << "WSAStartup failed: " << WSAGetLastError() << endl;
		return 1;
	}
#endif

	NeoStore dlg;
    Fl_Double_Window* window = dlg.create_window();

	RepositoryManager* repoMgr = RepositoryManager::getInstance();
	Repository mainRepo;
	mainRepo.setServer(DEFAULT_HOST);

	repoMgr->addRepository(mainRepo);
	repoMgr->updatePackageInformation();

	vector<Repository::Package> packages;
	repoMgr->getPackageList(&packages);

	for(int i = 0; i < packages.size(); i++)
	{
		Repository::Package* p = (Repository::Package*) malloc(sizeof(Repository::Package));
		new(p) Repository::Package();

		*p = packages[i];
		dlg.available_packages->add(packages[i].name.c_str(), (void*) p);
		cout << "Got package: " << packages[i].name << endl;
	}

	window->show();
    return Fl::run();
}
Пример #15
0
Fl_Double_Window* UserInterface::makeWindow() {
    // make window
    Fl_Double_Window* w = new Fl_Double_Window(180, 170);
    w->user_data((void*)(this));

    // add saw wave button
    sawWaveButton = new Fl_Light_Button(25, 25, 125, 25, "Saw &Wave");
    sawWaveButton->callback((Fl_Callback*)cb_sawWaveButton, NULL); // (void*)(userdata));

    // add midi through button
    midiThruButton = new Fl_Light_Button(25, 65, 125, 25, "Midi &Through");
    midiThruButton->callback((Fl_Callback*)cb_midiThruButton, NULL);

    // add midi to synth button
    midiSynthButton = new Fl_Light_Button(25, 105, 125, 25, "Midi to &Synth");
    midiSynthButton->callback((Fl_Callback*)cb_midiSynthButton, NULL);

    // finish
    w->end();
    return w;
}
Пример #16
0
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();
}
Пример #17
0
Файл: Module.C Проект: 0mk/non
bool
Module::show_analysis_window ( void )
{
    /* use a large window for more accuracy at low frequencies */
    nframes_t nframes = sample_rate() / 2;
    float *buf = new float[nframes];

    memset( buf, 0, sizeof(float) * nframes );
    
    buf[0] = 1;
       
    if ( ! get_impulse_response( buf, nframes ) )
    {
        // return false;
    }
    
    Fl_Double_Window *w = new Fl_Double_Window( 1000, 500 );

    {
        SpectrumView * o = new SpectrumView( 25,25, 1000 - 50, 500 - 50, label() );
        o->labelsize(10);
        o->align(FL_ALIGN_RIGHT|FL_ALIGN_TOP);
        o->sample_rate( sample_rate() );
        o->data( buf, nframes );
    }

    w->end();

    w->show();

    while ( w->shown() )
        Fl::wait();

    delete w;

    return true;
}
Пример #18
0
int main(void) {
	Fl_Double_Window* win = new Fl_Double_Window(240, 165, "SevenSeg sample");
	win->begin();
		seg = new edelib::SevenSeg(10, 10, 70, 92);
		seg->box(FL_UP_BOX);
		seg->value(0);

		counter = new Fl_Counter(95, 20, 135, 20, "value");
		counter->type(1);
		counter->step(1);
		counter->minimum(-1);
		counter->maximum(9);
		counter->align(FL_ALIGN_TOP_LEFT);
		counter->callback(change_cb);

		slider = new Fl_Value_Slider(95, 65, 135, 20, "width");
		slider->type(1);
		slider->step(1);
		slider->minimum(2);
		slider->maximum(20);
		slider->value(seg->bar_width());
		slider->align(FL_ALIGN_TOP_LEFT);
		slider->callback(slide_cb);

		color_button = new Fl_Button(205, 95, 25, 25, "color");
		color_button->align(FL_ALIGN_LEFT);
		color_button->callback(color_cb);
		color_button->color(seg->color());

		chk = new Fl_Check_Button(95, 130, 135, 25, "deactivate");
		chk->down_box(FL_DOWN_BOX);
		chk->callback(deactivate_cb);
	win->end();
	win->show();
	return Fl::run();
}
Пример #19
0
ModelerUserInterface::ModelerUserInterface() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(395, 325, "Final Project Controls");
    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, 395, 25);
      o->menu(menu_m_controlsMenuBar);
    }
    { Fl_Browser* o = m_controlsBrowser = new Fl_Browser(0, 25, 140, 300, "Controls");
      o->type(3);
      o->textsize(10);
      o->callback((Fl_Callback*)cb_m_controlsBrowser);
      Fl_Group::current()->resizable(o);
    }
    { Fl_Scroll* o = m_controlsScroll = new Fl_Scroll(145, 25, 250, 300);
      o->type(6);
      o->when(FL_WHEN_CHANGED);
      { Fl_Pack* o = m_controlsPack = new Fl_Pack(145, 25, 225, 300);
        o->end();
      }
      o->end();
    }
    o->end();
  }
  { Fl_Double_Window* o = m_modelerWindow = new Fl_Double_Window( 800, 800, "Assignment 2 Model");
    w = o;
    o->callback((Fl_Callback*)cb_m_modelerWindow, (void*)(this));
    o->when(FL_WHEN_NEVER);
    { ModelerView* o = m_modelerView = new ModelerView(0, 0, 800, 800, "ModelerView");
      o->box(FL_NO_BOX);
      o->color(FL_BACKGROUND_COLOR);
      o->selection_color(FL_BACKGROUND_COLOR);
      o->labeltype(FL_NORMAL_LABEL);
      o->labelfont(0);
      o->labelsize(14);
      o->labelcolor(FL_BLACK);
      o->align(FL_ALIGN_CENTER);
      o->when(FL_WHEN_RELEASE);
      Fl_Group::current()->resizable(o);
    }
    o->end();
  }
}
Пример #20
0
int
main ( int argc, char **argv )
{
    bool no_ui = false;

    fl_display = 0;

    printf( "%s %s %s -- %s\n", APP_TITLE, VERSION, "", COPYRIGHT );

    Thread::init();

    Thread thread( "UI" );
    thread.set();

    ensure_dirs();

    signal( SIGTERM, sigterm_handler );
    signal( SIGHUP, sigterm_handler );
    signal( SIGINT, sigterm_handler );

    Fl_Tooltip::color( FL_BLACK );
    Fl_Tooltip::textcolor( FL_YELLOW );
    Fl_Tooltip::size( 14 );
    Fl_Tooltip::hoverdelay( 0.1f );


    LOG_REGISTER_CREATE( Mixer_Strip );
    LOG_REGISTER_CREATE( Chain );
    LOG_REGISTER_CREATE( Plugin_Module );
    LOG_REGISTER_CREATE( Gain_Module );
    LOG_REGISTER_CREATE( Spatializer_Module );
    LOG_REGISTER_CREATE( Meter_Module );
    LOG_REGISTER_CREATE( JACK_Module );
    LOG_REGISTER_CREATE( Mono_Pan_Module );
    LOG_REGISTER_CREATE( Meter_Indicator_Module );
    LOG_REGISTER_CREATE( Controller_Module );
    LOG_REGISTER_CREATE( AUX_Module );
    LOG_REGISTER_CREATE( Spatialization_Console );
    LOG_REGISTER_CREATE( Group );

    signal( SIGPIPE, SIG_IGN );


    const char *osc_port = NULL;

    nsm = new NSM_Client;

    instance_name = strdup( APP_NAME );
    bool instance_override = false;

    static struct option long_options[] = 
        {
            { "help", no_argument, 0, '?' },
            { "instance", required_argument, 0, 'i' },
            { "osc-port", required_argument, 0, 'p' },
            { "no-ui", no_argument, 0, 'u' },
            { 0, 0, 0, 0 }
        };

    int option_index = 0;
    int c = 0;
    

    while ( ( c = getopt_long_only( argc, argv, "", long_options, &option_index  ) ) != -1 )
    {
        switch ( c )
        {
            case 'p':
                DMESSAGE( "Using OSC port %s", optarg );
                osc_port = optarg;
                break;
            case 'i':
                DMESSAGE( "Using OSC port %s", optarg );
                free( instance_name );
                instance_name = strdup( optarg );
                instance_override = true;
                break;
            case 'u':
                DMESSAGE( "Disabling user interface" );
                no_ui = true;
                break;
            case '?':
                printf( "\nUsage: %s [--instance instance_name] [--osc-port portnum] [path_to_project]\n\n", argv[0] );
                exit(0);
                break;
        }
    }

    {
        char *name = strdup( argv[0] );
        char *n = basename( name );

        if ( ! strcmp( n, "non-mixer-noui" ) )
            no_ui = true;
        
        free( name );
    }

    if ( ! no_ui )
    {
        Fl::visual( FL_DOUBLE | FL_RGB );
        
        Fl::visible_focus( 0 );

        fl_register_images();
    }

    Fl::lock();

    Fl_Double_Window *main_window;

    
    {
        Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, "Non Mixer" );
        {
            main_window->xclass( APP_NAME );

            { 
                Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL );
                Fl_Group::current()->resizable(o);
            }
        }
        o->end();

        o->size_range( main_window->w(), mixer->min_h(), 0, 0 );

        o->callback( (Fl_Callback*)cb_main, main_window );

        if ( ! no_ui )
        {
            o->show( 0,0 );
        }
                      
    }

    Plugin_Module::spawn_discover_thread();

    mixer->init_osc( osc_port );

    char *nsm_url = getenv( "NSM_URL" );
        
    if ( nsm_url )
    {
        if ( ! nsm->init( nsm_url ) )
        {
            if ( instance_override )
                WARNING( "--instance option is not available when running under session management, ignoring." );
                
            if ( optind < argc )
                WARNING( "Loading files from the command-line is incompatible with session management, ignoring." );

            nsm->announce( APP_NAME, ":switch:dirty:", argv[0] );

            /* if ( ! no_ui ) */
            /* { */
                // poll so we can keep OSC handlers running in the GUI thread and avoid extra sync
                Fl::add_timeout( NSM_CHECK_INTERVAL, check_nsm, NULL );
            /* } */
        }
    }
    else
    {
        if ( optind < argc )
        {
            MESSAGE( "Waiting for plugins..." );
            Plugin_Module::join_discover_thread();

            MESSAGE( "Loading \"%s\"", argv[optind] );
                
            if ( ! mixer->command_load( argv[optind] ) )
            {
                fl_alert( "Error opening project specified on commandline" );
            }
        }
    }

    Fl::add_timeout( 0.1f, check_sigterm );
    Fl::dnd_text_ops( 0 );

    if ( ! no_ui )
    {
        DMESSAGE( "Running UI..." );

        Fl::run();
    }
    else
    {
        DMESSAGE( "Not Running UI..." );
        while ( ! got_sigterm )
        {
            Fl::check();
            usleep( 200 * 1000 );
        }
    }

    delete main_window;
    main_window = NULL;

    MESSAGE( "Your fun is over" );
}
Пример #21
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();
    
}
Пример #22
0
int main (int argc, char ** argv)
{
    Fl_Double_Window *window;
    fl_register_images();
    //static Fl_GIF_Image image_img1 ("lines.gif");
    window = new Fl_Double_Window (850, 590,"RC Practice Utility v1.0");
    #ifdef WIN32
        window->icon((char*)LoadIcon(fl_display, MAKEINTRESOURCE(101)));
    #endif /*WIN32*/
    Fl_Button *But_Nxt,*But_Prev, *But_random;
    p_no = new Fl_Input(90,5,50,30);
    But_A= new Fl_Button( 430, 510, 80, 30, "A" );
    But_A->labelsize(16);
    But_A->labelfont(FL_BOLD);
    But_A->callback(Btn_A);
    But_B= new Fl_Button( 512, 510, 80, 30, "B" );
    But_B->labelsize(16);
    But_B->labelfont(FL_BOLD);
    But_B->callback(Btn_B);
    But_C= new Fl_Button( 594, 510, 80, 30, "C" );
    But_C->labelsize(16);
    But_C->labelfont(FL_BOLD);
    But_C->callback(Btn_C);
    But_D= new Fl_Button( 676, 510, 80, 30, "D" );
    But_D->labelsize(16);
    But_D->labelfont(FL_BOLD);
    But_D->callback(Btn_D);
    But_E= new Fl_Button( 758, 510, 80, 30, "E" );
    But_E->labelsize(16);
    But_E->labelfont(FL_BOLD);
    But_E->callback(Btn_E);
    info_box = new Fl_Help_View(425,510,420,50,0);
    info_box->box(FL_FLAT_BOX);
    info_box->color(FL_BACKGROUND_COLOR);
    info_box->hide();
    info_box->scrollbar_size(1);
    nxt_question= new Fl_Button( 430, 550, 160, 30, "Next Question" );
    nxt_question->deactivate();
    nxt_question->callback(Btn_nxt_question,(void*)window);
    Fl_Button *about_btn= new Fl_Button( 676, 550, 160, 30, "About" );
    about_btn->callback(Btn_about_CB,(void*)window);
    But_Nxt= new Fl_Button( 150, 4, 80, 30, "Next" );
    But_Nxt->callback((Fl_Callback*)Btn_Nxt_CB, (void*)(0));
    But_random= new Fl_Button( 240, 4, 80, 30, "Random" );
    But_random->callback((Fl_Callback*)Btn_random_CB, (void*)(0));
    But_Prev= new Fl_Button( 4, 4, 80, 30, "Previous" );
    But_Prev->callback((Fl_Callback*)Btn_Prev_CB, (void*)(0));
    clock1 = new Fl_Text_Display(425,10,350,30,0);
    clock1->box(FL_NO_BOX);
    clock1->color(FL_BACKGROUND_COLOR);
    clock1->textsize(16);
    p_no->textsize(16);
    p_no->callback((Fl_Callback*)pid_no_input_CB, (void*)(0));
    p_no->when(FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED);
    q=new Fl_Help_View(425,40,420,460,0);
    q->box(FL_THIN_DOWN_BOX);
    p=new Fl_Help_View(3,40,423,500,0);
    p->box(FL_THIN_DOWN_BOX);
    FILE *fp;
    rapidxml::xml_document<> doc;
    pid=0;
    totalq=0;
    totalp=0;
    cur_qid=0;
    cur_ans=0;
    rs=0;
    usr_ans=-1;
    enable_timer=0;
    cur_progress p(5, 550,423, 30,0);
    obj_progress = (cur_progress*)window->child(15);

    int i=strlen(argv[0]);
    for(;i>0;i--)
    {
        if(argv[0][i]=='/')
        {
            argv[0][i+1]='\0';
            break;
        }
    }
    i=i+2;
    current_path=(char*)malloc(i*sizeof(char));
    strcpy(current_path,argv[0]);
    #ifdef __APPLE__
    char *file_path=NULL;
    file_path = (char*)malloc((i+9)*sizeof(char));
    strcpy(file_path,current_path);
    strcat(file_path,"data.xml");
    rapidxml::file<> f(file_path);
    #else
    rapidxml::file<> f("data.xml");
    #endif
    //printf("Ok till this point");
    doc.parse<0>(f.data());
    node = doc.first_node("passages");
    totalp=total_psg();
    //printf("%d",totalp);

    srand (time(NULL));
    populate_psg((int)(rand() % totalp));


    //printf("PID = %s\n",get_attr_value(pid,"val"));
    //printf("P_DATA = %s\n",get_attr_value(data,"txt"));



    enable_timer=1;
    Fl::add_timeout(1, Timer_CB);              // setup a timer
    window->end ();
    window->show (argc, argv);

    return(Fl::run());
    return 0;
}
Пример #23
0
ModelerUserInterface::ModelerUserInterface() {
	// Make this instance the current one
	instance = this;

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

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

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

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

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

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

		// Contains the controls on the left
		{ leftPane = new Fl_Group(0, 25, 250, 600);
			int tabSpace = -25, controlSpace = 0;
				{ Fl_Tile* o = m_controlSplitPane = new Fl_Tile(0, 50 + tabSpace, 250, 575 - tabSpace);
					o->box(FL_FLAT_BOX);
					{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
					  o->when(FL_WHEN_CHANGED);
					  o->callback((Fl_Callback*)TreeCallback);
					  o->marginleft(-5);
					  o->end();
					}
					{ Fl_Scroll* o = m_controlsScroll =
						new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
					  o->type(Fl_Scroll::VERTICAL);
					  o->when(FL_WHEN_CHANGED);
					  { Fl_Pack* o = m_controlsPack =
						  new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
						Fl_Group::current()->resizable(o);
						o->spacing(2);
						o->end();
					  }
					  o->end();
					}
					o->end();
				} // end Modeler group/tab
			leftPane->end();
		} // left pane
		{ // TODO: remove this extra brace!
			{ Fl_Group* o = m_viewPane = new Fl_Group(250, 25, 550, 600);
				o->box(FL_NO_BOX);
				o->color(FL_BACKGROUND_COLOR);
				m_modelerView = new ModelerView(250, 25, 550, 600, "");
				w->resizable(m_modelerView);
				o->end();
				Fl_Group::current()->resizable(o);
			}
		}
		o->end();
	}
}
int main( int argc, char **argv )
{
  //FL_NORMAL_SIZE = 12;
  Fl_Double_Window *win = new Fl_Double_Window( 500, 460, "Flu_Tree_Browser_Try" );

  tree = new Flu_Tree_Browser( 200, 0, 300, 460 );
  tree->box( FL_DOWN_BOX );
  tree->allow_dnd( true );
  //tree->when( FL_WHEN_RELEASE );
  tree->callback( tree_callback );
  //tree->color( FL_GRAY );

  Fl_Group *g = new Fl_Group( 0, 0, 200, 460 );
  g->resizable( NULL );

  showConnectors = new Fl_Check_Button( 10, 10, 140, 20, "Show Connectors" );
  showConnectors->value( tree->show_connectors() );
  showConnectors->callback( callback, 0 );

  showRoot = new Fl_Check_Button( 10, 30, 100, 20, "Show Root" );
  showRoot->value( tree->show_root() );
  showRoot->callback( callback, 0 );

  rootAlwaysOpen = new Fl_Check_Button( 10, 50, 140, 20, "Root Always Open" );
  rootAlwaysOpen->value( tree->get_root()->always_open() );
  rootAlwaysOpen->callback( callback, 0 );

  showLeaves = new Fl_Check_Button( 10, 70, 110, 20, "Show Leaves" );
  showLeaves->value( tree->show_leaves() );
  showLeaves->callback( callback, 0 );

  showBranches = new Fl_Check_Button( 10, 90, 120, 20, "Show Branches" );
  showBranches->value( tree->show_branches() );
  showBranches->callback( callback, 0 );

  openOnSelect = new Fl_Check_Button( 10, 110, 130, 20, "Open On Select" );
  openOnSelect->value( tree->open_on_select() );
  openOnSelect->callback( callback, 0 );

  active = new Fl_Check_Button( 10, 130, 100, 20, "Active" );
  active->value( tree->active() );
  active->callback( callback, 0 );

  animate = new Fl_Check_Button( 10, 150, 100, 20, "Animate" );
  animate->value( tree->animate() );
  animate->callback( callback, 0 );

  collapseTime = new Fl_Float_Input( 55, 170, 50, 20, "Time" );
  {
    char buf[32]; sprintf( buf, "%.2f", tree->collapse_time() );
    collapseTime->value( buf );
  }
  collapseTime->callback( callback, 0 );
  collapseTime->deactivate();

  frameRate = new Fl_Float_Input( 140, 170, 50, 20, "FPS" );
  {
    char buf[32]; sprintf( buf, "%.2f", tree->frame_rate() );
    frameRate->value( buf );
  }
  frameRate->callback( callback, 0 );
  frameRate->deactivate();

  shaded = new Fl_Check_Button( 10, 190, 130, 20, "Shaded Entries" );
  shaded->value( 0 );
  shaded->callback( callback, 0 );

  shadedEvenColor = new Fl_Button( 70, 210, 20, 20, "Even" );
  shadedEvenColor->align( FL_ALIGN_LEFT );
  shadedEvenColor->color( FL_LIGHT2 );
  shadedEvenColor->callback( shadedColorCB );
  shadedEvenColor->deactivate();

  shadedOddColor = new Fl_Button( 150, 210, 20, 20, "Odd" );
  shadedOddColor->align( FL_ALIGN_LEFT );
  shadedOddColor->color( FL_WHITE );
  shadedOddColor->callback( shadedColorCB );
  shadedOddColor->deactivate();

  selectionMode = new Fl_Choice( 110, 235, 85, 25, "Selection Mode" );
  selectionMode->add( "NO_SELECT" );
  selectionMode->add( "SINGLE_SELECT" );
  selectionMode->add( "MULTI_SELECT" );
  selectionMode->value( 2 );
  selectionMode->callback( mode_callback, 0 );

  selectionDragMode = new Fl_Choice( 110, 265, 85, 25, "Selection Drag" );
  selectionDragMode->add( "DRAG_IGNORE" );
  selectionDragMode->add( "DRAG_TO_SELECT" );
  if( tree->have_dnd() )
    selectionDragMode->add( "DRAG_TO_MOVE" );
  selectionDragMode->value( 1 );
  selectionDragMode->callback( mode_callback, 0 );

  insertionMode = new Fl_Choice( 110, 295, 85, 25, "Insertion Mode" );
  insertionMode->add( "INSERT_FRONT" );
  insertionMode->add( "INSERT_BACK" );
  insertionMode->add( "INSERT_SORTED" );
  insertionMode->add( "INSERT_SORTED_REVERSE" );
  insertionMode->value( 2 );
  insertionMode->callback( mode_callback, 0 );

  hGap = new Fl_Counter( 105, 325, 90, 20, "Horizontal Gap" );
  hGap->type( FL_SIMPLE_COUNTER );
  hGap->align( FL_ALIGN_LEFT );
  hGap->precision( 0 );
  hGap->range( 0, 20 );
  hGap->value( tree->horizontal_gap() );
  hGap->callback( callback, 0 );

  vGap = new Fl_Counter( 105, 350, 90, 20, "Vertical Gap" );
  vGap->type( FL_SIMPLE_COUNTER );
  vGap->align( FL_ALIGN_LEFT );
  vGap->precision( 0 );
  vGap->range( 0, 20 );
  vGap->value( tree->vertical_gap() );
  vGap->callback( callback, 0 );

  wGap = new Fl_Counter( 105, 375, 90, 20, "Widget Gap" );
  wGap->type( FL_SIMPLE_COUNTER );
  wGap->align( FL_ALIGN_LEFT );
  wGap->precision( 0 );
  wGap->range( 0, 20 );
  wGap->value( tree->widget_gap() );
  wGap->callback( callback, 0 );

  if( tree->have_dnd() )
    newNode = new Fl_Input( 50, 400, 50, 20, "New" );

  rebuildTree = new Fl_Button( 10, 405, 120, 20, "Rebuild Tree" );
  rebuildTree->callback( rebuildTreeCB, NULL );

  deleteNode = new Fl_Button( 10, 430, 120, 20, "Delete Selected" );
  deleteNode->callback( deleteNodeCB, NULL );

  g->end();

  win->end();
  win->resizable( tree );
  win->show( argc, argv );

  makeTree();

  //Fl::dnd_text_ops( 1 );

  printf( "sizeof(Flu_Tree_Browser::Node): %d\n", sizeof(Flu_Tree_Browser::Node) );

  return( Fl::run() );
}
Пример #25
0
	Fl_Double_Window* make_mods_window() {
		if(mods_window != nullptr) {
			delete (Fl_Double_Window*)mods_window;
			mods_window = nullptr;
		}

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

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

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

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


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

		mods_window = w;

		return w;
	}
Пример #26
0
Fl_Double_Window* make_window() {
  Fl_Double_Window* w;
   {Fl_Double_Window* o = new Fl_Double_Window(560, 489);
    w = o;
    o->type(241);
     {Fl_Box* o = imbox = new Fl_Box(5, 30, 385, 455);
      o->box(FL_ENGRAVED_BOX);
      o->align(FL_ALIGN_CLIP);
      Fl_Group::current()->resizable(o);
    }
     {Fl_Box* o = filename_box = new Fl_Box(5, 5, 385, 20, "No file loaded...");
      o->box(FL_THIN_DOWN_BOX);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
    }
     {Fl_Group* o = new Fl_Group(395, 5, 160, 480);
      o->box(FL_THIN_DOWN_BOX);
       {Fl_Button* o = new Fl_Button(10, 10, 140, 25, "Load File");
        o->box(FL_THIN_UP_BOX);
        o->callback((Fl_Callback*)cb_Load);
      }
       {Fl_Button* o = new Fl_Button(10, 40, 140, 25, "Exit");
        o->box(FL_THIN_UP_BOX);
        o->callback((Fl_Callback*)cb_Exit);
      }
      new Fl_Divider(10, 75, 140, 15, "label");
       {Fl_Button* o = new Fl_Button(10, 100, 140, 25, "Fit To Box");
        o->type(Fl_Button::TOGGLE);
        o->box(FL_THIN_UP_BOX);
        o->callback((Fl_Callback*)cb_Fit);
      }
       {Fl_Button* o = new Fl_Button(10, 130, 140, 25, "Tile");
        o->type(Fl_Button::TOGGLE);
        o->box(FL_THIN_UP_BOX);
        o->callback((Fl_Callback*)cb_Tile);
      }
       {Fl_Choice* o = filter_choice = new Fl_Choice(10, 335, 140, 25, "Filter:"); o->begin();
        o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
        o->tooltip("Choose filter");
         {Fl_Item* o = new Fl_Item("None");
          o->user_data((void*)(0));
        }
         {Fl_Item* o = new Fl_Item("Brightness");
          o->user_data((void*)(FILTER_BRIGHTNESS));
        }
         {Fl_Item* o = new Fl_Item("Contrast");
          o->user_data((void*)(FILTER_CONTRAST));
        }
         {Fl_Item* o = new Fl_Item("Grayscale");
          o->user_data((void*)(FILTER_GRAYSCALE));
        }
         {Fl_Item* o = new Fl_Item("Gamma");
          o->user_data((void*)(FILTER_GAMMA));
        }
         {Fl_Item* o = new Fl_Item("Fore Blend");
          o->user_data((void*)(FILTER_FOREBLEND));
        }
         {Fl_Item* o = new Fl_Item("Back Blend");
          o->user_data((void*)(FILTER_BACKBLEND));
        }
        o->end();
      }
       {Fl_Box* o = new Fl_Box(10, 160, 140, 160);
        o->parent()->resizable(o);
      }
       {Fl_Value_Slider* o = Rslider = new Fl_Value_Slider(25, 380, 125, 15, "R");
        o->type(Fl_Value_Slider::HORIZONTAL);
        o->label_size(10);
        o->text_size(10);
        o->minimum(-3);
        o->maximum(3);
        o->value(1);
        o->slider_size(5);
        o->align(FL_ALIGN_LEFT);
        o->tooltip("Red value for filter");
      }
       {Fl_Value_Slider* o = Gslider = new Fl_Value_Slider(25, 400, 125, 15, "G");
        o->type(Fl_Value_Slider::HORIZONTAL);
        o->label_size(10);
        o->text_size(10);
        o->minimum(-3);
        o->maximum(3);
        o->value(1);
        o->slider_size(5);
        o->align(FL_ALIGN_LEFT);
        o->tooltip("Green value for filter");
      }
       {Fl_Value_Slider* o = Bslider = new Fl_Value_Slider(25, 420, 125, 15, "B");
        o->type(Fl_Value_Slider::HORIZONTAL);
        o->label_size(10);
        o->text_size(10);
        o->minimum(-3);
        o->maximum(3);
        o->value(1);
        o->slider_size(5);
        o->align(FL_ALIGN_LEFT);
        o->tooltip("Blue value for filter");
      }
       {Fl_Button* o = new Fl_Button(10, 445, 140, 25, "Apply");
        o->box(FL_THIN_UP_BOX);
        o->callback((Fl_Callback*)cb_Apply);
        o->tooltip("Apply current selected filter");
      }
       {Fl_Check_Button* o = lock = new Fl_Check_Button(10, 365, 140, 15, "Lock sliders");
        o->label_size(10);
        o->callback((Fl_Callback*)cb_lock);
        o->tooltip("Lock slider, RGB values taken from R slider ");
      }
      o->end();
    }
    o->end();
  }
  return  w;
}
Пример #27
0
Fl_Double_Window* UserInterface::make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_mainWindow = new Fl_Double_Window(797, 595, "Mesh viewer");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(0, 22, 125, 506, "Camera controls");
      o->box(FL_ENGRAVED_BOX);
      { Fl_Slider* o = m_sldZoom = new Fl_Slider(16, 29, 95, 25, "Zoom");
        o->tooltip("Zoom camera in and out");
        o->type(1);
        o->minimum(0.0001);
        o->maximum(0.999);
        o->step(0.01);
        o->value(0.5);
        o->slider_size(0.040404);
        o->callback((Fl_Callback*)cb_m_sldZoom);
      }
      { Fl_Roller* o = m_rolRotAmt = new Fl_Roller(45, 333, 75, 20, "Rot. ");
        o->tooltip("Set rotation amount for key (j,k,i,m,r,R)");
        o->type(1);
        o->value(0.2);
        o->callback((Fl_Callback*)cb_m_rolRotAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Dial* o = m_dialSpin = new Fl_Dial(74, 91, 31, 30, "Spin");
        o->tooltip("Spin camera");
        o->step(0.05);
        o->callback((Fl_Callback*)cb_m_dialSpin);
      }
      { Fl_Adjuster* o = m_adjXTrans = new Fl_Adjuster(5, 223, 105, 17, "Move horiz");
        o->tooltip("Pan left/right");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjXTrans);
      }
      { Fl_Adjuster* o = m_adjYTrans = new Fl_Adjuster(5, 257, 105, 17, "Move vertical");
        o->tooltip("Camera up/down");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjYTrans);
      }
      { Fl_Adjuster* o = m_adjInOut = new Fl_Adjuster(5, 296, 105, 17, "In/Out");
        o->tooltip("Move camera in and out");
        o->minimum(-5);
        o->maximum(5);
        o->callback((Fl_Callback*)cb_m_adjInOut);
      }
      { Fl_Roller* o = m_rolTransAmt = new Fl_Roller(45, 358, 75, 15, "Trans.");
        o->tooltip("Change translation amount");
        o->type(1);
        o->maximum(10);
        o->value(0.1);
        o->callback((Fl_Callback*)cb_m_rolTransAmt);
        o->align(FL_ALIGN_LEFT);
      }
      { Fl_Button* o = new Fl_Button(24, 378, 65, 25, "Reset");
        o->tooltip("Reset camera");
        o->callback((Fl_Callback*)cb_Reset);
      }
      { Fl_Roller* o = m_rolUpDown = new Fl_Roller(15, 68, 20, 70, "Up/down");
        o->tooltip("Rotate the camera up/down");
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolUpDown);
      }
      { Fl_Roller* o = m_rolLeftRight = new Fl_Roller(16, 158, 85, 20, "Rot left/rignt");
        o->tooltip("Rotate left to right");
        o->type(1);
        o->minimum(-1);
        o->step(0.01);
        o->callback((Fl_Callback*)cb_m_rolLeftRight);
      }
      { Fl_Button* o = new Fl_Button(5, 194, 35, 25, "Zero");
        o->tooltip("Zero trans sliders");
        o->callback((Fl_Callback*)cb_Zero);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 462, 20, 25, "IBar");
        o->down_box(FL_DOWN_BOX);
        o->value(1);
        o->callback((Fl_Callback*)cb_IBar);
      }
      { Fl_Check_Button* o = new Fl_Check_Button(0, 483, 25, 20, "Center obj");
        o->down_box(FL_DOWN_BOX);
        o->callback((Fl_Callback*)cb_Center);
      }
      o->end();
    }
    { JofGTIBar* o = m_view = new JofGTIBar(135, 3, 560, 557);
      Fl_Group::current()->resizable(o);
    }
    o->end();
  }
  return w;
}
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;
}
Пример #29
0
parameter_window::parameter_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = param_window = new Fl_Double_Window(391, 105, "Open Slice Parameter");
    w = o;
    o->user_data((void*)(this));
    { Fl_Value_Input* o = width = new Fl_Value_Input(55, 10, 50, 25, "X size :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(1000);
      o->value(512);
      o->when(FL_WHEN_RELEASE);
    }
    { Fl_Value_Input* o = height = new Fl_Value_Input(55, 40, 50, 25, "Y size :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(1000);
      o->value(512);
    }
    { Fl_Value_Input* o = depth = new Fl_Value_Input(55, 70, 50, 25, "Z size :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(1000);
      o->value(400);
    }
    { Fl_Value_Input* o = sizeX = new Fl_Value_Input(170, 10, 50, 25, "Real X :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(100);
      o->value(0.625);
    }
    { Fl_Value_Input* o = sizeY = new Fl_Value_Input(170, 40, 50, 25, "Real Y :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(100);
      o->value(0.625);
    }
    { Fl_Value_Input* o = sizeZ = new Fl_Value_Input(170, 70, 50, 25, "Real Z :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->maximum(100);
      o->value(1);
    }
    { Fl_Value_Input* o = offset = new Fl_Value_Input(315, 10, 65, 25, "CT offset :");
      o->labeltype(FL_ENGRAVED_LABEL);
      o->labelfont(8);
      o->minimum(-2000);
      o->maximum(7999);
    }
    { Fl_Return_Button* o = OK = new Fl_Return_Button(235, 60, 70, 35, "OK");
      o->labelsize(16);
      o->callback((Fl_Callback*)cb_OK);
    }
    { Fl_Button* o = Cancel = new Fl_Button(310, 60, 70, 35, "Cancel");
      o->labelsize(16);
      o->callback((Fl_Callback*)cb_Cancel);
    }
    o->set_modal();
    o->end();
  }
  val = -1;
}
Fl_Double_Window* IntersectionInterface::make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = m_intersectionWindow = new Fl_Double_Window(420, 265, "Intersection UI");
    w = o;
    o->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(5, 25, 145, 30);
      o->end();
    }
    { Fl_Choice* o = m_iShapeType = new Fl_Choice(5, 25, 145, 30, "Object type");
      o->down_box(FL_BORDER_BOX);
      o->align(FL_ALIGN_TOP_LEFT);
      o->menu(menu_m_iShapeType);
    }
    { Fl_Value_Slider* o = m_dXAt = new Fl_Value_Slider(5, 75, 200, 25, "At x pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dXAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dYAt = new Fl_Value_Slider(5, 115, 200, 25, "At y pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dYAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dZAt = new Fl_Value_Slider(5, 155, 200, 25, "At z pos");
      o->type(5);
      o->minimum(-1.5);
      o->maximum(1.5);
      o->callback((Fl_Callback*)cb_m_dZAt);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dTheta = new Fl_Value_Slider(5, 195, 200, 25, "Vec theta");
      o->type(5);
      o->maximum(360);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dTheta);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dPhi = new Fl_Value_Slider(5, 235, 200, 25, "Vec phi");
      o->type(5);
      o->minimum(-90);
      o->maximum(90);
      o->step(1);
      o->value(45);
      o->callback((Fl_Callback*)cb_m_dPhi);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Button* o = new Fl_Button(330, 25, 85, 25, "Write test");
      o->callback((Fl_Callback*)cb_Write);
    }
    { Fl_Value_Slider* o = m_dXRot = new Fl_Value_Slider(215, 75, 200, 25, "View rotation");
      o->type(5);
      o->maximum(360);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dXRot);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Value_Slider* o = m_dYRot = new Fl_Value_Slider(215, 115, 200, 25, "View height");
      o->type(5);
      o->minimum(-90);
      o->maximum(90);
      o->step(1);
      o->callback((Fl_Callback*)cb_m_dYRot);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Check_Button* o = m_bGrid = new Fl_Check_Button(215, 155, 25, 25, "Show grid");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bGrid);
    }
    { Fl_Check_Button* o = m_bRay = new Fl_Check_Button(215, 195, 25, 25, "Show ray");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bRay);
    }
    { Fl_Check_Button* o = m_bRayShadow = new Fl_Check_Button(215, 235, 25, 25, "Show ray shadow");
      o->down_box(FL_DOWN_BOX);
      o->value(1);
      o->callback((Fl_Callback*)cb_m_bRayShadow);
    }
    m_iSeed = new Fl_Value_Input(240, 30, 85, 20, "Seed");
    o->end();
    o->resizable(o);
  }
  return w;
}