Exemplo n.º 1
0
 def create_form_timerform(self):
     fdui = FD_timerform()
     fdui.timerform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 290, 210)
     xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 290, 210, "")
     xfl.fl_add_frame(xfl.FL_UP_FRAME, 0, 0, 290, 94, "")
     xfl.fl_add_frame(xfl.FL_UP_FRAME, 0, 100, 330, 190, "")
     xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 100, 170, 80, 30, "Done")
     fdui.timer = xfl.fl_add_timer(xfl.FL_VALUE_TIMER, 20, 30, 180, 40, "Timer")
     xfl.fl_set_object_boxtype(fdui.timer, xfl.FL_UP_BOX)
     xfl.fl_set_object_lsize(fdui.timer, xfl.FL_MEDIUM_SIZE)
     xfl.fl_set_object_lalign(fdui.timer, xfl.FL_ALIGN_TOP)
     xfl.fl_set_object_lstyle(fdui.timer, xfl.FL_TIMES_STYLE)
     xfl.fl_set_object_callback(fdui.timer, self.expired, 0)
     pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 20, 120, 80, 30, "Suspend")
     xfl.fl_set_object_callback(pobj, self.suspend_resume, 0)
     pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 100, 120, 80, 30, "Resume")
     xfl.fl_set_object_callback(pobj, self.suspend_resume, 1)
     pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 180, 120, 80, 30, "Reset")
     xfl.fl_set_object_callback(pobj, self.reset, 0)
     fdui.down = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 210, 20, 70, 30, "Down")
     xfl.fl_set_object_shortcut(fdui.down, "D#D", 1)
     xfl.fl_set_object_callback(fdui.down, self.timer_direction, 0)
     fdui.down = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 210, 50, 70, 30, "Up")
     xfl.fl_set_object_shortcut(fdui.down, "U#U", 1)
     xfl.fl_set_object_callback(fdui.down, self.timer_direction, 1)
     xfl.fl_end_form()
     return fdui
