<commit_before># Controls

A form Control is a UI interface for the user to interact with the application.  

Bellow we can find the description of all the Controls implemented in the PyForms library.



## ControlBase
***************************

All the Controls inherit from this Control, therefore you can find its functions and properties in all the other controls listed below.

### **Constructer**
***************************

#### \_\_init\_\_(label='', default='', helptext='')  

**label** - Control label.  
**default** - Initial value of the control.  
**helptext** - Text shown when the mouse is over the control.


### **Functions**
***************************

#### init_form()  

Load the control UI and initiate all the events.
 	
#### load_form(data, path=None)  
Loads the value of the control.  
**data** - It is a dictionary with the required information to load the control.
**path** - Optional parameter that can be used to save the data.
 	
#### save_form(data, path=None)  

Save a value of the control to a dictionary.  

**data** - Dictionary where the control value should be saved.
**path** - Optional parameter that can be used to load the data.
 	
#### show()  

Show the control.
 	
#### hide()  

Hide the control.
 	
#### add_popup_menu_option(label, function_action=None, key=None, icon=None, submenu=None)  

Add an option to the Control popup menu.

**label** - Label of the opti
**function_action** - Optional parameter that can be used to load the data.
**key** - Dictionary where the control value should be saved.
**icon** - Optional parameter that can be used to load the data.
 	
#### add_popup_submenu(label, submenu=None)

Add submenu options to the Control popup menu.
 	
	

### **Events**
***************************
 	
#### about_to_show_contextmenu_event()  

Function called before the Control popup menu is opened.<commit_msg>docs updated<commit_after># Controls

A form Control is a UI interface for the user to interact with the application.  

Bellow we can find the description of all the Controls implemented in the PyForms library.



## ControlBase
***************************

All the Controls inherit from this Control, therefore you can find its functions and properties in all the other controls listed below.

### **Constructer**
***************************

#### \_\_init\_\_(label='', default='', helptext='')  

**label** - Control label.  
**default** - Initial value of the control.  
**helptext** - Text shown when the mouse is over the control.


### **Functions**
***************************

#### init_form()  

Load the control UI and initiate all the events.
 	
#### load_form(data, path=None)  
Loads the value of the control.  
**data** - It is a dictionary with the required information to load the control.  
**path** - Optional parameter that can be used to save the data.  
 	
#### save_form(data, path=None)  

Save a value of the control to a dictionary.  

**data** - Dictionary where the control value should be saved.  
**path** - Optional parameter that can be used to load the data.  
 	
#### show()  

Show the control.
 	
#### hide()  

Hide the control.
 	
#### add_popup_menu_option(label, function_action=None, key=None, icon=None, submenu=None)  

Add an option to the Control popup menu.

**label** - Label of the opti
**function_action** - Optional parameter that can be used to load the data.
**key** - Dictionary where the control value should be saved.
**icon** - Optional parameter that can be used to load the data.
**submenu** - Parent submenu to which the option should be added. If no value is set, then the option will be added to the main popup menu.
 	
#### add_popup_submenu(label, submenu=None)

It returns a new sub popup menu. If submenu is open the menu is added to the main popup menu.
 	
	

### **Events**
***************************
 	
#### about_to_show_contextmenu_event()  

Function called before the Control popup menu is opened.
{'fraction_non_alphanumeric': 0.15172239108409322, 'fraction_numerical': 0.0, 'mean_word_length': 4.017789072426938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1864237', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1052, 'n_words': 498}