Entry Class Module#

entry_class module#

String, Integer and Float Entry classes, using super, inherit from tkinter.ttk LabelFrame. Contains the following functionality:-

  • Entry Validation

  • Layout in a LabelFrame

  • includes limits and warnings

  • ability for the user to disable with a checkbox

  • default value

  • colour of LabelFrame

class entry_class.FloatEntry(parent, lf_text, l_limit, u_limit, def_inp='', colour='brown', mod=False)#

Bases: IntegerEntry

Float class for entry.

Parameters:
  • parent (str) -- parent handle

  • lf_text (str) -- text on LabelFrame

  • l_limit (float) -- lower limit

  • u_limit (float) -- upper limit

  • def_inp (str) -- default text

  • colour (str) -- frame colour

  • mod (bool) -- enable or disable state switch

Return type:

float

is_okay(text, input_, index)#

Validation function, using the same attributes as String entry.

Parameters:
  • text (str) -- text if allowed

  • input (str) -- current input

  • index (str)

Return type:

boolean

class entry_class.IntegerEntry(parent, lf_text, l_limit, u_limit, def_inp='', colour='brown', mod=False)#

Bases: StringEntry

Integer class with enhanced string entry functionality.

applying limits with warnings, using super

Parameters:
  • parent (str) -- parent handle

  • lf_text (str) -- text on LabelFrame

  • l_limit (int) -- lower limit

  • u_limit (int) -- upper limit

  • def_inp (str) -- default text

  • colour (str) -- frame colour

  • mod (bool) -- enable or disable state switch

Return type:

integer

end_input(_evt)#

Limit logic for integer or float.

Parameters:

evt (str) -- bind handle

is_okay(text, input_, index)#

Validation function, using the same attributes as String entry.

Parameters:
  • text (str) -- text if allowed

  • input (str) -- current input

  • index (str)

Return type:

boolean

limits()#

Buiding limit Labels.

class entry_class.StringEntry(parent, lf_text, def_inp='', colour='brown', mod=False)#

Bases: Labelframe

String class for entry.

rationalised with integer and float classes, using super

Parameters:
  • parent (str) -- parent handle

  • lf_text (str) -- text on LabelFrame

  • def_inp (str) -- default text

  • colour (str) -- frame colour

  • mod (boolean) -- enable or disable state switch

Return type:

string

construct(colour)#

Building the colour style.

Parameters:

colour (str) -- frame colour

end_input(_evt)#

String size limit logic.

Parameters:

evt (str) -- bind handle

is_okay(text, input_, index)#

String validation function.

Parameters:
  • text (str) -- text if allowed

  • input (str) -- current input

  • index (str)

make_entry()#

Building of Entry.

modify()#

Building of state switch. consists of checkbox in Label part of LabelFrame

toggle_opt()#

state switch toggle logic