コード例 #1
0
    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.bitmapname = xfl.fl_add_bitmap(xfl.FL_NORMAL_BITMAP, 40, 30, 250, 100, 'bitmap')
        xfl.fl_set_object_boxtype(self.bitmapname, xfl.FL_NO_BOX)
        bm2_width = 16
        bm2_height = 16
        bm2_bits = [0, 0, 0, 87, 124, 114, 252, 82, 252, 0, 124, 1, 124, 31, 252, 34, 64, 66, 64, 68, 64, 67, 192, 64, 112, 64, 140, 32, 0, 31, 0, 0]
        xfl.fl_set_bitmap_data(self.bitmapname, bm2_width, bm2_height, bm2_bits)
        xfl.fl_set_object_color(self.bitmapname, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.bitmapname, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.bitmapname, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.bitmapname, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.bitmapname, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.bitmapname, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.bitmapname, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.bitmapname, 'b', 1)
        xfl.fl_set_object_callback(self.bitmapname, self.bitmapcb, 2)

        xfl.fl_end_form()
コード例 #2
0
    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.mynormalbutton = xfl.fl_add_button(xfl.FL_TOUCH_BUTTON, 60, 30, 170, 50, 'button')
        xfl.fl_set_object_boxtype(self.mynormalbutton, xfl.FL_UP_BOX)
        xfl.fl_set_button_mouse_buttons(self.mynormalbutton, 30)
        xfl.fl_set_object_color(self.mynormalbutton, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.mynormalbutton, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.mynormalbutton, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.mynormalbutton, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.mynormalbutton, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.mynormalbutton, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.mynormalbutton, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.mynormalbutton, 'o', 1)
        xfl.fl_set_object_callback(self.mynormalbutton, self.buttoncb, 1001)
        xfl.fl_set_object_return(self.mynormalbutton, xfl.FL_RETURN_CHANGED)

        xfl.fl_end_form()
コード例 #3
0
    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()
コード例 #4
0
    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.pcounter = xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 30, 50, 260, 70, 'My counter')
        xfl.fl_set_object_boxtype(self.pcounter, xfl.FL_FLAT_BOX)
        xfl.fl_set_counter_bounds(self.pcounter, -1000.0000, 1000.0000)
        xfl.fl_set_counter_value(self.pcounter, 100.0000)
        xfl.fl_set_object_color(self.pcounter, xfl.FL_WHEAT, xfl.FL_DARKGOLDENROD)
        xfl.fl_set_object_lalign(self.pcounter, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pcounter, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pcounter, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pcounter, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pcounter, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pcounter, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pcounter, 'M', 1)
        xfl.fl_set_object_callback(self.pcounter, self.countercb, 6)
        xfl.fl_set_object_return(self.pcounter, xfl.FL_RETURN_END_CHANGED)

        xfl.fl_end_form()
コード例 #5
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)
コード例 #6
0
    def create_form_x(self):

        fdui = FD_x()
        fdui.x = xfl.fl_bgn_form(xfl.FL_FLAT_BOX, 170, 176)
        pobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 20, 10, 150, 50, \
                "Click on the digits...\n(left or right button)")
        xfl.fl_set_object_lsize(pobj, xfl.FL_NORMAL_SIZE)

        fdui.c = xfl.fl_add_button(xfl.FL_TOUCH_BUTTON, 40, 65, 90, 40, "012345")
        xfl.fl_set_object_boxtype(fdui.c, xfl.FL_EMBOSSED_BOX );
        xfl.fl_set_object_color(fdui.c, xfl.FL_YELLOW, xfl.FL_YELLOW );
        xfl.fl_set_object_lstyle(fdui.c, \
                xfl.FL_FIXED_STYLE | xfl.FL_EMBOSSED_STYLE)
        xfl.fl_set_object_lsize(fdui.c, xfl.FL_LARGE_SIZE );
        xfl.fl_set_object_callback(fdui.c, self.ccb, 0)
        xfl.fl_set_button_mouse_buttons(fdui.c, 1 | 4 | 8 | 16)
        xfl.fl_set_object_helper(fdui.c, \
                "May not look like a button but it's one...\n" \
                "(Also try the scroll wheel if you have.)" )

        pobj = xfl.fl_add_button(xfl.FL_RETURN_BUTTON, 50, 130, 70, 30, "Exit" );
        xfl.fl_set_button_mouse_buttons(pobj, 1)

        xfl.fl_end_form()
        xfl.fl_adjust_form_size(fdui.x)
        return fdui
