Ejemplo n.º 1
0
int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(400,350);

  int y = 10;
  input[0] = new Fl_Input(70,y,300,23,"Normal:"); y += 27;
  input[0]->tooltip("Normal input field");
  // input[0]->cursor_color(FL_SELECTION_COLOR);
  //  input[0]->maximum_size(20);
  // input[0]->static_value("this is a testgarbage");
  input[1] = new Fl_Float_Input(70,y,300,23,"Float:"); y += 27;
  input[1]->tooltip("Input field for floating-point number");
  input[2] = new Fl_Int_Input(70,y,300,23,"Int:"); y += 27;
  input[2]->tooltip("Input field for integer number");
  input[3] = new Fl_Secret_Input(70,y,300,23,"Secret:"); y += 27;
  input[3]->tooltip("Input field for password");
  input[4] = new Fl_Wordwrap_Input(70,y,300,100,"Wordwrap:"); y += 105;
  input[4]->tooltip("Input field for short text with newlines");

  for (int i = 0; i < 4; i++) {
    input[i]->when(0); input[i]->callback(cb);
  }
  int y1 = y;

  Fl_Button *b;
  b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&CHANGED");
  b->tooltip("Do callback each time the text changes");
  b->callback(toggle_cb, FL_WHEN_CHANGED); y += 23;
  b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&RELEASE");
  b->callback(toggle_cb, FL_WHEN_RELEASE); y += 23;
  b->tooltip("Do callback when widget loses focus");
  b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&ENTER_KEY");
  b->callback(toggle_cb, FL_WHEN_ENTER_KEY); y += 23;
  b->tooltip("Do callback when user hits Enter key");
  b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&NOT_CHANGED");
  b->callback(toggle_cb, FL_WHEN_NOT_CHANGED); y += 23;
  b->tooltip("Do callback even if the text is not changed");
  y += 5;
  b = new Fl_Button(10,y,200,23,"&print changed()");
  b->callback(button_cb);
  b->tooltip("Print widgets that have changed() flag set");

  b = new Fl_Button(220,y1,100,23,"color"); y1 += 23;
  b->color(input[0]->color()); b->callback(color_cb, (void*)0);
  b->label_color(fl_contrast(FL_BLACK,b->color()));
  b->tooltip("Color behind the text");
  b = new Fl_Button(220,y1,100,23,"selection_color"); y1 += 23;
  b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1);
  b->label_color(fl_contrast(FL_BLACK,b->color()));
  b->tooltip("Color behind selected text");
  b = new Fl_Button(220,y1,100,23,"text_color"); y1 += 23;
  b->color(input[0]->text_color()); b->callback(color_cb, (void*)2);
  b->label_color(fl_contrast(FL_BLACK,b->color()));
  b->tooltip("Color of the text");

  window->resizable(window);
  window->end();
  window->show(argc,argv);
