PERL PROGRAM NAME: param_widgets_grey AUTHOR: Juan Lorenzo
DATE: V 0.0.1 May 6 2018
manages the parameter labels, values and their checkboxes in the guis
bring gui history parameters in to share and update # initialize default parameter values from gui_history # needed herein
bring gui history parameters in to share and update
We keep track of whether user is entering or leaving a widget: _check_value_changes changes are only allowed for those sunix programs whose spec files have a max_index defined currently changes in param_widgets_grey package only works with regular flows and not with pre-built superflows index = parameter line index of the Entry widget in the flow
locate change index for Entry widget off = 0 on = 1
Second case applies when we are using project_selector project_selector does not yet have a max_index defined in a separate module
locate change index for Entry widget
When entry values are in error
return an array widget references
clear the gui completely of 61 parameter values 61 = current defaulted maximum number of variables in a list box
update for one parameter index in currently active program Entry widget uses textvariables
screen location by using part of the widget name print(" self:$self widget: $widget\n"); print(" currently focus lies in: $screen_location\n"); print(" reference: $reference\n"); foreach my $i (@fields) { print(" 2. widget is $i\n"); my $screen_location = $widget->focusCurrent; my $reference = ref $screen_location; print(" 1. widget is $a\n"); print ( "widget is $fields[-1]\n"); name is in the last element of the split array if widget_name= frame then we have flow $var->{_flow} if widget_name= menubutton we have superflow $var->{_tool}
determine which Entry Button is chosen print("param is $entry_param;\n"); print ("selected widget is # $LSU->{_parameter_value_index}\"); print ("label is $out\n");
all the values for one program at a time from the parameter list in the GUI
equivalent to get_naems_aref
equivalent to get_labels_aref
same set of check buttons for all programs
establish the first and last indices of the array foreach my $key (sort keys %$ref_hash) { print (" param_widgets_color,range, key is $key, value is $ref_hash->{$key}\n"); }
update colors in check button boxes
print("1. redisplay, resdisplay_labels, text is @{$label_array_ref}[$i]\n"); print("redisplay, resdisplay_labels, i is $i\n"); print("2. redisplay, resdisplay_labels, text is @{$LSU->{_label_array_ref}}[$i]\n");
display parameter values without quotes although internally we always have quotes for strings and no quotes if the value looks like a number i/p: 2 array references o/p: array reference N.B. This is an ENTRY widget textvariables must be a reference in order for -validatecommand to work. BEWARE! For the Entry widget do not alter the textvariable directly while using validatecommand but instead indirectly delete the textvaribale and replace it using the insert method &_changes is invoked if there is a new selection after an entry change or even just if redisplay is selected _changes returns a 0 to invoke an error check In main, focus is forced to follows the mouse so focus will change whenever mouse moves to a new widget. That means the _changes will be invoked at every shift of the mouse to a new widget. use App::SeismicUnixGui::misc::control '0.0.3' to remove terminal quotes for values, only for display purposes; when later read again the values will be given quotes if they do not look like a number-- this occurs in a superclass my $length = $param_widgets_color_href->{_length}; print("param_widgets_color, redisplay_values, length is $length\n");
used in main by flow_select, sunix_select and delete_from_flow_button
=0
put focus on a widget Entry_w
a widget reference
override default length values
packing
set check_buttons by user from outside
set labels by user from outside
set single value in widget array index required separately
set values by user from outside
specs come from local private variables uses default specs, unless overwritten specs are not fed from above packing
To install App::SeismicUnixGui, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SeismicUnixGui
CPAN shell
perl -MCPAN -e shell install App::SeismicUnixGui
For more information on module installation, please visit the detailed CPAN module installation guide.