コード例 #7
0
    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.ppixmap = xfl.fl_add_pixmap(xfl.FL_NORMAL_PIXMAP, 40, 40, 240, 90, 'one\ndemo\npixmap')
        xfl.fl_set_object_boxtype(self.ppixmap, xfl.FL_FRAME_BOX)
        xfl.fl_set_pixmap_align(self.ppixmap, xfl.FL_ALIGN_RIGHT|xfl.FL_ALIGN_INSIDE, 3, 3)
        xfl.fl_set_pixmap_file(self.ppixmap, 'crab45.xpm')
        xfl.fl_set_object_color(self.ppixmap, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.ppixmap, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.ppixmap, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.ppixmap, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.ppixmap, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.ppixmap, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.ppixmap, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.ppixmap, 'm', 1)
        xfl.fl_set_object_callback(self.ppixmap, self.pmapcb, 0)

        xfl.fl_end_form()
コード例 #8
0
    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.plabelbtn = xfl.fl_add_labelbutton(xfl.FL_INOUT_BUTTON, 50, 50, 230, 100, 'anylabel\nyadda yadda')
        xfl.fl_set_object_boxtype(self.plabelbtn, xfl.FL_FLAT_BOX)
        xfl.fl_set_button_mouse_buttons(self.plabelbtn, 15)
        xfl.fl_set_object_color(self.plabelbtn, xfl.FL_RED, xfl.FL_BLUE)
        xfl.fl_set_object_lalign(self.plabelbtn, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.plabelbtn, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.plabelbtn, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.plabelbtn, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.plabelbtn, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.plabelbtn, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.plabelbtn, 'a', 1)
        xfl.fl_set_object_callback(self.plabelbtn, self.labelcb, 7)

        xfl.fl_end_form()
コード例 #9
0
    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.pcanvas = xfl.fl_add_canvas(xfl.FL_NORMAL_CANVAS, 60, 60, 210, 120, 'My canvas')
        xfl.fl_set_object_boxtype(self.pcanvas, xfl.FL_RFLAT_BOX)
        xfl.fl_set_object_color(self.pcanvas, xfl.FL_COL1, xfl.FL_BLACK)
        xfl.fl_set_object_lalign(self.pcanvas, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.pcanvas, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pcanvas, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pcanvas, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pcanvas, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pcanvas, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pcanvas, 'c', 1)
        xfl.fl_set_object_callback(self.pcanvas, self.canvascb, 4)

        xfl.fl_end_form()
コード例 #10
0
    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.pscrollbar = xfl.fl_add_scrollbar(xfl.FL_HOR_PLAIN_SCROLLBAR, 40, 40, 250, 50, 'A common scrollbar')
        xfl.fl_set_object_boxtype(self.pscrollbar, xfl.FL_DOWN_BOX)
        xfl.fl_set_scrollbar_bounds(self.pscrollbar, 1, 5)
        xfl.fl_set_scrollbar_value(self.pscrollbar, 1)
        xfl.fl_set_scrollbar_increment(self.pscrollbar, 0.5, 0.05)
        xfl.fl_set_scrollbar_size(self.pscrollbar, 0.20)
        xfl.fl_set_scrollbar_step(self.pscrollbar, 1.000)
        xfl.fl_set_object_color(self.pscrollbar, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.pscrollbar, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pscrollbar, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pscrollbar, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pscrollbar, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pscrollbar, xfl.FL_RESIZE_X)
        xfl.fl_set_object_gravity(self.pscrollbar, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pscrollbar, 'r', 1)
        xfl.fl_set_object_callback(self.pscrollbar, self.scrollbarcb, 3)
        xfl.fl_set_object_return(self.pscrollbar, xfl.FL_RETURN_END_CHANGED)

        xfl.fl_end_form()
