def fl_add_pixmap(pixmaptype, xpos, ypos, width, height, label): """fl_add_pixmap(pixmaptype, xpos, ypos, width, height, label) -> ptr_flobject Adds a pixmap flobject (plain text multi-color image format). The label is by default placed below the pixmap. The pixmap is empty on creation. Parameters ---------- pixmaptype : int type of pixmap to be added. Values (from xfdata.py) FL_NORMAL_PIXMAP (normal pixmap flobject type) xpos : int horizontal position (upper-left corner) ypos : int vertical position of bitmap (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of pixmap Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT flobject created Examples -------- >>> fl_add_pixmap(xfdata.FL_NORMAL_PIXMAP, 320, 200, 100, 100, "MyPixmap") Notes ----- Status: UnitTest + Doc + Demo = OK """ _fl_add_pixmap = library.cfuncproto( library.load_so_libforms(), "fl_add_pixmap", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_pixmap(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(pixmaptype, \ xfdata.PIXMAPTYPE_list) i_pixmaptype = library.convert_to_intc(pixmaptype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(pixmaptype, xpos, ypos, width, height, \ label, i_pixmaptype, i_xpos, i_ypos, i_width, i_height, \ s_label) retval = _fl_add_pixmap(i_pixmaptype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_formbrowser(frmbrwstype, xpos, ypos, width, height, label): """fl_add_formbrowser(frmbrwstype, xpos, ypos, width, height, label) -> ptr_flform Adds a formbrowser flobject. It is a container class that is capable of holding multiple forms, the height of which in aggregate may exceed the screen height. The formbrowser also works obviously for a single form that has a height that is larger than the screen height. Parameters ---------- frmbrwstype : int type of formbrowser to be added. Values (from xfdata.py) FL_NORMAL_FORMBROWSER (normal formbrowser type) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of formbrowser Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT formbrowser flobject added Examples -------- >>> pfrmbrobj = fl_add_formbrowser(xfdata.FL_NORMAL_FORMBROWSER, 110, 60, 550, 750, "My Formbrowser) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_add_formbrowser = library.cfuncproto( library.load_so_libforms(), "fl_add_formbrowser", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_formbrowser(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(frmbrwstype, \ xfdata.FORMBRWSTYPE_list) i_frmbrwstype = library.convert_to_intc(frmbrwstype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(frmbrwstype, xpos, ypos, width, height, label, \ i_frmbrwstype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_formbrowser(i_frmbrwstype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_set_formbrowser_scroll(ptr_flobject, howscroll): """fl_set_formbrowser_scroll(ptr_flobject, howscroll) Changes the vertical scrollbar so each action of the scrollbar scrolls to the next forms. By default it scrolls a fixed number of pixels. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT formbrowser flobject howscroll : int How it scrolls. Values (from xfdata.py) - FL_SMOOTH_SCROLL (Default scroll), - FL_JUMP_SCROLL (Scrolls in form increments). Examples -------- >>> fl_set_formbrowser_scroll(pfrmbrobj, xfdata.FL_JUMP_SCROLL) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_formbrowser_scroll = library.cfuncproto( library.load_so_libforms(), "fl_set_formbrowser_scroll", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """void fl_set_formbrowser_scroll(FL_OBJECT * ob, int how)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(howscroll, \ xfdata.FORMBRWSSCROLL_list) i_howscroll = library.convert_to_intc(howscroll) library.keep_elem_refs(ptr_flobject, howscroll, i_howscroll) _fl_set_formbrowser_scroll(ptr_flobject, i_howscroll)
def fl_add_clock(clocktype, xpos, ypos, width, height, label): """fl_add_clock(clocktype, xpos, ypos, width, height, label) -> ptr_flobject Adds a clock flobject. Parameters ---------- clocktype : int type of clock to be added. Values (from xfdata.py) - FL_ANALOG_CLOCK (An analog clock complete with the second hand), - FL_DIGITAL_CLOCK (A digital clock) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of clock Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT clock flobject added Examples -------- >>> pclkobj = fl_add_clock(xfdata.FL_ANALOG_CLOCK, 150, 210, 220, 200, "My great clock") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_clock = library.cfuncproto( library.load_so_libforms(), "fl_add_clock", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_clock(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * s)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(clocktype, \ xfdata.CLOCKTYPE_list) i_clocktype = library.convert_to_intc(clocktype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(clocktype, xpos, ypos, width, height, label, \ i_clocktype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_clock(i_clocktype, i_xpos, i_ypos, i_width, i_height, \ s_label) return retval
def fl_add_glcanvas(canvastype, xpos, ypos, width, height, label): """fl_add_glcanvas(canvastype, xpos, ypos, width, height, label) -> ptr_flobject Adds a glcanvas flobject to the form. Parameters ---------- canvastype : int type of glcanvas to be added. Values (from xfdata.py) - FL_NORMAL_CANVAS (normal canvas type), - FL_SCROLLED_CANVAS (not enabled) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of glcanvas Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT glcanvas flobject added Examples -------- >>> pglcnvobj = fl_add_glcanvas(xfdata.FL_NORMAL_CANVAS, 14, 21, 654, 457, "My Gl Canvas") Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_add_glcanvas = library.cfuncproto( library.load_so_libformsgl(), "fl_add_glcanvas", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_glcanvas(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(canvastype, \ xfdata.CANVASTYPE_list) i_canvastype = library.convert_to_intc(canvastype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(canvastype, xpos, ypos, width, height, label, \ i_canvastype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_glcanvas(i_canvastype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_counter(countertype, xpos, ypos, width, height, label): """fl_add_counter(countertype, xpos, ypos, width, height, label) -> ptr_flobject Adds a counter flobject. Parameters ---------- countertype : int type of counter to be added. Values (from xfdata.py) FL_NORMAL_COUNTER (A counter with two buttons on each side), FL_SIMPLE_COUNTER (A counter with one button on each side). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of counter Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT counter flobject added Examples -------- >>> pcntrobj = fl_add_counter(FL_NORMAL_COUNTER, 142, 230, 142, 100, "My Counter") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_counter = library.cfuncproto( library.load_so_libforms(), "fl_add_counter", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_counter(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(countertype, \ xfdata.COUNTERTYPE_list) i_countertype = library.convert_to_intc(countertype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(countertype, xpos, ypos, width, height, label, \ i_countertype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_counter(i_countertype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_set_pixmap_align(ptr_flobject, align, xmargin, ymargin): """fl_set_pixmap_align(ptr_flobject, align, xmargin, ymargin) Changes alignment of a pixmap. By default it is displayed centered inside the bounding box; although you can place a pixmap outside of the bounding box, it probably is not a good idea. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT pixmap flobject align : int alignment of pixmap. Values (from xfdata.py) - FL_ALIGN_CENTER (In the middle of the box, inside it), - FL_ALIGN_TOP (To the top of the box, outside it), - FL_ALIGN_BOTTOM (To the bottom of the box, outside it), - FL_ALIGN_LEFT (To the left of the box, outside it), - FL_ALIGN_RIGHT (To the right of the box, outside it), - FL_ALIGN_LEFT_TOP (To the left and top of the box, outside it), - FL_ALIGN_RIGHT_TOP (To the right and top of the box, outside it), - FL_ALIGN_LEFT_BOTTOM (To the left and bottom of box, outside), - FL_ALIGN_RIGHT_BOTTOM (To the right and bottom of box, outside), - FL_ALIGN_INSIDE (places the text inside the box), - FL_ALIGN_VERT (not functional yet). Bitwise OR with FL_ALIGN_INSIDE is allowed. xmargin : int extra margin to leave in addition to the flobject border width. By default it is 3. ymargin : int extra margin to leave in addition to the flobject border height. By default it is 3. Examples -------- >>> fl_set_pixmap_align(xpmobj, xfdata.FL_ALIGN_CENTER, 10, 10) Notes ----- Status: UnitTest + Doc + Demo = OK """ _fl_set_pixmap_align = library.cfuncproto( library.load_so_libforms(), "fl_set_pixmap_align", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int, cty.c_int, cty.c_int], """void fl_set_pixmap_align(FL_OBJECT * ob, int align, int xmargin, int ymargin)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(align, xfdata.ALIGN_list) i_align = library.convert_to_intc(align) i_xmargin = library.convert_to_intc(xmargin) i_ymargin = library.convert_to_intc(ymargin) library.keep_elem_refs(ptr_flobject, align, xmargin, ymargin, \ i_align, i_xmargin, i_ymargin) _fl_set_pixmap_align(ptr_flobject, i_align, i_xmargin, i_ymargin)
def fl_add_text(texttype, xpos, ypos, width, height, label): """fl_add_text(texttype, xpos, ypos, width, height, label) -> ptr_flobject Adds a text flobject. It simply consists of a label maybe placed in a box. Parameters ---------- texttype : int type of text to be added. Values (from xfdata.py) FL_NORMAL_TEXT (Normal text type) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of text Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT text flobject added Examples -------- >>> ptxtobj = fl_add_text(xfdata.FL_NORMAL_TEXT, 140, 120, 400, 500, "My text flobject") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_text = library.cfuncproto( library.load_so_libforms(), "fl_add_text", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_text(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(texttype, xfdata.TEXTTYPE_list) i_texttype = library.convert_to_intc(texttype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(texttype, xpos, ypos, width, height, label, \ i_texttype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_text(i_texttype, i_xpos, i_ypos, i_width, i_height, \ s_label) return retval
def fl_set_chart_lstyle(ptr_flobject, style): """fl_set_chart_lstyle(ptr_flobject, style) Changes the font style of a chart's label. By default the label is drawn in a tiny font. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT chart flobject style : int label style. Values (from xfdata.py) - FL_NORMAL_STYLE (Helvetica normal text), - FL_BOLD_STYLE (Helvetica boldface text), - FL_ITALIC_STYLE (Helvetica italic text), - FL_BOLDITALIC_STYLE (Helvetica boldface and italic text), - FL_FIXED_STYLE (Courier fixed width, good for tables), - FL_FIXEDBOLD_STYLE (Courier bold fixed text), - FL_FIXEDITALIC_STYLE (Courier italic fixed text), - FL_FIXEDBOLDITALIC_STYLE (Courier boldface and italic fixed), - FL_TIMES_STYLE (Times-Roman like normal font), - FL_TIMESBOLD_STYLE (Times-Roman like boldface text), - FL_TIMESITALIC_STYLE (Times-Roman like italic text), - FL_TIMESBOLDITALIC_STYLE (Times-Roman like boldface and italic), - FL_MISC_STYLE (Charter normal text), - FL_MISCBOLD_STYLE (Charter boldface text), - FL_MISCITALIC_STYLE (Charter italic text), - FL_SYMBOL_STYLE (Symbol text), - FL_SHADOW_STYLE (Text casting a shadow, modifier mask), - FL_ENGRAVED_STYLE (Text engraved into the form, modifier mask), - FL_EMBOSSED_STYLE (Text standing out, modifier mask). Bitwise OR with any of modifiers is allowed. Examples -------- >>> fl_set_chart_lstyle(pchrtobj, xfdata.FL_TIMESBOLD_STYLE) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_chart_lstyle = library.cfuncproto( library.load_so_libforms(), "fl_set_chart_lstyle", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """void fl_set_chart_lstyle(FL_OBJECT * ob, int lstyle)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(style, xfdata.TEXTSTYLE_list) i_style = library.convert_to_intc(style) library.keep_elem_refs(ptr_flobject, style, i_style) _fl_set_chart_lstyle(ptr_flobject, i_style)
def fl_set_select_text_align(ptr_flobject, align): """fl_set_select_text_align(ptr_flobject, align) -> oldalign Defines the alignment of the text with the currently selected item on top of the select flobject. The xfdata.FL_ALIGN_INSIDE flag should be set with align since the text always will be drawn withing the boundaries of the flobject. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT select flobject align : int alignment of text. Values (from xfdata.py) - FL_ALIGN_CENTER (In the middle of the box, inside it), - FL_ALIGN_TOP (To the top of the box, outside it), - FL_ALIGN_BOTTOM (To the bottom of the box, outside it), - FL_ALIGN_LEFT (To the left of the box, outside it), - FL_ALIGN_RIGHT (To the right of the box, outside it), - FL_ALIGN_LEFT_TOP (To the left and top of the box, outside it), - FL_ALIGN_RIGHT_TOP (To the right and top of the box, outside), - FL_ALIGN_LEFT_BOTTOM (To the left and bottom of box, outside it), - FL_ALIGN_RIGHT_BOTTOM (To the right and bottom of box, outside), - FL_ALIGN_INSIDE (places the text inside the box), - FL_ALIGN_VERT (not functional yet). Bitwise OR with FL_ALIGN_INSIDE is allowed. Returns ------- oldalign : int old setting of alignment, or -1 (on errors) Examples -------- >>> oldalgn = fl_set_select_text_align(selobj, xfdata.FL_ALIGN_TOP) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_select_text_align = library.cfuncproto( library.load_so_libforms(), "fl_set_select_text_align", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """int fl_set_select_text_align(FL_OBJECT * p1, int p2)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(align, xfdata.ALIGN_list) library.verify_flobjectptr_type(ptr_flobject) i_align = library.convert_to_intc(align) library.keep_elem_refs(ptr_flobject, align, i_align) retval = _fl_set_select_text_align(ptr_flobject, i_align) return retval
def fl_set_nmenu_policy(ptr_flobject, policy): """fl_set_nmenu_policy(ptr_flobject, policy) -> oldpol Changes nmenu policy about closing, so that the popup also gets closed (without a selection) when the mouse button is clicked or released on a non-selectable item (giving the impression of a "pull-down" menu). By default, the popup is closed when an item is selected or (without a selection) when the user clicks somehwere outside of the popups area. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT nmenu flobject policy : int under which conditions the nmenu's popup gets closed. Values (from xfdata.py) - FL_POPUP_NORMAL_SELECT (default, keeps the popup opened when the mouse is not released on one of the selectable items), - FL_POPUP_DRAG_SELECT (Closes the popup immediately when the mouse button is released) Returns ------- oldpol : int old policy settings, or -1 (on failure) Examples -------- >>> oldpolc = fl_set_nmenu_policy(nmnobj, xfdata.FL_POPUP_DRAG_SELECT) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_nmenu_policy = library.cfuncproto( library.load_so_libforms(), "fl_set_nmenu_policy", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """int fl_set_nmenu_policy(FL_OBJECT * p1, int p2)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(policy, xfdata.POPUPPOLICY_list) i_policy = library.convert_to_intc(policy) library.keep_elem_refs(ptr_flobject, policy, i_policy) retval = _fl_set_nmenu_policy(ptr_flobject, i_policy) return retval
def fl_set_input_format(ptr_flobject, fmt, sep): """fl_set_input_format(ptr_flobject, fmt, sep) Defines the format used for an input flobject. Currently used only for xfdata.FL_DATE_INPUT flobjects. Parameters ---------- fmt : int format for the input. Values (from xfdata.py) - FL_INPUT_MMDD (Used as format for FL_DATE_INPUT, it places the month before the day), - FL_INPUT_DDMM (Used as format for FL_DATE_INPUT, it places the day before the month). sep : int or char printable single character used as separator Examples -------- >>> fl_set_input_format(pinpobj, xfdata.FL_INPUT_DDMM, "-") Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_input_format = library.cfuncproto( library.load_so_libforms(), "fl_set_input_format", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int, cty.c_int], """void fl_set_input_format(FL_OBJECT * ob, int fmt, int sep)""", ) library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(fmt, xfdata.DATEFMT_list) i_fmt = library.convert_to_intc(fmt) if isinstance(sep, str): # workaround to let a character as int argument ordsep = ord(sep) else: ordsep = sep i_sep = library.convert_to_intc(ordsep) library.keep_elem_refs(ptr_flobject, fmt, sep, ordsep, i_fmt, i_sep) _fl_set_input_format(ptr_flobject, i_fmt, i_sep)
def fl_set_tabfolder_autofit(ptr_flobject, howfit): """fl_set_tabfolder_autofit(ptr_flobject, howfit) -> oldhowfit Adjusts dynamically the sizes of the folders in the tab folder so they fit. Since tab size can vary depending on monitor/font resolutions, it is in general not possible to design the forms (folders) so they fit exactly into the folder area. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT tabfolder flobject howfit : int how do folders' sizes fit . Values (from xfdata.py) - FL_NO (do not scale the form), - FL_FIT (Always scale the form), - FL_ENLARGE_ONLY (Scale the form only if it is smaller than folder area). Returns ------- oldhowfit : int previous fit settings Examples -------- >>> *todo* Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_tabfolder_autofit = library.cfuncproto( library.load_so_libforms(), "fl_set_tabfolder_autofit", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """int fl_set_tabfolder_autofit(FL_OBJECT * ob, int y)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(howfit, \ xfdata.FOLDERSIZESFIT_list) i_howfit = library.convert_to_intc(howfit) library.keep_elem_refs(ptr_flobject, howfit, i_howfit) retval = _fl_set_tabfolder_autofit(ptr_flobject, i_howfit) return retval
def fl_set_select_policy(ptr_flobject, policy): """fl_set_select_policy(ptr_flobject, policy) -> oldpol Defines a policy of a select flobject. By default, the popup of a select flobjects remains shown when the user releases the mouse somewhere outside the popup window (or on its title area). The alternative is closing the popup immediately when user releases the mouse, regardless of where is it. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT select flobject policy : int popup policy to be set. Values (from xfdata.py) - FL_POPUP_NORMAL_SELECT (default, keeps the popup opened when the mouse is not released on one of the selectable items), - FL_POPUP_DRAG_SELECT (Closes the popup immediately when the mouse button is released) Returns ------- oldpol : int previous policy setting, or -1 (on error) Examples -------- >>> fl_set_select_policy(selobj, xfdata.FL_POPUP_NORMAL_SELECT) Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_set_select_policy = library.cfuncproto( library.load_so_libforms(), "fl_set_select_policy", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """int fl_set_select_policy(FL_OBJECT * p1, int p2)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(policy, xfdata.POPUPPOLICY_list) library.verify_flobjectptr_type(ptr_flobject) i_policy = library.convert_to_intc(policy) library.keep_elem_refs(ptr_flobject, policy, i_policy) retval = _fl_set_select_policy(ptr_flobject, i_policy) return retval
def fl_set_input_vscrollbar(ptr_flobject, pref): """fl_set_input_vscrollbar(ptr_flobject, pref) Defines vertical scrollbar settings. By default, if an input field of type xfdata.FL_MULTILINE_INPUT contains more text than can be shown, scrollbars will appear with which the user can scroll the text around vertically. Turning off scrollbars for an input field does not turn off scrolling, the user can still scroll the field using cursor and other keys. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT input flobject pref : int how is vertical scrollbar shown. Values (from xfdata.py) - FL_AUTO (On when needed, default), - FL_ON (always on), - FL_OFF (always off) Examples -------- >>> fl_set_input_vscrollbar(pinpobj, xfdata.FL_OFF) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_input_vscrollbar = library.cfuncproto( library.load_so_libforms(), "fl_set_input_vscrollbar", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """void fl_set_input_vscrollbar(FL_OBJECT * ob, int pref)""", ) library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(pref, xfdata.SCROLLBARVAL_list) i_pref = library.convert_to_intc(pref) library.keep_elem_refs(ptr_flobject, pref, i_pref) _fl_set_input_vscrollbar(ptr_flobject, i_pref)
def fl_set_formbrowser_vscrollbar(ptr_flobject, howscroll): """fl_set_formbrowser_vscrollbar(ptr_flobject, howscroll) Controls the presence of vertical scrollbar. By default, if the size of the forms exceeds the size of the formbrowser, scrollbars are added automatically. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT formbrowser flobject howscroll : int if scrollbar is added or not. Values (from xfdata.py) - FL_AUTO (On when needed, default), - FL_ON (always on), - FL_OFF (always off). Examples -------- >>> fl_set_formbrowser_vscrollbar(pfrmbrobj, xfdata.FL_OFF) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_formbrowser_vscrollbar = library.cfuncproto( library.load_so_libforms(), "fl_set_formbrowser_vscrollbar", None, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int], """void fl_set_formbrowser_vscrollbar(FL_OBJECT * ob, int how)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(howscroll, \ xfdata.SCROLLBARVAL_list) i_howscroll = library.convert_to_intc(howscroll) library.keep_elem_refs(ptr_flobject, howscroll, i_howscroll) _fl_set_formbrowser_vscrollbar(ptr_flobject, i_howscroll)
def fl_add_timer(timertype, xpos, ypos, width, height, label): """fl_add_timer(timertype, xpos, ypos, width, height, label) -> ptr_flobject Adds a timer flobject. It can be used to make a timer that runs down toward 0.0 or runs up toward a pre-set value after which it starts blinking and returns itself to the application program. This can be used in many different ways, e.g. to give a user a particular amount of time for a task, etc. Also a hidden timer object can be created, so the application program can take action at the moment the timer expires; e.g. you can use this to show a message that remains visible until the user presses the OK button or until a particular amount of time has passed. The precision of the timer is not very good. Do not count on anything better than, say, 0.05 seconds. Parameters ---------- timertype : int type of timer to be added. Values (from xfdata.py) - FL_NORMAL_TIMER (Visible, showing a label in a box which blinks when the timer expires), - FL_VALUE_TIMER (Visible, showing the time left or the elapsed time. Blinks if the timer expires), - FL_HIDDEN_TIMER (Not visible). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of timer Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT timer flobject added Examples -------- >>> ptimerobj = fl_add_timer(xfdata.FL_NORMAL_TIMER, 120, 120, 210, 210, "My Timer") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_timer = library.cfuncproto( library.load_so_libforms(), "fl_add_timer", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_timer(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(timertype, \ xfdata.TIMERTYPE_list) i_timertype = library.convert_to_intc(timertype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(timertype, xpos, ypos, width, height, label, \ i_timertype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_timer(i_timertype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_set_select_text_font(ptr_flobject, style, size): """fl_set_select_text_font(ptr_flobject, style, size) -> result Defines the font style and size used for the text of a select flobject. Parameters ---------- ptr_flobject : pointer to xfdata.FL_OBJECT select flobject style : int font style for text. Values (from xfdata.py) - FL_NORMAL_STYLE (Helvetica normal text), - FL_BOLD_STYLE (Helvetica boldface text), - FL_ITALIC_STYLE (Helvetica italic text), - FL_BOLDITALIC_STYLE (Helvetica boldface and italic text), - FL_FIXED_STYLE (Courier fixed width, good for tables), - FL_FIXEDBOLD_STYLE (Courier bold fixed text), - FL_FIXEDITALIC_STYLE (Courier italic fixed text), - FL_FIXEDBOLDITALIC_STYLE (Courier boldface and italic fixed), - FL_TIMES_STYLE (Times-Roman like normal font), - FL_TIMESBOLD_STYLE (Times-Roman like boldface text), - FL_TIMESITALIC_STYLE (Times-Roman like italic text), - FL_TIMESBOLDITALIC_STYLE (Times-Roman like boldface and italic), - FL_MISC_STYLE (Charter normal text), - FL_MISCBOLD_STYLE (Charter boldface text), - FL_MISCITALIC_STYLE (Charter italic text), - FL_SYMBOL_STYLE (Symbol text), - FL_SHADOW_STYLE (Text casting a shadow, modifier mask), - FL_ENGRAVED_STYLE (Text engraved into the form, modifier mask), - FL_EMBOSSED_STYLE (Text standing out, modifier mask). Bitwise OR with any of modifiers is allowed. size : int font size for text. Values (from xfdata.py) - FL_TINY_SIZE (8 points font), - FL_SMALL_SIZE or FL_DEFAULT_SIZE (10 points font, default), - FL_NORMAL_SIZE (12 points font), - FL_MEDIUM_SIZE (14 points font), - FL_LARGE_SIZE (18 points font), - FL_HUGE_SIZE (24 points font), - or other numeric odd or even value Returns ------- result : int 0, or -1 (on failure) Examples -------- >>> rslt = fl_set_select_text_font(pselobj, xfdata.FL_TIMESBOLD_STYLE, xfdata.FL_LARGE_SIZE) Notes ----- Status: NA-UTest + Doc + NoDemo = Maybe """ _fl_set_select_text_font = library.cfuncproto( library.load_so_libforms(), "fl_set_select_text_font", cty.c_int, [cty.POINTER(xfdata.FL_OBJECT), cty.c_int, cty.c_int], """int fl_set_select_text_font(FL_OBJECT * p1, int p2, int p3)""") library.check_if_flinitialized() library.verify_flobjectptr_type(ptr_flobject) library.checkfatal_allowed_value_in_list(style, xfdata.TEXTSTYLE_list) i_style = library.convert_to_intc(style) i_size = library.convert_to_intc(size) library.keep_elem_refs(ptr_flobject, style, size, i_style, i_size) retval = _fl_set_select_text_font(ptr_flobject, i_style, i_size) return retval
def fl_add_nmenu(nmenutype, xpos, ypos, width, height, label): """fl_add_nmenu(nmenutype, xpos, ypos, width, height, label) -> ptr_flobject Adds a new generation menu (nmenu) object. It heavily depends on popups. Parameters ---------- nmenutype : type of nmenu to be. Values (from xfdata.py) - FL_NORMAL_NMENU (Probably the most often used type, shown as text on a borderless background, popup gets opened when clicked on), - FL_NORMAL_TOUCH_NMENU (Also shown as text on a borderless background, but popup gets opened when the mouse is moved on top of it without any further user action required), - FL_BUTTON_NMENU (When not active shown as text on borderless background, when clicked on popup is shown and the flobject itself being displayed as a button), - FL_BUTTON_TOUCH_NMENU (When not active shown as text on borderless background, when mouse is moved onto it the popup is shown and the flobject itself is displayed as a button) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of nmenu flobject Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT nmenu flobject added Examples -------- >>> nmnobj = fl_add_nmenu(xfdata.FL_NORMAL_NMENU, 50, 100, 300, 90, "MyNmenu") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_nmenu = library.cfuncproto( library.load_so_libforms(), "fl_add_nmenu", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_nmenu(int p1, FL_Coord p2, FL_Coord p3, FL_Coord p4, FL_Coord p5, const char * p6)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(nmenutype, \ xfdata.NMENUTYPE_list) i_nmenutype = library.convert_to_intc(nmenutype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(nmenutype, xpos, ypos, width, height, label, \ i_nmenutype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_nmenu(i_nmenutype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_tabfolder(foldertype, xpos, ypos, width, height, label): """fl_add_tabfolder(foldertype, xpos, ypos, width, height, label) -> ptr_flobject Adds a tabfolder flobject. It is a special container that is capable of holding multiple groups of objects (folders) to maximize the utilization of the screen space. Each folder has its own tab the user can click on to call up a specific folder from which option can be selected. Parameters ---------- foldertype : int type of tabfolder to be added. Values (from xfdata.py) - FL_TOP_TABFOLDER or FL_NORMAL_TABFOLDER (it has tab on top), - FL_BOTTOM_TABFOLDER (it has tab on bottom), - FL_LEFT_TABFOLDER (it has tab on left), - FL_RIGHT_TABFOLDER (it has tab on right) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of tabfolder Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT tabfolder flobject added Examples -------- >>> ptbfobj = fl_add_tabfolder(xfdata.FL_TOP_TABFOLDER, 120, 120, 250, 400, "myTabFolder") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_tabfolder = library.cfuncproto( library.load_so_libforms(), "fl_add_tabfolder", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_tabfolder(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(foldertype, \ xfdata.TABFOLDERTYPE_list) i_foldertype = library.convert_to_intc(foldertype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(foldertype, xpos, ypos, width, height, label, \ i_foldertype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_tabfolder(i_foldertype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_slider(slidertype, xpos, ypos, width, height, label): """fl_add_slider(slidertype, xpos, ypos, width, height, label) -> ptr_flobject Adds a slider to a form. No value is displayed. Parameters ---------- slidertype : int type of slider to be added. Values (from xfdata.py) - FL_VERT_SLIDER (normal slider), - FL_HOR_SLIDER (horizontal slider), - FL_VERT_FILL_SLIDER (filled slider), - FL_HOR_FILL_SLIDER (horizontal filled slider), - FL_VERT_NICE_SLIDER (*todo*), - FL_HOR_NICE_SLIDER (horizontal *todo*), - FL_VERT_BROWSER_SLIDER (*todo*), - FL_HOR_BROWSER_SLIDER (horizontal *todo*), - FL_VERT_BROWSER_SLIDER2 (for vertical scrollbar only), - FL_HOR_BROWSER_SLIDER2 (for horizontal scrollbar only), - FL_VERT_THIN_SLIDER (for vertical thin scrollbar only), - FL_HOR_THIN_SLIDER (for horizontal thin scrollbar only), - FL_VERT_NICE_SLIDER2 (for vertical nice scrollbar only), - FL_HOR_NICE_SLIDER2 (for horizontal nice scrollbar only), - FL_VERT_BASIC_SLIDER (for vertical plain scrollbar only), - FL_HOR_BASIC_SLIDER (for horizontal plain scrollbar only). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : int label of the slider (placed below it by default) Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT slider flobject added Examples -------- >>> sldobj = fl_add_slider(xfdata.FL_VERT_SLIDER, 200, 120, 30, 100, "MySlider") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_slider = library.cfuncproto( library.load_so_libforms(), "fl_add_slider", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_slider(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(slidertype, \ xfdata.SLIDERTYPE_list) i_slidertype = library.convert_to_intc(slidertype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(slidertype, xpos, ypos, width, height, label, \ i_slidertype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_slider(i_slidertype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_thumbwheel(wheeltype, xpos, ypos, width, height, label): """fl_add_thumbwheel(wheeltype, xpos, ypos, width, height, label) -> ptr_flobject Adds a thumbwheel flobject. It is a valuator that can be useful for letting the user indicate a value between some fixed bounds. Both horizontal and vertical thumbwheels exist. They have a minimum, a maximum and a current value (all floating point values). The user can change the current value by rolling the wheel. Parameters ---------- wheeltype : int type of thumbwheel to be added. Values (from xfdata.py) - FL_VERT_THUMBWHEEL (A vertical thumbwheel), - FL_HOR_THUMBWHEEL (A horizontal thumbwheel) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of thumbwheel Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT thumbwheel flobject added Examples -------- >>> ptmwobj = fl_add_thumbwheel(xfdata.FL_HOR_THUMBWHEEL, 140, 134, 250, 30, "MyThumbwheel") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_thumbwheel = library.cfuncproto( library.load_so_libforms(), "fl_add_thumbwheel", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_thumbwheel(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(wheeltype, \ xfdata.THUMBWHEELTYPE_list) i_wheeltype = library.convert_to_intc(wheeltype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(wheeltype, xpos, ypos, width, height, label, \ i_wheeltype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_thumbwheel(i_wheeltype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_free(freetype, xpos, ypos, width, height, label, pyfn_HandlePtr): """fl_add_free(freetype, xpos, ypos, width, height, label, pyfn_HandlePtr) -> ptr_flobject Adds a free object. Parameters ---------- freetype : int type of free to be added. Value (from xfdata.py) - FL_NORMAL_FREE (The flobject will receive the events FL_DRAW, FL_ENTER, FL_LEAVE, FL_MOTION, FL_PUSH, FL_RELEASE and FL_MOUSE), - FL_INACTIVE_FREE or FL_SLEEPING_FREE (The flobject only receives FL_DRAW events. This should be used for flobjects without interaction, e.g. a picture), - FL_INPUT_FREE (Same as FL_NORMAL_FREE but the flobject also receives FL_FOCUS, FL_UNFOCUS and FL_KEYBOARD events. The ptr_flobject.contents.wantkey is by default set to FL_KEY_NORMAL, i.e., the free flobject will receive all normal keys (0-255) except <Tab> and <Return> key. If you are interested in <Tab> or <Return> key, you need to change ptr_flobject.contents.wantkey to FL_KEY_TAB or FL_KEY_ALL), - FL_CONTINUOUS_FREE (Same as FL_NORMAL_FREE but the flobject also receives FL_STEP events. This should be used for flobjects that change themselves continuously), - FL_ALL_FREE (The flobject receives all types of events). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of free pyfn_HandlePtr : python function, returned value name referring to function(ptr_flobject, [int]event, [int]xpos, [int]ypos, [int]key, [pointer to void]ptr_xevent) -> [int]num Function does the redrawing and handles the interaction with the free flobject. First param is the flobject to which the event applies; event indicates what has to happen to the object; xpos and ypos indicate the position of the mouse (only meaningful with mouse related events) relative to the form origin; key is the KeySym of the key typed in by the user (only for xfdata.FL_KEYPRESS events). ptr_xevent is pointer to X Event that causes the invocation of this handler. event and ptr_xevent.contents.type can both be used to obtain the event types. The routine should return whether the status of the object has changed, i.e., whether flbasic.fl_do_forms() or flbasic.fl_check_forms() should return this flobject. Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT free flobject added Examples -------- >>> *todo* Notes ----- Status: NA-UTest + Doc + Demo = OK """ #FL_HANDLEPTR = cty.CFUNCTYPE(cty.c_int, cty.POINTER(FL_OBJECT), \ # cty.c_int, FL_Coord, FL_Coord, cty.c_int, cty.c_void_p) _fl_add_free = library.cfuncproto( library.load_so_libforms(), "fl_add_free", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING, xfdata.FL_HANDLEPTR], """FL_OBJECT * fl_add_free(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label, FL_HANDLEPTR handle)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(freetype, xfdata.FREETYPE_list) i_freetype = library.convert_to_intc(freetype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.verify_function_type(pyfn_HandlePtr) cfn_HandlePtr = xfdata.FL_HANDLEPTR(pyfn_HandlePtr) library.keep_cfunc_refs(cfn_HandlePtr, pyfn_HandlePtr) library.keep_elem_refs(freetype, xpos, ypos, width, height, label, \ i_freetype, i_xpos, i_ypos, i_width,i_height, s_label) retval = _fl_add_free(i_freetype, i_xpos, i_ypos, i_width, i_height, \ s_label, cfn_HandlePtr) return retval
def fl_add_labelframe(frametype, xpos, ypos, width, height, label): """fl_add_labelframe(frametype, xpos, ypos, width, height, label) -> ptr_flobject Adds a labelframe flobject. It is almost the same as a frame except that the label is placed on the frame instead of inside or outside of the bounding box as in a regular frame. Parameters ---------- frametype : int type of labelframe to be added. Values (from xfdata.py) - FL_NO_FRAME (Nothing is drawn), - FL_UP_FRAME (A frame appears coming out of the screen), - FL_DOWN_FRAME (A frame that goes down into the screen), - FL_BORDER_FRAME (A frame with a simple outline), - FL_SHADOW_FRAME (A frame with a shadow), - FL_ENGRAVED_FRAME (A frame appears to be engraved), - FL_ROUNDED_FRAME (A rounded frame), - FL_EMBOSSED_FRAME (A frame appears embossed), - FL_OVAL_FRAME (An elliptic box). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of labelframe Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT labelframe flobject added Examples -------- >>> lfrmobj = fl_add_labelframe(xfdata.FL_SHADOW_FRAME, 100, 100, 400, 300, "MyFrame") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_labelframe = library.cfuncproto( library.load_so_libforms(), "fl_add_labelframe", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_labelframe(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(frametype, \ xfdata.FRAMETYPE_list) i_frametype = library.convert_to_intc(frametype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(frametype, xpos, ypos, width, height, label, \ i_frametype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_labelframe(i_frametype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_chart(charttype, xpos, ypos, width, height, label): """fl_add_chart(charttype, xpos, ypos, width, height, label) -> ptr_flobject Adds a chart flobject. Parameters ---------- charttype : int type of chart to be created. Values (from xfdata.py) - FL_BAR_CHART (A vertical bar-chart), - FL_HORBAR_CHART (A horizontal bar-chart), - FL_LINE_CHART (A line-chart), - FL_FILL_CHART (A line-chart but the area below curve is filled), - FL_SPIKE_CHART (A chart with a vertical spike for each value), - FL_PIE_CHART (A pie-chart), - FL_SPECIALPIE_CHART (A pie-chart with displaced first item) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of chart Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT chart flobject added Examples -------- >>> pchrtobj = fl_add_chart(xfdata.FL_SPIKE_CHART, 147, 168, 250, 492, "My Chart") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_chart = library.cfuncproto( library.load_so_libforms(), "fl_add_chart", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_chart(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(charttype, \ xfdata.CHARTTYPE_list) i_charttype = library.convert_to_intc(charttype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(charttype, xpos, ypos, width, height, label, \ i_charttype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_chart(i_charttype, i_xpos, i_ypos, i_width, i_height, \ s_label) return retval
def fl_add_positioner(posittype, xpos, ypos, width, height, label): """fl_add_positioner(posittype, xpos, ypos, width, height, label) -> ptr_flobject Adds a positioner flobject. By default the label is placed below the box. Parameters ---------- posittype : int type of positioner to be added. Values (from xfdata.py) - FL_NORMAL_POSITIONER (Cross-hair inside a box), - FL_OVERLAY_POSITIONER (Cross-hair inside a transparent box, i.e. drawn in in XOR mode), - FL_INVISIBLE_POSITIONER (Completely invisible positioner to be used just for the side effect of obtaining a position, typically a flobject is below it that otherwise would receive user events) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of positioner. Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT positioner flobject added Examples -------- >>> pstobj = fl_add_positioner(xfdata.FL_NORMAL_POSITIONER, 140, 120, 180, 180, "MyPositioner") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_positioner = library.cfuncproto( library.load_so_libforms(), "fl_add_positioner", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_positioner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(posittype, \ xfdata.POSITIONERTYPE_list) i_posittype = library.convert_to_intc(posittype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(posittype, xpos, ypos, width, height, label, \ i_posittype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_positioner(i_posittype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_pixmapbutton(buttontype, xpos, ypos, width, height, label): """fl_add_pixmapbutton(buttontype, xpos, ypos, width, height, label) -> ptr_flobject Adds a pixmapbutton flobject. Parameters ---------- buttontype : int type of button to be added. Values (from xfdata.py) - FL_NORMAL_BUTTON (Returns value when released), - FL_PUSH_BUTTON or FL_TOGGLE_BUTTON (Stays pushed until user pushes it again), - FL_RADIO_BUTTON (Push button that switches off other radio buttons), - FL_HIDDEN_BUTTON (Invisible normal button), - FL_TOUCH_BUTTON (Returns value as long as the user pushes it), - FL_INOUT_BUTTON (Returns value both when pushed and when released), - FL_RETURN_BUTTON (Like a normal button but reacts on the <Return> key), - FL_HIDDEN_RET_BUTTON (Invisible return button), - FL_MENU_BUTTON (Returns value when pushed, useful e.g. for opening a popup when pushed). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of button Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT created button flobject Examples -------- >>> btnobj = fl_add_roundbutton(xfdata.FL_TOGGLE_BUTTON, 145, 199, 120, 30, "MyButton") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_pixmapbutton = library.cfuncproto( library.load_so_libforms(), "fl_add_pixmapbutton", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, \ xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_pixmapbutton(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(buttontype, \ xfdata.BUTTONTYPE_list) i_buttontype = library.convert_to_intc(buttontype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(buttontype, xpos, ypos, width, height, label, \ i_buttontype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_pixmapbutton(i_buttontype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_frame(frametype, xpos, ypos, width, height, label): """fl_add_frame(frametype, xpos, ypos, width, height, label) -> ptr_flobject Adds a frame flobject. It is simply used to give the dialogue form a nicer appearance. It can be used to visually group other objects together. Frames are almost the same as a box, except that the interior of the bounding box is not filled. Use of frames can speed up drawing in certain situations, e.g. to place a group of radio buttons within an xfdata.FL_ENGRAVED_FRAME. If we were to use an xfdata.FL_FRAME_BOX to group the buttons, visually they would look the same; however, the latter is faster as we do not have to fill the interior of the bounding box and can also reduce flicker. Frames are useful in decorating free objects and canvases. Parameters ---------- frametype : int type of frame to be added. Values (from xfdata.py) - FL_NO_FRAME (Nothing is drawn), - FL_UP_FRAME (A frame appears coming out of the screen), - FL_DOWN_FRAME (A frame that goes down into the screen), - FL_BORDER_FRAME (A frame with a simple outline), - FL_SHADOW_FRAME (A frame with a shadow), - FL_ENGRAVED_FRAME (A frame appears to be engraved), - FL_ROUNDED_FRAME (A rounded frame), - FL_EMBOSSED_FRAME (A frame appears embossed), - FL_OVAL_FRAME (An elliptic box). xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of frame Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT frame flobject added Examples -------- >>> frmobj = fl_add_frame(xfdsata.FL_BORDER_FRAME, 100, 100, 400, 300, "MyFrame") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_frame = library.cfuncproto( library.load_so_libforms(), "fl_add_frame", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_frame(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(frametype, \ xfdata.FRAMETYPE_list) i_frametype = library.convert_to_intc(frametype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(frametype, xpos, ypos, width, height, label, \ i_frametype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_frame(i_frametype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_spinner(spinnertype, xpos, ypos, width, height, label): """fl_add_spinner(spinnertype, xpos, ypos, width, height, label) -> ptr_flobject Adds a spinner flobject. It is a combination of a (numerical) input field with two (touch) buttons that allow to increment or decrement the value in the (editable) input field. I.e. the user can change the spinners value by either editing the value of the input field or by using the up/down buttons shown beside the input field. Parameters ---------- spinnertype : int type of spinner to be added. Values (from xfdata.py) - FL_INT_SPINNER (spinner with integer values), - FL_FLOAT_SPINNER (spinner with float values) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of spinner Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT spinner flobject added Examples -------- >>> pspnobj = fl_add_spinner(xfdata.FL_INT_SPINNER, 175, 75, 140, 150, "My spinner") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_spinner = library.cfuncproto( library.load_so_libforms(), "fl_add_spinner", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_spinner(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(spinnertype, \ xfdata.SPINNERTYPE_list) i_spinnertype = library.convert_to_intc(spinnertype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(spinnertype, xpos, ypos, width, height, label, \ i_spinnertype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_spinner(i_spinnertype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval
def fl_add_box(boxtype, xpos, ypos, width, height, label): """fl_add_box(boxtype, xpos, ypos, width, height, label) -> ptr_flobject Adds a ractangular box area flobject. It is simply used to give the dialogue form a nicer appearance. It can be used to visually group other objects together. The bottom of each form is a box. Parameters ---------- boxtype : int type of the box to be added. Values (from xfdata.py) - FL_NO_BOX (No box at all, it is transparent, just a label), - FL_UP_BOX (A box that comes out of the screen), - FL_DOWN_BOX (A box that goes down into the screen), - FL_BORDER_BOX (A flat box with a border), - FL_SHADOW_BOX (A flat box with a shadow), - FL_FRAME_BOX (A flat box with an engraved frame), - FL_ROUNDED_BOX (A rounded box), - FL_EMBOSSED_BOX (A flat box with an embossed frame), - FL_FLAT_BOX (A flat box without a border, normally invisible unless given a different color than the surroundings), - FL_RFLAT_BOX (A rounded box without a border, normally invisible unless given a different color than the surroundings), - FL_RSHADOW_BOX (A rounded box with a shadow), - FL_OVAL_BOX (A box shaped like an ellipse), - FL_ROUNDED3D_UPBOX (A rounded box coming out of the screen), - FL_ROUNDED3D_DOWNBOX (A rounded box going into the screen), - FL_OVAL3D_UPBOX (An oval box coming out of the screen), - FL_OVAL3D_DOWNBOX (An oval box going into the screen), - FL_OVAL3D_FRAMEBOX (An oval box with an engraved frame), - FL_OVAL3D_EMBOSSEDBOX (An oval box with an embossed frame) xpos : int horizontal position (upper-left corner) ypos : int vertical position (upper-left corner) width : int width in coord units height : int height in coord units label : str text label of box Returns ------- ptr_flobject : pointer to xfdata.FL_OBJECT box flobject added Examples -------- >>> pboxobj = fl_add_box(xfdata.FL_UP_BOX, 120, 150, 200, 250, "MyBox") Notes ----- Status: NA-UTest + Doc + Demo = OK """ _fl_add_box = library.cfuncproto( library.load_so_libforms(), "fl_add_box", cty.POINTER(xfdata.FL_OBJECT), [cty.c_int, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.FL_Coord, xfdata.STRING], """FL_OBJECT * fl_add_box(int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char * label)""") library.check_if_flinitialized() library.checkfatal_allowed_value_in_list(boxtype, xfdata.BOXTYPE_list) i_boxtype = library.convert_to_intc(boxtype) i_xpos = library.convert_to_FL_Coord(xpos) i_ypos = library.convert_to_FL_Coord(ypos) i_width = library.convert_to_FL_Coord(width) i_height = library.convert_to_FL_Coord(height) s_label = library.convert_to_bytestrc(label) library.keep_elem_refs(boxtype, xpos, ypos, width, height, label, \ i_boxtype, i_xpos, i_ypos, i_width, i_height, s_label) retval = _fl_add_box(i_boxtype, i_xpos, i_ypos, i_width, \ i_height, s_label) return retval