Package gui :: Package analyses :: Package elements :: Module bool_element :: Class Boolean_ctrl
[hide private]
[frames] | no frames]

Class Boolean_ctrl

source code

The analysis specific text control.

This consists of three elements: wx.StaticText, wx.TextCtrl, and wx.Button.

Instance Methods [hide private]
 
__init__(self, box, parent, text='', default=True, tooltip=None, tooltip_button=None, button_text=' Toggle', control=<class 'wx._controls.TextCtrl'>, width_text=200, width_button=80, spacer=0)
Create a text selection element for the frame.
source code
 
Enable(self, enable=True)
Enable or disable the element for user input.
source code
int
GetValue(self)
Set the value of the control.
source code
 
SetValue(self, value)
Set the value of the control.
source code
 
toggle(self, event=None)
Switch the state.
source code
Method Details [hide private]

__init__(self, box, parent, text='', default=True, tooltip=None, tooltip_button=None, button_text=' Toggle', control=<class 'wx._controls.TextCtrl'>, width_text=200, width_button=80, spacer=0)
(Constructor)

source code 

Create a text selection element for the frame.

This consists of a horizontal layout with a static text element, a text control, and an optional button.

Parameters:
  • box (wx.BoxSizer instance) - The box element to pack the structure file selection GUI element into.
  • parent (wx object) - The parent GUI element.
  • text (str) - The static text.
  • default (bool) - The default value of the control.
  • tooltip (str) - The tooltip which appears on hovering over the text or input field.
  • tooltip_button (str) - The separate tooltip for the button.
  • button_text (str) - The text to display on the button.
  • control (wx.TextCtrl derived class) - The control class to use.
  • width_text (int) - The width of the text element.
  • width_button (int) - The width of the button.
  • spacer (int) - The horizontal spacing between the elements.

Enable(self, enable=True)

source code 

Enable or disable the element for user input.

Parameters:
  • enable (bool) - The flag specifying if the element should be enabled or disabled.

GetValue(self)

source code 

Set the value of the control.

Returns: int
The value of the text control.

SetValue(self, value)

source code 

Set the value of the control.

Parameters:
  • value (bool) - The value to set the boolean control to.