コード例 #11
0
    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.pdial = xfl.fl_add_dial(xfl.FL_LINE_DIAL, 40, 30, 240, 120, 'A line dial')
        xfl.fl_set_object_boxtype(self.pdial, xfl.FL_FLAT_BOX)
        xfl.fl_set_dial_bounds(self.pdial, 1, 128)
        xfl.fl_set_dial_value(self.pdial, 2.5)
        xfl.fl_set_dial_step(self.pdial, 1)
        xfl.fl_set_dial_angles(self.pdial, 45, 270)
        xfl.fl_set_dial_direction(self.pdial, xfl.FL_DIAL_CCW)
        xfl.fl_set_object_color(self.pdial, xfl.FL_COL1, xfl.FL_RIGHT_BCOL)
        xfl.fl_set_object_lalign(self.pdial, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pdial, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pdial, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pdial, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pdial, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pdial, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pdial, 'd', 1)
        xfl.fl_set_object_callback(self.pdial, self.dialcb, 7)
        xfl.fl_set_object_return(self.pdial, xfl.FL_RETURN_CHANGED)

        xfl.fl_end_form()
コード例 #12
0
    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.ptabfolder = xfl.fl_add_tabfolder(xfl.FL_BOTTOM_TABFOLDER, 50, 50, 240, 140, 'My Tabfolder')
        xfl.fl_set_object_boxtype(self.ptabfolder, xfl.FL_SHADOW_BOX)
        xfl.fl_set_object_color(self.ptabfolder, xfl.FL_LEMONCHIFFON, xfl.FL_LIGHTGREY)
        xfl.fl_set_object_lalign(self.ptabfolder, xfl.FL_ALIGN_LEFT_BOTTOM)
        xfl.fl_set_object_lstyle(self.ptabfolder, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.ptabfolder, xfl.FL_TINY_SIZE)
        xfl.fl_set_object_lcol(self.ptabfolder, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.ptabfolder, xfl.FL_RESIZE_NONE)
        xfl.fl_set_object_gravity(self.ptabfolder, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.ptabfolder, 'T', 1)
        xfl.fl_set_object_callback(self.ptabfolder, self.tabfoldcb, 4)

        xfl.fl_end_form()
コード例 #13
0
    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.ptimer = xfl.fl_add_timer(xfl.FL_VALUE_TIMER, 120, 20, 150, 120, 'first\ntimer')
        xfl.fl_set_object_boxtype(self.ptimer, xfl.FL_UP_BOX)
        xfl.fl_set_object_color(self.ptimer, xfl.FL_TOP_BCOL, xfl.FL_RED)
        xfl.fl_set_object_lalign(self.ptimer, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.ptimer, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.ptimer, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.ptimer, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.ptimer, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.ptimer, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.ptimer, 'm', 1)
        xfl.fl_set_object_callback(self.ptimer, self.timercb, 3)

        xfl.fl_end_form()
コード例 #14
0
    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.pbmbutton = xfl.fl_add_bitmapbutton(xfl.FL_NORMAL_BUTTON, 50, 40, 220, 90, 'xbmbutton')
        xfl.fl_set_object_boxtype(self.pbmbutton, xfl.FL_UP_BOX)
        xfl.fl_set_button_mouse_buttons(self.pbmbutton, 27)
        bm1_width = 16
        bm1_height = 16
        bm1_bits = [0, 0, 0, 87, 124, 114, 196, 82, 196, 0, 68, 1, 68, 31, 252, 34, 64, 66, 64, 68, 64, 67, 192, 64, 112, 64, 140, 32, 0, 31, 0, 0]
        xfl.fl_set_bitmapbutton_data(self.pbmbutton, bm1_width, bm1_height, bm1_bits)
        xfl.fl_set_object_color(self.pbmbutton, xfl.FL_COL1, xfl.FL_BLUE)
        xfl.fl_set_object_lalign(self.pbmbutton, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pbmbutton, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pbmbutton, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pbmbutton, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pbmbutton, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pbmbutton, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pbmbutton, 'm', 1)
        xfl.fl_set_object_callback(self.pbmbutton, self.buttoncb, 999)

        xfl.fl_end_form()
