def create_form_fontsform(self): fdui = FD_fontsform() fdui.pfontsform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 371, 296) pobj = xfl.fl_add_box(xfl.FL_FLAT_BOX, 0, 0, 371, 296, "") xfl.fl_set_object_color(pobj, xfl.FL_SLATEBLUE, xfl.FL_COL1) fdui.pfontobj = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, 10, 145, \ 195, 135, "") xfl.fl_set_object_lalign(fdui.pfontobj, \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_BOTTOM)) xfl.fl_set_object_callback(fdui.pfontobj, self.style_cb, 0) fdui.psizeobj = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, 215, 145, \ 145, 135, "") xfl.fl_set_object_lalign(fdui.psizeobj, \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_BOTTOM)) xfl.fl_set_object_callback(fdui.psizeobj, self.size_cb, 0) fdui.ptextobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 10, 5, 351, \ 125, "The quick brown\nfox jumps over\nthe lazy dog.") xfl.fl_set_object_boxtype(fdui.ptextobj, xfl.FL_FRAME_BOX) xfl.fl_set_object_lalign(fdui.ptextobj, xfl.FL_ALIGN_CENTER) pobj = xfl.fl_add_button(xfl.FL_HIDDEN_BUTTON, 0, 0, 370, 140, \ "Button") xfl.fl_set_button_shortcut(pobj, "^[qQ", 1) xfl.fl_set_object_callback(pobj, self.done_cb, 0) xfl.fl_end_form() return fdui
def create_form_fbform(): fdui = FD_fbform() fdui.vdata = fdui.cdata = None fdui.ldata = 0 fdui.fbform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 371, 361) pobj = xfl.fl_add_box( xfl.FL_UP_BOX, 0, 0, 371, 361, "") fdui.browser = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 20, 50, \ 240, 290, "") xfl.fl_set_object_color(fdui.browser, xfl.FL_COL1, xfl.FL_YELLOW) pobj = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 270, 50, 70, \ 25, "AlphaSort") xfl.fl_set_object_callback(pobj, sort_method_cb, xfl.FL_ALPHASORT) xfl.fl_set_button(pobj, 1) pobj = xfl.fl_add_checkbutton( xfl.FL_RADIO_BUTTON, 270, 85, 70, \ 25, "SizeSort") xfl.fl_set_object_callback(pobj, sort_method_cb, xfl.FL_SIZESORT) pobj = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 270, 120, 70, \ 25, "TimeSort") xfl.fl_set_object_callback(pobj, sort_method_cb, xfl.FL_MTIMESORT) pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 275, 310, 75, 25, \ "Done") xfl.fl_set_object_lalign(pobj, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_callback(pobj, done_cb, 0) fdui.total = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 10, 15, 220, \ 30, "") xfl.fl_set_object_boxtype(fdui.total, xfl.FL_NO_BOX) xfl.fl_end_form() return fdui
def create_form_form0(self): fdui = FD_form0() fdui.form0 = xfl.fl_bgn_form(xfl.FL_NO_BOX, 321, 276) pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 321, 276, "") fdui.pobj[0] = xfl.fl_add_valslider(xfl.FL_HOR_SLIDER, 12, 55, \ 138, 22, "") xfl.fl_set_object_lalign(fdui.pobj[0], \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_BOTTOM)) xfl.fl_set_object_callback(fdui.pobj[0], self.return_cb, 0) xfl.fl_set_object_return(fdui.pobj[0], xfl.FL_RETURN_CHANGED) fdui.pobj[1] = xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 12, 85, \ 138, 22, "") xfl.fl_set_object_lalign(fdui.pobj[1], \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_BOTTOM)) xfl.fl_set_object_callback(fdui.pobj[1], self.return_cb, 1) fdui.pobj[2] = xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 12, 150, \ 138, 25, "") xfl.fl_set_object_callback(fdui.pobj[2], self.return_cb, 2) fdui.br = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 170, 55, \ 140, 160, "") fdui.pobj[3] = xfl.fl_add_input(xfl.FL_INT_INPUT, 12, 187, \ 138, 25, "") xfl.fl_set_object_lalign(fdui.pobj[3], \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_LEFT)) xfl.fl_set_object_callback(fdui.pobj[3], self.return_cb, 3) fdui.when = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 40, 12, \ 240, 27, "") xfl.fl_set_object_callback(fdui.when, self.when_cb, 0) pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 170, 239, \ 80, 25, "Done") pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 70, 239, \ 80, 25, "ResetLog") xfl.fl_set_object_callback(pobj, self.resetlog_cb, 0) xfl.fl_end_form() return fdui
def create_forms(self): self.sample = xfl.fl_bgn_form(xfl.FL_NO_BOX, 320, 250) self.ptrflobj0 = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 320, 250, '') xfl.fl_set_object_color(self.ptrflobj0, xfl.FL_COL1, xfl.FL_COL1) xfl.fl_set_object_lalign(self.ptrflobj0, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(self.ptrflobj0, xfl.FL_NORMAL_STYLE) xfl.fl_set_object_lsize(self.ptrflobj0, xfl.FL_DEFAULT_SIZE) xfl.fl_set_object_lcol(self.ptrflobj0, xfl.FL_BLACK) xfl.fl_set_object_resize(self.ptrflobj0, xfl.FL_RESIZE_ALL) xfl.fl_set_object_gravity(self.ptrflobj0, xfl.FL_NoGravity, xfl.FL_NoGravity) self.pbrowser = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 20, 40, 280, 160, 'My Browser with\na lot of text') xfl.fl_set_object_boxtype(self.pbrowser, xfl.FL_DOWN_BOX) xfl.fl_set_browser_hscrollbar(self.pbrowser, xfl.FL_ON) xfl.fl_set_browser_vscrollbar(self.pbrowser, xfl.FL_ON) xfl.fl_set_object_color(self.pbrowser, xfl.FL_WHITE, xfl.FL_YELLOW) xfl.fl_set_object_lalign(self.pbrowser, xfl.FL_ALIGN_BOTTOM) xfl.fl_set_object_lstyle(self.pbrowser, xfl.FL_NORMAL_STYLE) xfl.fl_set_object_lsize(self.pbrowser, xfl.FL_DEFAULT_SIZE) xfl.fl_set_object_lcol(self.pbrowser, xfl.FL_BLACK) xfl.fl_set_object_resize(self.pbrowser, xfl.FL_RESIZE_ALL) xfl.fl_set_object_gravity(self.pbrowser, xfl.FL_NoGravity, xfl.FL_NoGravity) xfl.fl_set_object_shortcut(self.pbrowser, 'l', 1) xfl.fl_set_object_callback(self.pbrowser, self.browsercb, 33) xfl.fl_set_object_return(self.pbrowser, xfl.FL_RETURN_END_CHANGED|xfl.FL_RETURN_SELECTION|xfl.FL_RETURN_DESELECTION) xfl.fl_end_form()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 130, 100) self.pbr = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 5, 5, 95, 90, \ "") pbut = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 105, 5, 20, 8, \ "Exit") pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 105, 75, 20, 8, \ "Load") xfl.fl_set_object_callback(pobj, self.load_file, 0) pobj = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 105, 60, 20, 8, \ "Small") xfl.fl_set_object_callback(pobj, self.set_size, xfl.FL_SMALL_SIZE) xfl.fl_call_object_callback(pobj) xfl.fl_set_button(pobj, 1) pobj = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 105, 50, 20, 8, \ "Normal") xfl.fl_set_object_callback(pobj, self.set_size, xfl.FL_NORMAL_SIZE) pobj = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 105, 40, 20, 8, \ "Large") xfl.fl_set_object_callback(pobj, self.set_size, xfl.FL_LARGE_SIZE) xfl.fl_end_form() xfl.fl_scale_form(pform, 4.0, 4.0) xfl.fl_adjust_form_size(pform) xfl.fl_clear_browser(self.pbr) xfl.fl_add_browser_line(self.pbr, "LOAD A FILE.") xfl.fl_show_form(pform, xfl.FL_PLACE_FREE, xfl.FL_FULLBORDER, \ "Browser") while True: pobj = xfl.fl_do_forms() if xfl.fl_is_same_object(pobj, pbut): break xfl.fl_hide_form(pform) xfl.fl_finish()
def create_form(self): self.pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 390, 420) self.pbrowserobj = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, \ 20, 20, 210, 330, "") xfl.fl_set_object_dblbuffer(self.pbrowserobj, 1) self.pinputobj = xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 20, 370, \ 210, 30, "") xfl.fl_set_object_return(self.pinputobj, xfl.FL_RETURN_CHANGED) self.pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 20, \ 120, 30, "Add") xfl.fl_set_object_callback(self.pobj, self.addit, 0) self.pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 60, \ 120, 30, "Insert") xfl.fl_set_object_callback(self.pobj, self.insertit, 0) self.pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 100, \ 120, 30, "Replace") xfl.fl_set_object_callback(self.pobj, self.replaceit, 0) self.pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 160, \ 120, 30, "Delete") xfl.fl_set_object_callback(self.pobj, self.deleteit, 0) self.pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 200, \ 120, 30, "Clear") xfl.fl_set_object_callback(self.pobj, self.clearit, 0) self.pexitobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 250, 370, \ 120, 30, "Exit") #xfl.fl_set_object_callback(self.pexitobj, self.exitcb, 0) xfl.fl_end_form()
def create_form_canvasform(self): fdui = FD_canvasform() fdui.canvasform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 450, 280) xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 450, 280, "") fdui.canvas = xfl.fl_add_canvas(xfl.FL_NORMAL_CANVAS, 20, 40, \ 155, 187, "") xfl.fl_set_object_color(fdui.canvas, xfl.FL_BLACK, xfl.FL_COL1) fdui.br = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 188, 40, \ 152, 187, "") pobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 103, 10, 150, 20, \ "Canvas Events") xfl.fl_set_object_lsize(pobj, xfl.FL_MEDIUM_SIZE) xfl.fl_set_object_lalign(pobj, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj, xfl.FL_BOLD_STYLE) fdui.keyboard = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 345, 40, \ 76, 26, "Keyboard") xfl.fl_set_object_color(fdui.keyboard, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_set_object_callback(fdui.keyboard, self.sensitive_setting, \ xfl.KeyPress) fdui.mouse = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 345, 70, 76, 26, \ "Buttons") xfl.fl_set_object_color(fdui.mouse, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_set_object_callback(fdui.mouse, self.sensitive_setting, \ xfl.ButtonPress) fdui.move = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 345, 100, 74, 26, \ "Movements") xfl.fl_set_object_color(fdui.move, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_set_object_callback(fdui.move, self.sensitive_setting, \ xfl.MotionNotify) fdui.misc = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 345, 130, \ 74, 26, "Enter\nLeave") xfl.fl_set_object_color(fdui.misc, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_set_object_callback(fdui.misc, self.sensitive_setting, \ xfl.EnterNotify) pobj = xfl.fl_add_button(xfl.FL_PUSH_BUTTON, 30, 240, 90, 27, "Deactivate") xfl.fl_set_object_callback(pobj, self.disable_it, 0) pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 130, 240, 90, 27, \ "Hide canvas") xfl.fl_set_object_callback(pobj, self.hide_it, 0) pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 230, 240, 90, 27, "Clear") xfl.fl_set_object_callback(pobj, self.clear_list, 0) xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 330, 240, 90, 27, "Done") xfl.fl_end_form() return fdui
def create_form_choiceform(self): fdui = FD_choiceform() fdui.choiceform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 431, 211) pobj = xfl.fl_add_box(xfl.FL_FLAT_BOX, 0, 0, 431, 211, "") fdui.pulldown = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 45, 36, 45, 21, "Menu") xfl.fl_set_object_color(fdui.pulldown, xfl.FL_COL1, xfl.FL_LEFT_BCOL) xfl.fl_set_object_lstyle(fdui.pulldown, xfl.FL_BOLD_STYLE) fdui.choice = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 24, 93, 111, 27, "") fdui.browser = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, 257, 14, 154, 179, "") xfl.fl_set_object_color(fdui.browser, xfl.FL_COL1, xfl.FL_YELLOW) fdui.pushmenu = xfl.fl_add_nmenu(xfl.FL_BUTTON_NMENU, 152, 51, 75, 26, "Menu") xfl.fl_set_object_boxtype(fdui.pushmenu, xfl.FL_UP_BOX) xfl.fl_set_object_lstyle(fdui.pushmenu, xfl.FL_BOLD_STYLE) xfl.fl_end_form() return fdui
def create_form(self): x = 20 dx = 80 dy = 28 pform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 590, 610) pobj1 = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 590, 610, "") self.pbr = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 20, 20, \ 550, 530, "") xfl.fl_set_object_boxtype(self.pbr, xfl.FL_EMBOSSED_BOX) pobj1 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, x, 565, \ dx-5, dy, "Load") xfl.fl_set_object_callback(pobj1, self.load_file, 0) x += dx pobj2 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, x, 565, \ dx, dy, "Tiny") xfl.fl_set_object_callback(pobj2, self.set_size, \ xfl.FL_TINY_SIZE) x += dx pobj3 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, x , 565, \ dx, dy, "Small") xfl.fl_set_object_callback(pobj3, self.set_size, xfl.FL_SMALL_SIZE) xfl.fl_set_button(pobj3, xfl.FL_SMALL_SIZE == xfl.FL_BROWSER_FONTSIZE) x += dx pobj4 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, x , 565, \ dx, dy, "Normal") xfl.fl_set_object_callback(pobj4, self.set_size, xfl.FL_NORMAL_SIZE) xfl.fl_set_button(pobj4, xfl.FL_NORMAL_SIZE == \ xfl.FL_BROWSER_FONTSIZE) x += dx pobj5 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, x , 565, \ dx, dy, "Large") xfl.fl_set_object_callback(pobj5, self.set_size, xfl.FL_LARGE_SIZE) x += dx pobj6 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, x, 565, \ dx, dy, "Hide/Show") xfl.fl_set_object_callback(pobj6, self.hide_show, 0) x += dx pobj7 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, x, 565, dx, dy, \ "Exit") #60->dx xfl.fl_set_object_callback(pobj7, self.exit_program, 0) xfl.fl_end_form() xfl.fl_adjust_form_size(pform) return pform
def test_fl_add_browser(self): """fl_add_browser(browsertype, xpos, ypos, width, height, label)""" xfl.fl_add_browser(77.1234, )
def create_form_objsform(): fdui = FD_objsform() fdui.objsform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 456, 361) xfl.fl_add_box(xfl.FL_FLAT_BOX, 0, 0, 456, 361, "") xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 455, 360, "") xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 456, 70, "") fdui.button[0] = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 15, 20, 75, \ 30, "Static") xfl.fl_set_object_lsize(fdui.button[0], xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(fdui.button[0], xfl.FL_TIMESBOLD_STYLE) xfl.fl_set_object_callback(fdui.button[0], show_group, 0) fdui.button[1] = xfl.fl_add_button( xfl.FL_RADIO_BUTTON, 90, 20, 75, \ 30, "Button") xfl.fl_set_object_lsize(fdui.button[1], xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(fdui.button[1], xfl.FL_TIMESBOLD_STYLE) xfl.fl_set_object_callback(fdui.button[1], show_group, 1) fdui.button[2] = xfl.fl_add_button( xfl.FL_RADIO_BUTTON, 165, 20, 70, \ 30, "Valuator") xfl.fl_set_object_lsize(fdui.button[2], xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(fdui.button[2], xfl.FL_TIMESBOLD_STYLE) xfl.fl_set_object_callback(fdui.button[2], show_group, 2) fdui.button[3] = xfl.fl_add_button( xfl.FL_RADIO_BUTTON, 235, 20, 70, \ 30, "Input") xfl.fl_set_object_lsize(fdui.button[3], xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(fdui.button[3], xfl.FL_TIMESBOLD_STYLE) xfl.fl_set_object_callback(fdui.button[3], show_group, 3) fdui.button[4] = xfl.fl_add_button( xfl.FL_RADIO_BUTTON, 305, 20, 70, \ 30, "Other") xfl.fl_set_object_lsize(fdui.button[4], xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(fdui.button[4], xfl.FL_TIMESBOLD_STYLE) xfl.fl_set_object_callback(fdui.button[4], show_group, 4) xfl.fl_add_box(xfl.FL_UP_BOX, 0, 70, 456, 291, "") xfl.fl_add_box(xfl.FL_DOWN_BOX, 9, 90, 435, 260, "") fdui.group[2] = xfl.fl_bgn_group() pobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 260, 140, 80, 30, "Text") xfl.fl_set_object_lalign(pobj, xfl.fl_to_inside_lalign(xfl.FL_ALIGN_LEFT)) xfl.fl_add_slider(xfl.FL_HOR_BROWSER_SLIDER, 60, 120, 170, 25, "") pobj = xfl.fl_add_slider(xfl.FL_HOR_FILL_SLIDER, 60, 160, 170, 30, "") xfl.fl_set_slider_value(pobj, 0.54) pobj = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 390, 110, 30, 170, "") xfl.fl_set_slider_value(pobj, 0.48) xfl.fl_add_valslider(xfl.FL_VERT_SLIDER, 350, 110, 30, 170, "") pobj = xfl.fl_add_dial(xfl.FL_FILL_DIAL, 50, 220, 90, 70, "") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_add_positioner(xfl.FL_NORMAL_POSITIONER, 150, 210, 120, 100, "") xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 300, 300, 130, 30, "") xfl.fl_end_group() fdui.group[1] = xfl.fl_bgn_group() fdui.bitbutton = xfl.fl_add_bitmapbutton(xfl.FL_NORMAL_BUTTON, 60, 250, \ 50, 40, "") fdui.pixbutton = xfl.fl_add_pixmapbutton(xfl.FL_NORMAL_BUTTON, 85, 120, \ 80, 80, "") xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 290, 270, 90, 35, "Button") pobj = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 260, 95, 60, 40, \ "Round3DButton") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_MAGENTA) xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 220, 140, 60, 40, \ "RoundButton") pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 190, 230, 50, 40, \ "CheckButton") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 290, 200, 100, 30, \ "LightButton") pobj = xfl.fl_add_button(xfl.FL_PUSH_BUTTON, 120, 290, 100, 35, \ "Button") xfl.fl_set_object_boxtype(pobj, xfl.FL_ROUNDED3D_UPBOX) xfl.fl_end_group() fdui.group[0] = xfl.fl_bgn_group() pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 40, 120, 70, 70, "A Box") xfl.fl_set_object_lsize(pobj, xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(pobj, xfl.FL_TIMESBOLD_STYLE) fdui.bit = xfl.fl_add_bitmap(xfl.FL_NORMAL_BITMAP, 30, 220, 80, 70, \ "bitmap") xfl.fl_add_clock(xfl.FL_ANALOG_CLOCK, 330, 240, 90, 80, "") pobj = xfl.fl_add_frame(xfl.FL_ENGRAVED_FRAME, 130, 120, 80, 70, \ "A Frame") xfl.fl_set_object_lsize(pobj, xfl.FL_NORMAL_SIZE) xfl.fl_set_object_lstyle(pobj, xfl.FL_TIMESBOLD_STYLE) fdui.pix = xfl.fl_add_pixmap(xfl.FL_NORMAL_PIXMAP, 340, 110, 90, 70, \ "pixmap") fdui.chart = xfl.fl_add_chart(xfl.FL_PIE_CHART, 160, 210, 130, 110, \ "chart") pobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 240, 130, 100, 30, \ "Text stuff\nand more stuff") xfl.fl_set_object_lalign(pobj, \ xfl.fl_to_inside_lalign(xfl.FL_ALIGN_CENTER)) xfl.fl_end_group() fdui.group[3] = xfl.fl_bgn_group() xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 140, 120, 150, 30, "Input") xfl.fl_add_input(xfl.FL_MULTILINE_INPUT, 60, 170, 320, 130, "") xfl.fl_end_group() fdui.quit = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 385, 20, 60, 30, \ "Quit") fdui.group[4] = xfl.fl_bgn_group() fdui.menu = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 190, 110, 40, 19, \ "Menu") xfl.fl_set_object_boxtype(fdui.menu, xfl.FL_FLAT_BOX) fdui.choice = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 290, 110, 120, \ 30, "") fdui.browser = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 30, 140, \ 140, 150, "") fdui.xyplot = xfl.fl_add_xyplot( xfl.FL_IMPULSE_XYPLOT, 190, 150, \ 240, 180, "") xfl.fl_set_object_lsize(fdui.xyplot, xfl.FL_DEFAULT_SIZE) xfl.fl_end_group() xfl.fl_end_form() return fdui
def create_form(self): self.pform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 720, 520) pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 720, 520, "") xfl.fl_set_object_color(pobj, xfl.FL_BLUE, xfl.FL_COL1) pobj = xfl.fl_add_box(xfl.FL_DOWN_BOX, 10, 90, 700, 420, "") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_COL1) pobj = xfl.fl_add_box(xfl.FL_DOWN_BOX, 10, 10, 700, 70, "") xfl.fl_set_object_color(pobj, xfl.FL_SLATEBLUE, xfl.FL_COL1) tobj[0] = xfl.fl_add_box(xfl.FL_UP_BOX, 30, 110, 110, 110, "Box") tobj[1] = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 30, 240, 110, 30, "Text") tobj[2] = xfl.fl_add_bitmap(xfl.FL_NORMAL_BITMAP, 40, 280, 90, 80, "Bitmap") xfl.fl_set_object_lcol(tobj[2], xfl.FL_BLUE) tobj[3] = xfl.fl_add_chart(xfl.FL_BAR_CHART, 160, 110, 160, 110, "Chart") tobj[4] = xfl.fl_add_clock(xfl.FL_ANALOG_CLOCK, 40, 390, 90, 90, "Clock") xfl.fl_set_object_dblbuffer(tobj[4], 1) tobj[5] = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 340, 110, 120, 30, "Button") tobj[6] = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 340, 150, 120, 30, "Lightbutton") tobj[7] = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 340, 190, 120, 30, "Roundbutton") tobj[8] = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 160, 250, 40, 230, "Slider") tobj[9] = xfl.fl_add_valslider(xfl.FL_VERT_SLIDER, 220, 250, 40, 230, "Valslider") tobj[10] = xfl.fl_add_dial(xfl.FL_LINE_DIAL, 280, 250, 100, 100, "Dial") tobj[11] = xfl.fl_add_positioner(xfl.FL_NORMAL_POSITIONER, 280, 380, 150, 100, "Positioner") tobj[12] = xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 480, 110, 210, 30, "Counter") tobj[13] = xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 520, 170, 170, 30, "Input") tobj[14] = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 400, 240, 100, 30, "Menu") tobj[15] = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 580, 250, 110, 30, "Select") tobj[16] = xfl.fl_add_timer(xfl.FL_VALUE_TIMER, 580, 210, 110, 30, "Timer") xfl.fl_set_object_dblbuffer(tobj[16], 1) tobj[17] = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 450, 300, 240, 180, "Browser") self.pexitob = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 590, 30, 100, 30, "Exit") self.pbtypeob = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 110, 30, 130, 30, "Boxtype") xfl.fl_set_object_callback(self.pbtypeob, self.boxtype_cb, 0) xfl.fl_popup_set_title(xfl.fl_get_select_popup(self.pbtypeob), "Boxtype") self.pmodeob = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 370, 30, 130, 30, "Graphics mode") xfl.fl_set_object_callback(self.pmodeob, self.mode_cb, 0) xfl.fl_popup_set_title(xfl.fl_get_select_popup(self.pmodeob), "Graphics mode") xfl.fl_end_form()
def create_form_cl(self): if self.pcl: return self.pcl = xfl.fl_bgn_form(xfl.FL_NO_BOX, 330, 385) pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 330, 385, "") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_COL1) pobj = xfl.fl_add_box(xfl.FL_NO_BOX, 40, 10, 250, 30, "Color Browser") xfl.fl_set_object_lcol(pobj, xfl.FL_RED) xfl.fl_set_object_lsize(pobj, xfl.FL_HUGE_SIZE) xfl.fl_set_object_lstyle(pobj, xfl.FL_BOLD_STYLE + xfl.FL_SHADOW_STYLE) xfl.fl_set_object_gravity(pobj, xfl.FL_North, xfl.FL_North) xfl.fl_set_object_resize(pobj, xfl.FL_RESIZE_NONE) self.pdbobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 40, 50, \ 250, 25, "") xfl.fl_set_object_boxtype(self.pdbobj, xfl.FL_BORDER_BOX) if xfl.fl_get_visual_depth() == 1: tmpcolr = xfl.FL_WHITE else: tmpcolr = xfl.FL_COL1 xfl.fl_set_object_color(self.pdbobj, tmpcolr, xfl.FL_COL1) xfl.fl_set_object_callback(self.pdbobj, self.db_cb, 0) xfl.fl_set_object_gravity(self.pdbobj, xfl.FL_North, xfl.FL_North) xfl.fl_set_object_resize(self.pdbobj, xfl.FL_RESIZE_X) self.prescol = xfl.fl_add_box(xfl.FL_FLAT_BOX, 225, 90, 90, 35, "") xfl.fl_set_object_color(self.prescol, xfl.FL_FREE_COL4, \ xfl.FL_FREE_COL4) xfl.fl_set_object_boxtype(self.prescol, xfl.FL_BORDER_BOX) xfl.fl_set_object_resize(self.prescol, xfl.FL_RESIZE_NONE) xfl.fl_set_object_gravity(self.prescol, xfl.FL_NorthEast, \ xfl.FL_East) self.prs = xfl.fl_add_valslider(xfl.FL_VERT_FILL_SLIDER, 225, 130, \ 30, 200, "") xfl.fl_set_object_color(self.prs, xfl.FL_COL1, xfl.FL_RED) xfl.fl_set_slider_bounds(self.prs, 0, 255) xfl.fl_set_slider_precision(self.prs, 0) xfl.fl_set_object_callback(self.prs, self.search_rgb, 0) #xfl.fl_set_object_return(self.prs, 0) xfl.fl_set_object_resize(self.prs, xfl.FL_RESIZE_Y) xfl.fl_set_object_gravity(self.prs, xfl.FL_NorthEast, \ xfl.FL_SouthEast) xfl.fl_set_object_return(self.prs, xfl.FL_RETURN_CHANGED) self.pgs = xfl.fl_add_valslider(xfl.FL_VERT_FILL_SLIDER, 255, 130, \ 30, 200, "") xfl.fl_set_object_color(self.pgs, xfl.FL_COL1, xfl.FL_GREEN) xfl.fl_set_slider_bounds(self.pgs, 0, 255) xfl.fl_set_slider_precision(self.pgs, 0) xfl.fl_set_object_callback(self.pgs, self.search_rgb, 1) #xfl.fl_set_object_return(self.pgs, 0) xfl.fl_set_object_resize(self.pgs, xfl.FL_RESIZE_Y) xfl.fl_set_object_gravity(self.pgs, xfl.FL_NorthEast, \ xfl.FL_SouthEast) xfl.fl_set_object_return(self.pgs, xfl.FL_RETURN_CHANGED) self.pbs = xfl.fl_add_valslider(xfl.FL_VERT_FILL_SLIDER, 285, 130, \ 30, 200, "") xfl.fl_set_object_color(self.pbs, xfl.FL_COL1, xfl.FL_BLUE) xfl.fl_set_slider_bounds(self.pbs, 0, 255) xfl.fl_set_slider_precision(self.pbs, 0) xfl.fl_set_object_callback(self.pbs, self.search_rgb, 2) #xfl.fl_set_object_return(self.pbs, 0) xfl.fl_set_object_resize(self.pbs, xfl.FL_RESIZE_Y) xfl.fl_set_object_gravity(self.pbs, xfl.FL_NorthEast, \ xfl.FL_SouthEast) xfl.fl_set_object_return(self.pbs, xfl.FL_RETURN_CHANGED) self.pcolbr = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, 10, 90, \ 205, 240, "") xfl.fl_set_browser_fontstyle(self.pcolbr, xfl.FL_FIXED_STYLE) xfl.fl_set_object_callback(self.pcolbr, self.br_cb, 0) xfl.fl_set_object_gravity(self.pcolbr, xfl.FL_NorthWest, \ xfl.FL_SouthEast) pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 135, 345, \ 80, 30, "Done") xfl.fl_set_object_callback(pobj, self.done_cb, 0) xfl.fl_set_object_gravity(pobj, xfl.FL_South, xfl.FL_South) xfl.fl_set_object_resize(pobj, xfl.FL_RESIZE_NONE) xfl.fl_end_form() xfl.fl_scale_form(self.pcl, 1.1, 1.0)
def create_form_form0(self): self.form0 = xfl.fl_bgn_form(xfl.FL_NO_BOX, 360, 330) pobj0 = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 360, 330, "") pobj1 = xfl.fl_add_button(xfl.FL_HIDDEN_BUTTON, 0, 0, \ 360, 330, "") xfl.fl_set_object_lalign(pobj1, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_callback(pobj1, self.button_cb, 0) pobj2 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 18, 15, \ 107, 30, "Normal") xfl.fl_set_object_lalign(pobj2, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj2, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj2, self.button_cb, 1) pobj3 = xfl.fl_add_button(xfl.FL_PUSH_BUTTON, 18, 53, \ 107, 30, "Push") xfl.fl_set_object_lalign(pobj3, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj3, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj3, self.button_cb, 2) pobj4 = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 18, 91, \ 107, 30, "Radio 1") xfl.fl_set_object_lalign(pobj4, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj4, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj4, self.button_cb, 3) xfl.fl_set_button(pobj4, 1) pobj5 = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 18, 129, \ 107, 30, "Radio 2") xfl.fl_set_object_lalign(pobj5, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj5, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj5, self.button_cb, 4) pobj6 = xfl.fl_add_button(xfl.FL_TOUCH_BUTTON, 18, 167, \ 107, 30, "Touch") xfl.fl_set_object_lalign(pobj6, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj6, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj6, self.button_cb, 5) xfl.fl_set_object_return(pobj6, xfl.FL_RETURN_CHANGED) pobj7 = xfl.fl_add_button(xfl.FL_INOUT_BUTTON, 18, 205, \ 107, 30, "InOut") xfl.fl_set_object_lalign(pobj7, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj7, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj7, self.button_cb, 6) pobj8 = xfl.fl_add_button(xfl.FL_MENU_BUTTON, 18, 243, \ 107, 30, "Menu") xfl.fl_set_object_lalign(pobj8, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj8, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj8, self.button_cb, 7) pobj9 = xfl.fl_add_button(xfl.FL_RETURN_BUTTON, 18, 281, \ 107, 30, "Return") xfl.fl_set_object_lalign(pobj9, xfl.FL_ALIGN_CENTER) xfl.fl_set_object_lstyle(pobj9, xfl.FL_BOLD_STYLE) xfl.fl_set_object_callback(pobj9, self.button_cb, 8) self.br = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 135, 15, \ 210, 296, "") xfl.fl_set_object_color(self.br, xfl.FL_COL1, xfl.FL_YELLOW) xfl.fl_set_object_callback(self.br, self.button_cb, 9) xfl.fl_end_form()