Exemplo n.º 2
0
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
Exemplo n.º 3
0
    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_buttonform(self):
     fdui = FD_buttonform()
     fdui.buttonform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 430, 210)
     pobj = xfl.fl_add_box(xfl.FL_FLAT_BOX, 0, 0, 430, 210, "")
     pobj1 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 30, 151, 80, 30, "Button")
     xfl.fl_set_object_lalign(pobj1, xfl.FL_ALIGN_CENTER)
     pobj2 = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 40, 91, 100, 30, "RoundButton")
     pobj3 = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 135, 151, 110, 30, "Round3DButton")
     xfl.fl_set_object_color(pobj3, xfl.FL_COL1, xfl.FL_BLUE)
     pobj4 = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 170, 111, 110, 30, "CheckButton")
     pobj4 = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 30, 31, 100, 30, "LightButton")
     pobj5 = xfl.fl_add_pixmapbutton(xfl.FL_NORMAL_BUTTON, 320, 36, 80, 80, "PixmapButton")
     xfl.fl_set_object_color(pobj5, xfl.FL_COL1, xfl.FL_YELLOW)
     xfl.fl_set_pixmapbutton_file(pobj5, "porsche.xpm")
     pobj6 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 185, 26, 100, 30, "Button")
     xfl.fl_set_object_boxtype(pobj6, xfl.FL_ROUNDED3D_UPBOX)
     xfl.fl_set_object_lalign(pobj6, xfl.FL_ALIGN_CENTER)
     pobj7 = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 290, 146, 100, 30, "Button")
     xfl.fl_set_object_boxtype(pobj7, xfl.FL_EMBOSSED_BOX)
     pobj8 = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 175, 71, 60, 25, "Button")
     xfl.fl_set_object_boxtype(pobj8, xfl.FL_SHADOW_BOX)
     xfl.fl_set_object_color(pobj8, xfl.FL_COL1, xfl.FL_SLATEBLUE)
     xfl.fl_set_object_lalign(pobj8, xfl.FL_ALIGN_CENTER)
     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.chkbutton = xfl.fl_add_checkbutton(xfl.FL_INOUT_BUTTON, 50, 30, 240, 100, "button")
        xfl.fl_set_object_boxtype(self.chkbutton, xfl.FL_NO_BOX)
        xfl.fl_set_button_mouse_buttons(self.chkbutton, 14)
        xfl.fl_set_button(self.chkbutton, 1)
        xfl.fl_set_object_color(self.chkbutton, xfl.FL_COL1, xfl.FL_YELLOW)
        xfl.fl_set_object_lalign(self.chkbutton, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(self.chkbutton, xfl.FL_NORMAL_STYLE)
        xfl.fl_set_object_lsize(self.chkbutton, xfl.FL_DEFAULT_SIZE)
        xfl.fl_set_object_lcol(self.chkbutton, xfl.FL_BLACK)
        xfl.fl_set_object_resize(self.chkbutton, xfl.FL_RESIZE_ALL)
        xfl.fl_set_object_gravity(self.chkbutton, xfl.FL_NoGravity, xfl.FL_NoGravity)
        xfl.fl_set_object_shortcut(self.chkbutton, "t", 1)
        xfl.fl_set_object_callback(self.chkbutton, self.buttoncb, 123)

        xfl.fl_end_form()
 def create_form_form0(self):
     fdui = FD_form0()
     fdui.form0 = xfl.fl_bgn_form(xfl.FL_NO_BOX, 320, 250)
     xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 320, 250, "")
     xfl.fl_add_frame(xfl.FL_ENGRAVED_FRAME, 200, 70, 95, 100, "")
     fdui.butt = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 20, 70, \
             170, 100, "A Button")
     fdui.enter = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 210, 70, \
             45, 30, "Enter")
     fdui.leave = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 210, 95, \
             40, 30, "Leave")
     fdui.push = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 210, 120, \
             50, 30, "Push")
     fdui.release = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 210, 140, \
             60, 30, "Release")
     pobj = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 55, 15, 220, 30, \
             "Pre-emptive Handler")
     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.peek = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 150, 40, \
             35, 30, "Peek")
     xfl.fl_set_object_color(fdui.peek, xfl.FL_COL1, xfl.FL_BLUE)
     fdui.override = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, \
             210, 40, 35, 30, "Override")
     xfl.fl_set_object_color(fdui.override, xfl.FL_COL1, xfl.FL_BLUE)
     fdui.event = xfl.fl_add_box(xfl.FL_FLAT_BOX, 40, 180, 245, 25, "")
     fdui.done = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 170, 210, \
             100, 30, "Done")
     xfl.fl_end_form()
     return fdui
