def make_folder(self, folder):
     # x = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
     y = [5.5, 4, 4.5, 3.8, 4, 5]
     label = ["Mon", "Tue", "Wed", "Thur", "Fri", "Sat"]
     fd_buttonform = self.create_form_buttonform()
     fd_staticform = self.create_form_staticform()
     fd_valuatorform = self.create_form_valuatorform()
     fd_choiceform = self.create_form_choiceform()
     fd_inputform = self.create_form_inputform()
     # fill-in form initialization code
     for i in range(0, len(y)):
         xfl.fl_add_chart_value(fd_staticform.chart, y[i], label[i], i + 1)
     xfl.fl_add_nmenu_items(fd_choiceform.pulldown, "MenuEntry1|MenuEntry2|MenuEntry3|MenuEntry4")
     xfl.fl_add_nmenu_items(fd_choiceform.pushmenu, "MenuEntry1|MenuEntry2|MenuEntry3")
     xfl.fl_add_select_items(fd_choiceform.choice, "Choice1|Choice2|Choice3|Choice4|Choice5|Choice6")
     xfl.fl_load_browser(fd_choiceform.browser, "Readme")
     xfl.fl_addto_tabfolder(folder, "ButtonObj", fd_buttonform.buttonform)
     xfl.fl_addto_tabfolder(folder, "StaticObj", fd_staticform.staticform)
     xfl.fl_addto_tabfolder(folder, "ValuatorObj", fd_valuatorform.valuatorform)
     xfl.fl_addto_tabfolder(folder, "ChoiceObj", fd_choiceform.choiceform)
     xfl.fl_addto_tabfolder(folder, "InputObj", fd_inputform.inputform)
예제 #2
0
def init_gui(fd):
    x = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]
    y = [5.5, 4.0, 4.5, 3.8, 4.0, 5.0]
    label = ["Mon", "Tue", "Wed", "Thur", "Fri", "Sat"]
    xfl.fl_add_nmenu_items(fd.menu, "One\tF1|Two\tF2|Three\tF3|Four\tF4")
    xfl.fl_add_select_items(fd.choice, "Option1|Option2|Option3")
    crab = xfl.fls_import_xpmdata_from_file("crab45.xpm")
    xfl.fl_set_pixmapbutton_data(fd.pixbutton, crab)
    xfl.fl_set_pixmap_data(fd.pix, crab)
    bm1_width, bm1_height, bm1_bits = xfl.fls_import_xbmdata_from_file( \
            "bm1.xbm")
    xfl.fl_set_bitmapbutton_data(fd.bitbutton, bm1_width, bm1_height, \
            bm1_bits)
    nomail_width, nomail_height, nomail_bits = \
            xfl.fls_import_xbmdata_from_file("nomail.xbm")
    xfl.fl_set_bitmap_data(fd.bit, nomail_width, nomail_height, nomail_bits)
    xfl.fl_set_browser_fontsize(fd.browser, xfl.FL_NORMAL_SIZE)
    xfl.fl_addto_browser(fd.browser, "browser line 1\nbrowser line 2")
    xfl.fl_addto_browser(fd.browser, "browser line 3\nbrowser line 4")
    xfl.fl_addto_browser(fd.browser, "browser line 5\nbrowser line 6")
    xfl.fl_addto_browser(fd.browser, "browser line 7\nbrowser line 8")
    xfl.fl_addto_browser(fd.browser, "browser line 9\nbrowser line 10")
    xfl.fl_addto_browser(fd.browser, "browser line 11\nbrowser line 12")
    xfl.fl_addto_browser(fd.browser, "browser line 13\nbrowser line 14")
    xfl.fl_addto_browser(fd.browser, "browser line 15\nbrowser line 16")
    xfl.fl_addto_browser(fd.browser, "browser line 17\nbrowser line 18")
    for i in range(0, len(y)):
        xfl.fl_add_chart_value(fd.chart, y[i], label[i], i + 1)
    xfl.fl_set_xyplot_data(fd.xyplot, x, y, 6, "", "","")
    xfl.fl_add_xyplot_overlay(fd.xyplot, 1, x, y, 6, xfl.FL_RED)
    xfl.fl_add_xyplot_text(fd.xyplot, 2.5, 5.2, "Weekly Summary", \
            xfl.FL_ALIGN_CENTER, xfl.FL_BLUE)
    xfl.fl_add_xyplot_text(fd.xyplot, 3, 3.85, "@-22->", xfl.FL_ALIGN_TOP, \
            xfl.FL_RED)
    xfl.fl_set_xyplot_overlay_type(fd.xyplot, 1, xfl.FL_NORMAL_XYPLOT)
    xfl.fl_set_xyplot_alphaxtics(fd.xyplot, "Mon|Tue|Wed|Thu|Fri|Sat", "")
    xfl.fl_set_xyplot_ytics(fd.xyplot, -1, -1)
    xfl.fl_set_xyplot_linewidth(fd.xyplot, 0, 3)