コード例 #15
0
    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.pinput = xfl.fl_add_input(xfl.FL_SECRET_INPUT, 100, 60, 170, 30, 'MyInput')
        xfl.fl_set_object_boxtype(self.pinput, xfl.FL_DOWN_BOX)
        xfl.fl_set_object_color(self.pinput, xfl.FL_INDIANRED, xfl.FL_BISQUE)
        xfl.fl_set_object_lalign(self.pinput, xfl.FL_ALIGN_LEFT)
        xfl.fl_set_object_lstyle(self.pinput, 14)
        xfl.fl_set_object_lsize(self.pinput, xfl.FL_MEDIUM_SIZE)
        xfl.fl_set_object_lcol(self.pinput, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pinput, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pinput, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_callback(self.pinput, self.inputcb, 5)
        xfl.fl_set_object_return(self.pinput, xfl.FL_RETURN_END_CHANGED)

        xfl.fl_end_form()
コード例 #16
0
    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.pxyplot = xfl.fl_add_xyplot(xfl.FL_SQUARE_XYPLOT, 30, 40, 260, 160, 'myxyplot')
        xfl.fl_set_object_boxtype(self.pxyplot, xfl.FL_FLAT_BOX)
        xfl.fl_set_xyplot_xgrid(self.pxyplot, xfl.FL_GRID_MAJOR)
        xfl.fl_set_xyplot_ygrid(self.pxyplot, xfl.FL_GRID_MAJOR)
        xfl.fl_set_xyplot_grid_linestyle(self.pxyplot, xfl.FL_DOTDASH)
        xfl.fl_set_object_color(self.pxyplot, xfl.FL_COL1, xfl.FL_BLACK)
        xfl.fl_set_object_lalign(self.pxyplot, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pxyplot, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pxyplot, xfl.FL_TINY_SIZE)
        xfl.fl_set_object_lcol(self.pxyplot, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pxyplot, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pxyplot, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pxyplot, 'x', 1)
        xfl.fl_set_object_callback(self.pxyplot, self.xyplot_cb, 2)

        xfl.fl_end_form()
コード例 #17
0
    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.pclock = xfl.fl_add_clock(xfl.FL_ANALOG_CLOCK, 50, 40, 230, 100, 'mygoodlabel')
        xfl.fl_set_object_boxtype(self.pclock, xfl.FL_UP_BOX)
        xfl.fl_set_object_color(self.pclock, xfl.FL_INACTIVE, xfl.FL_BOTTOM_BCOL)
        xfl.fl_set_object_lalign(self.pclock, xfl.FL_ALIGN_TOP)
        xfl.fl_set_object_lstyle(self.pclock, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pclock, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pclock, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pclock, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pclock, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pclock, 'g', 1)
        xfl.fl_set_object_callback(self.pclock, self.clockcb, 88)

        xfl.fl_end_form()
コード例 #18
0
    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.ppxmbutton = xfl.fl_add_pixmapbutton(xfl.FL_TOUCH_BUTTON, 40, 50, 230, 90, "mypixmapbtn")
        xfl.fl_set_object_boxtype(self.ppxmbutton, xfl.FL_ROUNDED_BOX)
        xfl.fl_set_button_mouse_buttons(self.ppxmbutton, 29)
        xfl.fl_set_pixmapbutton_align(self.ppxmbutton, xfl.FL_ALIGN_TOP | xfl.FL_ALIGN_INSIDE, 3, 3)
        xfl.fl_set_object_helper(self.ppxmbutton, "my image")
        xfl.fl_set_pixmapbutton_file(self.ppxmbutton, "./crab45.xpm")
        xfl.fl_set_object_color(self.ppxmbutton, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.ppxmbutton, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.ppxmbutton, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.ppxmbutton, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.ppxmbutton, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.ppxmbutton, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.ppxmbutton, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.ppxmbutton, "b", 1)
        xfl.fl_set_object_callback(self.ppxmbutton, self.buttoncb, 5)
        xfl.fl_set_object_return(self.ppxmbutton, xfl.FL_RETURN_CHANGED)

        xfl.fl_end_form()
コード例 #19
0
 def create_form(self):
     pform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 444, 380)
     pobj = xfl.fl_add_box(xfl.FL_BORDER_BOX, 0, 0, 444, 380, "")
     xfl.fl_set_object_color(pobj, xfl.FL_SLATEBLUE, xfl.FL_COL1)
     pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 444, 29, "")
     xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_COL1)
     self.pmenu1 = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 2, 2, \
             110, 25, "Color 1")
     xfl.fl_set_object_shortcut(self.pmenu1, "1#1", 1)
     xfl.fl_set_object_callback(self.pmenu1, self.menu_cb, 0)
     self.pmenu2 = xfl.fl_add_nmenu(xfl.FL_NORMAL_TOUCH_NMENU, 112, 2, \
             110, 25, "Color 2")
     xfl.fl_set_object_shortcut(self.pmenu2, "2#2", 1)
     xfl.fl_set_object_callback(self.pmenu2, self.menu_cb, 1)
     self.pmenu3 = xfl.fl_add_nmenu(xfl.FL_BUTTON_NMENU, 222, 2, \
             110, 25, "Color 3")
     xfl.fl_set_object_shortcut(self.pmenu3, "3#3", 1)
     xfl.fl_set_object_callback(self.pmenu3, self.menu_cb, 2)
     self.pmenu4 = xfl.fl_add_nmenu(xfl.FL_BUTTON_TOUCH_NMENU, 332, 2, \
             110, 25, "Color 4")
     xfl.fl_set_object_shortcut(self.pmenu4, "4#4", 1)
     xfl.fl_set_object_callback(self.pmenu4, self.menu_cb, 3)
     self.pabox[0] = xfl.fl_add_box(xfl.FL_SHADOW_BOX,  20, 80, 70, 230, "")
     self.pabox[1] = xfl.fl_add_box(xfl.FL_SHADOW_BOX, 130, 80, 70, 230, "")
     self.pabox[2] = xfl.fl_add_box(xfl.FL_SHADOW_BOX, 240, 80, 70, 230, "")
     self.pabox[3] = xfl.fl_add_box(xfl.FL_SHADOW_BOX, 350, 80, 70, 230, "")
     pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 310, 330, \
             110, 30, "Quit")
     xfl.fl_set_object_shortcut(pobj, "Q#Q", 1)
     xfl.fl_set_object_callback(pobj, self.done_cb, 0)
     xfl.fl_end_form()
     return pform