// CET - FIXME - crashes windows  Fl::lock();
  return Fl::run();
}
Ejemplo n.º 2
0
void butt_cb(Fl_Widget *butt, void *data)
{
	// Deactivate the button
	butt->deactivate();                        // prevent button from being pressed again
	Fl::check();                               // give fltk some cpu to gray out button
	// Make the progress bar
	Fl_Window *w = (Fl_Window*)data;           // access parent window
	w->begin();                                // add progress bar to it..
	Fl_Progress *progress = new Fl_Progress(10,50,200,30);

	progress->minimum(0);                      // set progress range to be 0.0 ~ 1.0
	progress->maximum(1);
	progress->color(0x88888800);               // background color
	progress->selection_color(0x4444ff00);     // progress bar color
	progress->labelcolor(FL_WHITE);            // percent text color
	w->end();                                  // end adding to window
	// Computation loop..

	for ( int t=1; t<=500; t++ )
	{
		progress->value(t/500.0);              // update progress bar with 0.0 ~ 1.0 value
		char percent[10];
		sprintf(percent, "%d%%", int((t/500.0)*100.0));
		progress->label(percent);              // update progress bar's label
		Fl::check();                           // give fltk some cpu to update the screen
		Sleep(1000);                          // 'your stuff' that's compute intensive
	}

	// Cleanup
	w->remove(progress);                       // remove progress bar from window
	delete(progress);                          // deallocate it
	butt->activate();                          // reactivate button
	w->redraw();                               // tell window to redraw now that progress removed
}
Ejemplo n.º 3
0
/*
  Initial creation of ui components.
*/
void SelectorGUI::create(){
  Fl_Window *window = new Fl_Window(400,460,"Stream Selector");
  x = 80;
  y = 10;
  char* participantList[100];
  test = "this is a member";
   
  window->size_range(400, 400, 600, 600);

  // Scroll window containing participants
  swindow = new Fl_Scroll(0, y, 400, 380);
  Fl_Group* o = new Fl_Group(x, y, 380, 280);
  o->box(FL_THIN_UP_FRAME);
  
  // Add buttons to scroll window
  update();
  
  // Apply and close button.
  y = 400;
  x = 150; 
  Fl_Button *applyButton = new Fl_Button(150, y, 60, 40, "Refresh");
  Fl_Button *closeButton = new Fl_Button(x + 70, y, 60, 40, "Close");
  
  // Callbacks.
  applyButton->callback(static_applyCB, this);
  closeButton->callback(static_closeCB, this);
  
  window->end();
  window->show();
    
 
  // For some reason, the idle callback causes a segfault.
  //Fl::add_idle(static_idleCB);
}
Ejemplo n.º 4
0
int main() {
	srand(time(NULL)); // initialize random
    fl_register_images();
	Fl_Window* win = new KitchenFloor();
	win->show();
    return(Fl::run());
}
Ejemplo n.º 5
0
int main()
{


Fl_Window* w = new Fl_Window(width,height);


Widgets widgets;
w->begin();
widgets.img[0] = new Fl_JPEG_Image("f1.jpg");
widgets.img[1] = new Fl_JPEG_Image("f2.jpg");
widgets.img[2] = new Fl_JPEG_Image("f3.jpg");
widgets.box = new Fl_Box(100,100,100,100);
Fl_Button* button = new Fl_Button(300,400,50,30,"CHANGE");
w->end();


button->callback(button_clicked,&widgets);


w->show();

return(Fl::run());
 
}
Ejemplo n.º 6
0
int main(int argc, char **argv) {
 Fl_Window *w;
 {Fl_Window* o = new Fl_Window(365, 525);
  w = o;
  scroll = new Fl_Scroll(10,10,345,285);
  {Fl_Pack* o = new Fl_Pack(10, 10, 345, 285);
   pack = o;
   o->box(FL_DOWN_BOX);
   //o->box(FL_ENGRAVED_FRAME);
   (void) new Fl_Button(35, 35, 25, 25, "b1");
   (void) new Fl_Button(45, 45, 25, 25, "b2");
   (void) new Fl_Button(55, 55, 25, 25, "b3");
   (void) new Fl_Button(65, 65, 25, 25, "b4");
   (void) new Fl_Button(75, 75, 25, 25, "b5");
   (void) new Fl_Button(85, 85, 25, 25, "b6");
   (void) new Fl_Button(95, 95, 25, 25, "b7");
   (void) new Fl_Button(105, 105, 25, 25, "b8");
   (void) new Fl_Button(115, 115, 25, 25, "b9");
   (void) new Fl_Button(125, 125, 25, 25, "b10");
   (void) new Fl_Button(135, 135, 25, 25, "b11");
   (void) new Fl_Button(145, 145, 25, 25, "b12");
   (void) new Fl_Button(155, 155, 25, 25, "b13");
   (void) new Fl_Button(165, 165, 25, 25, "b14");
   (void) new Fl_Button(175, 175, 25, 25, "b15");
   (void) new Fl_Button(185, 185, 25, 25, "b16");
   (void) new Fl_Button(195, 195, 25, 25, "b17");
   (void) new Fl_Button(205, 205, 25, 25, "b18");
   (void) new Fl_Button(215, 215, 25, 25, "b19");
   (void) new Fl_Button(225, 225, 25, 25, "b20");
   (void) new Fl_Button(235, 235, 25, 25, "b21");
   (void) new Fl_Button(245, 245, 25, 25, "b22");
   (void) new Fl_Button(255, 255, 25, 25, "b23");
   (void) new Fl_Button(265, 265, 25, 25, "b24");
   o->end();
   w->resizable(o);
  }
  scroll->end();
  {Fl_Light_Button* o = new Fl_Light_Button(10, 325, 175, 25, "HORIZONTAL");
   o->type(FL_RADIO_BUTTON);
   o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::HORIZONTAL));
  }
  {Fl_Light_Button* o = new Fl_Light_Button(10, 350, 175, 25, "VERTICAL");
   o->type(FL_RADIO_BUTTON);
   o->value(1);
   o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::VERTICAL));
  }
  {Fl_Value_Slider* o = new Fl_Value_Slider(50,375, 295,25,"spacing:");
   o->clear_flag(FL_ALIGN_MASK);
   o->set_flag(FL_ALIGN_LEFT);
   o->type(Fl_Slider::HORIZONTAL);
   o->range(0,30);
   o->step(1);
   o->callback((Fl_Callback*)spacing_cb);
  }
  w->end();
 }
 w->show(argc, argv);
 return Fl::run();
}
Ejemplo n.º 7
0
void _Fl_Overlay::create()
{
    Fl_X::create(this, fl_overlay_visual, fl_overlay_colormap, int(fl_transparent_pixel));
    // find the outermost window to tell wm about the colormap:
    Fl_Window *w = window();
    for (;;) {Fl_Window *w1 = w->window(); if (!w1) break; w = w1;}
    XSetWMColormapWindows(fl_display, fl_xid(w), &(Fl_X::i(this)->xid), 1);
}
Ejemplo n.º 8
0
Archivo: Mixer.C Proyecto: imv/non
void
Mixer::redraw_windows ( void )
{
    window()->redraw();

    if ( Fl::first_window() )
        for ( Fl_Window *w = Fl::first_window(); ( w = Fl::next_window( w ) ); )
            w->redraw();
}
Ejemplo n.º 9
0
int main()
{
	Fl_Window *window = new Fl_Window (12*tilesize,12*tilesize,"DEMO");
	window->color(56);
	Board *b = new Board(0,0,12*tilesize,12*tilesize,70); 
	window->end(); 
   	window->show();
   	return(Fl::run());
}
Ejemplo n.º 10
0
void close_cb(Fl_Widget*, void* w)
{
	Fl_Window* win = (Fl_Window*)w;
	conf_global->set_section("Tips");
	conf_global->write("Show", !show_check->value()); 
	conf_global->flush(); 

	win->hide();
}
Ejemplo n.º 11
0
void os_specific_set_app_icon()
{
    Fl_Window* window = window_main_get_instance();

    fl_open_display();
    Pixmap p;
    XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), const_cast<char**>(icon_xpm), &p, &mask, NULL);
    window->icon((char*)p);
}
Ejemplo n.º 12
0
int main(int argc, char **argv) 
{
	Fl_Window *window = new Fl_Window(WINDOW_WIDTH, WINDOW_HEIGHT);
	ClockWidget *clock = new ClockWidget();
	window->end();
	window->show(argc, argv);
	Fl::add_timeout(INTERVAL, update, clock);
	return Fl::run();
}
Ejemplo n.º 13
0
static void winCB( Fl_Widget* w, void* p )
{
    Fl_Window* fdw = (Fl_Window*)w;

    if ( fdw != NULL )
    {
        fdw->hide();
    }
}
Ejemplo n.º 14
0
Fl_Window* make_about_panel(const char *copyright) {
  Fl_Window* w;
   {Fl_Window* o = about_panel = new Fl_Window(330, 276, _("About eFluid"));
    w = o;
    o->type(240);
    o->selection_color((Fl_Color)47);
    o->shortcut(0xff1b);
     {Fl_Group* o = display_group = new Fl_Group(0, 0, 330, 240);
       {Fl_Group* o = new Fl_Group(5, 5, 320, 55, _("eFluid"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(40);
        o->align(FL_ALIGN_INSIDE);
        o->end();
      }
       {Fl_Button* o = new Fl_Button(5, 165, 320, 70, _("\302\251""2002-2003\nClick here for more information"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->highlight_color((Fl_Color)0x9d9da700);
        o->highlight_label_color((Fl_Color)55);
        o->label_size(14);
        o->callback((Fl_Callback*)cb_2002);
        o->align(FL_ALIGN_WRAP);
      }
       {Fl_Box* o = new Fl_Box(5, 60, 320, 105, _("EFLTK User Interface Designer\nVersion 2.0.3"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(18);
      }
      o->end();
    }
     {Fl_Box* o = copyright_box = new Fl_Box(0, 0, 330, 240);
      o->label_size(10);
      o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP);
      o->hide();
      o->label(copyright);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(5, 245, 320, 25, _("OK"));
      o->label_size(10);
      o->shortcut(0xff0d);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
  return  w;
}
Ejemplo n.º 15
0
int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(300,180);
  Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!");
  box->labelfont(FL_BOLD+FL_ITALIC);
  box->labelsize(36);
  box->labeltype(FL_SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return Fl::run();
}
Ejemplo n.º 16
0
int main() {
	Fl_Window* win = new Fl_Window(290, 180, "Icon chooser test");
	win->begin();
	Fl_Box* ibox = image_box = new Fl_Box(80, 10, 135, 110);
	ibox->box(FL_THIN_DOWN_BOX);
	Fl_Button* run = new Fl_Button(95, 145, 90, 25, "&Run");
	run->callback(run_cb);
	Fl_Button* close = new Fl_Button(190, 145, 90, 25, "&Close");
	close->callback(close_cb, win);
	win->end();
	win->show();
	return  Fl::run();
}
				void Init() {

					cWindow = new Fl_Window(400, 420, 300, 70, "Connect to Host");
					bInput = new Fl_Input(50, 0, 150, 30, "Host: ");
					checkbx = new Fl_Check_Button(50, 40, 100, 14, " Scaling");
					checkbx->align(FL_ALIGN_LEFT);
					checkbx->callback(setscale, this);
					connectbtn = new Fl_Button(200, 0, 80, 30, "Connect");
					connectbtn->callback(try_connect_frm, this);
					cWindow->end();
					cWindow->show();

				}
Ejemplo n.º 18
0
int main(int argc, char ** argv) {
  Fl_Window *window = new Fl_Window(420,660);
  box = new Fl_Box(10,25,400,100,".0");
  box->box(FL_DOWN_BOX);
  box->labelsize(36);
  Fl_Button *b1 = new Fl_Button(10, 250, 100, 100, "1");
  b1->callback(b1cb,0);
  Fl_Button *b2 = new Fl_Button(110, 250, 100, 100, "2");
  b2->callback(b2cb,0);
  Fl_Button *b3 = new Fl_Button(210, 250, 100, 100, "3");
  b3->callback(b3cb,0);
  Fl_Button *b4 = new Fl_Button(10, 350, 100, 100, "4");
  b4->callback(b4cb,0);
  Fl_Button *b5 = new Fl_Button(110, 350, 100, 100, "5");
  b5->callback(b5cb,0);
  Fl_Button *b6 = new Fl_Button(210, 350, 100, 100, "6");
  b6->callback(b6cb,0);
  Fl_Button *b7 = new Fl_Button(10, 450, 100, 100, "7");
  b7->callback(b7cb,0);
  Fl_Button *b8 = new Fl_Button(110, 450, 100, 100, "8");
  b8->callback(b8cb,0);
  Fl_Button *b9 = new Fl_Button(210, 450, 100, 100, "9");
  b9->callback(b9cb,0);
  Fl_Button *b0 = new Fl_Button(10, 550, 100, 100, "0");
  b0->callback(b0cb,0);
  Fl_Button *bsqrt = new Fl_Button(10, 150, 100, 100, "sqrt");
  bsqrt->callback(bsqrtcb,0);
  Fl_Button *bexp = new Fl_Button(110, 150, 100, 100, "exp");
  bexp->callback(bexpcb,0);
  Fl_Button *bres = new Fl_Button(210, 150, 100, 100, "reset");
  bres->callback(brescb,0);
  Fl_Button *bplus = new Fl_Button(310, 150, 100, 100, "+");
  bplus->callback(bpluscb,0);
  Fl_Button *bmin = new Fl_Button(310, 250, 100, 100, "-");
  bmin->callback(bmincb,0);
  Fl_Button *bmul = new Fl_Button(310, 350, 100, 100, "X");
  bmul->callback(bmulcb,0);
  Fl_Button *bdiv = new Fl_Button(310, 450, 100, 100, "/");
  bdiv->callback(bdivcb,0);
  Fl_Button *bentr = new Fl_Button(310, 550, 100, 100, "enter");
  bentr->callback(bentrcb,0);
  Fl_Button *bdp = new Fl_Button(210, 550, 100, 100, "drop");
  bdp->callback(bdpcb,0);
  Fl_Button *bpm = new Fl_Button(110, 550, 100, 50, "+/-");
  bpm->callback(bpmcb,0);
  Fl_Button *bdec = new Fl_Button(110, 600, 100, 50, ".");
  bdec->callback(bdeccb,0);
  window->end();
  window->show(argc,argv);
  return Fl::run();
}
Ejemplo n.º 19
0
HelpPageUI::HelpPageUI() {
  Fl_Window* w;
  { Fl_Window* o = mainWindow = new Fl_Window(390, 366, "About my image filter :)");
    w = o;
    o->user_data((void*)(this));
    { Fl_Output* o = helpText = new Fl_Output(0, 25, 390, 305, "     How to ...");
      o->type(4);
      o->align(FL_ALIGN_TOP_LEFT);
    }
    { Fl_Button* o = new Fl_Button(130, 335, 135, 25, "OK");
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
}
Ejemplo n.º 20
0
void gdAlert(const char *c) {
	Fl_Window *modal = new Fl_Window(
			(Fl::w() / 2) - 150,
			(Fl::h() / 2) - 47,
			300, 90, "Alert");
	modal->set_modal();
	modal->begin();
		gBox *box = new gBox(10, 10, 280, 40, c);
		gClick *b = new gClick(210, 60, 80, 20, "Close");
	modal->end();
	box->labelsize(GUI_FONT_SIZE_BASE);
	b->callback(__cb_window_closer, (void *)modal);
	b->shortcut(FL_Enter);
	gu_setFavicon(modal);
	modal->show();
}
Ejemplo n.º 21
0
//-----------------------------------------------------------------------------
void NrmDlg::create_dlg()
{
	Fl_Menu_Item k[]={{"x"}, {"y"}, { "z"}, {0}};
	wnd = new Fl_Double_Window(135, 215);
	min = new Fl_Value_Input(10, 25, 115, 25, mgl_gettext("Minimal value (v1)"));
	min->align(FL_ALIGN_TOP_LEFT);
	min->tooltip(mgl_gettext("Minimal value for resulting data values"));
	max = new Fl_Value_Input(10, 70, 115, 25, mgl_gettext("Maximal value (v2)"));
	max->align(FL_ALIGN_TOP_LEFT);
	max->tooltip(mgl_gettext("Maximal value for resulting data values"));
	dir = new Fl_Choice(10, 115, 115, 25, mgl_gettext("Direction"));
	dir->align(FL_ALIGN_TOP_LEFT);	dir->copy(k);
	dir->tooltip(mgl_gettext("Direction along which data will be filled"));
	sym = new Fl_Check_Button(10, 115, 115, 25, mgl_gettext("Symetrical range"));
	sym->tooltip(mgl_gettext("Normalize in symmetrical range: -max(|v1|,|v2|) ... max(|v1|,|v2|)"));

	Fl_Button *o;
	o = new Fl_Button(25, 150, 85, 25, mgl_gettext("Cancel"));	o->callback(close_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Do nothing and close this window"));
	o = new Fl_Return_Button(25, 180, 85, 25, mgl_gettext("Change"));o->callback(nrm_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Change data values and close this window"));
	wnd->end();
}
Ejemplo n.º 22
0
int main(int argc, char *argv[]) {
  fl_init_images_lib();
  Fl_Window *w = make_window();
  w->show();
  
  if(argc>1)
  {
  	char *f = argv[1];
      image = Fl_Image::read(f);
      filename_box->label(f);
      filename_box->redraw();
      apply_cur_effect();
    }
  
  return Fl::run();
}
Ejemplo n.º 23
0
ImgFilterUI::ImgFilterUI() {
  Fl_Window* w;
  { Fl_Window* o = mainWindow = new Fl_Window(445, 439, "Intelligent Scissor UI");
    w = o;
    o->user_data((void*)(this));
    mouseInfo = new Fl_Output(92, 411, 353, 28, "mouse status:");
    { Fl_Menu_Bar* o = mainMenu = new Fl_Menu_Bar(0, 0, 444, 28, "mainMenu");
      o->menu(menu_mainMenu);
    }
    { ImgView* o = imgView = new ImgView(0, 32, 444, 376);
      o->box(FL_DOWN_BOX);
	  //revised by JHC
	  w->focus(imgView);
    }
    o->end();
  }
}
Ejemplo n.º 24
0
/*--------------------------------------------------------------------*/
int 
MessageBox (char* message) 
{   
	int w=320, h=200;
                                              
  Fl_Window window (w,h);                                                   

  Fl_Box box(FL_BORDER_BOX, 30,20, w-60,h-10-60, message);  
	box.color(FL_CYAN);

/*   Fl_Button    cancel( 60, h-40, 80, 25, "cancel");                                  */
  Fl_Return_Button ok (w/2-40, h-40, 80, 25, "OK");                                 
	ok.color (FL_CYAN);

	window.color (FL_BLUE);
  window.hotspot(&/* cancel */ok); // you must position modal windows                 
  window.end();                                                               
  window.set_modal();                                                         
  window.label("MessageBox");                                                              
  window.show();                                                              

  for (;;) {                                                                  
    Fl::wait();                                                               
    Fl_Widget *o;                                                             

    while ((o = Fl::readqueue())) {                                           
      if (o == &ok)                                                          
        return 1;                                                             
      else                             
        return 0;                                                             
    }                                                                         
  }                                                                           

}                                                                             
Ejemplo n.º 25
0
int run_main (int argc, ACE_TCHAR *argv[])
{
  ACE_START_TEST (ACE_TEXT ("FlReactor_Test"));

  Fl_Window window (300, 370);

  Test_Window tw (10, 75, window.w () - 20, window.h ()-90);
  window.resizable (&tw);

  Fl_Hor_Slider slider (60, 5, window.w () - 70, 30, "Sides:");
  slider.align (FL_ALIGN_LEFT);
  slider.callback (sides_cb, &tw);
  slider.value (tw.sides ());
  slider.step (1);
  slider.bounds (3, 10);

  ACE_FlReactor reactor;
  ACE_Reactor r (&reactor);

  Fl_Box *box = new Fl_Box (FL_UP_BOX, 10, 40,
                            window.w () - 20, 30,
                            "Setting up");
  box->labelfont (FL_BOLD);

  Acceptor acceptor (&tw, box);

  ACE_INET_Addr address;

  if (acceptor.open (address, &r) == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "%p\n",
                       "open acceptor"),
                      -1);

  acceptor.acceptor ().get_local_addr (address);

  const int bufsiz = 128;
  char buf[bufsiz];

  address.addr_to_string (buf, bufsiz, 0);

  char msg[2 * bufsiz];
  ACE_OS::sprintf (msg, "Listening on <%s>\n", buf);

  box->label (msg);
  box->redraw ();

  window.end ();
  window.show (argc, argv);
  tw.show ();

  return Fl::run ();

  ACE_END_TEST;
}
Ejemplo n.º 26
0
int main(int argc, char **argv)
{
    Fl_Window *window = new Fl_Window(20,20,300,180);

    //Set type to DIALOG
    window->window_type(Fl_WM::DIALOG);

    window->begin();
    Fl_Box *box = new Fl_Box(20,40,260,100,"Hello World");
    box->box(FL_UP_BOX);
    box->label_font(FL_HELVETICA_BOLD_ITALIC);
    box->label_size(36);
    box->label_type(FL_SHADOW_LABEL);
    window->end();
    window->show(argc, argv);

    return Fl::run();
}
Ejemplo n.º 27
0
static int xevent_handler(int id) {
	if(fl_xevent->type != ClientMessage)
		goto done;

	if(fl_xevent->xclient.message_type != _XA_EDELIB_FOREIGN_CALLBACK)
		goto done;

	for(Fl_Window *win = Fl::first_window(); win; win = Fl::next_window(win)) {
		if(win->type() < FL_WINDOW)
			continue;

		do_callback_by_id(win, fl_xevent->xclient.data.l[0]);
	}

done:
	/* allow events could be processed again if user installs own handler */
	return 0;
}
Ejemplo n.º 28
0
void Fl_Popup_ListView::cb_clicked(Fl_Widget *w, void *d) {
    Fl_Popup_ListView *plw = (Fl_Popup_ListView *)w->parent();
    Fl_Window *win = w->window();
    if (!win) return;

    if (win->shown()) {
        if (Fl::event_button()<=3) {
            win->set_value();
            win->hide();
        }
    } else {
        if (Fl::event() == FL_DATA_CHANGE && plw->m_masterWidget) {
            //puts("Combobox data changed");
            plw->m_masterWidget->do_callback();
            return;
        }
    }
}
Ejemplo n.º 29
0
svmUI::svmUI() {
    Fl_Window* w;
    {   Fl_Window* o = mainWindow = new Fl_Window(864, 687, "Single View Metrology User Interface");
        w = o;
        o->user_data((void*)(this));
        mouseInfo = new Fl_Output(92, 659, 772, 28, "mouse status:");
        {   Fl_Menu_Bar* o = mainMenu = new Fl_Menu_Bar(0, 0, 864, 28);
            o->menu(menu_mainMenu);
        }
        {   ImgView* o = imgView = new ImgView(0, 29, 864, 628);
            o->box(FL_DOWN_BOX);
            //w->focus(imgView); // dch
        }
        o->end();
    }
    imgView->svmui = this;
    mainWindow->resizable(imgView);
}
Ejemplo n.º 30
0
BrushConfigUI::BrushConfigUI() {
  Fl_Window* w;
  { Fl_Window* o = mainWindow = new Fl_Window(234, 116, "Brush Property");
    w = o;
    o->user_data((void*)(this));
    /*{ Fl_Group* o = new Fl_Group(5, 25, 120, 55, "Brush Type:");
      o->box(FL_ENGRAVED_FRAME);
      { Fl_Round_Button* o = round = new Fl_Round_Button(9, 30, 111, 25, "Round Brush");
        o->type(102);
        o->down_box(FL_ROUND_DOWN_BOX);
        o->callback((Fl_Callback*)cb_round);
      }
      { Fl_Check_Button* o = square = new Fl_Check_Button(6, 50, 111, 28, "Square Brush");
        o->type(102);
        o->down_box(FL_DIAMOND_DOWN_BOX);
        o->callback((Fl_Callback*)cb_square);
      }
      o->end();
    }*/
    { Fl_Value_Slider* o = brushSize = new Fl_Value_Slider(70, 25, 90, 20, "Brush Size:");
      o->type(1);
      o->maximum(20);
      o->step(1);
      o->value(10);
      o->callback((Fl_Callback*)cb_brushSize);
      o->align(FL_ALIGN_TOP);
      o->when(FL_WHEN_RELEASE);
    }
    { Fl_Value_Slider* o = brushOpacity = new Fl_Value_Slider(70, 60, 90, 19, "Brush Opacity:");
      o->type(1);
      o->value(1);
      o->callback((Fl_Callback*)cb_brushOpacity);
      o->align(FL_ALIGN_TOP);
      o->when(FL_WHEN_RELEASE);
    }
    { Fl_Button* o = new Fl_Button(5, 90, 107, 25, "Clean All");
      o->callback((Fl_Callback*)cb_Clean);
    }
    { Fl_Button* o = new Fl_Button(128, 90, 102, 25, "Close");
      o->callback((Fl_Callback*)cb_Close);
    }
    o->end();
  }
}