Exemplo n.º 7
0
 def create_form_inputform(self):
     fdui = FD_inputform()
     fdui.inputform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 475, 485)
     pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 475, 485, "")
     fdui.input1 = xfl.fl_add_input(xfl.FL_MULTILINE_INPUT, 15, 275, \
             350, 180, "")
     xfl.fl_set_object_lalign(fdui.input1, xfl.FL_ALIGN_TOP)
     xfl.fl_set_object_callback(fdui.input1, self.input_callback, 1)
     fdui.howreturn = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON,
             375, 435, 80, 35, "always\nreturn")
     xfl.fl_set_object_color(fdui.howreturn, xfl.FL_COL1, xfl.FL_BLUE)
     xfl.fl_set_object_callback(fdui.howreturn, self.howreturn_callback, 0)
     fdui.status = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 20, 15, 270, 30, "")
     xfl.fl_set_object_boxtype(fdui.status, xfl.FL_FRAME_BOX)
     xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 375, 15, 80, 35, "Done")
     fdui.input2 = xfl.fl_add_input(xfl.FL_MULTILINE_INPUT, 15, 60, \
             349, 185, "")
     xfl.fl_set_object_lalign(fdui.input2, xfl.FL_ALIGN_TOP)
     xfl.fl_set_object_callback(fdui.input2, self.input_callback, 2)
     xfl.fl_end_form()
     return fdui
    def __init__(self, lsysargv, sysargv):
        # application default. Can be overriden by the command line options
        xfl.fl_set_border_width(1)
        xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0)
        self.pbwform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 380, 340)
        self.pbwgroup = xfl.fl_bgn_group()
        xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 380, 340, "")
        xfl.fl_add_frame(xfl.FL_EMBOSSED_FRAME, 220, 60, 135, 145, "")
        xfl.fl_add_frame(xfl.FL_ENGRAVED_FRAME, 15, 60, 185, 145, "")
        xfl.fl_add_slider(xfl.FL_HOR_SLIDER, 25, 70, 160, 20, "")
        xfl.fl_add_valslider(xfl.FL_HOR_BROWSER_SLIDER, 25, 105, \
                160, 20, "")
        self.pobj = xfl.fl_add_scrollbar(xfl.FL_HOR_THIN_SCROLLBAR,
                25, 140, 160, 20, "")
        xfl.fl_set_scrollbar_size(self.pobj, 0.2)
        xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 25, 175, \
                160, 20, "")
        self.ppmobj = xfl.fl_add_pixmapbutton(xfl.FL_NORMAL_BUTTON, \
                305, 145, 40, 35, "")
        xfl.fl_add_positioner(xfl.FL_NORMAL_POSITIONER, 30, 225, \
                100, 80, "")
        xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 230, 65, 100, 28, \
                "Button")
        xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 230, 98, 100, 28, \
                "LightButton")
        xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 230, 128, \
                80, 32, "Button")
        self.pobj = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, \
                230, 152, 80, 32, "Button")
        xfl.fl_set_object_color(self.pobj, xfl.FL_COL1, xfl.FL_BLUE)
        xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 230, 175, \
                80, 32, "Button")
        xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 195, 240, 160, 28, \
                "Input")
        self.pbwselect = xfl.fl_add_select(xfl.FL_MENU_SELECT, 105, \
                20, 100, 28, "Border Width")
        xfl.fl_set_object_callback(self.pbwselect, self.bw_callback, 0)
        xfl.fl_end_group()
        self.pdoneobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 270, 290, \
                75, 30, "Done")
        xfl.fl_set_object_callback(self.pdoneobj, self.done_callback, 0)
        xfl.fl_end_form()
        # end create_form_bwform

        # form initialization code
        xfl.fl_set_pixmapbutton_file(self.ppmobj, "crab.xpm")
        xfl.fl_add_select_items(self.pbwselect, \
                "-5 Pixel|-4 Pixel|-3 Pixel|-2 Pixel|-1 Pixel|" \
                " 1 Pixel| 2 Pixel| 3 Pixel| 4 Pixel| 5 Pixel")
        pbw = xfl.fl_get_border_width()
        if (pbw < -5 or pbw == 0 or pbw > 5):
            pbw = -2
            xfl.fl_set_border_width(pbw)

        txt = "%2d Pixel" % pbw
        ppupentr = xfl.fl_get_select_item_by_label(self.pbwselect, txt)
        xfl.fl_set_select_item(self.pbwselect, ppupentr)

        # show the form
        xfl.fl_show_form(self.pbwform, xfl.FL_PLACE_CENTER, \
                xfl.FL_TRANSIENT, "bwform")

        while xfl.fl_do_forms():
            pass                # empty
    def create_form_buttform(self):
        fdui = FD_buttform()

        fdui.buttform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 290, 260)

        fdui.backface = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 290, \
                260, "")

        fdui.done = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 185, \
                215, 90, 30, "Done")
        xfl.fl_set_object_lalign(fdui.done, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_callback(fdui.done, self.done_cb, 0)

        fdui.objsgroup = xfl.fl_bgn_group()

        pobj = xfl.fl_add_frame(xfl.FL_ENGRAVED_FRAME, 175, 170, \
                100, 30, "")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_GREEN)

        pobj = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 210, 170, \
                30, 30, "")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_GREEN)

        fdui.bbutt = xfl.fl_add_bitmapbutton(xfl.FL_NORMAL_BUTTON, \
                25, 85, 40, 40, "bitmapbutton")
        xfl.fl_set_object_color(fdui.bbutt, xfl.FL_COL1, \
                xfl.FL_BLACK)

        fdui.pbutt = xfl.fl_add_pixmapbutton(xfl.FL_NORMAL_BUTTON, \
                25, 25, 40, 40, "pixmapbutton")
        xfl.fl_set_object_color(fdui.pbutt, xfl.FL_COL1, \
                xfl.FL_YELLOW)

        pobj = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 100, 31, \
                70, 32, "Red")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_RED)

        pobj = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 100, 60, \
                70, 32, "Green")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_GREEN)

        pobj = xfl.fl_add_checkbutton(xfl.FL_RADIO_BUTTON, 100, 90, \
                70, 32, "Blue")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)

        pobj = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 20, 170, \
                108, 30, "LightButton")
        xfl.fl_set_button(pobj, 1)

        pobj = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 200, 35, \
                75, 25, "Red")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_RED)

        pobj = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 200, 64, \
                75, 25, "Green")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_GREEN)

        pobj = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 200, 93, \
                75, 25, "Blue")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)

        pobj = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 180, 170, \
                30, 30, "")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_RED)

        pobj = xfl.fl_add_round3dbutton(xfl.FL_PUSH_BUTTON, 240, 170, \
                30, 30, "")
        xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)

        pobj = xfl.fl_add_button(xfl.FL_PUSH_BUTTON, 130, 210, 30, 30, "go")
        xfl.fl_set_object_boxtype(pobj, xfl.FL_OVAL3D_UPBOX)
        xfl.fl_set_object_lalign(pobj, xfl.FL_ALIGN_CENTER)
        xfl.fl_set_object_lstyle(pobj, xfl.FL_BOLD_STYLE)

        pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 20, 210, \
                90, 30, "Button")
        xfl.fl_set_object_boxtype(pobj, xfl.FL_ROUNDED3D_UPBOX)
        xfl.fl_set_object_lalign(pobj, xfl.FL_ALIGN_CENTER)

        fdui.bw_obj = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 105, 135, \
                80, 30, "BW")
        xfl.fl_set_object_callback(fdui.bw_obj, self.bw_cb, 0)

        pobj = xfl.fl_add_labelframe(xfl.FL_ENGRAVED_FRAME, 190, 25, \
                85, 100, "RoundButton")

        pobj = xfl.fl_add_labelframe(xfl.FL_ENGRAVED_FRAME, 90, 25, \
                90, 100, "CheckButton")

        xfl.fl_end_group()
        xfl.fl_end_form()

        return fdui
