The Control class provides the base control. To create Control instances, use the add() method of the Interface object, which should be passed the arguments that will be used to instantiate a control.
Clicking on control with identity 'Control' generates a State Object with the control being 'Control', and button pressed being 'Control' for main button or 'Control_top' or 'Control_bottom' for switches. With the method add_action(), an action function can be attached to the control that will be called when pressed.
|
__init__(self,
panel,
identity,
control_type,
position,
size=None,
color=(40,80,120),
fill=1,
control_outline=None,
control_image=None,
font_color=None,
font_type=None,
font_size=None,
split_text=True,
center_text=True,
control_list=None,
icon_list=None,
icon_size=None,
tip_list=None,
link=None,
link_activated=True,
activated_color=(0,120,160),
activated_toggle=True,
label=None,
label_display=True,
active=True,
control_response=None,
hold_response=1000,
delay_response=0,
loop=False,
reverse=False,
control_button=True,
text_margin=5,
text_paste=False,
event=None)
Control Object: Define panel control. |
|
|
|
set_control_image(self,
control_image=None,
data_folder=None,
data_zip=None,
file_obj=None,
color_key=None,
surface=None)
Set image of control. |
|
|
|
set_color(self,
color=None,
activated_color=None,
fill=None)
Set control color. |
|
|
|
set_list(self,
control_list,
icon_list=None,
size=None,
icon_size=None,
case=False,
data_folder=None,
data_zip=None,
file_obj=None,
color_key=None,
surface=None,
append=False,
index=None,
keep_link=True,
keep_tip=True)
Set control listing of a control. |
|
|
|
set_list_icon(self,
control_list,
icon_list=None,
data_folder=None,
data_zip=None,
file_obj=None,
color_key=None,
surface=None,
icon_size=None)
Set control listing icon of a control, changing if item in listing or appending new item. |
|
|
|
get_list(self)
Return control listing. |
|
|
|
remove_list(self,
items=None,
index=None)
Remove specified items (or item at index) from control listing, including corresponding tips and links. Passing no parameter removes complete control list. |
|
|
|
set_label(self,
label=None)
Set control label. |
|
|
|
get_label(self)
Get control label. |
|
|
|
set_tip(self,
*tip)
Set tip for a control item. Parameters: tip: str or [] - single control tip or tip list for control list items; or tuple item:str,tip:str tip for control list item. |
|
|
|
get_tip(self,
item=None)
Get the tip for a control item, or list of tips if no parameter given. Parameter: item:str |
|
|
|
set_link(self,
control,
link)
Set linked controls. Parameters: control:str, link:[]. |
|
|
|
set_link_activated(self,
setting='Toggle')
Set whether linked control active immediately or upon control button activation. |
|
|
|
add_action(self,
function,
obj=None)
Bind action function to control. Function should take two arguments, for instance Function(control, value), that will receive the control button pressed and control value. Optional obj argument to provide object for method binding in Pyjs -O mode. |
|
|
|
get_id(self)
Get control identity |
|
|
|
get_position(self)
Retrieve control position. |
|
|
|
get_size(self)
Retrieve control size. |
|
|
|
set_text_margin(self,
margin)
Set text margin. Parameter: margin int or (t,r,b,l). |
|
|
|
get_text_margin(self)
Get text margin. Return [t,r,b,l]. |
|
|
|
is_activated(self)
Check whether control is activated. |
|
|
|
set_activated(self,
setting='Toggle')
Set control activated. |
|
|
|
is_activated_lock(self)
Check control activate lock. |
|
|
|
set_activated_lock(self,
setting='Toggle')
Set control activate lock. |
|
|
|
set_value(self,
value,
change_index=True)
Set the value of a control. Parameters: value - control value; change_index - True change list index to first available value, False to leave index position unchanged, index number for specific index if is value. |
|
|
|
get_value(self)
Get the value of a control. |
|
|
|
set_list_index(self,
index)
Set the place in control listing. |
|
|
|
get_list_index(self,
item=None)
Get the current place in control listing, or index of first occurrence of item. |
|
|
|
is_active(self)
Check whether a control is active. |
|
|
|
set_active(self,
setting='Toggle')
Set control active setting. |
|
|
|
is_enabled(self)
Check whether control is enabled. |
|
|
|
set_enabled(self,
setting='Toggle')
Set control enabled setting. |
|
|
|
resize_control(self,
size)
Resize control. |
|
|
|
set_display_info(self,
size,
font_color,
font_type,
font_size,
position=None,
text=None,
center=True)
Initiate control display text. |
|
|
|
set_display_text(self,
font_color=None,
font_bgcolor=None,
font_type=None,
font_size=None,
split_text=None,
size=None,
info=False)
Set display text properties. |
|
|
|
get_display_text(self)
Get display text object. |
|
|
|
set_label_info(self,
size,
font_color,
font_type,
font_size,
position=None,
text=None)
Initiate control label text. |
|
|
|
set_label_text(self,
font_color=None,
font_bgcolor=None,
font_type=None,
font_size=None,
split_text=None)
Set label text properties. |
|
|
|
check_link(self,
ctrl,
activate)
Maintain active state of linked controls. |
|
|
|
reset(self,
change_index=True)
Reset value to start of control list. |
|
|
|
next(self)
Set value to next in control list. |
|
|
|
previous(self)
Set value to previous in control list. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|