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
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, "Menu 1") xfl.fl_set_object_shortcut(self.pmenu1, "1#1", 1) self.pmenu2 = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 102, 2, \ 110, 25, "Menu 2") xfl.fl_set_object_shortcut(self.pmenu2, "2#2", 1) xfl.fl_end_form() return pform
def create_form_choiceform(self): fdui = FD_choiceform() fdui.choiceform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 431, 211) pobj = xfl.fl_add_box(xfl.FL_FLAT_BOX, 0, 0, 431, 211, "") fdui.pulldown = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 45, 36, 45, 21, "Menu") xfl.fl_set_object_color(fdui.pulldown, xfl.FL_COL1, xfl.FL_LEFT_BCOL) xfl.fl_set_object_lstyle(fdui.pulldown, xfl.FL_BOLD_STYLE) fdui.choice = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 24, 93, 111, 27, "") fdui.browser = xfl.fl_add_browser(xfl.FL_HOLD_BROWSER, 257, 14, 154, 179, "") xfl.fl_set_object_color(fdui.browser, xfl.FL_COL1, xfl.FL_YELLOW) fdui.pushmenu = xfl.fl_add_nmenu(xfl.FL_BUTTON_NMENU, 152, 51, 75, 26, "Menu") xfl.fl_set_object_boxtype(fdui.pushmenu, xfl.FL_UP_BOX) xfl.fl_set_object_lstyle(fdui.pushmenu, xfl.FL_BOLD_STYLE) xfl.fl_end_form() return fdui
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
def create_form(self): self.pform = xfl.fl_bgn_form(xfl.FL_NO_BOX, 720, 520) pobj = xfl.fl_add_box(xfl.FL_UP_BOX, 0, 0, 720, 520, "") xfl.fl_set_object_color(pobj, xfl.FL_BLUE, xfl.FL_COL1) pobj = xfl.fl_add_box(xfl.FL_DOWN_BOX, 10, 90, 700, 420, "") xfl.fl_set_object_color(pobj, xfl.FL_COL1, xfl.FL_COL1) pobj = xfl.fl_add_box(xfl.FL_DOWN_BOX, 10, 10, 700, 70, "") xfl.fl_set_object_color(pobj, xfl.FL_SLATEBLUE, xfl.FL_COL1) tobj[0] = xfl.fl_add_box(xfl.FL_UP_BOX, 30, 110, 110, 110, "Box") tobj[1] = xfl.fl_add_text(xfl.FL_NORMAL_TEXT, 30, 240, 110, 30, "Text") tobj[2] = xfl.fl_add_bitmap(xfl.FL_NORMAL_BITMAP, 40, 280, 90, 80, "Bitmap") xfl.fl_set_object_lcol(tobj[2], xfl.FL_BLUE) tobj[3] = xfl.fl_add_chart(xfl.FL_BAR_CHART, 160, 110, 160, 110, "Chart") tobj[4] = xfl.fl_add_clock(xfl.FL_ANALOG_CLOCK, 40, 390, 90, 90, "Clock") xfl.fl_set_object_dblbuffer(tobj[4], 1) tobj[5] = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 340, 110, 120, 30, "Button") tobj[6] = xfl.fl_add_lightbutton(xfl.FL_PUSH_BUTTON, 340, 150, 120, 30, "Lightbutton") tobj[7] = xfl.fl_add_roundbutton(xfl.FL_PUSH_BUTTON, 340, 190, 120, 30, "Roundbutton") tobj[8] = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 160, 250, 40, 230, "Slider") tobj[9] = xfl.fl_add_valslider(xfl.FL_VERT_SLIDER, 220, 250, 40, 230, "Valslider") tobj[10] = xfl.fl_add_dial(xfl.FL_LINE_DIAL, 280, 250, 100, 100, "Dial") tobj[11] = xfl.fl_add_positioner(xfl.FL_NORMAL_POSITIONER, 280, 380, 150, 100, "Positioner") tobj[12] = xfl.fl_add_counter(xfl.FL_NORMAL_COUNTER, 480, 110, 210, 30, "Counter") tobj[13] = xfl.fl_add_input(xfl.FL_NORMAL_INPUT, 520, 170, 170, 30, "Input") tobj[14] = xfl.fl_add_nmenu(xfl.FL_NORMAL_NMENU, 400, 240, 100, 30, "Menu") tobj[15] = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 580, 250, 110, 30, "Select") tobj[16] = xfl.fl_add_timer(xfl.FL_VALUE_TIMER, 580, 210, 110, 30, "Timer") xfl.fl_set_object_dblbuffer(tobj[16], 1) tobj[17] = xfl.fl_add_browser(xfl.FL_NORMAL_BROWSER, 450, 300, 240, 180, "Browser") self.pexitob = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 590, 30, 100, 30, "Exit") self.pbtypeob = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 110, 30, 130, 30, "Boxtype") xfl.fl_set_object_callback(self.pbtypeob, self.boxtype_cb, 0) xfl.fl_popup_set_title(xfl.fl_get_select_popup(self.pbtypeob), "Boxtype") self.pmodeob = xfl.fl_add_select(xfl.FL_NORMAL_SELECT, 370, 30, 130, 30, "Graphics mode") xfl.fl_set_object_callback(self.pmodeob, self.mode_cb, 0) xfl.fl_popup_set_title(xfl.fl_get_select_popup(self.pmodeob), "Graphics mode") xfl.fl_end_form()