Exemplo n.º 10
0
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
Exemplo n.º 11
0
def create_form_drawfree():
    #gctx = xfl.fl_gc()       #xfl.fl_state[xfl.fl_get_vclass()].gc[0]
    #xfl.fl_set_background(gctx, xfl.FL_BLACK)
    fdui = FD_drawfree()
    fdui.drawfree = xfl.fl_bgn_form(xfl.FL_NO_BOX, 530, 490)
    pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 530, 490, "")
    pobj = xfl.fl_add_frame(xfl.FL_DOWN_FRAME, 145, 30, 370, 405, "")
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthWest, xfl.FL_SouthEast)
    fdui.freeobj = xfl.fl_add_free(xfl.FL_NORMAL_FREE, 145, 30, \
            370, 405, "", freeobject_handler)
    xfl.fl_set_object_gravity(fdui.freeobj, xfl.FL_NorthWest, \
            xfl.FL_SouthEast)
    xfl.fl_set_object_color(fdui.freeobj, xfl.FL_WHITE, xfl.FL_BLACK)
    pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 15, 25, 100, 35, \
            "Outline")
    xfl.fl_set_object_color(pobj, xfl.FL_MCOL, xfl.FL_BLUE)
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthWest, xfl.FL_NorthWest)
    xfl.fl_set_object_callback(pobj, fill_cb, 0)
    fdui.figgrp = xfl.fl_bgn_group()
    fdui.drobj[0] = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 10, 60, 40, \
            40, "@#circle")
    xfl.fl_set_object_lcol(fdui.drobj[0], xfl.FL_YELLOW)
    xfl.fl_set_object_callback(fdui.drobj[0], switch_object, 0)
    fdui.drobj[1] = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 50, 60, 40, \
            40, "@#square")
    xfl.fl_set_object_lcol(fdui.drobj[1], xfl.FL_YELLOW)
    xfl.fl_set_object_callback(fdui.drobj[1], switch_object, 1)
    fdui.drobj[2] = xfl.fl_add_button(xfl.FL_RADIO_BUTTON, 90, 60, 40, \
            40, "@#8>")
    xfl.fl_set_object_lcol(fdui.drobj[2], xfl.FL_YELLOW)
    xfl.fl_set_object_callback(fdui.drobj[2], switch_object, 2)
    xfl.fl_end_group()
    fdui.colgrp = xfl.fl_bgn_group()
    fdui.colorobj = xfl.fl_add_box(xfl.FL_BORDER_BOX, 25, 140, 90, 25, "")
    fdui.rsli = xfl.fl_add_slider(xfl.FL_VERT_FILL_SLIDER, 25, 170, \
            30, 125, "")
    xfl.fl_set_object_color(fdui.rsli, xfl.FL_COL1, xfl.FL_RED)
    xfl.fl_set_object_callback(fdui.rsli, change_color, 0)
    xfl.fl_set_object_return(fdui.rsli, xfl.FL_RETURN_CHANGED)
    fdui.gsli = xfl.fl_add_slider(xfl.FL_VERT_FILL_SLIDER, 55, 170, \
            30, 125, "")
    xfl.fl_set_object_color(fdui.gsli, xfl.FL_COL1, xfl.FL_GREEN)
    xfl.fl_set_object_callback(fdui.gsli, change_color, 1)
    xfl.fl_set_object_return(fdui.gsli, xfl.FL_RETURN_CHANGED)
    fdui.bsli = xfl.fl_add_slider(xfl.FL_VERT_FILL_SLIDER, 85, 170, \
            30, 125, "")
    xfl.fl_set_object_color(fdui.bsli, xfl.FL_COL1, xfl.FL_BLUE)
    xfl.fl_set_object_callback(fdui.bsli, change_color, 2)
    xfl.fl_set_object_return(fdui.bsli, xfl.FL_RETURN_CHANGED)
    xfl.fl_end_group()
    fdui.miscgrp = xfl.fl_bgn_group()
    pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 420, 455, 105, 30, "Quit")
    xfl.fl_set_button_shortcut(pobj, "Qq#q", 1)
    pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 280, 445, 105, \
            30, "Refresh")
    xfl.fl_set_object_callback(pobj, refresh_cb, 0)
    pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 165, 445, 105, \
            30, "Clear")
    xfl.fl_set_object_callback(pobj, clear_cb, 0)
    xfl.fl_end_group()
    fdui.sizegrp = xfl.fl_bgn_group()
    fdui.hsli = xfl.fl_add_valslider(xfl.FL_HOR_SLIDER, 15, 410, 120, 25, \
            "Height")
    xfl.fl_set_object_lalign(fdui.hsli, xfl.FL_ALIGN_TOP)
    xfl.fl_set_object_callback(fdui.hsli, change_size, 1)
    xfl.fl_set_object_return(fdui.hsli, xfl.FL_RETURN_CHANGED)
    fdui.wsli = xfl.fl_add_valslider(xfl.FL_HOR_SLIDER, 15, 370, \
            120, 25, "Width")
    xfl.fl_set_object_lalign(fdui.wsli, xfl.FL_ALIGN_TOP)
    xfl.fl_set_object_callback(fdui.wsli, change_size, 0)
    xfl.fl_set_object_return(fdui.wsli, xfl.FL_RETURN_CHANGED)
    xfl.fl_end_group()
    xfl.fl_end_form()
    return fdui