コード例 #20
0
 def makeform(self):
     label = ["Red", "Green", "Blue"]
     col = [xfl.FL_RED, xfl.FL_GREEN, xfl.FL_BLUE]
     y = 70
     self.pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 300, 330)
     pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 45, 15, \
             210, 45, "Color Editor")
     xfl.fl_set_object_lsize(pobj, xfl.FL_LARGE_SIZE)
     for i in range (0, 3):
         self.pdials[i] = xfl.fl_add_dial(xfl.FL_NORMAL_DIAL, 30, y, \
                 60, 60, label[i])
         xfl.fl_set_object_boxtype(self.pdials[i], xfl.FL_UP_BOX)
         xfl.fl_set_dial_bounds(self.pdials[i], 0.0, 255.0)
         xfl.fl_set_dial_value(self.pdials[i], 128.0)
         xfl.fl_set_object_color(self.pdials[i], col[i], xfl.FL_DIAL_COL2)
         xfl.fl_set_object_callback(self.pdials[i], self.cb, i)
         xfl.fl_set_object_return(self.pdials[i], xfl.FL_RETURN_CHANGED)
         self.ptexts[i] = xfl.fl_add_box(xfl.FL_DOWN_BOX, 105, y + 17, \
                 50, 25, "128")
         y += 85
     self.presult = xfl.fl_add_box(xfl.FL_DOWN_BOX, 180, 70, 90, 245, "")
     xfl.fl_set_object_color(self.presult, xfl.FL_FREE_COL1, \
             xfl.FL_FREE_COL1)
     xfl.fl_mapcolor(xfl.FL_FREE_COL1, 128, 128, 128)
     xfl.fl_set_object_dblbuffer(self.presult, 1)    # to avoid flicker
     xfl.fl_end_form()
