DOCUMENTATION
SYNOPSIS
PERL PERL PROGRAM NAME: conditions4flows.pm
AUTHOR: Juan Lorenzo
DATE: May 16 2018
DESCRIPTION
makes gui aware
of what method is active
Makes GUI disable and reenable certain widgets depending on which
method is called
Based on method used, hash values are reset internally
one of few packages that changes state of variables outside main
for this reason we copy all hash to private variables and reassign
them on potential exit so that nothing is lost or mislabeled
only conditions are reset. All other parameters travel through safely
Be careful to blank as many imported values as possible and only allow
the essential to be used (_reset and reset methods are available)
I sometimes reset some values internally (_reset)and only allow
one or a few to survive for manipulation internally. But, because
all variables that enter are sheltered in private variables those that are not
changed can safely be handed back to the namespace of the module that is calling
conditions4flows.
get_flow_index_last_touched needs to be exported so do not reset it
For safety we try to encapsulate this module
For safety we work internally sometimes with single scalars instead of imported hash and variables
For safety, input hash keys are assigned to new variables with short private names
New variables with short names are exported from a private hash
BASED ON:
conditions_gui.pm
previous version the main L_SU.pl (V 0.3)
USE
NOTES
Examples
SEISMIC UNIX NOTES
CHANGES and their DATES refactoring of 2017 version of L_SU.pl
Notes from bash
106 of convenient private abbreviated-variable names
These are defiend in every subroutine so that get_hash_ref can export them
private hash
106 off
sub _get_add2flow
sub _get_add2flow_button
sub _get_flow_color
sub _get_flow_listbox_color_w
sub _reset
26 off
do not reset important values:
location within GUI
sub _reset_is_flow_listbox_color_w
sub _set_flow_color
sub _set_flow_listbox_color_w
sub _set_flow_listbox_last_touched_txt
keep track of whcih listbox was last chosen
sub _set_flow_listbox_last_touched_w
sub get_flow_color
return flow color if it exists
sub get_hash_ref
return ALL values of the private hash, supposedly
improtant external widgets have not been reset.. only conditions
are reset
TODO: perhaps it is better to have a specific method
to return one specific widget address at a time?
}
99
25 off only reset the conditional parameters, not the widgets and other information
sub set_flow_color
sub set_hash_ref A private hash that helps track all past actions in the gui
sub set4FileDialog_Delete_end
sub set4FileDialog_Delete_start
sub set4FileDialog_SaveAs_end
sub set4FileDialog_open_end
sub set4FileDialog_open_perl_file_end
sub set4FileDialog_open_perl_file_fail
sub set4FileDialog_open_start
sub set4FileDialog_open_perl_file_start
sub set4_end_of_SaveAs_button
sub set4_start_of_SaveAs_button
sub set4end_of_flow_item_up_arrow_button
when the arrow that moves flow items up a list is clicked
location within GUI
foreach my $key (sort keys %$conditions4flows) {
print ("conditions4flows user,set4end_of_flow_select,key is $key, value is $conditions4flows->{$key}\n");
}
if an item within a user-built list of programs is selected then
the following options are set to be true--they can now be activated from the GUI
Also the color of the flow is maintained
sub set4end_of_run_button
location within GUI
sets
conditions4flows
sub set4end_of_run_superflow
location within GUI
sets
conditions4flows
sub set4user_built_flow_close_path_end inherited from set4superflow_close_path_end
sub set4user_built_open_path_end inherited from set4superflow_open_path_end
sub _get_num_listboxes_occupied
sub set_defaults4end_of_delete_whole_flow_button
when all items are removed from a flow listbox
the following conditions are set
sub set_defaults4last_delete_from_flow_button
when all items are removed from a flow listbox
the following conditions are set
sub set4run_button
is used by both pre-built sueprflows and user-built flows look at set4start_of_run_button and set4end_of_run_button
legacy?
sub set4run_button_end
location within GUI
sets
$conditions4flows
legacy?
look at set4start_of_run_button and set4end_of_run_button
location within GUI on first clicking delete button
sub set_defaults4start_of_delete_whole_flow_button
location within GUI on clicking whole-flow-delete button
when the arrow that moves flow items up a list is clicked
sub set_defaults_4start_of_flow_select
take focus of the first Entry button/Value for all listboxes returns only a few parameters All others have been reset to false
dynamically change the color and associated logical hash values
WARNING, _reset may make color disappear
legacy look at set4start_of_run_button and set4end_of_run_button
sub set4end_of_add2flow
sets
$conditions4flows
$add2flow_button_grey
$flow_listbox_grey_w
calls
_reset();
sees a
listbox
my $color = _get_flow_color();
sub set4end_of_add2flow_button
sets
$conditions4flows
$add2flow_button_color
$flow_listbox_color_w
calls
_reset();
sees a
listbox
my $color = _get_flow_color();
sub set4end_of_superflow_Save
sub set4end_of_superflow_select
sub set4start_of_add2flow
find out correct color
find out correct color