def create_form_axypform():

    fdui = FD_axyform()

    fdui.axypform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 431, 301)

    xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 431, 301, "")

    fdui.xyplot = xfl.fl_add_xyplot(xfl.FL_ACTIVE_XYPLOT, 20, 50, \
            285, 235, "")
    xfl.fl_set_xyplot_xscale(fdui.xyplot, xfl.FL_LOG, 2.0)
    xfl.fl_set_xyplot_yscale(fdui.xyplot, xfl.FL_LOG, 2.0)

    xfl.fl_set_object_boxtype(fdui.xyplot, xfl.FL_DOWN_BOX)
    xfl.fl_set_object_color(fdui.xyplot, xfl.FL_BLACK, xfl.FL_GREEN)
    xfl.fl_set_object_lalign(fdui.xyplot, \
            xfl.fl_to_inside_lalign(xfl.FL_ALIGN_BOTTOM))

    xfl.fl_set_object_callback(fdui.xyplot, xyplot_cb, 0)
    xfl.fl_set_object_gravity(fdui.xyplot, xfl.FL_NorthWest, xfl.FL_SouthEast)

    pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 315, 40, 80, 25, \
            "AlwaysReturn")
    xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)
    xfl.fl_set_object_callback(pobj, alwaysreturn_cb, 0)
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthEast, xfl.FL_NorthEast)

    pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 315, 65, 80, 25, \
            "Interpolate")
    xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)
    xfl.fl_set_object_callback(pobj, interpolate_cb, 0)
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthEast, xfl.FL_NorthEast)

    pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 315, 90, 85, 25, \
            "InspectOnly")
    xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)
    xfl.fl_set_object_callback(pobj, inspect_cb, 0)
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthEast, xfl.FL_NorthEast)

    pobj = xfl.fl_add_checkbutton(xfl.FL_PUSH_BUTTON, 315, 120, 85, 25, \
            "NoTics")
    xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_BLUE)
    xfl.fl_set_object_callback(pobj, notic_cb, 0)
    xfl.fl_set_object_gravity(pobj, xfl.FL_NorthEast, xfl.FL_NorthEast)

    fdui.xmin = xfl.fl_add_input(xfl.FL_FLOAT_INPUT, 315, 150, 50, 20,
            " x_min")
    xfl.fl_set_input(fdui.xmin, "1.0")
    xfl.fl_set_object_lalign(fdui.xmin, xfl.FL_ALIGN_RIGHT)
    xfl.fl_set_object_callback(fdui.xmin, bounds_cb, 0)
    xfl.fl_set_object_gravity(fdui.xmin, xfl.FL_NorthEast, xfl.FL_NorthEast)

    fdui.xmax = xfl.fl_add_input(xfl.FL_FLOAT_INPUT, 315, 170, 50, 20,
            " x_max")
    xfl.fl_set_input(fdui.xmax, "10.0")
    xfl.fl_set_object_lalign(fdui.xmax, xfl.FL_ALIGN_RIGHT)
    xfl.fl_set_object_callback(fdui.xmax, bounds_cb, 0)
    xfl.fl_set_object_gravity(fdui.xmax, xfl.FL_NorthEast, xfl.FL_NorthEast)

    fdui.ymin = xfl.fl_add_input(xfl.FL_FLOAT_INPUT, 315, 200, 50, 20,
             " y_min")
    xfl.fl_set_input(fdui.ymin, "1.0")
    xfl.fl_set_object_lalign(fdui.ymin, xfl.FL_ALIGN_RIGHT)
    xfl.fl_set_object_callback(fdui.ymin, bounds_cb, 1)
    xfl.fl_set_object_gravity(fdui.ymin, xfl.FL_NorthEast, xfl.FL_NorthEast)

    fdui.ymax = xfl.fl_add_input(xfl.FL_FLOAT_INPUT, 315, 220, 50, 20,
             " y_max")
    xfl.fl_set_input(fdui.ymax, "10.0")
    xfl.fl_set_object_lalign(fdui.ymax, xfl.FL_ALIGN_RIGHT)
    xfl.fl_set_object_callback(fdui.ymax, bounds_cb, 1)
    xfl.fl_set_object_gravity(fdui.ymax, xfl.FL_NorthEast, xfl.FL_NorthEast)

    fdui.status = xfl.fl_add_box(xfl.FL_BORDER_BOX, 20, 15, 285, 25, "")
    xfl.fl_set_object_boxtype(fdui.status, xfl.FL_DOWN_BOX)
    xfl.fl_set_object_gravity(fdui.status, xfl.FL_NorthWest, xfl.FL_NorthEast)
    xfl.fl_set_object_lalign(fdui.status, xfl.FL_ALIGN_CENTER)

    pobj = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 325, 250, 90, 30, "Done")
    xfl.fl_set_object_gravity(pobj, xfl.FL_SouthEast, xfl.FL_SouthEast)

    xfl.fl_end_form()

    return fdui