コード例 #21
0
 def create_form(self):
     self.pform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 420, 360)
     xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 420, 360, "")
     xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 70, 300, 320, 30, "Name")
     xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 70, 260, 320, 30, "Address")
     xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 70, 220, 320, 30, "City")
     xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 70, 180, 320, 30, "Country")
     psexobj = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 70, 130, \
             110, 30, "Sex")
     pmaleent = xfl.fl_add_select_items(psexobj, "Male%SM")
     xfl.fl_popup_entry_set_callback(pmaleent, self.cb)
     xfl.fl_popup_entry_set_state(pmaleent, xfl.FL_POPUP_NONE)    # 0
     xfl.fl_popup_entry_set_shortcut(pmaleent, "M")
     pfemaleent = xfl.fl_add_select_items(psexobj, "Female%SF")
     xfl.fl_popup_entry_set_callback(pfemaleent, self.cb)
     xfl.fl_popup_entry_set_state(pfemaleent, xfl.FL_POPUP_NONE)    # 0
     xfl.fl_popup_entry_set_shortcut(pfemaleent, "F")
     xfl.fl_set_object_shortcut(psexobj, "S", 1)
     pchildobj = xfl.fl_add_select(xfl.FL_MENU_SELECT, 280, 130, 110, 30, \
             "Children")
     xfl.fl_add_select_items(pchildobj, "Zero|One|Two|Three|Four|Many")
     xfl.fl_set_object_shortcut(pchildobj, "C", 1)
     xfl.fl_popup_set_title(xfl.fl_get_select_popup(pchildobj), "Kids")
     plicenceobj = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 280, 80, \
             110, 30, "Licence")
     xfl.fl_add_select_items(plicenceobj, "Yes|No")
     xfl.fl_set_select_policy(plicenceobj, xfl.FL_POPUP_DRAG_SELECT)
     pmarriedobj = xfl.fl_add_select(xfl.FL_DROPLIST_SELECT, 70, 80, \
             110, 27, "Married")
     xfl.fl_add_select_items(pmarriedobj, "Yes|No")
     self.preadyobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 150, 20, \
             140, 30, "Quit")
     xfl.fl_set_object_callback(self.preadyobj, self.exitcb, 0)
     xfl.fl_end_form()
コード例 #22
0
    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.ppositn = xfl.fl_add_positioner(xfl.FL_OVERLAY_POSITIONER, 50, 50, 210, 140, "My anonymous positioner")
        xfl.fl_set_object_boxtype(self.ppositn, xfl.FL_NO_BOX)
        xfl.fl_set_positioner_xbounds(self.ppositn, 1, 75)
        xfl.fl_set_positioner_ybounds(self.ppositn, 2, 150)
        xfl.fl_set_positioner_xvalue(self.ppositn, 50)
        xfl.fl_set_positioner_yvalue(self.ppositn, 50)
        xfl.fl_set_positioner_xstep(self.ppositn, 1)
        xfl.fl_set_positioner_ystep(self.ppositn, 2)
        xfl.fl_set_object_color(self.ppositn, xfl.FL_COL1, xfl.FL_RED)
        xfl.fl_set_object_lalign(self.ppositn, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.ppositn, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.ppositn, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.ppositn, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.ppositn, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.ppositn, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.ppositn, "u", 1)
        xfl.fl_set_object_callback(self.ppositn, self.positncb, 0)
        xfl.fl_set_object_return(self.ppositn, xfl.FL_RETURN_END_CHANGED)

        xfl.fl_end_form()
コード例 #23
0
    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.pformbrwsr = xfl.fl_add_formbrowser(xfl.FL_NORMAL_FORMBROWSER, 40, 40, 250, 180, 'A normal formbrowser')
        xfl.fl_set_object_boxtype(self.pformbrwsr, xfl.FL_OVAL3D_DOWNBOX)
        xfl.fl_set_object_color(self.pformbrwsr, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.pformbrwsr, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pformbrwsr, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pformbrwsr, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pformbrwsr, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pformbrwsr, xfl.FL_RESIZE_NONE)
        xfl.fl_set_object_gravity(self.pformbrwsr, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pformbrwsr, 'n', 1)
        xfl.fl_set_object_callback(self.pformbrwsr, self.formbrwsr_cb, 99)

        xfl.fl_end_form()
