9.7. Form Class Functions

9.7.1. Form items

class nettoolkit.nettoolkit.forms.formitems.DoubleClick(obj, i)[source]

Bases: object

Class which defines basic methods to detect the mouse double click threshold is set to 0.5 ms

should always have a do_action() method to determine what to when mouse double click is detected.

Parameters:
  • obj (NGui) – NGui object.

  • i (dict) – NGui Window object fields.

abstract classmethod do_action(**kwargs)[source]
is_double_clicked(threshold=0.5)[source]
last_click_time = 0
open_gtacmfa_devopt(obj, i)[source]
class nettoolkit.nettoolkit.forms.formitems.TripleClick(obj, i, threshold=0.5)[source]

Bases: object

Class which defines basic methods to detect the mouse triple click threshold is set to 0.5 ms

should always have a do_action() method to determine what to when mouse double click is detected.

Parameters:
  • obj (NGui) – NGui object.

  • i (dict) – NGui Window object fields.

abstract classmethod do_action(*args, **kwargs)[source]
first_click_time = 0
is_triple_clicked(threshold=0.5)[source]
open_gtacmfa_devopt(obj, i)[source]
second_click_time = 1
nettoolkit.nettoolkit.forms.formitems.activity_finish_popup(func)
nettoolkit.nettoolkit.forms.formitems.add_cable_n_connectors(file, **kwargs)[source]

add item/value

Parameters:

file (str) – cached cable and connector excel file name with full path

nettoolkit.nettoolkit.forms.formitems.banner(version, background_color)[source]

Banner / Texts with bold center aligned fonts

Parameters:

version (str) – version of code

Returns:

list with banner text

Return type:

list

nettoolkit.nettoolkit.forms.formitems.blank_line()[source]

to insert a blank row

Returns:

blank row

Return type:

list

nettoolkit.nettoolkit.forms.formitems.button_cancel(text, **kwargs)[source]

Insert a Cancel button of regular size. provide additional formating as kwargs.

Parameters:

text (str) – Text instead of Cancel to display (if need)

Returns:

Cancel button

Return type:

sg.Cancel

nettoolkit.nettoolkit.forms.formitems.button_ok(text, **kwargs)[source]

Insert an OK button of regular size. provide additional formating as kwargs.

Parameters:

text (str) – Text instead of OK to display (if need)

Returns:

OK button

Return type:

sg.OK

nettoolkit.nettoolkit.forms.formitems.button_pallete()[source]

button pallete containing standard OK and Cancel buttons

Returns:

list with sg.Frame containing buttons

Return type:

list

nettoolkit.nettoolkit.forms.formitems.enable_disable(obj, *, group, group_frames, all_tabs, event_updaters)[source]

enable/disable provided object frames

Parameters:
  • obj (NGui) – NGui class instance object

  • group (str) – button group key, which is to enabled.

  • group_frames (list) – list of frames to be enabled

  • all_tabs (set) – set of all frames keys

  • event_updaters (set) – set of Button pallet names button keys

nettoolkit.nettoolkit.forms.formitems.footer(version, width)[source]

Footer Credit text

Parameters:
  • version (str) – gui template version

  • width (_type_) – width of window

Returns:

list with footer text

Return type:

list

nettoolkit.nettoolkit.forms.formitems.get_cable_n_connectors(file, column, item)[source]

retrive the value for provided item for given column

Parameters:
  • file (str) – cached cable and connector file name with full path

  • column (str) – column name (attribute)

  • item (str) – row item (connector type)

Returns:

matched item value from cached file

Return type:

str

nettoolkit.nettoolkit.forms.formitems.get_cache(cache_file, key)[source]

retrive the value for provided key(item) from cache file

Parameters:
  • cache_file (str) – cache file name with full path

  • key (str) – name of item

Returns:

matched item value from cache file

Return type:

str

nettoolkit.nettoolkit.forms.formitems.get_list(raw_items)[source]

create list from given raw items splits by enter and comma

Parameters:

raw_items (str) – multiline raw items

Returns:

list of items

Return type:

list

nettoolkit.nettoolkit.forms.formitems.item_line(item, length)[source]

to draw a line with provided character or repeat a character for n-number of time

Parameters:
  • item (str) – character

  • length (int) – to repeat the character

Returns:

list with repeated item Text

Return type:

list

nettoolkit.nettoolkit.forms.formitems.popupmsg(pre=None, *, post=None)[source]

Decorator to provide pre/post custom popup message to a function

Parameters:
  • pre (str, optional) – Popup Message to display before function execution. Defaults to None.

  • post (str, optional) – Popup Message to display after function execution. Defaults to None.

nettoolkit.nettoolkit.forms.formitems.tabs(background_color, **kwargs)[source]

create tab groups for provided kwargs

Returns:

Tab groups

Return type:

sg.TabGroup

nettoolkit.nettoolkit.forms.formitems.tabs_display(background_color, **tabs_dic)[source]

define tabs display

Returns:

list of tabs

Return type:

list

nettoolkit.nettoolkit.forms.formitems.under_line(length, background_color=None)[source]

To draw a line

Parameters:

length (int) – character length of line

Returns:

underline row

Return type:

list

nettoolkit.nettoolkit.forms.formitems.update_cache(cache_file, **kwargs)[source]

add/update cache item/value

Parameters:

cache_file (str) – cache file name with full path