def __init__(self, lsysargv, sysargv): self.gd = [] for u in range(0, 9+1): self.gd.append(FD_grav_data()) #FD_grav_data()*9 self.gr = [xfl.FL_NorthWest, xfl.FL_North, xfl.FL_NorthEast, \ xfl.FL_West, xfl.FL_NoGravity, xfl.FL_East, \ xfl.FL_SouthWest, xfl.FL_South, xfl.FL_SouthEast] self.w = 500 self.h = 400 self.bw = 200 self.bh = 200 #grav = FD_gravity() #help_ = FD_help() xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.help_ = self.create_form_help() self.grav = self.create_form_gravity(self.help_.help_) xfl.fl_set_app_mainform(self.grav.grav) for i in range (0, 9): self.gd[i].box = self.grav.box self.gd[i].grav = self.gr[i] self.gd[i].rx = self.grav.rx self.gd[i].ry = self.grav.ry xfl.fl_show_form(self.grav.grav, \ xfl.FL_PLACE_CENTER | xfl.FL_FREE_SIZE, xfl.FL_FULLBORDER, \ "Gravity Demo") xfl.fl_do_forms() # xfl.fl_hide_form(self.grav.grav) # xfl.fl_free_form(self.grav.grav) # if (self.help_->is_shown ) # xfl.fl_hide_form(self.help_.help_) # xfl.fl_free_form(self.help_.help_) xfl.fl_finish() sys.exit(0)
def __init__(self, lsysargv, sysargv): xfl.fl_set_border_width(-2) xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 350, 250) pobj = xfl.fl_add_pixmap(xfl.FL_NORMAL_PIXMAP, 60, 70, 100, 100, "") xfl.fl_set_object_boxtype(pobj, xfl.FL_DOWN_BOX) xfl.fl_set_pixmap_file(pobj, "porsche.xpm") ppos = xfl.fl_add_positioner(xfl.FL_OVERLAY_POSITIONER, 60, 70, \ 100, 100, "") xfl.fl_set_positioner_xbounds(ppos, 0, 1) xfl.fl_set_positioner_ybounds(ppos, 0, 1) xfl.fl_set_object_callback(ppos, self.positioner_cb, 0) self.pxval = xfl.fl_add_box(xfl.FL_DOWN_BOX, 230, 40, 100, 30, "") xfl.fl_set_object_color(self.pxval, xfl.FL_COL1, xfl.FL_COL1) self.pyval = xfl.fl_add_box(xfl.FL_DOWN_BOX, 230, 90, 100, 30, "") xfl.fl_set_object_color(self.pyval, xfl.FL_COL1, xfl.FL_COL1) xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 230, 200, 100, 30, \ "Exit") xfl.fl_end_form() xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_TRANSIENT, \ "XOR Positioner") self.positioner_cb(ppos, 0) xfl.fl_do_forms() xfl.fl_hide_form(pform) xfl.fl_finish() sys.exit(0)
def __init__(self, lsysargv, sysargv): self.INTERVAL = 800 # wait this long before show tip xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_form0 = self.create_form_form0() # Fill-in form initialization code xfl.fl_set_button(self.fd_form0.peek, 1) xfl.fl_set_button(self.fd_form0.enter, 1) xfl.fl_set_button(self.fd_form0.leave, 1) xfl.fl_set_button(self.fd_form0.push, 1) xfl.fl_set_button(self.fd_form0.release, 1) xfl.fl_set_object_prehandler(self.fd_form0.butt, \ self.preemptive_handler) self.set_tip(self.fd_form0.done, "Want to quit ?\nPress me") self.set_tip(self.fd_form0.peek, "Turn preempting off") self.set_tip(self.fd_form0.override, "Turn preempting on") #xfl.fl_set_object_helper(self.fd_form0.done, \ # "Want to quit ?\nPress me") #xfl.fl_set_object_helper(self.fd_form0.peek, "Turn preempting off") #xfl.fl_set_object_helper(self.fd_form0.override, \ # "Turn preempting on") # Show the first form xfl.fl_show_form(self.fd_form0.form0, xfl.FL_PLACE_CENTER, \ xfl.FL_TRANSIENT, "Preemptive") while not xfl.fl_is_same_object(xfl.fl_do_forms(), \ self.fd_form0.done): pass # empty xfl.fl_finish()
def __init__(self, lsysargv, sysargv): self.rgbdb = [{'r':0, 'g':0, 'b':0}] * MAX_RGB self.pcl = None self.pdbobj = None self.prescol = None self.pcolbr = None self.prs = None self.pgs = None self.pbs = None self.dbname = "" if os.path.exists(rgbfile): self.dbname = rgbfile elif os.path.exists(rgbfile_2): self.dbname = rgbfile_2 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.create_form_cl() if self.load_browser(self.dbname): xfl.fl_set_object_label(self.pdbobj, self.dbname) else: xfl.fl_set_object_label(self.pdbobj, "None") xfl.fl_set_form_minsize(self.pcl, self.pcl.contents.w , \ self.pcl.contents.h) xfl.fl_set_form_maxsize(self.pcl, 2 * self.pcl.contents.w , \ 2 * self.pcl.contents.h) xfl.fl_show_form(self.pcl, xfl.FL_PLACE_FREE, xfl.FL_TRANSIENT, \ "RGB Browser") xfl.fl_do_forms() sys.exit(0)
def __init__(self, lsysargv, sysargv): self.mess = ["slider returned", "counter returned", \ "input 1 returned", "input 2 returned"] xfl.fl_set_border_width(-2) xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_form0 = self.create_form_form0() # fill-in form initialization code self.set_when(0) xfl.fl_set_object_dblbuffer(self.fd_form0.br, 1) pitem1st = xfl.fl_add_select_items(self.fd_form0.when, "RETURN_NONE") xfl.fl_popup_entry_set_value(pitem1st, xfl.FL_RETURN_NONE) pitem2nd = xfl.fl_insert_select_items(self.fd_form0.when, pitem1st, \ "RETURN_CHANGED") xfl.fl_popup_entry_set_value(pitem2nd, xfl.FL_RETURN_CHANGED) pitem3rd = xfl.fl_insert_select_items(self.fd_form0.when, pitem2nd, \ "RETURN_END") xfl.fl_popup_entry_set_value(pitem3rd, xfl.FL_RETURN_END) pitem4th = xfl.fl_insert_select_items(self.fd_form0.when, pitem3rd, \ "RETURN_END_CHANGED") xfl.fl_popup_entry_set_value(pitem4th, xfl.FL_RETURN_END_CHANGED) pitem5th = xfl.fl_insert_select_items(self.fd_form0.when, pitem4th, \ "RETURN_ALWAYS") xfl.fl_popup_entry_set_value(pitem5th, xfl.FL_RETURN_ALWAYS) # show the first form xfl.fl_show_form(self.fd_form0.form0, xfl.FL_PLACE_CENTER, \ xfl.FL_FULLBORDER, "form0") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_scb = self.create_form_scb() xfl.fl_show_form(self.fd_scb.scb, xfl.FL_PLACE_CENTERFREE, \ xfl.FL_FULLBORDER, "form0") xfl.fl_do_forms() xfl.fl_finish()
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 main(lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = create_form_form() xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_FULLBORDER, \ "IconTest") xfl.fl_do_forms() return 0
def __init__(self, lsysargv, sysargv): self.pabox = [None] * 4 self.set = [0] * 4 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = self.create_form() self.add_items_to_menu1() xfl.fl_popup_entry_set_state(xfl.fl_get_nmenu_item_by_value( \ self.pmenu1, 0), xfl.FL_POPUP_CHECKED) self.set[0] = 0 xfl.fl_set_object_color(self.pabox[0], xfl.FL_RED + self.set[0], \ xfl.FL_BLACK) self.add_items_to_menu2() xfl.fl_popup_entry_set_state(xfl.fl_get_nmenu_item_by_value( \ self.pmenu2, 1), xfl.FL_POPUP_CHECKED) self.set[1] = 1 xfl.fl_set_object_color(self.pabox[1], xfl.FL_RED + self.set[1], \ xfl.FL_BLACK) self.add_items_to_menu3() xfl.fl_popup_entry_set_state(xfl.fl_get_nmenu_item_by_value( \ self.pmenu3, 2), xfl.FL_POPUP_CHECKED) self.set[2] = 2 xfl.fl_set_object_color(self.pabox[2], xfl.FL_RED + self.set[2], \ xfl.FL_BLACK) self.add_items_to_menu4() xfl.fl_popup_entry_set_state(xfl.fl_get_nmenu_item_by_value( \ self.pmenu4, 3), xfl.FL_POPUP_CHECKED) self.set[3] = 3 xfl.fl_set_object_color(self.pabox[3], xfl.FL_RED + self.set[3], \ xfl.FL_BLACK) xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_TRANSIENT, "Nmenu") xfl.fl_do_forms() xfl.fl_hide_form(pform) xfl.fl_finish()
def main(lsysarg, sysargv): xfl.fl_initialize(lsysarg, sysargv, "FormDemo", None, 0) pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 300, 300) psl = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 40, 40, 60, 220, "X") psl.contents.radio = 1 pbut1 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 140, 220, \ 120, 40, "0.0") pbut2 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 140, 160, \ 120, 40, "0.5") pbut3 = xfl.fl_add_lightbutton(xfl.FL_RADIO_BUTTON, 140, 100, \ 120, 40, "1.0") pexitbut = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 140, 40, \ 120, 40, "Exit") xfl.fl_end_form() xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_NOBORDER, "slRadio") while True: pobj = xfl.fl_do_forms() if xfl.fl_is_same_object(pobj, pbut1): xfl.fl_set_slider_value(psl, 0.0) elif xfl.fl_is_same_object(pobj, pbut2): xfl.fl_set_slider_value(psl, 0.5) elif xfl.fl_is_same_object(pobj, pbut3): xfl.fl_set_slider_value(psl, 1.0) elif xfl.fl_is_same_object(pobj, pexitbut): break xfl.fl_finish() return 0
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) fd_twheelform = self.create_form_twheelform() # show the first form xfl.fl_show_form(fd_twheelform, xfl.FL_PLACE_CENTERFREE, \ xfl.FL_FULLBORDER, "twheelform") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): self.dcol = 1 self.on = 1 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 400, 400) pobj1 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 320, 20, 40, 30, \ "Exit") xfl.fl_set_object_callback(pobj1, self.done, 0) pobj2 = xfl.fl_add_free(xfl.FL_CONTINUOUS_FREE, 40, 80, 320, 280, \ "", self.handle_free1) xfl.fl_end_form() depth = xfl.fl_get_visual_depth() if depth < 4: # Can't do it if less than 4 bit deep... print("This Demo requires a depth of at least 4 bits\n") xfl.fl_finish() sys.exit(1) elif depth > 7: # ...but too large a depth also won't do depth = 7 self.cole = (1 << depth) - 1 if self.cole > 64: self.cole = 64 pobj2.contents.u_ldata = col = xfl.FL_FREE_COL1 self.cole += col for i in range(col, self.cole + 1): j = 255 * (i - col) / (self.cole - col) xfl.fl_mapcolor(i, j, j, j) xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_NOBORDER, \ "Free Object") xfl.fl_do_forms()
def __init__(self, lsysargv, sysarg): xfl.fl_initialize(lsysargv, sysarg, "FormDemo", None, 0) self.pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 300, 300) self.psl = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 40, 40, 60, 220, "X") xfl.fl_set_slider_value(self.psl, 0.5) xfl.fl_set_object_callback(self.psl, self.slider_callback, 0) self.pbut1 = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 140, 220, \ 120, 40, "0.0") xfl.fl_set_object_callback(self.pbut1, self.but1_callback, 0) self.pbut2 = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 140, 160, \ 120, 40, "0.5") xfl.fl_set_button(self.pbut2, 1) xfl.fl_set_object_callback(self.pbut2, self.but2_callback, 0) self.pbut3 = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 140, 100, \ 120, 40, "1.0") xfl.fl_set_object_callback(self.pbut3, self.but3_callback, 0) self.pbut = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 140, 40, \ 120, 40, "Exit") xfl.fl_set_object_callback(self.pbut, self.but_callback, 0) xfl.fl_end_form() xfl.fl_show_form(self.pform, xfl.FL_PLACE_CENTER, xfl.FL_NOBORDER, \ "slRadio") while xfl.fl_do_forms(): pass xfl.fl_finish()
def main(lsysargv, sysargv): sc = 1.0 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) ui = create_form_form() strng = "%.2f" % sc xfl.fl_set_input(ui.pscaleobj, strng) xfl.fl_show_form(ui.pform, xfl.FL_PLACE_CENTER | xfl.FL_FREE_SIZE, xfl.FL_FULLBORDER, "Scaling") while True: oldsc = sc pobj = xfl.fl_do_forms() if xfl.fl_is_same_object(pobj, ui.pexitobj): sys.exit(0) elif xfl.fl_is_same_object(pobj, ui.psmallerobj): sc = sc * 0.8 elif xfl.fl_is_same_object(pobj, ui.plargerobj): sc = sc / 0.8 elif xfl.fl_is_same_object(pobj, ui.pscaleobj): sc = float(xfl.fl_get_input(ui.pscaleobj)) if sc < 0.50: sc = 0.50 elif sc > 3: sc = 3 if sc != oldsc: xfl.fl_scale_form(ui.pform, sc / oldsc, sc / oldsc) xfl.fl_redraw_form(ui.pform) # to avoid garbage on screen strng = "%.2f" % sc xfl.fl_set_input(ui.pscaleobj, strng)
def __init__(self, lsysargv, sysargv): xfl.fl_set_border_width(-3) xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.ui = self.create_form_fontsform() xfl.fl_scale_form(self.ui.pfontsform, 1.1, 1.2) xfl.fl_set_object_dblbuffer(self.ui.ptextobj, 1) xfl.fl_set_object_bw(self.ui.ptextobj, 5) nfnt = xfl.fl_enumerate_fonts(self.addit, 1) xfl.fl_select_browser_line(self.ui.pfontobj, 1) xfl.fl_addto_browser(self.ui.psizeobj, "8 (tiny)") xfl.fl_addto_browser(self.ui.psizeobj, "10 (small)") xfl.fl_addto_browser(self.ui.psizeobj, "11 (scaled)") xfl.fl_addto_browser(self.ui.psizeobj, "12 (normal)") xfl.fl_addto_browser(self.ui.psizeobj, "13 (scaled)") xfl.fl_addto_browser(self.ui.psizeobj, "14 (medium)") xfl.fl_addto_browser(self.ui.psizeobj, "18 (large)") xfl.fl_addto_browser(self.ui.psizeobj, "24 (Huge)") xfl.fl_addto_browser(self.ui.psizeobj, "30 (scaled)") xfl.fl_select_browser_line(self.ui.psizeobj, 2) xfl.fl_set_object_lstyle(self.ui.ptextobj, xfl.FL_NORMAL_STYLE) xfl.fl_call_object_callback(self.ui.pfontobj) xfl.fl_call_object_callback(self.ui.psizeobj) xfl.fl_show_form(self.ui.pfontsform, xfl.FL_PLACE_CENTER, \ xfl.FL_TRANSIENT, "Fonts") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) pform = self.create_form() MypopupitemA = \ [{'text' : "First item ADD", 'callback' : self.item1_cb, \ 'shortcut' : "F", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}, \ {'text' : "Second item ADD", 'callback' : self.item2_cb, \ 'shortcut' : "n", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}] ppopmenu1 = xfl.fls_make_ptr_flpopupitem(MypopupitemA) entry12 = xfl.fl_add_nmenu_items2(self.pmenu1, ppopmenu1) MypopupitemB = \ [{'text' : "Third item INS", 'callback' : self.item3_cb, \ 'shortcut' : "r", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}, \ {'text' : "Fourth item INS", 'callback' : self.item4_cb, \ 'shortcut' : "h", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}] ppopmenu2 = xfl.fls_make_ptr_flpopupitem(MypopupitemB) entry34 = xfl.fl_insert_nmenu_items2(self.pmenu1, None, ppopmenu2) MypopupitemC = {'text' : "Fifth item ADD", 'callback' : self.item5_cb, 'shortcut' : "f", 'type' : xfl.FL_POPUP_NORMAL, 'state' : xfl.FL_POPUP_NONE} ppopmenu3 = xfl.fls_make_ptr_flpopupitem(MypopupitemC) entry5 = xfl.fl_add_nmenu_items2(self.pmenu1, ppopmenu3) MypopupitemD = \ [{'text' : "Sixth item REPL", 'callback' : self.item6_cb, \ 'shortcut' : "S", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}, \ {'text' : "Seventh menu REPL", 'callback' : self.item7_cb, \ 'shortcut' : "v", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}] ppopmenu4 = xfl.fls_make_ptr_flpopupitem(MypopupitemD) entry67 = xfl.fl_replace_nmenu_items2(self.pmenu1, entry12, ppopmenu4) MypopupitemE = {'text' : "Exit ADD", 'callback' : self.done_cb, \ 'shortcut' : "x", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE} ppopmenu5 = xfl.fls_make_ptr_flpopupitem(MypopupitemE) entry8 = xfl.fl_add_nmenu_items2(self.pmenu1, ppopmenu5) MypopupitemF = \ [{'text' : "Ninth item ADD", 'callback' : self.item1_cb, \ 'shortcut' : "N", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}, \ {'text' : "Tenth item ADD", 'callback' : self.item2_cb, \ 'shortcut' : "T", 'type' : xfl.FL_POPUP_NORMAL, \ 'state' : xfl.FL_POPUP_NONE}] ppopmenu6 = xfl.fls_make_ptr_flpopupitem(MypopupitemF) entry910 = xfl.fl_add_nmenu_items2(self.pmenu2, ppopmenu6) MypopupitemG = {'text' : "Eleventh item INS", \ 'callback' : self.item3_cb, 'shortcut' : "E", \ 'type' : xfl.FL_POPUP_NORMAL, 'state' : xfl.FL_POPUP_NONE} ppopmenu7 = xfl.fls_make_ptr_flpopupitem(MypopupitemG) entry910 = xfl.fl_insert_nmenu_items2(self.pmenu2, entry910, \ ppopmenu7) xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_TRANSIENT, \ "Nmenu") while xfl.fl_do_forms(): pass
def __init__(self, lsysargv, sysargv): self.pdial = [None] * 3 self.ptext = [None] * 3 xfl.fl_initialize(lsysargv, sysargv, "ColorEditor", 0, 0) self.makeform() xfl.fl_show_form(self.pform, xfl.FL_PLACE_MOUSE, xfl.FL_TRANSIENT, "Color Editor") xfl.fl_do_forms() xfl.fl_finish()
def __init__(self, lsysargv, sysargv): self.TIME = 5 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.makeforms() xfl.fl_show_form(self.pform1, xfl.FL_PLACE_CENTER, \ xfl.FL_NOBORDER, "Timer") xfl.fl_set_timer(self.ptim, self.TIME) xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.create_form_form0() # fill-in form initialization code # show the first form xfl.fl_show_form(self.form0, xfl.FL_PLACE_CENTER, \ xfl.FL_FULLBORDER, "form0") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.ui = self.create_form_inputform() xfl.fl_register_raw_callback(self.ui.inputform, xfl.KeyPressMask, \ self.peek_event) xfl.fl_show_form(self.ui.inputform, xfl.FL_PLACE_CENTER, \ xfl.FL_TRANSIENT, "Input") xfl.fl_do_forms() xfl.fl_finish()
def init_colorpart(self): self.create_colorform() xfl.fl_set_form_callback(self.pcolorform, self.color_callback, 0) xfl.fl_set_form_position(self.pcolorform, 20, \ -300 - self.pcolorform.contents.h) xfl.fl_show_form(self.pcolorform, xfl.FL_PLACE_GEOMETRY, \ xfl.FL_TRANSIENT, "Color") xfl.fl_mapcolor(xfl.FL_FREE_COL1, self.r, self.g, self.b) xfl.fl_redraw_object(self.pcolorobj)
def init_controlpart(self): self.create_controlform() xfl.fl_set_form_callback(self.pcontrolform, self.control_callback, 0) xfl.fl_set_button(self.psquareobj, 1) xfl.fl_set_form_geometry(self.pcontrolform, 20, \ -self.pcontrolform.contents.h - 40, \ self.pcontrolform.contents.w, self.pcontrolform.contents.h) xfl.fl_show_form(self.pcontrolform, xfl.FL_PLACE_SIZE, \ xfl.FL_TRANSIENT, "Control")
def __init__(self, lsysargv, sysargv): xfl.fl_set_border_width(-2) xfl.fl_initialize(lsysargv, sysargv, "FormDemo", 0, 0) self.fd_mainform = self.create_form_mainform() xfl.fl_set_object_return(self.fd_mainform.folder, xfl.FL_RETURN_NONE) self.make_folder(self.fd_mainform.folder) # show the first form xfl.fl_show_form(self.fd_mainform.mainform, xfl.FL_PLACE_ASPECT, xfl.FL_FULLBORDER, "TabFolder") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.create_form() xfl.fl_set_button(self.pfirstbut, 1) xfl.fl_show_form(self.pform, xfl.FL_PLACE_CENTER, xfl.FL_NOBORDER, \ "") while xfl.fl_do_forms(): pass # empty sys.exit(0)
def __init__(self, lsysargv, sysargv): self.pfclock = None xfl.fl_initialize(lsysargv, sysargv, "FormDemo", 0, 0) self.create_form_clock() xfl.fl_show_form(self.pfclock, xfl.FL_PLACE_CENTER, \ xfl.FL_TRANSIENT, "clocks") xfl.fl_do_forms() xfl.fl_finish() sys.exit(0)
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_ttt = self.create_form_ttt() xfl.fl_show_form(self.fd_ttt.ttt, xfl.FL_PLACE_CENTER, \ xfl.FL_TRANSIENT, "PixmapBrowser") xfl.fl_set_fselector_placement(xfl.FL_PLACE_FREE) xfl.fl_set_fselector_callback(self.load_file, 0) xfl.fl_show_fselector("Load a Pixmap file", "", "*.x?m", "") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fdform0 = self.create_form_form0() # fill-in form initialization code self.fdform0.ldata = 2800.0 self.start_timer(self.fdform0.timer, 0) # show the first form xfl.fl_show_form(self.fdform0.form0, xfl.FL_PLACE_CENTER, xfl.FL_FULLBORDER, "Timer object precision") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_form = self.create_form_form() # fill-in form initialization code self.fd_form.ldata = 800 self.start_timer(self.fd_form.report, 0) # show the first form xfl.fl_show_form(self.fd_form.form, xfl.FL_PLACE_CENTER, \ xfl.FL_FULLBORDER, "Timeout precision") xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): xfl.fl_initialize(lsysargv, sysargv, "Button", None, 0) self.fd_x = self.create_form_x() xfl.fl_show_form(self.fd_x.x, xfl.FL_PLACE_CENTERFREE, \ xfl.FL_FULLBORDER, "strange button") xfl.fl_do_forms() if xfl.fl_form_is_visible(self.fd_x.x): xfl.fl_hide_form(self.fd_x.x) xfl.fl_finish() sys.exit(0)
def __init__(self, lsysargv, sysargv): xfl.fl_flip_yorigin() xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.create_form() xfl.fl_show_form(self.pform, xfl.FL_PLACE_CENTER | xfl.FL_FREE_SIZE, \ xfl.FL_TRANSIENT, "Select Object Demo") while True: pobj = xfl.fl_do_forms() if xfl.fl_is_same_object(pobj, self.preadyobj): break