コード例 #24
0
    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.pvalslider = xfl.fl_add_valslider(xfl.FL_HOR_SLIDER, 10, 40, 290, 30, 'Horizontal way')
        xfl.fl_set_object_boxtype(self.pvalslider, xfl.FL_UP_BOX)
        xfl.fl_set_slider_bounds(self.pvalslider, 1, 25)
        xfl.fl_set_slider_value(self.pvalslider, 1)
        xfl.fl_set_slider_increment(self.pvalslider, 0.4, 0.5)
        xfl.fl_set_slider_size(self.pvalslider, 0.20)
        xfl.fl_set_slider_step(self.pvalslider, 1)
        xfl.fl_set_slider_precision(self.pvalslider, 3)
        xfl.fl_set_object_color(self.pvalslider, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.pvalslider, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pvalslider, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pvalslider, xfl.FL_TINY_SIZE)
        xfl.fl_set_object_lcol(self.pvalslider, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pvalslider, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pvalslider, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pvalslider, 'H', 1)
        xfl.fl_set_object_callback(self.pvalslider, self.slidercb, 4)
        xfl.fl_set_object_return(self.pvalslider, xfl.FL_RETURN_CHANGED|xfl.FL_RETURN_END)

        xfl.fl_end_form()
コード例 #25
0
    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.bitmapname = xfl.fl_add_bitmap(xfl.FL_NORMAL_BITMAP, 40, 30, 250, 100, 'bitmap')
        xfl.fl_set_object_boxtype(self.bitmapname, xfl.FL_NO_BOX)
        xfl.fl_set_bitmap_file(self.bitmapname, './bm2.xbm')
        xfl.fl_set_object_color(self.bitmapname, xfl.FL_COL1, xfl.FL_COL1)
        xfl.fl_set_object_lalign(self.bitmapname, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.bitmapname, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.bitmapname, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.bitmapname, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.bitmapname, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.bitmapname, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.bitmapname, 'b', 1)
        xfl.fl_set_object_callback(self.bitmapname, self.bitmapcb, 2)

        xfl.fl_end_form()
コード例 #26
0
    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.pbmbutton = xfl.fl_add_bitmapbutton(xfl.FL_NORMAL_BUTTON, 50, 40, 220, 90, 'xbmbutton')
        xfl.fl_set_object_boxtype(self.pbmbutton, xfl.FL_UP_BOX)
        xfl.fl_set_button_mouse_buttons(self.pbmbutton, 27)
        xfl.fl_set_bitmapbutton_file(self.pbmbutton, '././bm1.xbm')
        xfl.fl_set_object_color(self.pbmbutton, xfl.FL_COL1, xfl.FL_BLUE)
        xfl.fl_set_object_lalign(self.pbmbutton, xfl.FL_ALIGN_BOTTOM)
        xfl.fl_set_object_lstyle(self.pbmbutton, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.pbmbutton, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.pbmbutton, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.pbmbutton, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.pbmbutton, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.pbmbutton, 'm', 1)
        xfl.fl_set_object_callback(self.pbmbutton, self.buttoncb, 999)

        xfl.fl_end_form()
コード例 #27
0
 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()
コード例 #28
0
    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()
コード例 #29
0
    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.my3drnd = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 40, 30, 240, 70, 'My name is round3dbutton')
        xfl.fl_set_object_boxtype(self.my3drnd, xfl.FL_BORDER_BOX)
        xfl.fl_set_button_mouse_buttons(self.my3drnd, 30)
        xfl.fl_set_button(self.my3drnd, 1)
        xfl.fl_set_object_color(self.my3drnd, xfl.FL_COL1, xfl.FL_BLACK)
        xfl.fl_set_object_lalign(self.my3drnd, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.my3drnd, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.my3drnd, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.my3drnd, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.my3drnd, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.my3drnd, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.my3drnd, '3', 1)
        xfl.fl_set_object_callback(self.my3drnd, self.round3dcb, 22)

        xfl.fl_end_form()
コード例 #30
0
    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.plightbtn = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 60, 30, 210, 90, 'brain-on mode')
        xfl.fl_set_object_boxtype(self.plightbtn, xfl.FL_UP_BOX)
        xfl.fl_set_button_mouse_buttons(self.plightbtn, 29)
        xfl.fl_set_button(self.plightbtn, 1)
        xfl.fl_set_object_color(self.plightbtn, xfl.FL_COL1, xfl.FL_YELLOW)
        xfl.fl_set_object_lalign(self.plightbtn, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.plightbtn, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.plightbtn, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.plightbtn, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.plightbtn, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.plightbtn, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.plightbtn, 'o', 1)
        xfl.fl_set_object_callback(self.plightbtn, self.buttoncb, 555)

        xfl.fl_end_form()