コード例 #1
0
 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()
コード例 #2
0
 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()
コード例 #3
0
 def __init__(self, lsysargv, sysargv):
     self.pco = [0, 0, 0]
     xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0)
     self.create_form_form()
     xfl.fl_set_object_color(self.presult, xfl.FL_FREE_COL1, \
             xfl.FL_FREE_COL1)
     for i in range(0, 3):
         xfl.fl_set_counter_bounds(self.pco[i], 0.0, 255.0)
         xfl.fl_set_counter_step(self.pco[i], 1.0, 10.0)
         xfl.fl_set_counter_precision(self.pco[i], 0)
         xfl.fl_set_object_return(self.pco[i], 1)
     xfl.fl_call_object_callback(self.pco[0])
     xfl.fl_show_form(self.pform, xfl.FL_PLACE_CENTER, xfl.FL_TRANSIENT, \
                 "Counter")
     xfl.fl_do_forms()
     xfl.fl_finish()