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 }
/*--------------------------------------------------------------------*/ 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; } } }
/* 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); }
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()); }
int gdConfirmWin(const char *title, const char *msg) { Fl_Window *win = new Fl_Window( (Fl::w() / 2) - 150, (Fl::h() / 2) - 47, 300, 90, title); win->set_modal(); win->begin(); new gBox(10, 10, 280, 40, msg); gClick *ok = new gClick(212, 62, 80, 20, "Ok"); gClick *ko = new gClick(124, 62, 80, 20, "Cancel"); win->end(); ok->shortcut(FL_Enter); gu_setFavicon(win); win->show(); /* no callbacks here. readqueue() check the event stack. */ int r = 0; while (true) { Fl_Widget *o = Fl::readqueue(); if (!o) Fl::wait(); else if (o == ok) {r = 1; break;} else if (o == ko) {r = 0; break;} } //delete win; win->hide(); return r; }
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(); }
//----------------------------------------------------------------------------- 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(); }
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(); }
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()); }
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(); }
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; }
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(); }
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; }
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(); }
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(); }
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(); } }
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(); }
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(); } }
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); }
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(); }
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(); } }
//----------------------------------------------------------------------------- void NwdtDlg::create_dlg() { Fl_Menu_Item k[]={{mgl_gettext("Summation of")}, {mgl_gettext("Maximum of")}, { mgl_gettext("Minimum of")}, {0}}; wnd = new Fl_Double_Window(165, 215, mgl_gettext("Extract data")); kind = new Fl_Choice(10, 25, 145, 25, mgl_gettext("Type of operation")); kind->align(FL_ALIGN_TOP_LEFT); kind->copy(k); dx = new Fl_Check_Button(10, 55, 140, 25, mgl_gettext("apply in x direction")); dy = new Fl_Check_Button(10, 80, 140, 25, mgl_gettext("apply in y direction")); dz = new Fl_Check_Button(10, 105, 140, 25, mgl_gettext("apply in z direction")); name = new Fl_Input(10, 145, 145, 25, mgl_gettext("Name for output")); name->align(FL_ALIGN_TOP_LEFT); Fl_Button *o; o = new Fl_Button(10, 180, 65, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o = new Fl_Return_Button(90, 180, 65, 25, mgl_gettext("Do"));o->callback(chng_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); wnd->end(); }
int main(int argc, char **argv) { Fl_Window *window = new Fl_Window(340,180,"世界へようこそ!"); Fl_Box *box = new Fl_Box(20,40,300,100,"ようこそ、世界!"); Fl::set_font(FL_HELVETICA, "Kochi Mincho"); window->begin(); // Fl_Widget(x, y, width, height, label) //box->box(FL_UP_BOX); box->box(FL_NO_BOX); box->labelsize(36); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show(argc, argv); return Fl::run(); }
int main(int argc, char** argv) { temp = argc; temp2 = argv; //All the FLTK controls Fl_Window win (500,500, "window"); //Title Box Fl_Box title(-5,-5,510,50,"Teapot Finder!"); title.box(FL_UP_BOX); title.labelsize(36); title.labelfont(FL_BOLD+FL_ITALIC); //Description section Fl_Multiline_Output desc(0,45,500,250,""); desc.value( " Welcome to Teapot Finder. This is a maze game, find the spinning teapot!\n\nControls:\n\t~Drag the mouse along the x axis (side to side) to control the camera.\n\t~Use the arrow keys to navigate the maze\n\t~Click the right mouse button for a bird's eye view\n\nSetup:\n\t~Choose the level of difficulty on the slider below (5=easy, 20=hard).\n\t Then, choose your player!\n\nDescription:\n\t~In this game you must navigate through a maze and find the spinning\n\t teapot. But be aware! Every time you find the teapot, it changes\n\t location and maze regenerates! Find the teapot 5 times to win!"); //Maze size slider, still getting a seg fault if never moved Fl_Value_Slider sizeSlider (100,300,300,50,"Maze Size (Must Slide To Prevent Seg Fault)"); sizeSlider.type(FL_HORIZONTAL); sizeSlider.value(5); sizeSlider.minimum(5); sizeSlider.maximum(20); sizeSlider.step(1); sizeSlider.callback(sizeCB); //Buttons for different player shapes Fl_Button sphereButton (50,400,120,25,"Super Sphere"); sphereButton.callback (sphereCB); Fl_Button cubeButton (200, 400, 120, 25, "Courageous Cube"); cubeButton.callback (cubeCB); Fl_Button donughtButton (350, 400, 120, 25, "Doughnut!"); donughtButton.callback (donughtCB); win.end(); win.show(); return Fl::run(); return 0; }
int main(int argc, char *argv[]) { Fl_Window *window = new Fl_Window (800,700,"TETRIS"); window->color(56); Board *b = new Board(); Fl_Box *scorebox = new Fl_Box(tilesize*xmaxtiles+10,50,300,200,"Score: 0\0"); scorebox->box(FL_UP_BOX); scorebox->labelfont(FL_BOLD+FL_ITALIC); scorebox->labelsize(36); scorebox->labeltype(FL_ENGRAVED_LABEL); b->setScoreBox(&scorebox); Fl_Box *exi = new Fl_Box(tilesize*2,ymaxtiles*15,300,200,"Press Escape to Exit"); exi->box(FL_UP_BOX); exi->labelfont(FL_BOLD+FL_ITALIC); exi->labelsize(36); exi->labeltype(FL_ENGRAVED_LABEL); window->end(); window->show(); Fl::add_timeout(0.1, timeractions,b); return(Fl::run()); }
//----------------------------------------------------------------------------- void ChngDlg::create_dlg() { Fl_Menu_Item k[]={{mgl_gettext("Smooth")}, {mgl_gettext("CumSum")}, { mgl_gettext("Integrate")}, { mgl_gettext("Difference")}, { mgl_gettext("Double diff.")}, { mgl_gettext("Swap parts")}, {0}}; Fl_Menu_Item t[]={{mgl_gettext("Linear *3")}, {mgl_gettext("Linear *5")}, {mgl_gettext("Parabolic *5")},{0}}; wnd = new Fl_Double_Window(165, 215, mgl_gettext("Change data")); kind = new Fl_Choice(10, 25, 145, 25, mgl_gettext("Type of operation")); kind->align(FL_ALIGN_TOP_LEFT); kind->copy(k); dx = new Fl_Check_Button(10, 55, 140, 25, mgl_gettext("apply in x direction")); dy = new Fl_Check_Button(10, 80, 140, 25, mgl_gettext("apply in y direction")); dz = new Fl_Check_Button(10, 105, 140, 25, mgl_gettext("apply in z direction")); type = new Fl_Choice(10, 145, 145, 25, mgl_gettext("Type of smoothing")); type->align(FL_ALIGN_TOP_LEFT); type->copy(t); Fl_Button *o; o = new Fl_Button(10, 180, 65, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); o = new Fl_Return_Button(90, 180, 65, 25, mgl_gettext("Do"));o->callback(chng_dlg_cb,wnd); o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX); wnd->end(); }
Elements(){ window = new Fl_Window(WINDOW_W,WINDOW_H,WINDOW_TITLE); window->begin(); button = new Fl_Button (LABEL_SPACE,MARGIN,BUTTON_W,ELEMENT_H,"OK"); input = new Fl_Input (LABEL_SPACE,2*MARGIN+ELEMENT_H,TEXT_W,ELEMENT_H,"In:"); output = new Fl_Output (LABEL_SPACE,3*MARGIN+2*ELEMENT_H,TEXT_W,ELEMENT_H,"Out:"); window->end(); button ->labelfont(FL_HELVETICA); input ->labelfont(FL_HELVETICA); output ->labelfont(FL_HELVETICA); button ->labelsize(TEXT_S); input ->labelsize(TEXT_S); output ->labelsize(TEXT_S); button ->box(FL_UP_BOX); input ->box(FL_DOWN_BOX); output ->box(FL_DOWN_BOX); }
//----------------------------------------------------------------------------- void CropDlg::create_dlg() { wnd = new Fl_Double_Window(230, 155, mgl_gettext("Crop data")); x1 = new Fl_Input(45, 25, 80, 25, mgl_gettext("Lower bound")); x1->align(FL_ALIGN_TOP); x2 = new Fl_Input(140, 25, 80, 25, mgl_gettext("Upper bound")); x2->align(FL_ALIGN_TOP); y1 = new Fl_Input(45, 55, 80, 25); y2 = new Fl_Input(140, 55, 80, 25); z1 = new Fl_Input(45, 85, 80, 25); z2 = new Fl_Input(140, 85, 80, 25); new Fl_Box(15, 25, 25, 25, "X"); new Fl_Box(15, 55, 25, 25, "Y"); new Fl_Box(15, 85, 25, 25, "Z"); Fl_Button *o; o = new Fl_Button(45, 120, 75, 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(145, 120, 75, 25, mgl_gettext("Crop")); o->callback(crop_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(); }
//----------------------------------------------------------------------------- void TrspDlg::create_dlg() { wnd = new Fl_Double_Window(220, 170, mgl_gettext("Transpose data")); Fl_Group *g = new Fl_Group(10, 30, 200, 90, mgl_gettext("Select new order of dimensions")); g->box(FL_DOWN_BOX); yxz = new Fl_Round_Button(20, 40, 75, 25, "y - x - z"); yxz->callback(trsp_rad_cb,this); zyx = new Fl_Round_Button(20, 65, 75, 25, "z - y - x"); zyx->callback(trsp_rad_cb,this); zxy = new Fl_Round_Button(20, 90, 75, 25, "z - x - y"); zxy->callback(trsp_rad_cb,this); yzx = new Fl_Round_Button(100, 40, 75, 25, "y - z - x");yzx->callback(trsp_rad_cb,this); xzy = new Fl_Round_Button(100, 65, 75, 25, "x - z - y");xzy->callback(trsp_rad_cb,this); xyz = new Fl_Round_Button(100, 90, 75, 25, "x - y - z");xyz->callback(trsp_rad_cb,this); g->end(); Fl_Button *o; o = new Fl_Button(25, 130, 75, 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(125, 130, 75, 25, mgl_gettext("Do")); o->callback(trsp_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(); }