예제 #3
0
    def __init__(self, lsysargv, sysargv):
        self.pform = self.pexitob = self.pbtypeob = self.pmodeob = None

        c = xfl.FL_BLACK
        # 	char **p;
        # 	VN_struct *vn;
        # 	VN_struct *g = gmode,
        # 		      *gs = g + sizeof gmode / sizeof *gmode;

        xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0)

        self.create_form()

        sorceress_width, sorceress_height, sorceress_bits = xfl.fls_import_xbmdata_from_file("srs.xbm")
        xfl.fl_set_bitmap_data(tobj[2], sorceress_width, sorceress_height, sorceress_bits)

        xfl.fl_add_chart_value(tobj[3], 15, "Item 1", c)
        c += 1
        xfl.fl_add_chart_value(tobj[3], 5, "Item 2", c)
        c += 1
        xfl.fl_add_chart_value(tobj[3], -10, "Item 3", c)
        c += 1
        xfl.fl_add_chart_value(tobj[3], 25, "Item 4", c)
        c += 1

        xfl.fl_add_nmenu_items(tobj[14], "Item 1|Item 2|Item 3|Item 4|item 5")

        xfl.fl_add_select_items(tobj[15], "Item 1")
        xfl.fl_add_select_items(tobj[15], "Item 2")
        xfl.fl_add_select_items(tobj[15], "Item 3")
        xfl.fl_add_select_items(tobj[15], "Item 4")
        xfl.fl_add_select_items(tobj[15], "Item 5")

        xfl.fl_set_timer(tobj[16], 1000.0)

        # for ( p = browserlines; *p; p++ )
        for p in browserlines:
            xfl.fl_add_browser_line(tobj[17], p)

        # 	for ( vn = btypes; vn->val >= 0; vn++ )
        for vn in btypes:
            xfl.fl_add_select_items(self.pbtypeob, vn["name"])

        # 	for ( i = 1; g < gs; g++, i++ )
        for g in range(0, len(gmode)):
            pitem = xfl.fl_add_select_items(self.pmodeob, gmode[g]["name"])

            if not xfl.fl_mode_capable(gmode[g]["val"], 0):
                xfl.fl_popup_entry_set_state(pitem, xfl.FL_POPUP_DISABLED)

        # xfl.fl_vmode not working??
        xfl.fl_set_select_item(
            self.pmodeob, xfl.fl_get_select_item_by_value(self.pmodeob, xfl.fl_get_vclass())
        )  # 5 xfl.fl_get_vclass()))  #xfl.fl_vmode.value))

        xfl.fl_set_select_item(self.pbtypeob, xfl.fl_get_select_item_by_value(self.pbtypeob, 1))
        self.boxtype_cb(self.pbtypeob, 0)

        xfl.fl_show_form(self.pform, xfl.FL_PLACE_MOUSE, border, "Box types")

        while True:
            if xfl.fl_is_same_object(xfl.fl_do_forms(), self.pexitob):
                break

        xfl.fl_finish()