lib/App/SeismicUnixGui/misc/conditions4flows.pm untested

filter: Statementstmt 0.0% 0 / 1249 Branchbran 0.0% 0 / 148 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 76 Podpod 0.0% 0 / 70 totaltotal 0.0% 0 / 1560 CC 75 SCAR 29.5
CC
75
Cov
0%
set4_end_of_SaveAs_button
42.0
set4end_of_flow_select
42.0
set4end_of_Save_button
42.0
CRAP 19.1
1 package App::SeismicUnixGui::misc::conditions4flows;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PERL PROGRAM NAME: conditions4flows.pm
8 AUTHOR: Juan Lorenzo
9 DATE: May 16 2018
10  
11 DESCRIPTION
12 makes gui aware
13 of what method is active
14
15 Makes GUI disable and reenable certain widgets depending on which
16 method is called
17
18 Based on method used, hash values are reset internally
19 one of few packages that changes state of variables outside main
20 for this reason we copy all hash to private variables and reassign
21 them on potential exit so that nothing is lost or mislabeled
22
23 only conditions are reset. All other parameters travel through safely
24
25 Be careful to blank as many imported values as possible and only allow
26 the essential to be used (_reset and reset methods are available)
27
28 I sometimes reset some values internally (_reset)and only allow
29 one or a few to survive for manipulation internally. But, because
30 all variables that enter are sheltered in private variables those that are not
31 changed can safely be handed back to the namespace of the module that is calling
32 conditions4flows.
33
34 get_flow_index_last_touched needs to be exported so do not reset it
35
36 For safety we try to encapsulate this module
37 For safety we work internally sometimes with single scalars instead of imported hash and variables
38 For safety, input hash keys are assigned to new variables with short private names
39 New variables with short names are exported from a private hash
40
41 BASED ON:
42
43 conditions_gui.pm
44 previous version the main L_SU.pl (V 0.3)
45
46 =cut
47  
48 =head2 USE
49  
50 =head3 NOTES
51  
52 =head4 Examples
53  
54 =head3 SEISMIC UNIX NOTES
55  
56 =head2 CHANGES and their DATES
57 refactoring of 2017 version of L_SU.pl
58  
59 =cut
60  
61 =head2 Notes from bash
62
63 =cut
64  
65 use Moose;
66 our $VERSION = '0.0.2';
67  
68 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
69 my $get = L_SU_global_constants->new();
70  
71 my $var = $get->var();
72 my $false = $var->{_false};
73 my $true = $var->{_true};
74 my $empty_string = $var->{_empty_string};
75  
76 =head2
77
78 106 of convenient private abbreviated-variable names
79 These are defiend in every subroutine so that get_hash_ref can export them
80
81 =cut
82  
83 my $Data_menubutton;
84 my $FileDialog_sub_ref;
85 my $FileDialog_option;
86 my $Open_menubutton;
87 my $SaveAs_menubutton;
88 my $add2flow_button_grey;
89 my $add2flow_button_pink;
90 my $add2flow_button_green;
91 my $add2flow_button_blue;
92 my $big_stream_name_in;
93 my $big_stream_name_out;
94 #my $check_buttons_settings_aref;
95 #my $check_buttons_w_aref;
96 #my $check_code_button;
97 my $delete_from_flow_button;
98 my $delete_whole_flow_button;
99 my $dialog_type;
100 my $file_menubutton;
101 my $flowNsuperflow_name_w;
102 my $flow_color;
103 my $flow_item_down_arrow_button;
104 my $flow_item_up_arrow_button;
105 my $flow_listbox_grey_w;
106 my $flow_listbox_pink_w;
107 my $flow_listbox_green_w;
108 my $flow_listbox_blue_w;
109 my $flow_listbox_color_w;
110 my $flow_name_in;
111 my $flow_name_in_blue;
112 my $flow_name_in_grey;
113 my $flow_name_in_green;
114 my $flow_name_in_pink;
115 my $flow_name_out;
116 my $flow_name_out_blue;
117 my $flow_name_out_grey;
118 my $flow_name_out_green;
119 my $flow_name_out_pink;
120 my $flow_type;
121 my $flow_widget_index;
122 my $gui_history_ref;
123 #my $has_used_check_code_button;
124 my $has_used_Delete_button;
125 my $has_used_SaveAs_button;
126 my $has_used_Save_button;
127 my $has_used_Save_superflow;
128 my $has_used_open_perl_file_button;
129 my $has_used_run_button;
130 my $is_Delete_file_button;
131 my $is_Save_button;
132 my $is_SaveAs_button;
133 my $is_SaveAs_file_button;
134 my $is_add2flow;
135 my $is_add2flow_button;
136 #my $is_check_code_button;
137 my $is_delete_from_flow_button;
138 my $is_delete_whole_flow_button;
139 #my $is_dragNdrop;
140 my $is_flow_item_down_arrow_button;
141 my $is_flow_item_up_arrow_button;
142 my $is_flow_listbox_grey_w;
143 my $is_flow_listbox_pink_w;
144 my $is_flow_listbox_green_w;
145 my $is_flow_listbox_blue_w;
146 my $is_flow_listbox_color_w;
147 my $is_future_flow_listbox_grey;
148 my $is_future_flow_listbox_pink;
149 my $is_future_flow_listbox_green;
150 my $is_future_flow_listbox_blue;
151 my $is_last_flow_index_touched_grey;
152 my $is_last_flow_index_touched_pink;
153 my $is_last_flow_index_touched_green;
154 my $is_last_flow_index_touched_blue;
155 my $is_last_flow_index_touched;
156 my $is_last_parameter_index_touched_grey;
157 my $is_last_parameter_index_touched_pink;
158 my $is_last_parameter_index_touched_green;
159 my $is_last_parameter_index_touched_blue;
160 my $is_last_parameter_index_touched_color;
161 my $is_neutral_flow;
162 my $is_moveNdrop_in_flow;
163 my $is_new_listbox_selection;
164 my $is_open_file_button;
165 my $is_pre_built_superflow;
166 my $is_run_button;
167 my $is_select_file_button;
168 my $is_selected_file_name;
169 my $is_selected_path;
170 my $is_sunix_listbox;
171 my $is_superflow_select_button;
172 my $is_superflow; # for deprecation
173 my $is_user_built_flow;
174 my $is_wipe_plots_button;
175 my $labels_w_aref;
176 my $last_flow_listbox_touched;
177 my $last_flow_listbox_touched_w;
178 my $last_flow_index_touched_grey;
179 my $last_flow_index_touched_pink;
180 my $last_flow_index_touched_green;
181 my $last_flow_index_touched_blue;
182 my $last_flow_index_touched;
183 my $last_flow_color;
184 my $last_parameter_index_touched_grey;
185 my $last_parameter_index_touched_pink;
186 my $last_parameter_index_touched_green;
187 my $last_parameter_index_touched_blue;
188 my $last_parameter_index_touched_color;
189 my $message_w;
190 my $mw;
191 my $names_aref;
192 my $occupied_listbox_aref;
193 my $parameter_value_index;
194 my $parameter_values_frame;
195 my $path;
196 my $prog_name_sref;
197 my $run_button;
198 my $save_button;
199 my $selected_file_name;
200 my $sub_ref;
201 my $values_aref;
202 my $vacant_listbox_aref;
203 my $values_w_aref;
204 my $wipe_plots_button;
205  
206 =head2 private hash
207  
208 106 off
209  
210 =cut
211  
212 my $conditions4flows = {
213  
214 _Data_menubutton => '',
215 _Open_menubutton => '',
216 _SaveAs_menubutton => '',
217 _add2flow_button_grey => '',
218 _add2flow_button_pink => '',
219 _add2flow_button_green => '',
220 _add2flow_button_blue => '',
221 # _big_stream_name_in => '',
222 # _big_stream_name_out => '',
223 # _check_code_button => '',
224 # _check_buttons_settings_aref => '',
225 # _check_buttons_w_aref => '',
226 _delete_from_flow_button => '',
227 _delete_whole_flow_button => '',
228 _dialog_type => '',
229 _file_menubutton => '',
230 _flowNsuperflow_name_w => '',
231 _flow_color => '',
232 _flow_item_down_arrow_button => '',
233 _flow_item_up_arrow_button => '',
234 _flow_listbox_grey_w => '',
235 _flow_listbox_pink_w => '',
236 _flow_listbox_green_w => '',
237 _flow_listbox_blue_w => '',
238 _flow_listbox_color_w => '',
239 _flow_name_in => '',
240 # _flow_name_in_blue => '',
241 # _flow_name_in_grey => '',
242 # _flow_name_in_green => '',
243 # _flow_name_in_pink => '',
244 _flow_name_out => '',
245 # _flow_name_out_blue => '',
246 # _flow_name_out_grey => '',
247 # _flow_name_out_green => '',
248 # _flow_name_out_pink => '',
249 _flow_type => '',
250 _flow_widget_index => '',
251 _gui_history_aref => '',
252 # _has_used_check_code_button => '',
253 _has_used_Delete_button => '',
254 _has_used_Save_button => '',
255 _has_used_Save_superflow => '',
256 _has_used_SaveAs_button => '',
257 _has_used_open_perl_file_button => '',
258 _has_used_run_button => '',
259 _is_Delete_file_button => '',
260 _is_SaveAs_file_button => '',
261 _is_SaveAs_button => '',
262 _is_Save_button => '',
263 _is_add2flow => '',
264 _is_add2flow_button => '',
265 # _is_check_code_button => '',
266 _is_delete_from_flow_button => '',
267 _is_delete_whole_flow_button => '',
268 # _is_dragNdrop => '',
269 _is_flow_item_down_arrow_button => '',
270 _is_flow_item_up_arrow_button => '',
271 _is_flow_listbox_grey_w => '',
272 _is_flow_listbox_pink_w => '',
273 _is_flow_listbox_green_w => '',
274 _is_flow_listbox_blue_w => '',
275 _is_flow_listbox_color_w => '',
276 _is_last_flow_index_touched_grey => '',
277 _is_last_flow_index_touched_pink => '',
278 _is_last_flow_index_touched_green => '',
279 _is_last_flow_index_touched_blue => '',
280 _is_last_flow_index_touched => '',
281 _is_last_parameter_index_touched_grey => '',
282 _is_last_parameter_index_touched_pink => '',
283 _is_last_parameter_index_touched_green => '',
284 _is_last_parameter_index_touched_blue => '',
285 _is_last_parameter_index_touched_color => '',
286 _is_neutral_flow => '',
287 _is_moveNdrop_in_flow => '',
288 _is_new_listbox_selection => '',
289 _is_open_file_button => '',
290 _is_pre_built_superflow => '',
291 _is_run_button => '',
292 _is_select_file_button => '',
293 _is_selected_file_name => '',
294 _is_selected_path => '',
295 _is_superflow => '',
296 _is_sunix_listbox => '',
297 _is_superflow_select_button => '',
298 _is_run_button => '',
299 _is_user_built_flow => '',
300 _is_wipe_plots_button => '',
301 _labels_w_aref => '',
302 _last_flow_color => '',
303 _last_flow_index_touched_grey => -1,
304 _last_flow_index_touched_pink => -1,
305 _last_flow_index_touched_green => -1,
306 _last_flow_index_touched_blue => -1,
307 _last_flow_listbox_touched => -1,
308 _last_flow_listbox_touched_w => '',
309 _last_flow_index_touched => -1,
310 _last_parameter_index_touched_grey => -1,
311 _last_parameter_index_touched_pink => -1,
312 _last_parameter_index_touched_green => -1,
313 _last_parameter_index_touched_blue => -1,
314 _last_parameter_index_touched_color => -1,
315 _message_w => '',
316 _mw => '',
317 _names_aref => '',
318 _occupied_listbox_aref => '',
319 _parameter_values_frame => '',
320 _parameter_value_index => '',
321 _path => '',
322 _prog_name_sref => '',
323 _run_button => '',
324 _save_button => '',
325 _sub_ref => '',
326 _vacant_listbox_aref => '',
327 _values_aref => '',
328 _values_w_ref => '',
329 _wipe_plots_button => '',
330  
331 };
332  
333 =head2 sub _get_add2flow
334  
335  
336 =cut
337  
338 sub _get_add2flow {
339 my ($self) = @_;
340 my $color;
341 my $correct_add2flow_button;
342  
343 $color = $conditions4flows->{_flow_color};
344  
345 if ( $color eq 'grey' ) {
346 $correct_add2flow_button = $conditions4flows->{_add2flow_button_grey};
347  
348 } elsif ( $color eq 'pink' ) {
349 $correct_add2flow_button = $conditions4flows->{_add2flow_button_pink};
350  
351 } elsif ( $color eq 'green' ) {
352 $correct_add2flow_button = $conditions4flows->{_add2flow_button_green};
353  
354 } elsif ( $color eq 'blue' ) {
355 $correct_add2flow_button = $conditions4flows->{_add2flow_button_blue};
356  
357 } else {
358 print("conditions4flows, _get_add2flow_button, missing color,missing color, color:$color\n");
359 }
360  
361 return ($correct_add2flow_button);
362 }
363  
364 =head2 sub _get_add2flow_button
365  
366  
367 =cut
368  
369 sub _get_add2flow_button {
370 my ($self) = @_;
371 my $color;
372 my $correct_add2flow_button;
373  
374 $color = $conditions4flows->{_flow_color};
375  
376 if ( $color eq 'grey' ) {
377 $correct_add2flow_button = $conditions4flows->{_add2flow_button_grey};
378  
379 } elsif ( $color eq 'pink' ) {
380 $correct_add2flow_button = $conditions4flows->{_add2flow_button_pink};
381  
382 } elsif ( $color eq 'green' ) {
383 $correct_add2flow_button = $conditions4flows->{_add2flow_button_green};
384  
385 } elsif ( $color eq 'blue' ) {
386 $correct_add2flow_button = $conditions4flows->{_add2flow_button_blue};
387  
388 } else {
389 print("conditions4flows, _get_add2flow_button, missing color,missing color, color:$color\n");
390 }
391  
392 return ($correct_add2flow_button);
393 }
394  
395 =head2 sub _get_flow_color
396  
397  
398 =cut
399  
400 sub _get_flow_color {
401 my ($self) = @_;
402 my $color;
403  
404 if ( $conditions4flows->{_flow_color} ) {
405  
406 $color = $conditions4flows->{_flow_color};
407 return ($color);
408  
409 } else {
410 print("conditions4flows,_get_flow_color missing conditions4flows->{_flow_color}\n");
411  
412 }
413  
414 }
415  
416 =head2 sub _get_flow_listbox_color_w
417  
418  
419 =cut
420  
421 sub _get_flow_listbox_color_w {
422 my ($self) = @_;
423 my $correct_flow_listbox_color_w;
424  
425 if ( $conditions4flows->{_flow_listbox_color_w} ) {
426  
427 my $correct_flow_listbox_color_w = $conditions4flows->{_flow_listbox_color_w};
428 return ($correct_flow_listbox_color_w);
429  
430 } else {
431 print("conditions4flows, _get_flow_listbox_color_w, unassigned flow listbox w for current color\n");
432 return ();
433 }
434  
435 }
436  
437 =head2 sub _reset
438  
439 26 off
440 do not reset important values:
441 location within GUI
442  
443 =cut
444  
445 sub _reset {
446 my ($self) = @_;
447  
448 $conditions4flows->{_is_Delete_file_button} = $false;
449 $conditions4flows->{_is_Save_button} = $false;
450 $conditions4flows->{_is_SaveAs_file_button} = $false;
451 $conditions4flows->{_is_SaveAs_button} = $false;
452 # $conditions4flows->{_has_used_check_code_button} = $false;
453 $conditions4flows->{_has_used_run_button} = $false;
454 $conditions4flows->{_is_add2flow_button} = $false;
455 # $conditions4flows->{_is_check_code_button} = $false;
456 $conditions4flows->{_is_delete_from_flow_button} = $false;
457 $conditions4flows->{_is_delete_whole_flow_button} = $false;
458 $conditions4flows->{_is_dragNdrop} = $false;
459 $conditions4flows->{_is_flow_item_down_arrow_button} = $false;
460 $conditions4flows->{_is_flow_item_up_arrow_button} = $false;
461 $conditions4flows->{_is_flow_listbox_grey_w} = $false;
462 $conditions4flows->{_is_flow_listbox_pink_w} = $false;
463 $conditions4flows->{_is_flow_listbox_green_w} = $false;
464 $conditions4flows->{_is_flow_listbox_blue_w} = $false;
465 $conditions4flows->{_is_flow_listbox_color_w} = $false;
466 $conditions4flows->{_is_moveNdrop_in_flow} = $false;
467 $conditions4flows->{_is_open_file_button} = $false;
468 $conditions4flows->{_is_select_file_button} = $false;
469 $conditions4flows->{_is_sunix_listbox} = $false;
470 $conditions4flows->{_is_new_listbox_selection} = $false;
471 $conditions4flows->{_is_superflow_select_button} = $false;
472 $conditions4flows->{_is_run_button} = $false;
473 $conditions4flows->{_is_pre_built_superflow} = $false;
474 $conditions4flows->{_is_superflow} = $false;
475 $conditions4flows->{_is_user_built_flow} = $false;
476 $conditions4flows->{_is_wipe_plots_button} = $false;
477  
478 }
479  
480 =head2 sub _reset_is_flow_listbox_color_w
481  
482  
483 =cut
484  
485 sub _reset_is_flow_listbox_color_w {
486 my ($self) = @_;
487  
488 if ( $conditions4flows->{_flow_color} eq 'grey'
489 || $conditions4flows->{_flow_color} eq 'pink'
490 || $conditions4flows->{_flow_color} eq 'green'
491 || $conditions4flows->{_flow_color} eq 'blue'
492 || $conditions4flows->{_flow_color} eq 'neutral' ) {
493  
494 $conditions4flows->{_is_flow_listbox_grey_w} = $false;
495 $conditions4flows->{_is_flow_listbox_pink_w} = $false;
496 $conditions4flows->{_is_flow_listbox_green_w} = $false;
497 $conditions4flows->{_is_flow_listbox_blue_w} = $false;
498  
499 # for export
500 $is_flow_listbox_grey_w = $false;
501 $is_flow_listbox_pink_w = $false;
502 $is_flow_listbox_green_w = $false;
503 $is_flow_listbox_blue_w = $false;
504  
505 } else {
506 print(" conditions4flows, _reset_is_flow_listbox_color_w ,missing flow color \n");
507 }
508  
509 return ();
510 }
511  
512 =head2 sub _set_flow_color
513  
514  
515 =cut
516  
517 sub _set_flow_color {
518 my ($color) = @_;
519  
520 if ($color) {
521  
522 # print("conditions4flows, _set_flow_color , color:$color\n");
523 $conditions4flows->{_flow_color} = $color;
524 } else {
525  
526 print("conditions4flows, set_flow_color, missing color\n");
527 }
528 return ();
529 }
530  
531 =head2 sub _set_flow_listbox_color_w
532  
533  
534 =cut
535  
536 sub _set_flow_listbox_color_w {
537 my ($color) = @_;
538  
539 if ( $color eq 'grey' ) {
540 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{_flow_listbox_grey_w};
541 $conditions4flows->{_is_flow_listbox_grey_w} = $true;
542 $flow_listbox_color_w = $conditions4flows->{_flow_listbox_grey_w}; # for possible export via get_hash_ref
543 $is_flow_listbox_grey_w = $true; # for possible export via get_hash_ref
544  
545 } elsif ( $color eq 'pink' ) {
546 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{_flow_listbox_pink_w};
547 $conditions4flows->{_is_flow_listbox_pink_w} = $true;
548 $flow_listbox_color_w = $conditions4flows->{_flow_listbox_pink_w}; # for possible export via get_hash_ref
549 $is_flow_listbox_pink_w = $true; # for possible export via get_hash_ref
550  
551 } elsif ( $color eq 'green' ) {
552 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{_flow_listbox_green_w};
553 $conditions4flows->{_is_flow_listbox_green_w} = $true;
554 $flow_listbox_color_w = $conditions4flows->{_flow_listbox_green_w}; # for possible export via get_hash_ref
555 $is_flow_listbox_green_w = $true; # for possible export via get_hash_ref
556  
557 } elsif ( $color eq 'blue' ) {
558 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{_flow_listbox_blue_w};
559 $conditions4flows->{_is_flow_listbox_blue_w} = $true;
560 $flow_listbox_color_w = $conditions4flows->{_flow_listbox_blue_w}; # for possible export via get_hash_ref
561 $is_flow_listbox_blue_w = $true; # for possible export via get_hash_ref
562  
563 } else {
564 print("conditions4flows, _set_flow_listbox_color_w, missing color, color:$color\n");
565 }
566  
567 return ();
568 }
569  
570 =head2 sub _set_flow_listbox_last_touched_txt
571  
572 keep track of whcih listbox was last chosen
573  
574 =cut
575  
576 sub _set_flow_listbox_last_touched_txt {
577 my ($last_flow_lstbx_touched) = @_;
578  
579 if ($last_flow_lstbx_touched) {
580 $conditions4flows->{_last_flow_listbox_touched} = $last_flow_lstbx_touched;
581  
582 # print("conditions4flows,_set_flow_listbox_touched left listbox = $conditions4flows->{_last_flow_listbox_touched}\n");
583  
584 # for possible export via get_hash_ref
585 $last_flow_listbox_touched = $last_flow_lstbx_touched;
586  
587 } else {
588 print("conditions4flows,set_flow_listbox_touched_txt, missing listbox name\n");
589 }
590  
591 return ();
592 }
593  
594 =head2 sub _set_flow_listbox_last_touched_w
595  
596  
597 =cut
598  
599 sub _set_flow_listbox_last_touched_w {
600 my ($flow_listbox_color_w) = @_;
601  
602 # print("1 conditions4flows, _set_flow_listbox_last_touched_w; flow_listbox_color_w: $flow_listbox_color_w \n");
603  
604 if ($flow_listbox_color_w) {
605  
606 # print("1 conditions4flows, _set_flow_listbox_last_touched_w; $flow_listbox_color_w\n");
607 $conditions4flows->{_last_flow_listbox_touched_w} = $flow_listbox_color_w;
608 $last_flow_listbox_touched_w = $flow_listbox_color_w; # for export via get_hash-ref
609  
610 } else {
611 print("conditions4flows,_set_flow_listbox_touched_w, missing listbox widget\n");
612 }
613 return ();
614 }
615  
616 =head2 sub get_flow_color
617  
618 return flow color if it exists
619
620 =cut
621  
622 sub get_flow_color {
623 my ($self) = @_;
624 my $flow_color;
625  
626 if ( $conditions4flows->{_flow_color} ) {
627  
628 $flow_color = $conditions4flows->{_flow_color};
629  
630 print("conditions4flows, conditions4flows->{_flow_color}: $conditions4flows->{_flow_color}\n");
631 return ($flow_color);
632  
633 } else {
634 print("conditions4flows, get_flow_color , missing flow color value \n");
635 return ();
636 }
637 }
638  
639 =head2 sub get_hash_ref
640  
641 return ALL values of the private hash, supposedly
642 improtant external widgets have not been reset.. only conditions
643 are reset
644 TODO: perhaps it is better to have a specific method
645 to return one specific widget address at a time?
646 }
647
648 99
649
650 =cut
651  
652 sub get_hash_ref {
653 my ($self) = @_;
654  
655 if ($conditions4flows) {
656  
657 $conditions4flows->{_Data_menubutton} = $Data_menubutton;
658 $conditions4flows->{_Open_menubutton} = $Open_menubutton;
659 $conditions4flows->{_SaveAs_menubutton} = $SaveAs_menubutton;
660 $conditions4flows->{_add2flow_button_grey} = $add2flow_button_grey;
661 $conditions4flows->{_add2flow_button_pink} = $add2flow_button_pink;
662 $conditions4flows->{_add2flow_button_green} = $add2flow_button_green;
663 $conditions4flows->{_add2flow_button_blue} = $add2flow_button_blue;
664 $conditions4flows->{_big_stream_name_in} = $big_stream_name_in;
665 $conditions4flows->{_big_stream_name_out} = $big_stream_name_out;
666 # $conditions4flows->{_check_buttons_w_aref} = $check_buttons_w_aref;
667 # $conditions4flows->{_check_buttons_settings_aref} = $check_buttons_settings_aref;
668 # $conditions4flows->{_check_code_button} = $check_code_button;
669 $conditions4flows->{_delete_from_flow_button} = $delete_from_flow_button;
670 $conditions4flows->{_delete_whole_flow_button} = $delete_whole_flow_button;
671 $conditions4flows->{_file_menubutton} = $file_menubutton;
672 $conditions4flows->{_flowNsuperflow_name_w} = $flowNsuperflow_name_w;
673 $conditions4flows->{_flow_item_down_arrow_button} = $flow_item_down_arrow_button;
674 $conditions4flows->{_flow_item_up_arrow_button} = $flow_item_up_arrow_button;
675 $conditions4flows->{_flow_listbox_grey_w} = $flow_listbox_grey_w;
676 $conditions4flows->{_flow_listbox_pink_w} = $flow_listbox_pink_w;
677 $conditions4flows->{_flow_listbox_green_w} = $flow_listbox_green_w;
678 $conditions4flows->{_flow_listbox_blue_w} = $flow_listbox_blue_w;
679 $conditions4flows->{_flow_listbox_color_w} = $flow_listbox_color_w;
680 $conditions4flows->{_flow_name_in} = $flow_name_in;
681 $conditions4flows->{_flow_name_in_blue} = $flow_name_in_blue;
682 $conditions4flows->{_flow_name_in_grey} = $flow_name_in_grey;
683 $conditions4flows->{_flow_name_in_green} = $flow_name_in_green;
684 $conditions4flows->{_flow_name_in_pink} = $flow_name_in_pink;
685 $conditions4flows->{_flow_name_out} = $flow_name_out;
686 $conditions4flows->{_flow_name_out_blue} = $flow_name_out_blue;
687 $conditions4flows->{_flow_name_out_grey} = $flow_name_out_grey;
688 $conditions4flows->{_flow_name_out_green} = $flow_name_out_green;
689 $conditions4flows->{_flow_name_out_pink} = $flow_name_out_pink;
690 $conditions4flows->{_flow_widget_index} = $flow_widget_index;
691 $conditions4flows->{_labels_w_aref} = $labels_w_aref;
692 $conditions4flows->{_message_w} = $message_w;
693 $conditions4flows->{_mw} = $mw;
694 $conditions4flows->{_parameter_values_frame} = $parameter_values_frame;
695 $conditions4flows->{_parameter_value_index} = $parameter_value_index;
696 $conditions4flows->{_run_button} = $run_button;
697 $conditions4flows->{_save_button} = $save_button;
698 $conditions4flows->{_values_w_aref} = $values_w_aref;
699 $conditions4flows->{_dialog_type} = $dialog_type;
700 $conditions4flows->{_flow_color} = $flow_color;
701 $conditions4flows->{_flow_type} = $flow_type;
702 $conditions4flows->{_flow_widget_index} = $flow_widget_index;
703 $conditions4flows->{_gui_history_ref} = $gui_history_ref;
704 $conditions4flows->{_has_used_Delete_button} = $has_used_Delete_button;
705 $conditions4flows->{_has_used_SaveAs_button} = $has_used_SaveAs_button;
706 $conditions4flows->{_has_used_Save_button} = $has_used_Save_button;
707 $conditions4flows->{_has_used_Save_superflow} = $has_used_Save_superflow;
708 # $conditions4flows->{_has_used_check_code_button} = $has_used_check_code_button;
709 $conditions4flows->{_has_used_open_perl_file_button} = $has_used_open_perl_file_button;
710 $conditions4flows->{_has_used_run_button} = $has_used_run_button;
711 $conditions4flows->{_is_Delete_file_button} = $is_Delete_file_button;
712 $conditions4flows->{_is_Save_button} = $is_Save_button;
713 $conditions4flows->{_is_SaveAs_button} = $is_SaveAs_button;
714 $conditions4flows->{_is_SaveAs_file_button} = $is_SaveAs_file_button;
715 # $conditions4flows->{_is_add2flow_button} = $is_add2flow_button;
716 # $conditions4flows->{_is_check_code_button} = $is_check_code_button;
717 $conditions4flows->{_is_delete_from_flow_button} = $is_delete_from_flow_button;
718 $conditions4flows->{_is_delete_whole_flow_button} = $is_delete_whole_flow_button;
719 # $conditions4flows->{_is_dragNdrop} = $is_dragNdrop;
720 $conditions4flows->{_is_flow_item_up_arrow_button} = $is_flow_item_up_arrow_button;
721 $conditions4flows->{_is_flow_item_down_arrow_button} = $is_flow_item_down_arrow_button;
722 $conditions4flows->{_is_flow_listbox_grey_w} = $is_flow_listbox_grey_w;
723 $conditions4flows->{_is_flow_listbox_pink_w} = $is_flow_listbox_pink_w;
724 $conditions4flows->{_is_flow_listbox_green_w} = $is_flow_listbox_green_w;
725 $conditions4flows->{_is_flow_listbox_blue_w} = $is_flow_listbox_blue_w;
726 $conditions4flows->{_is_flow_listbox_color_w} = $is_flow_listbox_color_w;
727 $conditions4flows->{_is_future_flow_listbox_grey} = $is_future_flow_listbox_grey;
728 $conditions4flows->{_is_future_flow_listbox_pink} = $is_future_flow_listbox_pink;
729 $conditions4flows->{_is_future_flow_listbox_green} = $is_future_flow_listbox_green;
730 $conditions4flows->{_is_future_flow_listbox_blue} = $is_future_flow_listbox_blue;
731 $conditions4flows->{_is_last_flow_index_touched} = $is_last_flow_index_touched;
732 $conditions4flows->{_is_last_flow_index_touched_grey} = $is_last_flow_index_touched_grey;
733 $conditions4flows->{_is_last_flow_index_touched_pink} = $is_last_flow_index_touched_pink;
734 $conditions4flows->{_is_last_flow_index_touched_green} = $is_last_flow_index_touched_green;
735 $conditions4flows->{_is_last_flow_index_touched_blue} = $is_last_flow_index_touched_blue;
736 $conditions4flows->{_is_last_parameter_index_touched_grey} = $is_last_parameter_index_touched_grey;
737 $conditions4flows->{_is_last_parameter_index_touched_pink} = $is_last_parameter_index_touched_pink;
738 $conditions4flows->{_is_last_parameter_index_touched_green} = $is_last_parameter_index_touched_green;
739 $conditions4flows->{_is_last_parameter_index_touched_blue} = $is_last_parameter_index_touched_blue;
740 $conditions4flows->{_is_last_parameter_index_touched_color} = $is_last_parameter_index_touched_color;
741 $conditions4flows->{_is_open_file_button} = $is_open_file_button;
742 $conditions4flows->{_is_run_button} = $is_run_button;
743 $conditions4flows->{_is_moveNdrop_in_flow} = $is_moveNdrop_in_flow;
744 $conditions4flows->{_is_user_built_flow} = $is_user_built_flow;
745 $conditions4flows->{_is_select_file_button} = $is_select_file_button;
746 $conditions4flows->{_is_selected_file_name} = $is_selected_file_name;
747 $conditions4flows->{_is_selected_path} = $is_selected_path;
748 $conditions4flows->{_is_sunix_listbox} = $is_sunix_listbox;
749 $conditions4flows->{_is_new_listbox_selection} = $is_new_listbox_selection;
750 $conditions4flows->{_is_pre_built_superflow} = $is_pre_built_superflow;
751 $conditions4flows->{_is_superflow_select_button} = $is_superflow_select_button;
752 $conditions4flows->{_is_superflow} = $is_superflow; # for deprecation TODO
753 $conditions4flows->{_is_moveNdrop_in_flow} = $is_moveNdrop_in_flow;
754 $conditions4flows->{_is_wipe_plots_button} = $is_wipe_plots_button;
755  
756 # $conditions4flows->{_last_flow_color} = $last_flow_color;
757 $conditions4flows->{_last_flow_index_touched_grey} = $last_flow_index_touched_grey;
758 $conditions4flows->{_last_flow_index_touched_pink} = $last_flow_index_touched_pink;
759 $conditions4flows->{_last_flow_index_touched_green} = $last_flow_index_touched_green;
760 $conditions4flows->{_last_flow_index_touched_blue} = $last_flow_index_touched_blue;
761 $conditions4flows->{_last_parameter_index_touched_grey} = $last_parameter_index_touched_grey;
762 $conditions4flows->{_last_parameter_index_touched_pink} = $last_parameter_index_touched_pink;
763 $conditions4flows->{_last_parameter_index_touched_green} = $last_parameter_index_touched_green;
764 $conditions4flows->{_last_parameter_index_touched_blue} = $last_parameter_index_touched_blue;
765 $conditions4flows->{_last_parameter_index_touched_color} = $last_parameter_index_touched_color;
766 $conditions4flows->{_last_flow_index_touched} = $last_flow_index_touched;
767 $conditions4flows->{_names_aref} = $names_aref;
768 $conditions4flows->{_occupied_listbox_aref} = $occupied_listbox_aref;
769 $conditions4flows->{_parameter_values_frame} = $parameter_values_frame;
770 $conditions4flows->{_path} = $path;
771 $conditions4flows->{_sub_ref} = $sub_ref;
772 $conditions4flows->{_vacant_listbox_aref} = $vacant_listbox_aref;
773 $conditions4flows->{_values_aref} = $values_aref;
774 $conditions4flows->{_wipe_plots_button} = $wipe_plots_button;
775  
776 # print("conditions4flows, get_hash_ref , conditions4flows->{_flowNsuperflow_name_w: $conditions4flows->{_flowNsuperflow_name_w}\n");
777  
778 return ($conditions4flows);
779  
780 } else {
781 print("conditions4flows, get_hash_ref , missing hconditions4flows hash_ref\n");
782 }
783 }
784  
785 =head2
786  
787 25 off only reset the conditional parameters, not the widgets and other information
788  
789 =cut
790  
791 sub reset {
792 my ($self) = @_;
793  
794 # location within GUI
795 # $conditions4flows->{_has_used_check_code_button} = $false;
796 $conditions4flows->{_has_used_run_button} = $false;
797 $conditions4flows->{_is_Delete_file_button} = $false;
798 $conditions4flows->{_is_Save_button} = $false;
799 $conditions4flows->{_is_SaveAs_file_button} = $false;
800 $conditions4flows->{_is_SaveAs_button} = $false;
801 $conditions4flows->{_is_add2flow_button} = $false;
802 # $conditions4flows->{_is_check_code_button} = $false;
803 $conditions4flows->{_is_delete_from_flow_button} = $false;
804 $conditions4flows->{_is_delete_whole_flow_button} = $false;
805 $conditions4flows->{_is_dragNdrop} = $false;
806 $conditions4flows->{_is_flow_item_down_arrow_button} = $false;
807 $conditions4flows->{_is_flow_item_up_arrow_button} = $false;
808 $conditions4flows->{_is_flow_listbox_grey_w} = $false;
809 $conditions4flows->{_is_flow_listbox_pink_w} = $false;
810 $conditions4flows->{_is_flow_listbox_green_w} = $false;
811 $conditions4flows->{_is_flow_listbox_blue_w} = $false;
812 $conditions4flows->{_is_flow_listbox_color_w} = $false;
813 $conditions4flows->{_is_open_file_button} = $false;
814 $conditions4flows->{_is_select_file_button} = $false;
815 $conditions4flows->{_is_sunix_listbox} = $false;
816 $conditions4flows->{_is_new_listbox_selection} = $false;
817 $conditions4flows->{_is_superflow_select_button} = $false;
818 $conditions4flows->{_is_run_button} = $false;
819 $conditions4flows->{_is_pre_built_superflow} = $false;
820 $conditions4flows->{_is_superflow} = $false; # for deprecation TODO
821 $conditions4flows->{_is_user_built_flow} = $false;
822 $conditions4flows->{_is_moveNdrop_in_flow} = $false;
823 $conditions4flows->{_is_wipe_plots_button} = $false;
824  
825 }
826  
827 =head2 sub set_flow_color
828  
829  
830 =cut
831  
832 sub set_flow_color {
833 my ( $self, $color ) = @_;
834  
835 if ($color) {
836  
837 $conditions4flows->{_flow_color} = $color;
838 $flow_color = $color; # export via get_hash_ref
839  
840 } else {
841  
842 # my $parameter = '_is_flow_listbox_'.$color.'_w';
843 # $conditions4flows->{$parameter} = $true;
844 print("conditions4flows, set_flow_color, missing color\n");
845 }
846 return ();
847 }
848  
849 =head2 sub set_hash_ref
850 A private hash that helps
851 track all past actions in the gui
852
853 =cut
854  
855 sub set_hash_ref {
856 my ( $self, $hash_ref ) = @_;
857  
858 if ($hash_ref) {
859  
860 $conditions4flows = $hash_ref;
861  
862 $Data_menubutton = $hash_ref->{_Data_menubutton};
863 $Open_menubutton = $hash_ref->{_Open_menubutton};
864 $SaveAs_menubutton = $hash_ref->{_SaveAs_menubutton};
865 $add2flow_button_grey = $hash_ref->{_add2flow_button_grey};
866 $add2flow_button_pink = $hash_ref->{_add2flow_button_pink};
867 $add2flow_button_green = $hash_ref->{_add2flow_button_green};
868 $add2flow_button_blue = $hash_ref->{_add2flow_button_blue};
869 $big_stream_name_in = $hash_ref->{_big_stream_name_in};
870 $big_stream_name_out = $hash_ref->{_big_stream_name_out};
871 # $check_buttons_w_aref = $hash_ref->{_check_buttons_w_aref};
872 # $check_code_button = $hash_ref->{_check_code_button};
873 $delete_from_flow_button = $hash_ref->{_delete_from_flow_button};
874 $delete_whole_flow_button = $hash_ref->{_delete_whole_flow_button};
875 $file_menubutton = $hash_ref->{_file_menubutton};
876 $flowNsuperflow_name_w = $hash_ref->{_flowNsuperflow_name_w};
877 $flow_color = $hash_ref->{_flow_color};
878 $flow_item_down_arrow_button = $hash_ref->{_flow_item_down_arrow_button};
879 $flow_item_up_arrow_button = $hash_ref->{_flow_item_up_arrow_button};
880 $flow_listbox_grey_w = $hash_ref->{_flow_listbox_grey_w};
881 $flow_listbox_pink_w = $hash_ref->{_flow_listbox_pink_w};
882 $flow_listbox_green_w = $hash_ref->{_flow_listbox_green_w};
883 $flow_listbox_blue_w = $hash_ref->{_flow_listbox_blue_w};
884 $flow_listbox_color_w = $hash_ref->{_flow_listbox_color_w};
885 $flow_widget_index = $hash_ref->{_flow_widget_iindex};
886 $labels_w_aref = $hash_ref->{_labels_w_aref};
887 $message_w = $hash_ref->{_message_w};
888 $mw = $hash_ref->{_mw};
889 $parameter_values_frame = $hash_ref->{_parameter_values_frame};
890 $parameter_value_index = $hash_ref->{_parameter_value_index};
891 $run_button = $hash_ref->{_run_button};
892 $save_button = $hash_ref->{_save_button};
893 $values_w_aref = $hash_ref->{_values_w_aref};
894 $wipe_plots_button = $hash_ref->{_wipe_plots_button};
895 # $check_buttons_settings_aref = $hash_ref->{_check_buttons_settings_aref};
896 $dialog_type = $hash_ref->{_dialog_type};
897 $flow_color = $hash_ref->{_flow_color};
898 $flow_item_down_arrow_button = $hash_ref->{_flow_item_down_arrow_button};
899 $flow_item_up_arrow_button = $hash_ref->{_flow_item_up_arrow_button};
900 $flow_name_in = $hash_ref->{_flow_name_in};
901 $flow_name_in_blue = $hash_ref->{_flow_name_in_blue};
902 $flow_name_in_grey = $hash_ref->{_flow_name_in_grey};
903 $flow_name_in_green = $hash_ref->{_flow_name_in_green};
904 $flow_name_in_pink = $hash_ref->{_flow_name_in_pink};
905 $flow_name_out = $hash_ref->{_flow_name_out};
906 $flow_name_out_blue = $hash_ref->{_flow_name_out_blue};
907 $flow_name_out_grey = $hash_ref->{_flow_name_out_grey};
908 $flow_name_out_green = $hash_ref->{_flow_name_out_green};
909 $flow_name_out_pink = $hash_ref->{_flow_name_out_pink};
910 $flow_type = $hash_ref->{_flow_type};
911 $flow_widget_index = $hash_ref->{_flow_widget_index};
912 $gui_history_ref = $hash_ref->{_gui_history_ref};
913 # $has_used_check_code_button = $hash_ref->{_has_used_check_code_button};
914 $has_used_Delete_button = $hash_ref->{_has_used_Delete_button};
915 $has_used_SaveAs_button = $hash_ref->{_has_used_SaveAs_button};
916 $has_used_Save_button = $hash_ref->{_has_used_Save_button};
917 $has_used_Save_superflow = $hash_ref->{_has_used_Save_superflow};
918 $has_used_open_perl_file_button = $hash_ref->{_has_used_open_perl_file_button};
919 $has_used_run_button = $hash_ref->{_has_used_run_button};
920 $is_add2flow_button = $hash_ref->{_is_add2flow_button};
921 $is_Delete_file_button = $hash_ref->{_is_Delete_file_button};
922 $is_Save_button = $hash_ref->{_is_Save_button};
923 $is_SaveAs_button = $hash_ref->{_is_SaveAs_button};
924 $is_SaveAs_file_button = $hash_ref->{_is_SaveAs_file_button};
925 # $is_check_code_button = $hash_ref->{_is_check_code_button};
926 # $is_dragNdrop = $hash_ref->{_is_dragNdrop};
927 $is_delete_from_flow_button = $hash_ref->{_is_delete_from_flow_button};
928 $is_delete_whole_flow_button = $hash_ref->{_is_delete_whole_flow_button};
929 $is_flow_item_down_arrow_button = $hash_ref->{_is_flow_item_down_arrow_button};
930 $is_flow_item_up_arrow_button = $hash_ref->{_is_flow_item_up_arrow_button};
931 $is_flow_listbox_grey_w = $hash_ref->{_is_flow_listbox_grey_w};
932 $is_flow_listbox_pink_w = $hash_ref->{_is_flow_listbox_pink_w};
933 $is_flow_listbox_green_w = $hash_ref->{_is_flow_listbox_green_w};
934 $is_flow_listbox_blue_w = $hash_ref->{_is_flow_listbox_blue_w};
935 $is_flow_listbox_color_w = $hash_ref->{_is_flow_listbox_color_w};
936 $is_future_flow_listbox_grey = $hash_ref->{_is_future_flow_listbox_grey};
937 $is_future_flow_listbox_pink = $hash_ref->{_is_future_flow_listbox_pink};
938 $is_future_flow_listbox_green = $hash_ref->{_is_future_flow_listbox_green};
939 $is_future_flow_listbox_blue = $hash_ref->{_is_future_flow_listbox_blue};
940 $is_last_flow_index_touched_grey = $hash_ref->{_is_last_flow_index_touched_grey};
941 $is_last_flow_index_touched_pink = $hash_ref->{_is_last_flow_index_touched_pink};
942 $is_last_flow_index_touched_green = $hash_ref->{_is_last_flow_index_touched_green};
943 $is_last_flow_index_touched_blue = $hash_ref->{_is_last_flow_index_touched_blue};
944 $is_last_flow_index_touched = $hash_ref->{_is_last_flow_index_touched};
945 $is_last_parameter_index_touched_grey = $hash_ref->{_is_last_parameter_index_touched_grey};
946 $is_last_parameter_index_touched_pink = $hash_ref->{_is_last_parameter_index_touched_pink};
947 $is_last_parameter_index_touched_green = $hash_ref->{_is_last_parameter_index_touched_green};
948 $is_last_parameter_index_touched_blue = $hash_ref->{_is_last_parameter_index_touched_blue};
949 $is_open_file_button = $hash_ref->{_is_open_file_button};
950 $is_run_button = $hash_ref->{_is_run_button};
951 $is_moveNdrop_in_flow = $hash_ref->{_is_moveNdrop_in_flow};
952 $is_user_built_flow = $hash_ref->{_is_user_built_flow};
953 $is_select_file_button = $hash_ref->{_is_select_file_button};
954 $is_selected_file_name = $hash_ref->{_is_selected_file_name};
955 $is_selected_path = $hash_ref->{_is_selected_path};
956 $is_sunix_listbox = $hash_ref->{_is_sunix_listbox};
957 $is_new_listbox_selection = $hash_ref->{_is_new_listbox_selection};
958 $is_pre_built_superflow = $hash_ref->{_is_pre_built_superflow};
959 $is_superflow_select_button = $hash_ref->{_is_superflow_select_button};
960 $is_superflow = $hash_ref->{_is_superflow}; # for deprecation TODO
961 $is_moveNdrop_in_flow = $hash_ref->{_is_moveNdrop_in_flow};
962 $is_wipe_plots_button = $hash_ref->{_is_wipe_plots_button};
963 # $last_flow_color = $hash_ref->{_last_flow_color};
964 $last_flow_index_touched_grey = $hash_ref->{_last_flow_index_touched_grey};
965 $last_flow_index_touched_pink = $hash_ref->{_last_flow_index_touched_pink};
966 $last_flow_index_touched_green = $hash_ref->{_last_flow_index_touched_green};
967 $last_flow_index_touched_blue = $hash_ref->{_last_flow_index_touched_blue};
968 $last_flow_index_touched = $hash_ref->{_last_flow_index_touched};
969 $last_parameter_index_touched_grey = $hash_ref->{_last_parameter_index_touched_grey};
970 $last_parameter_index_touched_pink = $hash_ref->{_last_parameter_index_touched_pink};
971 $last_parameter_index_touched_green = $hash_ref->{_last_parameter_index_touched_green};
972 $last_parameter_index_touched_blue = $hash_ref->{_last_parameter_index_touched_blue};
973 $last_parameter_index_touched_color = $hash_ref->{_last_parameter_index_touched_color};
974 $occupied_listbox_aref = $hash_ref->{_occupied_listbox_aref};
975 $path = $hash_ref->{_path};
976 $sub_ref = $hash_ref->{_sub_ref};
977 $names_aref = $hash_ref->{_names_aref}; # equiv labels
978 $vacant_listbox_aref = $hash_ref->{_vacant_listbox_aref};
979 $values_aref = $hash_ref->{_values_aref};
980 $wipe_plots_button = $hash_ref->{_wipe_plots_button};
981  
982 } else {
983  
984 print("conditions4flows, set_hash_ref , missing hash_ref\n");
985 }
986 return ();
987 }
988  
989 #=head2
990 #
991 #
992 #=cut
993 #
994 #sub set4_check_code_button {
995 # my ($self) = @_;
996 #
997 # # _conditions ->reset();
998 # # print("1. conditions4flows, set4end_of_check_code_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
999 # # location within GUI
1000 # $conditions4flows->{_has_used_check_code_button} = $true;
1001 #
1002 # # for potential export via get_hash_ref
1003 # $has_used_check_code_button = $true;
1004 #
1005 # return ();
1006 #}
1007  
1008 =head2 sub set4FileDialog_Delete_end
1009  
1010  
1011 =cut
1012  
1013 sub set4FileDialog_Delete_end {
1014 my ($self) = @_;
1015  
1016 $conditions4flows->{_is_Delete_file_button} = $false;
1017 $conditions4flows->{_is_neutral_flow} = $false;
1018 $conditions4flows->{_has_used_Delete_button} = $true;
1019  
1020 # for potential export via get_hash_ref
1021 $is_Delete_file_button = $false;
1022 $is_neutral_flow = $false;
1023 $has_used_Delete_button = $true;
1024  
1025 # clean path
1026 $conditions4flows->{_path} = '';
1027 # print("conditions4flows,set4FileDialog_Delete_end
1028 # $conditions4flows->{_is_Delete_file_button}\n");
1029 return ();
1030 }
1031  
1032  
1033 =head2 sub set4FileDialog_Delete_start
1034  
1035  
1036 =cut
1037  
1038 sub set4FileDialog_Delete_start {
1039 my ($self) = @_;
1040  
1041 $conditions4flows->{_is_Delete_file_button} = $true;
1042 $conditions4flows->{_is_neutral_flow} = $true;
1043 $conditions4flows->{_has_used_Delete_button} = $false;
1044  
1045 # for potential export via get_hash_ref
1046 $is_Delete_file_button = $true;
1047 $is_neutral_flow = $true;
1048 $has_used_Delete_button = $false;
1049  
1050 # clean path
1051 $conditions4flows->{_path} = '';
1052 # print("conditions4flows,set4FileDialog_Delete_start
1053 # $conditions4flows->{_is_Delete_file_button}\n");
1054 return ();
1055 }
1056 =head2 sub set4FileDialog_SaveAs_end
1057  
1058  
1059 =cut
1060  
1061 sub set4FileDialog_SaveAs_end {
1062 my ($self) = @_;
1063  
1064 $conditions4flows->{_is_SaveAs_file_button} = $false;
1065 $conditions4flows->{_has_used_SaveAs_button} = $true;
1066  
1067 # for potential export via get_hash_ref
1068 $is_SaveAs_file_button = $false;
1069 $has_used_SaveAs_button = $true;
1070  
1071 # clean path
1072 # $conditions4flows->{_path} = '';
1073 # print("conditions4flows,set4FileDialog_SaveAs_end
1074 # $conditions4flows->{_is_SaveAs_file_button}\n");
1075 return ();
1076 }
1077  
1078 =head2 sub set4FileDialog_open_end
1079  
1080  
1081 =cut
1082  
1083 sub set4FileDialog_open_end {
1084 my ($self) = @_;
1085  
1086 $conditions4flows->{_is_open_file_button} = $false;
1087  
1088 # for potential export via get_hash_ref
1089 $is_open_file_button = $false;
1090  
1091 # print("conditions4flows,set4FileDialog_open_end $conditions4flows->{_is_open_file_button}\n");
1092  
1093 return ();
1094 }
1095  
1096 =head2 sub set4FileDialog_open_perl_file_end
1097  
1098  
1099 =cut
1100  
1101 sub set4FileDialog_open_perl_file_end {
1102 my ($self) = @_;
1103  
1104 $conditions4flows->{_is_open_file_button} = $false;
1105 $conditions4flows->{_has_used_open_perl_file_button} = $true;
1106  
1107 # for potential export via get_hash_ref
1108 $is_open_file_button = $false;
1109 $has_used_open_perl_file_button = $true;
1110  
1111 # print("conditions4flows,set4FileDialog_open_perl_file_end $conditions4flows->{_is_open_file_button}\n");
1112  
1113 return ();
1114 }
1115  
1116 =head2 sub set4FileDialog_open_perl_file_fail
1117  
1118  
1119 =cut
1120  
1121 sub set4FileDialog_open_perl_file_fail {
1122 my ($self) = @_;
1123  
1124 $conditions4flows->{_is_open_file_button} = $false;
1125 $conditions4flows->{_has_used_open_perl_file_button} = $false;
1126  
1127 # for potential export via get_hash_ref
1128 $is_open_file_button = $false;
1129 $has_used_open_perl_file_button = $false;
1130  
1131 # print("conditions4flows,set4FileDialog_open_perl_file_fail $conditions4flows->{_is_open_file_button}\n");
1132  
1133 return ();
1134 }
1135  
1136 =head2 sub set4FileDialog_open_start
1137  
1138  
1139 =cut
1140  
1141 sub set4FileDialog_open_start {
1142  
1143 my ($self) = @_;
1144  
1145 $conditions4flows->{_is_open_file_button} = $true;
1146  
1147 # for potential export via get_hash_ref
1148 $is_open_file_button = $true;
1149  
1150 # print("conditions4flows,set4FileDialog_open_start _is_open_file_button}: $conditions4flows->{_is_open_file_button}\n");
1151  
1152 return ();
1153 }
1154  
1155 =head2 sub set4FileDialog_open_perl_file_start
1156  
1157  
1158 =cut
1159  
1160 sub set4FileDialog_open_perl_file_start {
1161  
1162 my ($self) = @_;
1163  
1164 $conditions4flows->{_is_open_file_button} = $true;
1165  
1166 # for potential export via get_hash_ref
1167 $is_open_file_button = $true;
1168  
1169 # print("conditions4flows,set4FileDialog_open_perl_file_start _is_open_file_button}: $conditions4flows->{_is_open_file_button}\n");
1170  
1171 return ();
1172 }
1173  
1174 =head2
1175  
1176  
1177 =cut
1178  
1179 sub set4FileDialog_SaveAs_start {
1180 my ($self) = @_;
1181  
1182 use App::SeismicUnixGui::misc::L_SU_global_constants;
1183 my $get = L_SU_global_constants->new();
1184 my $flow_type_h = $get->flow_type_href();
1185  
1186 $conditions4flows->{_is_SaveAs_file_button} = $true;
1187 $conditions4flows->{_is_SaveAs_button} = $true;
1188  
1189 # for potential export via get_hash_ref
1190 $is_SaveAs_file_button = $true;
1191 $is_SaveAs_button = $true;
1192  
1193 if ( $conditions4flows->{_flow_type} eq $flow_type_h->{_user_built} ) {
1194 $conditions4flows->{_is_user_built_flow} = $true;
1195 $conditions4flows->{_is_pre_built_superflow} = $false;
1196  
1197 # for potential export via get_hash_ref
1198 $is_user_built_flow = $true;
1199 $is_pre_built_superflow = $false;
1200  
1201 } elsif ( $conditions4flows->{_flow_type} eq $flow_type_h->{_pre_built_superflow} ) {
1202  
1203 $conditions4flows->{_user_built_flow} = $false;
1204 $conditions4flows->{_is_pre_built_superflow} = $true;
1205  
1206 # for potential export via get_hash_ref
1207 $is_user_built_flow = $false;
1208 $is_pre_built_superflow = $true;
1209 }
1210  
1211 # print("conditions4flows,set4FileDialog_SaveAs_start
1212 # $conditions4flows->{_is_SaveAs_file_button}\n");
1213 return ();
1214 }
1215  
1216 =head2
1217  
1218  
1219 =cut
1220  
1221 sub set4_Save_button {
1222 my ($self) = @_;
1223  
1224 # _conditions ->reset();
1225 # print("1. conditions4flows, set4end_of_save_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1226 # location within GUI
1227 $conditions4flows->{_has_used_Save_button} = $true;
1228  
1229 return ();
1230 }
1231  
1232 =head2 sub set4_end_of_SaveAs_button
1233  
1234  
1235 =cut
1236  
1237 sub set4_end_of_SaveAs_button {
1238 my ($self) = @_;
1239  
1240 $conditions4flows->{_has_used_SaveAs_button} = $true;
1241 $conditions4flows->{_is_SaveAs_button} = $false;
1242  
1243 _reset_is_flow_listbox_color_w();
1244  
1245 if ( $conditions4flows->{_flow_color} eq 'grey' ) {
1246 $conditions4flows->{_is_flow_listbox_grey_w} = $true;
1247 $is_flow_listbox_grey_w = $true;
1248  
1249 } elsif ( $conditions4flows->{_flow_color} eq 'pink' ) {
1250 $conditions4flows->{_is_flow_listbox_pink_w} = $true;
1251 $is_flow_listbox_pink_w = $true;
1252  
1253 } elsif ( $conditions4flows->{_flow_color} eq 'green' ) {
1254 $conditions4flows->{_is_flow_listbox_green_w} = $true;
1255 $is_flow_listbox_green_w = $true;
1256  
1257 } elsif ( $conditions4flows->{_flow_color} eq 'blue' ) {
1258 $conditions4flows->{_is_flow_listbox_blue_w} = $true;
1259 $is_flow_listbox_blue_w = $true;
1260  
1261 } elsif ( $conditions4flows->{_flow_type} eq 'pre_built_superflow' ) {
1262  
1263 # print("2 conditions4flows,set4start_of_run_button Running a pre-built superflow\n");
1264 # NADA
1265  
1266 } else {
1267 print("2 conditions4flows,set4start_of_run_button missing color \n");
1268 }
1269 return ();
1270  
1271 }
1272  
1273 =head2 sub set4_start_of_SaveAs_button
1274  
1275  
1276 =cut
1277  
1278 sub set4_start_of_SaveAs_button {
1279 my ($self) = @_;
1280  
1281 $conditions4flows->{_is_SaveAs_button} = $true;
1282  
1283 return ();
1284 }
1285  
1286 #=head2
1287 #
1288 #
1289 #=cut
1290 #
1291 #sub set4end_of_check_code_button {
1292 # my ($self) = @_;
1293 #
1294 # # _conditions ->reset();
1295 # # print("1. conditions4flows, set4end_of_check_code_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1296 # # location within GUI
1297 # $conditions4flows->{_is_check_code_button} = $false;
1298 #
1299 # return ();
1300 #}
1301  
1302 =head2
1303  
1304  
1305 =cut
1306  
1307 sub set4end_of_SaveAs_button {
1308 my ($self) = @_;
1309  
1310 $conditions4flows->{_is_SaveAs_button} = $false;
1311 $conditions4flows->{_has_used_SaveAs_button} = $true;
1312 return ();
1313 }
1314  
1315 #=head2
1316 #
1317 #
1318 #=cut
1319 #
1320 #sub set4start_of_check_code_button {
1321 # my ($self) = @_;
1322 #
1323 # # _conditions ->reset();
1324 # # print("1. conditions4flows, set4start_of_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1325 # # location within GUI
1326 # $conditions4flows->{_is_check_code_button} = $true;
1327 # $conditions4flows->{_has_used_check_code_button} = $false;
1328 #
1329 # return ();
1330 #}
1331  
1332 =head2 sub set4end_of_flow_item_up_arrow_button
1333  
1334 when the arrow that moves flow items up a list is clicked
1335  
1336 =cut
1337  
1338 sub set4end_of_flow_item_up_arrow_button {
1339 my ( $self, $color ) = @_;
1340  
1341 if ($color) {
1342 _reset();
1343  
1344 $conditions4flows->{_is_flow_item_up_arrow_button} = $true;
1345 _set_flow_color($color);
1346  
1347 # from color create general keys and assign values to those keys (text names)
1348 # from color generalize which colored flow is being used and set it true
1349 # save copies of values for reassignment during get_hash_ref call from outside modules
1350 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
1351 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w';
1352  
1353 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
1354 $conditions4flows->{_is_user_built_flow} = $true;
1355  
1356 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{$flow_listbox_color_w_key};
1357 $flow_listbox_color_w = $conditions4flows->{$flow_listbox_color_w_key};
1358  
1359 } else {
1360 print("conditions4flows, set4end_of_flow_item_up_arrow_button, no color: $color\n");
1361 }
1362  
1363 return ();
1364 }
1365  
1366 #=head2 sub set4end_of_wipe_plots_button
1367 #
1368 # when the arrow that moves flow items up a list is clicked
1369 #
1370 #=cut
1371 #
1372 #sub set4end_of_wipe_plots_button {
1373 # my ( $self, $color ) = @_;
1374 #
1375 # if ($color) {
1376 # _reset();
1377 #
1378 # $conditions4flows->{_is_wipe_plots_button} = $true;
1379 # _set_flow_color($color);
1380 #
1381 ## from color create general keys and assign values to those keys (text names)
1382 ## from color generalize which colored flow is being used and set it true
1383 ## save copies of values for reassignment during get_hash_ref call from outside modules
1384 # my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
1385 # my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w';
1386 #
1387 # $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
1388 # $conditions4flows->{_is_user_built_flow} = $true;
1389 #
1390 # $conditions4flows->{_flow_listbox_color_w} =
1391 # $conditions4flows->{$flow_listbox_color_w_key};
1392 # $flow_listbox_color_w = $conditions4flows->{$flow_listbox_color_w_key};
1393 #
1394 # }
1395 # else {
1396 # print(
1397 # "conditions4flows, set4end_of_wipe_plots_button, no color: $color\n"
1398 # );
1399 # }
1400 #
1401 # return ();
1402 #}
1403  
1404 =head2
1405  
1406 location within GUI
1407
1408 foreach my $key (sort keys %$conditions4flows) {
1409 print ("conditions4flows user,set4end_of_flow_select,key is $key, value is $conditions4flows->{$key}\n");
1410 }
1411
1412 if an item within a user-built list of programs is selected then
1413 the following options are set to be true--they can now be activated from the GUI
1414 Also the color of the flow is maintained
1415
1416  
1417 =cut
1418  
1419 sub set4end_of_flow_select {
1420 my ( $self, $color ) = @_;
1421  
1422 if ($color) {
1423 _reset();
1424 _reset_is_flow_listbox_color_w();
1425 _set_flow_color($color);
1426  
1427 # my $is_flow_listbox_color_w_key = '_is_flow_listbox_'.$color.'_w';
1428 # print("conditions4flows, set4end_of_flow_select, color:$color\n");
1429 # print("1. conditions4flows, set4end_of_flow_select,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1430 # print("1. conditions4flows, set4end_of_flow_select, is_flow_listbox_color_w: $is_flow_listbox_color_w \n");
1431 # $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
1432 # my $ans = $conditions4flows->{$is_flow_listbox_color_w_key};
1433 # print("1. conditions4flows, set4end_of_flow_select, is_flow_listbox_color_w: $ans is EMPTY\n");
1434  
1435 $conditions4flows->{_flow_color} = $color;
1436 $conditions4flows->{_is_delete_from_flow_button} = $true;
1437 $conditions4flows->{_is_delete_whole_flow_button} = $true;
1438 $conditions4flows->{_is_flow_listbox_color_w} = $true;
1439  
1440 $conditions4flows->{_flow_item_down_arrow_button} = $true;
1441 $conditions4flows->{_flow_item_up_arrow_button} = $true;
1442  
1443 # Because the flow is selected automatically without user clicking,
1444 # as the case of when a perl flow has been read in, then
1445 # at least the grey flow listbox will have been touched
1446 # which is not the case when flow_select is directly chosen
1447 # Note that color_flow->_flow_select points to flow_select, so do not complicate yourself
1448 # and place these requirements into _flow_select as well
1449 if ( $color eq 'grey' ) {
1450  
1451 $conditions4flows->{_is_flow_listbox_grey_w} = $true;
1452  
1453 $conditions4flows->{_is_last_flow_index_touched_grey} = $true;
1454 $conditions4flows->{_is_last_parameter_index_touched_grey} = $true;
1455  
1456 # for export
1457 $is_flow_listbox_grey_w = $true;
1458 $is_last_flow_index_touched_grey = $true;
1459 $is_last_parameter_index_touched_grey = $true;
1460 $is_last_parameter_index_touched_color = $true;
1461  
1462 # print("conditions4flows, set4end_of_flow_select,is_last_parameter_index_touched_grey=$is_last_parameter_index_touched_grey\n");
1463 # print("conditions4flows, set4end_of_flow_select,is_last_flow_index_touched_grey=$is_last_flow_index_touched_grey\n");
1464  
1465 } elsif ( $color eq 'pink' ) {
1466  
1467 $conditions4flows->{_is_flow_listbox_pink_w} = $true;
1468  
1469 # for export
1470 $is_flow_listbox_pink_w = $true;
1471  
1472 } elsif ( $color eq 'green' ) {
1473  
1474 $conditions4flows->{_is_flow_listbox_green_w} = $true;
1475  
1476 # for export
1477 $is_flow_listbox_green_w = $true;
1478  
1479 } elsif ( $color eq 'blue' ) {
1480  
1481 $conditions4flows->{_is_flow_listbox_blue_w} = $true;
1482  
1483 # for export
1484 $is_flow_listbox_blue_w = $true;
1485  
1486 } else {
1487 print("conditions4flows, set4end_of_flow_select , color missing: $color\n");
1488 }
1489  
1490 } else {
1491 print("conditions4flows, set4end_of_flow_select , color missing: $color\n");
1492 }
1493  
1494 # my $ans = $conditions4flows->{$is_flow_listbox_color_w};
1495 # print("conditions4flows, set4end_of_flow_select, color:$color\n");
1496 # print("conditions4flows, set4end_of_flow_select, is_flow_listbox_color_w 'grey pink green or blue'_w: $ans \n");
1497  
1498 return ();
1499 }
1500  
1501 =head2 sub set4end_of_run_button
1502  
1503 location within GUI
1504  
1505 sets
1506 conditions4flows
1507  
1508 =cut
1509  
1510 sub set4end_of_run_button {
1511 my ($self) = @_;
1512  
1513 # location within GUI
1514 $conditions4flows->{_is_run_button} = $false;
1515 $conditions4flows->{_has_used_run_button} = $false;
1516 $conditions4flows->{_has_used_Save_button} = $false;
1517 $conditions4flows->{_has_used_Save_superflow} = $false;
1518 $conditions4flows->{_last_flow_index_touched} = -1;
1519  
1520 # for potential export
1521 $has_used_run_button = $false;
1522 $is_run_button = $false;
1523 $has_used_Save_button = $false; # allows re-use of run_button
1524 $has_used_Save_superflow = $false; # allows re-use of run_button
1525  
1526 # the last program that was touched is cancelled out
1527 $last_flow_index_touched = -1;
1528  
1529 return ();
1530 }
1531  
1532 =head2 sub set4end_of_run_superflow
1533  
1534 location within GUI
1535  
1536 sets
1537 conditions4flows
1538  
1539 =cut
1540  
1541 sub set4end_of_run_superflow {
1542  
1543 # location within GUI
1544 $conditions4flows->{_is_run_button} = $false;
1545 $conditions4flows->{_has_used_Save_superflow} = $true;
1546  
1547 # for potential export
1548 $is_run_button = $false;
1549 $has_used_Save_superflow = $true; # allows re-use of run_button
1550  
1551 return ();
1552 }
1553  
1554 =head2
1555  
1556  
1557 =cut
1558  
1559 sub set4start_of_Save_button {
1560 my ($self) = @_;
1561  
1562 # print("1. conditions4flows, set4start_of_Save_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1563 # location within GUI
1564 $conditions4flows->{_is_Save_button} = $true;
1565 $conditions4flows->{_has_used_Save_button} = $false;
1566  
1567 # for potential export
1568 $is_Save_button = $true;
1569 $has_used_Save_button = $false;
1570  
1571 return ();
1572 }
1573  
1574 =head2
1575  
1576  
1577 =cut
1578  
1579 sub set4start_of_SaveAs_button {
1580 my ($self) = @_;
1581  
1582 # print("1. conditions4flows, set4start_of_Save_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1583 # location within GUI
1584 $conditions4flows->{_is_SaveAs_button} = $true;
1585 $conditions4flows->{_has_used_SaveAs_button} = $false;
1586  
1587 # for potential export
1588 $is_SaveAs_button = $true;
1589 $has_used_SaveAs_button = $false;
1590  
1591 return ();
1592 }
1593  
1594 sub set4end_of_sunix_select {
1595 my ($self) = @_;
1596  
1597 # _set_gui_widgets();
1598  
1599 $add2flow_button_grey->configure( -state => 'normal', );
1600 $add2flow_button_pink->configure( -state => 'normal', );
1601 $add2flow_button_green->configure( -state => 'normal', );
1602 $add2flow_button_blue->configure( -state => 'normal', );
1603  
1604 # print ("conditions4flows,set4end_of_sunix_select, prog_name: ${$conditions4flows->{_prog_name_sref}}\n");
1605  
1606 # $conditions4flows->{_is_flow_listbox_grey_w} = $false;
1607 # $conditions4flows->{_is_flow_listbox_pink_w} = $false;
1608 # $conditions4flows->{_is_flow_listbox_green_w} = $false;
1609 # $conditions4flows->{_is_flow_listbox_blue_w} = $false;
1610 # $conditions4flows->{_is_flow_listbox_color_w} = $false;
1611 # $conditions4flows->{_is_add2flow_button} = $true; LOOK
1612  
1613 # for export
1614 # $is_flow_listbox_grey_w = $false;
1615 # $is_flow_listbox_pink_w = $false;
1616 # $is_flow_listbox_green_w = $false;
1617 # $is_flow_listbox_blue_w = $false;
1618 # $is_flow_listbox_color_w = $false;
1619 # $is_add2flow_button = $true; LOOK
1620  
1621 # $conditions4flows->{_is_sunix_listbox} = $false;
1622 }
1623  
1624 =head2
1625  
1626  
1627 =cut
1628  
1629 sub set4end_of_Save_button {
1630 my ($self) = @_;
1631  
1632 # _conditions ->reset();
1633 # print("1. conditions4flows, set4end_of_save_button,last left listbox flow program touched had index = $conditions4flows->{_last_flow_index_touched}\n");
1634 # location within GUI
1635 $conditions4flows->{_is_Save_button} = $false;
1636 $conditions4flows->{_has_used_Save_button} = $true;
1637 $conditions4flows->{_has_used_SaveAs_button} = $false;
1638 $conditions4flows->{_has_used_open_perl_file_button} = $false;
1639  
1640 # for export
1641 $is_Save_button = $false; # a reset
1642 $has_used_Save_button = $true;
1643  
1644 # N.B. Save can only be used if SaveAs is true
1645 # But, after Save is used, reset SaveAs to false
1646 $has_used_SaveAs_button = $false;
1647 $has_used_open_perl_file_button = $false;
1648  
1649 _reset_is_flow_listbox_color_w();
1650  
1651 if ( $conditions4flows->{_flow_color} eq 'grey' ) {
1652 $conditions4flows->{_is_flow_listbox_grey_w} = $true;
1653 $is_flow_listbox_grey_w = $true;
1654  
1655 } elsif ( $conditions4flows->{_flow_color} eq 'pink' ) {
1656 $conditions4flows->{_is_flow_listbox_pink_w} = $true;
1657 $is_flow_listbox_pink_w = $true;
1658  
1659 } elsif ( $conditions4flows->{_flow_color} eq 'green' ) {
1660 $conditions4flows->{_is_flow_listbox_green_w} = $true;
1661 $is_flow_listbox_green_w = $true;
1662  
1663 } elsif ( $conditions4flows->{_flow_color} eq 'blue' ) {
1664 $conditions4flows->{_is_flow_listbox_blue_w} = $true;
1665 $is_flow_listbox_blue_w = $true;
1666  
1667 } elsif ( $conditions4flows->{_flow_type} eq 'pre_built_superflow' ) {
1668  
1669 # print("2 conditions4flows,set4end_of_save_button Running a pre-built superflow NADA\n");
1670  
1671 } else {
1672 print("2 conditions4flows,set4start_of_run_button missing color \n");
1673 }
1674 return ();
1675  
1676 }
1677  
1678 =head2 sub set4user_built_flow_close_path_end
1679 inherited from set4superflow_close_path_end
1680  
1681 =cut
1682  
1683 sub set4user_built_flow_close_path_end {
1684 my ($self) = @_;
1685  
1686 # print("conditions4flows, set4user_built_flow_close_path_end OK \n");
1687 # Forces a Save before the next Run
1688 $conditions4flows->{_has_used_Save_button} = $false;
1689  
1690 # for potential export
1691 $has_used_Save_button = $false;
1692  
1693 # Allows user to open a user-built perl flow
1694 $Open_menubutton->configure( -state => 'normal', );
1695  
1696 return ();
1697 }
1698  
1699 =head2 sub set4user_built_open_path_end
1700 inherited from
1701 set4superflow_open_path_end
1702  
1703  
1704 =cut
1705  
1706 sub set4user_built_flow_open_path_end {
1707 my ($self) = @_;
1708  
1709 # print("conditions4flows, set4superflow_open_path_end OK \n");
1710 $conditions4flows->{_is_user_built_flow} = $true;
1711  
1712 # for potential export
1713 $is_user_built_flow = $true;
1714  
1715 return ();
1716 }
1717  
1718 =head2 sub _get_num_listboxes_occupied
1719  
1720  
1721 =cut
1722  
1723 sub _get_num_listboxes_occupied {
1724 my ($self) = @_;
1725  
1726 # print("1 conditions4flows, _get_num_listboxes_occupied: @{$conditions4flows->{_occupied_listbox_aref}} \n");
1727 if ( $conditions4flows->{_occupied_listbox_aref} ) {
1728  
1729 my $number
1730 = @{ $conditions4flows->{_occupied_listbox_aref} }[0]
1731 + @{ $conditions4flows->{_occupied_listbox_aref} }[1]
1732 + @{ $conditions4flows->{_occupied_listbox_aref} }[2]
1733 + @{ $conditions4flows->{_occupied_listbox_aref} }[3];
1734  
1735 # print("2 conditions4flows, _get_num_listboxes_occupied= $number \n");
1736 return ($number);
1737  
1738 } else {
1739 print("2 conditions4flows, get_num_listboxes_occupied: missing conditions4flows->{_occupied_listbox_aref} \n");
1740 }
1741 }
1742  
1743 # sub set_defaults4end_of_delete_whole_flow_button {
1744 # my ($self) = @_;
1745  
1746 # my $color = _get_flow_color();
1747  
1748 # if ( $color eq 'grey'
1749 # || $color eq 'pink'
1750 # || $color eq 'green'
1751 # || $color eq 'blue' ) {
1752  
1753 # # the last program that was touched is cancelled out
1754 # $last_flow_index_touched = -1;
1755  
1756 # $flow_item_down_arrow_button->configure( -state => 'disabled', );
1757 # $flow_item_up_arrow_button->configure( -state => 'disabled', );
1758 # $delete_from_flow_button->configure( -state => 'disabled', );
1759 # $delete_whole_flow_button->configure( -state => 'disabled', );
1760  
1761 # } else {
1762 # print("conditions4flows, set_defaults4delete_whole_flow_button, color missing: $color\n");
1763 # }
1764  
1765 # if ( $color eq 'grey' ) {
1766  
1767 # $conditions4flows->{_is_flow_listbox_grey_w} = $false;
1768 # @{ $conditions4flows->{_occupied_listbox_aref} }[0] = $false;
1769 # @{ $conditions4flows->{_vacant_listbox_aref} }[0] = $true;
1770  
1771 # # turn off flow listbox
1772 # $flow_listbox_grey_w->configure( -state => 'disabled', );
1773  
1774 # # name is removed from the namespace
1775 # $conditions4flows->{_flow_name_out_grey} = $empty_string;
1776  
1777 # # for export
1778 # $is_flow_listbox_grey_w = $false;
1779 # $flow_name_out_grey = $empty_string;
1780  
1781 # # the last program that was touched is cancelled out
1782 # $is_last_flow_index_touched_grey = $false;
1783  
1784 # } elsif ( $color eq 'pink' ) {
1785  
1786 # $conditions4flows->{_is_flow_listbox_pink_w} = $false;
1787 # @{ $conditions4flows->{_occupied_listbox_aref} }[1] = $false;
1788 # @{ $conditions4flows->{_vacant_listbox_aref} }[1] = $true;
1789  
1790 # # turn off flow -listbox
1791 # $flow_listbox_pink_w->configure( -state => 'disabled', );
1792  
1793 # # name is removed from the namespace
1794 # $conditions4flows->{_flow_name_out_pink} = $empty_string;
1795  
1796 # # for export
1797 # $is_flow_listbox_pink_w = $false;
1798 # $flow_name_out_pink = $empty_string;
1799  
1800 # # the last program that was touched is cancelled out
1801 # $is_last_flow_index_touched_pink = $false;
1802  
1803 # } elsif ( $color eq 'green' ) {
1804  
1805 # $conditions4flows->{_is_flow_listbox_green_w} = $false;
1806 # @{ $conditions4flows->{_occupied_listbox_aref} }[2] = $false;
1807 # @{ $conditions4flows->{_vacant_listbox_aref} }[2] = $true;
1808  
1809 # # turn off flow -listbox
1810 # $flow_listbox_green_w->configure( -state => 'disabled', );
1811  
1812 # # name is removed from the namespace
1813 # $conditions4flows->{_flow_name_out_green} = $empty_string;
1814  
1815 # # for export
1816 # $is_flow_listbox_green_w = $false;
1817 # $flow_name_out_green = $empty_string;
1818  
1819 # # the last program that was touched is cancelled out
1820 # $is_last_flow_index_touched_green = $false;
1821  
1822 # } elsif ( $color eq 'blue' ) {
1823  
1824 # $conditions4flows->{_is_flow_listbox_blue_w} = $false;
1825 # @{ $conditions4flows->{_occupied_listbox_aref} }[3] = $false;
1826 # @{ $conditions4flows->{_vacant_listbox_aref} }[3] = $true;
1827  
1828 # # turn off flow -listbox
1829 # $flow_listbox_blue_w->configure( -state => 'disabled', );
1830  
1831 # # name is removed from the namespace
1832 # $conditions4flows->{_flow_name_out_blue} = $empty_string;
1833  
1834 # # for export
1835 # $is_flow_listbox_blue_w = $false;
1836 # $flow_name_out_blue = $empty_string;
1837  
1838 # # the last program that was touched is cancelled out
1839 # $is_last_flow_index_touched_blue = $false;
1840  
1841 # } else {
1842 # print("conditions4flows, set_defaults4delete_whole_flow_buttonset, color missing: $color\n");
1843 # }
1844  
1845 # my $number = _get_num_listboxes_occupied();
1846  
1847 # # print("conditions4flows, set_defaults4delete_whole_flow_button, number of list boxes occupied=$number\n");
1848  
1849 # # because the last item in last listbox is deleted
1850 # # print("conditions4flows, set_defaults4delete_whole_flow_button, if number < 0 remove this if statement\n");
1851 # # turn off delete button
1852 # $delete_from_flow_button->configure( -state => 'disabled', );
1853  
1854 # # turn off delete whole flow button
1855 # $delete_whole_flow_button->configure( -state => 'disabled', );
1856  
1857 # # turn off up-arrow
1858 # $flow_item_up_arrow_button->configure( -state => 'disabled', );
1859  
1860 # # turn off down_arrow
1861 # $flow_item_down_arrow_button->configure( -state => 'disabled', );
1862  
1863 # # turn off run button
1864 # # $run_button->configure( -state => 'disabled' );
1865  
1866 # # # turn off SaveAs menu button
1867 # # $SaveAs_menubutton->configure( -state => 'disabled' );
1868  
1869 # # # turn off Data menu button
1870 # # $Data_menubutton->configure( -state => 'disabled' );
1871  
1872 # # # turn on Flow menu button
1873 # $Open_menubutton->configure( -state => 'normal' );
1874  
1875 # # turn off save button
1876 # # $save_button->configure( -state => 'disabled' );
1877  
1878 # # turn off check_code_button
1879 # # $check_code_button->configure( -state => 'disabled' );
1880  
1881 # $conditions4flows->{_is_flow_listbox_color_w} = $false;
1882 # $conditions4flows->{_is_user_built_flow} = $false;
1883 # $conditions4flows->{_is_sunix_listbox} = $false;
1884 # $conditions4flows->{_is_delete_from_flow_button} = $false;
1885 # $conditions4flows->{_is_delete_whole_flow_button} = $false;
1886 # $conditions4flows->{_is_flow_item_down_arrow_button} = $false;
1887 # $conditions4flows->{_is_flow_item_up_arrow_button} = $false;
1888  
1889 # # for export
1890 # $is_delete_from_flow_button = $false;
1891 # $is_delete_whole_flow_button = $false;
1892 # $is_flow_item_down_arrow_button = $false;
1893 # $is_flow_item_up_arrow_button = $false;
1894  
1895 # $is_flow_listbox_color_w = $false;
1896 # $is_sunix_listbox = $false;
1897 # $is_user_built_flow = $false;
1898  
1899 # return ();
1900 # }
1901  
1902 #------------------------------------------------------------
1903 # Helper: reset all color-specific states for a given flow color
1904 #------------------------------------------------------------
1905 sub _reset_color_state {
1906 my ($color) = @_;
1907  
1908 my %color_map = (
1909 grey => { idx => 0, w => $flow_listbox_grey_w, name_key => '_flow_name_out_grey',
1910 is_w => \$is_flow_listbox_grey_w, last_touch => \$is_last_flow_index_touched_grey },
1911 pink => { idx => 1, w => $flow_listbox_pink_w, name_key => '_flow_name_out_pink',
1912 is_w => \$is_flow_listbox_pink_w, last_touch => \$is_last_flow_index_touched_pink },
1913 green => { idx => 2, w => $flow_listbox_green_w, name_key => '_flow_name_out_green',
1914 is_w => \$is_flow_listbox_green_w, last_touch => \$is_last_flow_index_touched_green },
1915 blue => { idx => 3, w => $flow_listbox_blue_w, name_key => '_flow_name_out_blue',
1916 is_w => \$is_flow_listbox_blue_w, last_touch => \$is_last_flow_index_touched_blue },
1917 );
1918  
1919 my $ref = $color_map{$color};
1920 return unless $ref; # Unknown color
1921  
1922 my $i = $ref->{idx};
1923  
1924 # mark listbox vacant
1925 my $key = "_is_flow_listbox_${color}_w";
1926 $conditions4flows->{$key} = $false;
1927 @{ $conditions4flows->{_occupied_listbox_aref} }[$i] = $false;
1928 @{ $conditions4flows->{_vacant_listbox_aref} }[$i] = $true;
1929  
1930 # turn off its widget
1931 # turn off flow listbox
1932 $ref->{w}->configure( -state => 'disabled' );
1933  
1934 # clear name from namespace
1935 $conditions4flows->{ $ref->{name_key} } = $empty_string;
1936  
1937 # export global variables and ...
1938 ${ $ref->{is_w} } = $false;
1939 # the last program that was touched is cancelled out
1940 ${ $ref->{last_touch} } = $false;
1941  
1942 return;
1943 }
1944  
1945  
1946 =head2 sub set_defaults4end_of_delete_whole_flow_button
1947  
1948 wWen all items are removed from a flow listbox
1949 the following conditions are set
1950
1951 =cut
1952  
1953 sub set_defaults4end_of_delete_whole_flow_button {
1954 my ($self) = @_;
1955  
1956 my $color = _get_flow_color();
1957  
1958 unless ($color =~ /^(grey|pink|green|blue)$/ ) {
1959 print "conditions4flows, set_defaults4delete_whole_flow_button, color missing: $color\n";
1960 return;
1961 }
1962  
1963 # Reset general UI buttons
1964 # Last program that was touched is cancelled out
1965 $last_flow_index_touched = -1;
1966 for my $b ($flow_item_down_arrow_button, $flow_item_up_arrow_button,
1967 $delete_from_flow_button, $delete_whole_flow_button) {
1968 $b->configure( -state => 'disabled' );
1969 }
1970  
1971 # Handle color-specific reset
1972 _reset_color_state($color);
1973  
1974 # Turn global buttons
1975 # Last item in last listbox is cancelled out
1976 # turn off delete button
1977 $delete_from_flow_button->configure( -state => 'disabled' );
1978 # turn off delete whole flow button
1979 $delete_whole_flow_button->configure( -state => 'disabled' );
1980 # turn off up-arrow
1981 $flow_item_up_arrow_button->configure( -state => 'disabled' );
1982 # turn off down_arrow
1983 $flow_item_down_arrow_button->configure( -state => 'disabled' );
1984 # turn off run button
1985 # $run_button->configure( -state => 'disabled' );
1986 # turn off SaveAs menu button
1987 # $SaveAs_menubutton->configure( -state => 'disabled' );
1988 # turn off Data menu button
1989 # $Data_menubutton->configure( -state => 'disabled' );
1990 # turn off save button
1991 # $save_button->configure( -state => 'disabled' );
1992 # turn off check_code_button
1993 # $check_code_button->configure( -state => 'disabled' );
1994  
1995 # Re-enable menu access
1996 # turn on Flow menu button
1997 $Open_menubutton->configure( -state => 'normal' );
1998  
1999 # Clear general conditions
2000 $conditions4flows->{$_} = $false for qw(
2001 _is_flow_listbox_color_w
2002 _is_user_built_flow
2003 _is_sunix_listbox
2004 _is_delete_from_flow_button
2005 _is_delete_whole_flow_button
2006 _is_flow_item_down_arrow_button
2007 _is_flow_item_up_arrow_button
2008 );
2009  
2010 # Export global equivalents
2011 $is_delete_from_flow_button = $false;
2012 $is_delete_whole_flow_button = $false;
2013 $is_flow_item_down_arrow_button = $false;
2014 $is_flow_item_up_arrow_button = $false;
2015  
2016 $is_flow_listbox_color_w = $false;
2017 $is_sunix_listbox = $false;
2018 $is_user_built_flow = $false;
2019  
2020 return;
2021 }
2022  
2023 =head2 sub set_defaults4last_delete_from_flow_button
2024  
2025 Wen all items are removed from a flow listbox
2026 the following conditions are set
2027
2028 =cut
2029  
2030 sub set_defaults4last_delete_from_flow_button {
2031 my ($self) = @_;
2032  
2033 my $color = _get_flow_color();
2034  
2035 unless ($color =~ /^(grey|pink|green|blue)$/ ) {
2036 print "conditions4flows, set_defaults4last_delete_from_flow_button, color missing: $color\n";
2037 return;
2038 }
2039  
2040 # Reset general state
2041 # Last program that was touched is cancelled out
2042 $last_flow_index_touched = -1;
2043 $flow_item_down_arrow_button->configure( -state => 'disabled' );
2044 $flow_item_up_arrow_button->configure( -state => 'disabled' );
2045 $delete_whole_flow_button->configure( -state => 'disabled' );
2046  
2047 # Reset color-specific state
2048 _reset_color_state($color);
2049  
2050 # Check remaining listboxes
2051 my $number = _get_num_listboxes_occupied();
2052  
2053 if ( $number < 0 ) {
2054 # Last item in listbox is cleared — shut everything down
2055 # turn off delete button
2056 $delete_from_flow_button->configure( -state => 'disabled' );
2057 # turn off whole-flow delete button
2058 $delete_whole_flow_button->configure( -state => 'disabled' );
2059 # turn off up-arrow
2060 $flow_item_up_arrow_button->configure( -state => 'disabled' );
2061 # turn off down_arrow
2062 $flow_item_down_arrow_button->configure( -state => 'disabled' );
2063 # turn off run button
2064 $run_button->configure( -state => 'disabled' );
2065 # turn off Data menu button
2066 # $Data_menubutton->configure( -state => 'disabled' );
2067 $SaveAs_menubutton->configure( -state => 'disabled' );
2068 # turn off save button
2069 $save_button->configure( -state => 'disabled' );
2070 # turn off Flow menu button
2071 $Open_menubutton->configure( -state => 'normal' );
2072 # turn off check_code_button
2073 # $check_code_button->configure( -state => 'disabled' );
2074 } else {
2075 # NADA print("conditions4flows,set_defaults4last_delete_from_flow_button, not at the last listbox yet\n");
2076 }
2077 # Clear general conditions
2078 $conditions4flows->{$_} = $false for qw(
2079 _is_flow_listbox_color_w
2080 _is_user_built_flow
2081 _is_sunix_listbox
2082 _is_delete_from_flow_button
2083 _is_delete_whole_flow_button
2084 _is_flow_item_down_arrow_button
2085 _is_flow_item_up_arrow_button
2086 );
2087  
2088 # Export global equivalents
2089 $is_delete_from_flow_button = $false;
2090 $is_delete_whole_flow_button = $false;
2091 $is_flow_item_down_arrow_button = $false;
2092 $is_flow_item_up_arrow_button = $false;
2093  
2094 $is_flow_listbox_color_w = $false;
2095 $is_sunix_listbox = $false;
2096 $is_user_built_flow = $false;
2097  
2098 return;
2099 }
2100  
2101  
2102 # sub set_defaults4last_delete_from_flow_button {
2103 # my ($self) = @_;
2104  
2105 # my $color = _get_flow_color();
2106  
2107 # if ( $color eq 'grey'
2108 # || $color eq 'pink'
2109 # || $color eq 'green'
2110 # || $color eq 'blue' ) {
2111  
2112 # # the last program that was touched is cancelled out
2113 # $last_flow_index_touched = -1;
2114  
2115 # $flow_item_down_arrow_button->configure( -state => 'disabled', );
2116 # $flow_item_up_arrow_button->configure( -state => 'disabled', );
2117 # $delete_whole_flow_button->configure( -state => 'disabled', );
2118 # } else {
2119 # print("conditions4flows, set_defaults4last_delete_from_flow_button, color missing: $color\n");
2120 # }
2121  
2122 # if ( $color eq 'grey' ) {
2123  
2124 # $conditions4flows->{_is_flow_listbox_grey_w} = $false;
2125 # @{ $conditions4flows->{_occupied_listbox_aref} }[0] = $false;
2126 # @{ $conditions4flows->{_vacant_listbox_aref} }[0] = $true;
2127  
2128 # # turn off flow listbox
2129 # $flow_listbox_grey_w->configure( -state => 'disabled', );
2130  
2131 # # name is removed from the namespace
2132 # $conditions4flows->{_flow_name_out_grey} = $empty_string;
2133  
2134 # # for export
2135 # $is_flow_listbox_grey_w = $false;
2136 # $flow_name_out_grey = $empty_string;
2137  
2138 # # the last program that was touched is cancelled out
2139 # $is_last_flow_index_touched_grey = $false;
2140  
2141 # } elsif ( $color eq 'pink' ) {
2142  
2143 # $conditions4flows->{_is_flow_listbox_pink_w} = $false;
2144 # @{ $conditions4flows->{_occupied_listbox_aref} }[1] = $false;
2145 # @{ $conditions4flows->{_vacant_listbox_aref} }[1] = $true;
2146  
2147 # # turn off flow -listbox
2148 # $flow_listbox_pink_w->configure( -state => 'disabled', );
2149  
2150 # # name is removed from the namespace
2151 # $conditions4flows->{_flow_name_out_pink} = $empty_string;
2152  
2153 # # for export
2154 # $is_flow_listbox_pink_w = $false;
2155 # $flow_name_out_pink = $empty_string;
2156  
2157 # # the last program that was touched is cancelled out
2158 # $is_last_flow_index_touched_pink = $false;
2159  
2160 # } elsif ( $color eq 'green' ) {
2161  
2162 # $conditions4flows->{_is_flow_listbox_green_w} = $false;
2163 # @{ $conditions4flows->{_occupied_listbox_aref} }[2] = $false;
2164 # @{ $conditions4flows->{_vacant_listbox_aref} }[2] = $true;
2165  
2166 # # turn off flow -listbox
2167 # $flow_listbox_green_w->configure( -state => 'disabled', );
2168  
2169 # # name is removed from the namespace
2170 # $conditions4flows->{_flow_name_out_green} = $empty_string;
2171  
2172 # # for export
2173 # $is_flow_listbox_green_w = $false;
2174 # $flow_name_out_green = $empty_string;
2175  
2176 # # the last program that was touched is cancelled out
2177 # $is_last_flow_index_touched_green = $false;
2178  
2179 # } elsif ( $color eq 'blue' ) {
2180  
2181 # $conditions4flows->{_is_flow_listbox_blue_w} = $false;
2182 # @{ $conditions4flows->{_occupied_listbox_aref} }[3] = $false;
2183 # @{ $conditions4flows->{_vacant_listbox_aref} }[3] = $true;
2184  
2185 # # turn off flow -listbox
2186 # $flow_listbox_blue_w->configure( -state => 'disabled', );
2187  
2188 # # name is removed from the namespace
2189 # $conditions4flows->{_flow_name_out_blue} = $empty_string;
2190  
2191 # # for export
2192 # $is_flow_listbox_blue_w = $false;
2193 # $flow_name_out_blue = $empty_string;
2194  
2195 # # the last program that was touched is cancelled out
2196 # $is_last_flow_index_touched_blue = $false;
2197  
2198 # } else {
2199 # print("conditions4flows, set_defaults4last_delete_from_flow_buttonset, color missing: $color\n");
2200 # }
2201  
2202 # my $number = _get_num_listboxes_occupied();
2203  
2204 # # print("conditions4flows, set_defaults4last_delete_from_flow_button, number=$number\n");
2205  
2206 # # when last item in last listbox is deleted
2207 # if ( $number < 0 ) {
2208  
2209 # # turn off delete button
2210 # $delete_from_flow_button->configure( -state => 'disabled', );
2211  
2212 # # turn off whole-flow delete button
2213 # $delete_whole_flow_button->configure( -state => 'disabled', );
2214  
2215 # # turn off up-arrow
2216 # $flow_item_up_arrow_button->configure( -state => 'disabled', );
2217  
2218 # # turn off down_arrow
2219 # $flow_item_down_arrow_button->configure( -state => 'disabled', );
2220  
2221 # # turn off run button
2222 # $run_button->configure( -state => 'disabled' );
2223  
2224 # $SaveAs_menubutton->configure( -state => 'disabled' );
2225  
2226 # # turn off Data menu button
2227 # # $Data_menubutton->configure( -state => 'disabled' );
2228  
2229 # # turn off Flow menu button
2230 # $Open_menubutton->configure( -state => 'normal' );
2231  
2232 # # turn off save button
2233 # $save_button->configure( -state => 'disabled' );
2234  
2235 # # turn off check_code_button
2236 # # $check_code_button->configure( -state => 'disabled' );
2237 # } else {
2238  
2239 # # NADA print("conditions4flows,set_defaults4last_delete_from_flow_button, not at the last listbox yet\n");
2240 # }
2241  
2242 # $conditions4flows->{_is_flow_listbox_color_w} = $false;
2243 # $conditions4flows->{_is_user_built_flow} = $false;
2244 # $conditions4flows->{_is_sunix_listbox} = $false;
2245 # $conditions4flows->{_is_delete_from_flow_button} = $false;
2246 # $conditions4flows->{_is_delete_whole_flow_button} = $false;
2247 # $conditions4flows->{_is_flow_item_down_arrow_button} = $false;
2248 # $conditions4flows->{_is_flow_item_up_arrow_button} = $false;
2249  
2250 # # for export
2251 # $is_delete_from_flow_button = $false;
2252 # $is_delete_whole_flow_button = $false;
2253 # $is_flow_item_down_arrow_button = $false;
2254 # $is_flow_item_up_arrow_button = $false;
2255  
2256 # $is_flow_listbox_color_w = $false;
2257 # $is_sunix_listbox = $false;
2258 # $is_user_built_flow = $false;
2259  
2260 # return ();
2261 # }
2262  
2263 =head2 sub set4run_button
2264  
2265 is used by both pre-built sueprflows and
2266 user-built flows
2267 look at set4start_of_run_button and set4end_of_run_button
2268  
2269 legacy?
2270  
2271 =cut
2272  
2273 sub set4run_button {
2274 my ($self) = @_;
2275  
2276 # _reset();
2277 # location within GUI
2278 $conditions4flows->{_is_run_button} = $true;
2279 $conditions4flows->{_has_used_run_button} = $true;
2280  
2281 # reset save and SaveAs options because
2282 # file must be saved before running, always
2283 $conditions4flows->{_has_used_SaveAs_button} = $false;
2284 $conditions4flows->{_has_used_Save_button} = $false;
2285 $conditions4flows->{_has_used_Save_superflow} = $false;
2286 $conditions4flows->{_has_used_open_perl_file_button} = $false;
2287  
2288 # for export to calling module via get_hash_ref
2289 $is_run_button = $true;
2290 $has_used_run_button = $true;
2291  
2292 $has_used_SaveAs_button = $false;
2293 $has_used_Save_button = $false;
2294 $has_used_Save_superflow = $false;
2295 $has_used_open_perl_file_button = $false;
2296  
2297 return ();
2298  
2299 }
2300  
2301 =head2 sub set4run_button_end
2302  
2303 location within GUI
2304  
2305 sets
2306 $conditions4flows
2307
2308 legacy?
2309 look at set4start_of_run_button and set4end_of_run_button
2310  
2311 =cut
2312  
2313 sub set4run_button_end {
2314 my ($self) = @_;
2315  
2316 # location within GUI
2317 $conditions4flows->{_is_run_button} = $false;
2318 $conditions4flows->{_has_used_run_button} = $false;
2319  
2320 $is_run_button = $false;
2321 $has_used_run_button = $false;
2322  
2323 return ();
2324 }
2325  
2326 =head2
2327  
2328 location within GUI on first clicking delete button
2329  
2330 =cut
2331  
2332 sub set_defaults4start_of_delete_from_flow_button {
2333 my ( $self, $color ) = @_;
2334  
2335 if ($color) {
2336 _reset();
2337  
2338 # print("conditions4flows, set_defaults_4start_of_delete_from_flow_button, color: $color\n");
2339 $conditions4flows->{_is_delete_from_flow_button} = $true;
2340 $is_delete_from_flow_button = $true;
2341 _set_flow_color($color);
2342  
2343 # from color generalize which colored flow is being used and set it true
2344 # from color create general keys and assign values to those keys (text names)
2345 # save copies of values for reassignment during get_hash_ref call from outside modules
2346  
2347 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w'; # true or false
2348 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w'; # value a widget hash
2349 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{$flow_listbox_color_w_key};
2350 $conditions4flows->{_is_user_built_flow} = $true;
2351  
2352 # set treu or false values for a colored flow ( the reset are assumed = 0)
2353 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2354  
2355 # set up for get_hash_ref call from outside module
2356 $is_user_built_flow = $true;
2357 $is_flow_listbox_color_w = $true;
2358  
2359 if ( $color eq 'grey' ) {
2360 $flow_listbox_grey_w = $conditions4flows->{$flow_listbox_color_w_key};
2361 $is_flow_listbox_grey_w = $true;
2362  
2363 } elsif ( $color eq 'pink' ) {
2364 $flow_listbox_pink_w = $conditions4flows->{$flow_listbox_color_w_key};
2365 $is_flow_listbox_pink_w = $true;
2366  
2367 } elsif ( $color eq 'green' ) {
2368 $flow_listbox_green_w = $conditions4flows->{$flow_listbox_color_w_key};
2369 $is_flow_listbox_green_w = $true;
2370  
2371 } elsif ( $color eq 'blue' ) {
2372 $flow_listbox_blue_w = $conditions4flows->{$flow_listbox_color_w_key};
2373 $is_flow_listbox_blue_w = $true;
2374 }
2375  
2376 # print("conditions4flows, set_defaults_4start_of_delete_from_flow_button, conditions4flows->$is_flow_listbox_color_w_key: $is_flow_listbox_color_w\n");
2377 # print("conditions4flows, set_defaults_4start_of_delete_from_flow_button, conditions4flows->$flow_listbox_color_w_key: $flow_listbox_color_w\n");
2378 # print("conditions4flows, set_defaults_4start_of_delete_from_flow_button, _is_flow_listbox_color_w_key: $is_flow_listbox_color_w_key\n");
2379 # print("conditions4flows, set_defaults_4start_of_delete_from_flow_button, flow_listbox_color_w_key: $flow_listbox_color_w_key\n");
2380  
2381 } else {
2382 print("conditions4flows, set_defaults4start_of_delete_from_flow_button, no color: $color\n");
2383 }
2384  
2385 return ();
2386 }
2387  
2388 =head2 sub set_defaults4start_of_delete_whole_flow_button
2389  
2390 location within GUI on clicking whole-flow-delete button
2391  
2392 =cut
2393  
2394 sub set_defaults4start_of_delete_whole_flow_button {
2395 my ( $self, $color ) = @_;
2396  
2397 if ($color) {
2398 _reset();
2399  
2400 # print("conditions4flows, set_defaults_4start_of_delete_whole_flow_button, color: $color\n");
2401 $conditions4flows->{_is_delete_whole_flow_button} = $true;
2402 $is_delete_whole_flow_button = $true;
2403 _set_flow_color($color);
2404  
2405 # use color to generalize which colored flow is being used and set it true
2406 # from color create general keys and assign values to those keys (text names)
2407 # save copies of values for reassignment during get_hash_ref call from outside modules
2408  
2409 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w'; # true or false
2410 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w'; # value a widget hash
2411 $conditions4flows->{_flow_listbox_color_w} = $conditions4flows->{$flow_listbox_color_w_key};
2412 $conditions4flows->{_is_user_built_flow} = $true;
2413  
2414 # set true or false values for a colored flow ( the rest are assumed = 0)
2415 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2416  
2417 # set up for get_hash_ref call from outside module
2418 $is_user_built_flow = $true;
2419 $is_flow_listbox_color_w = $true;
2420  
2421 if ( $color eq 'grey' ) {
2422  
2423 $flow_listbox_grey_w = $conditions4flows->{$flow_listbox_color_w_key};
2424 $is_flow_listbox_grey_w = $true;
2425  
2426 } elsif ( $color eq 'pink' ) {
2427  
2428 $flow_listbox_pink_w = $conditions4flows->{$flow_listbox_color_w_key};
2429 $is_flow_listbox_pink_w = $true;
2430  
2431 } elsif ( $color eq 'green' ) {
2432  
2433 $flow_listbox_green_w = $conditions4flows->{$flow_listbox_color_w_key};
2434 $is_flow_listbox_green_w = $true;
2435  
2436 } elsif ( $color eq 'blue' ) {
2437  
2438 $flow_listbox_blue_w = $conditions4flows->{$flow_listbox_color_w_key};
2439 $is_flow_listbox_blue_w = $true;
2440 }
2441  
2442 } else {
2443 print("conditions4flows, set_defaults4start_of_delete_whole_flow_button, no color: $color\n");
2444 }
2445  
2446 return ();
2447 }
2448  
2449 =head2
2450  
2451 when the arrow that moves flow items up a list is clicked
2452  
2453 =cut
2454  
2455 sub set4start_of_flow_item_up_arrow_button {
2456 my ( $self, $color ) = @_;
2457  
2458 if ($color) {
2459 _reset();
2460  
2461 $conditions4flows->{_is_flow_item_up_arrow_button} = $true;
2462 _set_flow_color($color);
2463 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
2464 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2465 $conditions4flows->{_is_user_built_flow} = $true;
2466  
2467 # set up for get_hash_ref call from outside module
2468 $is_user_built_flow = $true;
2469 $is_flow_listbox_color_w = $true;
2470  
2471 } else {
2472 print("conditions4flows, set4start_of_flow_item_up_arrow_button, no color: $color\n");
2473 }
2474  
2475 return ();
2476 }
2477  
2478 #=head2
2479 #
2480 # when the lightning cartoon that mzamps background images is clicked
2481 #
2482 #=cut
2483 #
2484 #sub set4start_of_wipe_plots_button {
2485 # my ( $self, $color ) = @_;
2486 #
2487 # if ($color) {
2488 # _reset();
2489 #
2490 # $conditions4flows->{_is_wipe_plots_button} = $true;
2491 # _set_flow_color($color);
2492 # my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
2493 # $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2494 # $conditions4flows->{_is_user_built_flow} = $true;
2495 #
2496 # # set up for get_hash_ref call from outside module
2497 # $is_user_built_flow = $true;
2498 # $is_flow_listbox_color_w = $true;
2499 #
2500 # }
2501 # else {
2502 # print(
2503 # "conditions4flows, set4start_of_wipe_plots_button, no color: $color\n"
2504 # );
2505 # }
2506 #
2507 # return ();
2508 #}
2509  
2510 =head2 sub set_defaults_4start_of_flow_select
2511  
2512 take focus of the first Entry button/Value
2513 for all listboxes
2514 returns only a few parameters
2515 All others have been reset to false
2516  
2517 dynamically change the color
2518 and associated logical hash values
2519  
2520 WARNING, _reset may make color disappear
2521  
2522 =cut
2523  
2524 sub set_defaults_4start_of_flow_select {
2525 my ( $self, $color ) = @_;
2526  
2527 _reset();
2528  
2529 if ($color) {
2530 _set_flow_color($color);
2531 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w';
2532 my $flow_listbox_color_w_txt = 'flow_listbox_' . $color . '_w';
2533 my $flow_listbox_color_w = $conditions4flows->{$flow_listbox_color_w_key};
2534  
2535 my $value2 = '_is_flow_listbox_' . $color . '_w';
2536 $conditions4flows->{$value2} = $true;
2537 $conditions4flows->{_is_flow_listbox_color_w} = $true;
2538  
2539 # print("conditions4flows, set_defaults_4start_of_flow_select , color:$color; flow_listbox_color_w =$conditions4flows->{$flow_listbox_color_w_key}\n");
2540 _set_flow_listbox_last_touched_txt($flow_listbox_color_w_txt);
2541 _set_flow_listbox_last_touched_w($flow_listbox_color_w);
2542
2543 # clear any and all previous highlighted indices
2544 $conditions4flows->{_is_flow_listbox_color_w} = $true;
2545 $conditions4flows->{_is_pre_built_superflow} = $false;
2546 $conditions4flows->{_is_superflow} = $false;
2547 $conditions4flows->{_is_superflow_select_button} = $false;
2548 $conditions4flows->{_is_user_built_flow} = $true;
2549  
2550 $delete_from_flow_button->configure( -state => 'active', );
2551 $delete_whole_flow_button->configure( -state => 'active', );
2552 $flow_item_down_arrow_button->configure( -state => 'active', );
2553 $flow_item_up_arrow_button->configure( -state => 'active', );
2554 # print("2370 conditions4flows, set_defaults_4start_of_flow_select , normalizing list box\n");
2555 $flow_listbox_grey_w->configure( -state => 'normal', );
2556 $flow_listbox_pink_w->configure( -state => 'normal', );
2557 $flow_listbox_green_w->configure( -state => 'normal', );
2558 $flow_listbox_blue_w->configure( -state => 'normal', );
2559 # $check_code_button->configure( -state => 'normal', );
2560  
2561 # for export to calling module via get_hash_ref
2562 $is_flow_listbox_color_w = $true;
2563 $is_pre_built_superflow = $false;
2564 $is_superflow = $false;
2565 $is_superflow_select_button = $false;
2566 $is_user_built_flow = $true;
2567  
2568 # same menu buttons that pre-built superflows turn off
2569 $SaveAs_menubutton->configure( -state => 'normal' );
2570  
2571 # keep add2flow buttons turned off
2572  
2573 # turn on 'action' buttons to arrange the programs in a flow
2574 $delete_from_flow_button->configure( -state => 'active', );
2575 $delete_whole_flow_button->configure( -state => 'active', );
2576 $flow_item_up_arrow_button->configure( -state => 'active', );
2577 $flow_item_down_arrow_button->configure( -state => 'active', );
2578  
2579 } else {
2580 print("conditions4flows, set_defaults_4start_of_flow_select , no color:$color\n");
2581  
2582 }
2583 return ();
2584  
2585 }
2586  
2587 =head2
2588  
2589 legacy
2590 look at set4start_of_run_button and set4end_of_run_button
2591  
2592 =cut
2593  
2594 sub set4run_button_start {
2595 my ($self) = @_;
2596  
2597 # location within GUI
2598 $conditions4flows->{_is_run_button} = $true;
2599  
2600 # for export to calling module via get_hash_ref
2601 $is_run_button = $true;
2602  
2603 return ();
2604  
2605 }
2606  
2607 =head2 sub set4end_of_add2flow
2608  
2609 sets
2610 $conditions4flows
2611 $add2flow_button_grey
2612 $flow_listbox_grey_w
2613
2614 calls
2615 _reset();
2616
2617 sees a
2618 listbox
2619 my $color = _get_flow_color();
2620 =cut
2621  
2622  
2623 sub set4end_of_add2flow {
2624 my ( $self, $color ) = @_;
2625  
2626 # print("2 conditions4flows,set4end_of_add2flow color: $color\n");
2627  
2628 if ($color) {
2629 _set_flow_color($color);
2630  
2631 my $add2flow_button_color = _get_add2flow_button();
2632 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w';
2633 my $flow_listbox_color_w_txt = 'flow_listbox_' . $color . '_w';
2634 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
2635  
2636 # print("2488 conditions4flows,set4end_of_add2flow flow_listbox_color_w: $flow_listbox_color_w\n");
2637 # print("2489 conditions4flows,set4end_of_add2flow color: $color\n");
2638  
2639 my $flow_listbox_color_w = $conditions4flows->{$flow_listbox_color_w_key};
2640  
2641 _set_flow_listbox_last_touched_w($flow_listbox_color_w);
2642 _set_flow_listbox_last_touched_txt($flow_listbox_color_w_txt);
2643  
2644 # clear any and all previous highlighted indices
2645 $flow_listbox_color_w->selectionClear( 0, "end" );
2646  
2647 # highlight new index !!!!!!!!!
2648 # print("2464 conditions4flows,set4end_of_add2flow highlight new index TBD\n");
2649 $flow_listbox_color_w->selectionSet("end");
2650  
2651 # note the last program that was touched
2652 $conditions4flows->{_is_add2flow} = $false;
2653 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2654  
2655 # for potential export via get_hash-ref
2656 $is_add2flow = $false;
2657 $is_flow_listbox_color_w = $true;
2658  
2659 # keep track of which listbox was just chosen
2660 # for possible export
2661 if ( $conditions4flows->{_flow_color} eq 'grey' ) {
2662 $is_flow_listbox_grey_w = $conditions4flows->{_is_flow_listbox_grey_w};
2663  
2664 } elsif ( $conditions4flows->{_flow_color} eq 'pink' ) {
2665 $is_flow_listbox_pink_w = $conditions4flows->{_is_flow_listbox_pink_w};
2666  
2667 } elsif ( $conditions4flows->{_flow_color} eq 'green' ) {
2668 $is_flow_listbox_green_w = $conditions4flows->{_is_flow_listbox_green_w};
2669  
2670 } elsif ( $conditions4flows->{_flow_color} eq 'blue' ) {
2671 $is_flow_listbox_blue_w = $conditions4flows->{_is_flow_listbox_blue_w};
2672  
2673 } else {
2674 print("2 conditions4flows,set4end_of_add2flow_of_run_button missing color \n");
2675 }
2676  
2677 # disable All Add-to-flow buttons
2678 # regardless of only one button having been clicked
2679 # For all listboxes
2680 $add2flow_button_grey->configure( -state => 'disabled' );
2681 $add2flow_button_pink->configure( -state => 'disabled' );
2682 $add2flow_button_green->configure( -state => 'disabled' );
2683 $add2flow_button_blue->configure( -state => 'disabled' );
2684  
2685 # print("1 conditions4flows,set4end_of_add2flow_button color: $color\n");
2686  
2687 # set flow color back to neutral after add2flow ends
2688 # _set_flow_color('neutral');
2689  
2690 # print("2 conditions4flows,set4end_of_add2flow color: $color\n");
2691 return ();
2692  
2693 } else {
2694 print("2 conditions4flows,set4end_of_add2flow reset color: $color\n");
2695 }
2696  
2697 }
2698  
2699 =head2 sub set4end_of_add2flow_button
2700  
2701 sets
2702 $conditions4flows
2703 $add2flow_button_color
2704 $flow_listbox_color_w
2705
2706 calls
2707 _reset();
2708
2709 sees a
2710 listbox
2711 my $color = _get_flow_color();
2712 =cut
2713  
2714 sub set4end_of_add2flow_button {
2715 my ( $self, $color ) = @_;
2716  
2717 # print("2 conditions4flows,set4end_of_add2flow_button color: $color\n");
2718  
2719 if ($color) {
2720  
2721 _set_flow_color($color);
2722  
2723 my $add2flow_button_color = _get_add2flow_button();
2724 my $flow_listbox_color_w_key = '_flow_listbox_' . $color . '_w';
2725 my $flow_listbox_color_w_txt = 'flow_listbox_' . $color . '_w';
2726 my $is_flow_listbox_color_w_key = '_is_flow_listbox_' . $color . '_w';
2727  
2728 my $flow_listbox_color_w = $conditions4flows->{$flow_listbox_color_w_key};
2729  
2730 # print("2581 conditions4flows,set4end_of_add2flow_button flow_listbox_color_w: $flow_listbox_color_w\n");
2731  
2732 _set_flow_listbox_last_touched_w($flow_listbox_color_w);
2733 _set_flow_listbox_last_touched_txt($flow_listbox_color_w_txt);
2734  
2735 # highlight new index
2736 # print("2552 conditions4flows,set4end_of_add2flow_button highlight new index TBD\n");
2737 $flow_listbox_color_w->selectionSet("end");
2738  
2739 # note the last program that was touched
2740 $conditions4flows->{_is_add2flow} = $false;
2741 $conditions4flows->{$is_flow_listbox_color_w_key} = $true;
2742  
2743 # for potential export via get_hash-ref
2744 $is_add2flow = $false;
2745 $is_flow_listbox_color_w = $true;
2746  
2747 # keep track of which listbox was just chosen
2748 if ( $conditions4flows->{_flow_color} eq 'grey' ) {
2749 $is_flow_listbox_grey_w = $conditions4flows->{_is_flow_listbox_grey_w};
2750  
2751 } elsif ( $conditions4flows->{_flow_color} eq 'pink' ) {
2752 $is_flow_listbox_pink_w = $conditions4flows->{_is_flow_listbox_pink_w};
2753  
2754 } elsif ( $conditions4flows->{_flow_color} eq 'green' ) {
2755 $is_flow_listbox_green_w = $conditions4flows->{_is_flow_listbox_green_w};
2756  
2757 } elsif ( $conditions4flows->{_flow_color} eq 'blue' ) {
2758 $is_flow_listbox_blue_w = $conditions4flows->{_is_flow_listbox_blue_w};
2759  
2760 } else {
2761 print("2 conditions4flows,set4end_of_add2flow_button_of_run_button missing color \n");
2762 }
2763  
2764 # disable All Add-to-flow buttons
2765 # regardless of only one button having been clicked
2766 # For all listboxes
2767 $add2flow_button_grey->configure( -state => 'disabled' );
2768 $add2flow_button_pink->configure( -state => 'disabled' );
2769 $add2flow_button_green->configure( -state => 'disabled' );
2770 $add2flow_button_blue->configure( -state => 'disabled' );
2771  
2772 # print("1 conditions4flows,set4end_of_add2flow_button color: $color\n");
2773  
2774 # set flow color back to neutral after add2flow_button is clicked
2775 # _set_flow_color('neutral');
2776  
2777 # print("2 conditions4flows,set4end_of_add2flow_button color: $color\n");
2778 return ();
2779  
2780 } else {
2781 print("2 conditions4flows,set4end_of_add2flow_button reset color: $color\n");
2782 }
2783 }
2784  
2785 =head2 sub set4end_of_superflow_Save
2786
2787  
2788 =cut
2789  
2790 sub set4end_of_superflow_Save {
2791 my ($self) = @_;
2792  
2793 # print("conditions4flows, set4end_of_superflow_Save OK \n");
2794 $conditions4flows->{_has_used_Save_superflow} = $true;
2795 $conditions4flows->{_is_pre_built_superflow} = $false;
2796 $conditions4flows->{_is_superflow} = $false;
2797 $conditions4flows->{_is_superflow_select_button} = $false;
2798  
2799 # for possible later export
2800 $has_used_Save_superflow = $true;
2801 $is_pre_built_superflow = $false;
2802 $is_superflow = $false;
2803 $is_superflow_select_button = $false;
2804  
2805 return ();
2806 }
2807  
2808 =head2
2809  
2810  
2811 =cut
2812  
2813 sub set4end_of_superflow_run_button {
2814 my ($self) = @_;
2815  
2816 # location within GUI
2817 $conditions4flows->{_is_run_button} = $false;
2818 $conditions4flows->{_has_used_run_button} = $true;
2819  
2820 # reset save and SaveAs options because
2821 # file must be saved before running, always
2822 $conditions4flows->{_has_used_SaveAs_button} = $false;
2823 $conditions4flows->{_has_used_Save_superflow} = $false;
2824  
2825 # for export to calling module via get_hash_ref
2826 $has_used_SaveAs_button = $false;
2827 $has_used_Save_superflow = $false;
2828  
2829 $is_run_button = $false;
2830 $has_used_run_button = $true;
2831 return ();
2832 }
2833  
2834 =head2 sub set4end_of_superflow_select
2835
2836  
2837 =cut
2838  
2839 sub set4end_of_superflow_select {
2840 my ($self) = @_;
2841  
2842 # print("conditions4flows, set4end_of_superflow_select OK \n");
2843 $conditions4flows->{_is_superflow} = $false;
2844 $conditions4flows->{_is_superflow_select_button} = $false;
2845 $conditions4flows->{_is_pre_built_superflow} = $false;
2846  
2847 # for possible later export
2848 $is_superflow = $false;
2849 $is_superflow_select_button = $false;
2850 $is_pre_built_superflow = $false;
2851  
2852 return ();
2853  
2854 }
2855  
2856 =head2
2857  
2858  
2859 =cut
2860  
2861 sub set4start_of_run_button {
2862 my ($self) = @_;
2863  
2864 # location within GUI
2865 $conditions4flows->{_is_run_button} = $true;
2866 $is_run_button = $true;
2867 _reset_is_flow_listbox_color_w();
2868  
2869 if ( $conditions4flows->{_flow_color} eq 'grey' ) {
2870 $conditions4flows->{_is_flow_listbox_grey_w} = $true;
2871 $is_flow_listbox_grey_w = $true;
2872  
2873 } elsif ( $conditions4flows->{_flow_color} eq 'pink' ) {
2874 $conditions4flows->{_is_flow_listbox_pink_w} = $true;
2875 $is_flow_listbox_pink_w = $true;
2876  
2877 } elsif ( $conditions4flows->{_flow_color} eq 'green' ) {
2878 $conditions4flows->{_is_flow_listbox_green_w} = $true;
2879 $is_flow_listbox_green_w = $true;
2880  
2881 } elsif ( $conditions4flows->{_flow_color} eq 'blue' ) {
2882 $conditions4flows->{_is_flow_listbox_blue_w} = $true;
2883 $is_flow_listbox_blue_w = $true;
2884  
2885 } elsif ( $conditions4flows->{_flow_type} eq 'pre_built_superflow' ) {
2886  
2887 # print("2 conditions4flows,set4start_of_run_button Running a pre-built superflow\n");
2888 # NADA
2889  
2890 } else {
2891 print("2 conditions4flows,set4start_of_run_button missing color \n");
2892 }
2893 return ();
2894 }
2895  
2896 =head2 sub set4start_of_add2flow
2897  
2898 find out correct color
2899  
2900 =cut
2901  
2902 sub set4start_of_add2flow {
2903 my ( $self, $color ) = @_;
2904  
2905 # _reset();
2906 # _set_gui_widgets();
2907 _set_flow_listbox_color_w($color);
2908  
2909 my $flow_listbox_color_w = _get_flow_listbox_color_w();
2910  
2911 # print("conditions4flows, set4start_of_add2flow flow_listbox_color_w $flow_listbox_color_w\n");
2912  
2913 _set_flow_listbox_last_touched_w($flow_listbox_color_w);
2914  
2915 $conditions4flows->{_is_add2flow} = $true;
2916 $conditions4flows->{_is_new_listbox_selection} = $true;
2917  
2918 # null some user dialogs
2919 $conditions4flows->{_has_used_Save_button} = $false;
2920 $conditions4flows->{_has_used_SaveAs_button} = $false;
2921 $conditions4flows->{_has_used_Save_superflow} = $false;
2922  
2923 # for potential later export
2924 $is_add2flow = $true;
2925 $is_new_listbox_selection = $true;
2926 $has_used_SaveAs_button = $false;
2927 $has_used_Save_button = $false;
2928 $has_used_Save_superflow = $false;
2929  
2930 #turn on the following buttons
2931 # print("conditions4flows, set4start_of_add2flow file_menubutton $file_menubutton\n");
2932 $file_menubutton->configure( -state => 'normal' );
2933 # $Data_menubutton->configure( -state => 'normal' );
2934 $SaveAs_menubutton->configure( -state => 'normal' );
2935 $run_button->configure( -state => 'normal' );
2936 $save_button->configure( -state => 'normal' );
2937 # $check_code_button->configure( -state => 'normal' );
2938  
2939 # turn on delete buttons
2940 $delete_from_flow_button->configure( -state => 'active', );
2941 $delete_whole_flow_button->configure( -state => 'active', );
2942  
2943 # turn on flow list item move up and down arrow buttons
2944 $flow_item_up_arrow_button->configure( -state => 'active', );
2945 $flow_item_down_arrow_button->configure( -state => 'active', );
2946  
2947 # turn on All ListBox(es) for possible later use
2948 $flow_listbox_grey_w->configure( -state => 'normal', );
2949 $flow_listbox_pink_w->configure( -state => 'normal', );
2950 $flow_listbox_green_w->configure( -state => 'normal', );
2951 $flow_listbox_blue_w->configure( -state => 'normal', );
2952  
2953 # unselect the previously selected item is set4end_of_add2flow ( 'end' )
2954 # the color of the listbox is identifiable via widget reference: $flow_listbox_color_w
2955  
2956 $flow_listbox_color_w->selectionClear( 0, "end" );
2957  
2958 # print("conditions4flows, set4start_of_add2flow, color is: $color \n");
2959 return ();
2960 }
2961  
2962 =head2
2963  
2964 find out correct color
2965  
2966 =cut
2967  
2968 sub set4start_of_add2flow_button {
2969 my ( $self, $color ) = @_;
2970  
2971 _set_flow_listbox_color_w($color);
2972  
2973 my $flow_listbox_color_w = _get_flow_listbox_color_w();
2974  
2975 _set_flow_listbox_last_touched_w($flow_listbox_color_w);
2976  
2977 $conditions4flows->{_is_add2flow_button} = $true;
2978 $conditions4flows->{_is_sunix_listbox} = $true;
2979 $conditions4flows->{_is_new_listbox_selection} = $true;
2980  
2981 # null some user dialogs
2982 $conditions4flows->{_has_used_Save_button} = $false;
2983 $conditions4flows->{_has_used_Save_superflow} = $false;
2984 $conditions4flows->{_has_used_SaveAs_button} = $false;
2985  
2986 # for potential later export
2987 $is_add2flow_button = $true;
2988 $is_sunix_listbox = $true;
2989 $is_new_listbox_selection = $true;
2990 $has_used_SaveAs_button = $false;
2991 $has_used_Save_button = $false;
2992 $has_used_Save_superflow = $false;
2993  
2994 #turn on the following buttons
2995 $file_menubutton->configure( -state => 'normal' );
2996 # $Data_menubutton->configure( -state => 'normal' );
2997 $SaveAs_menubutton->configure( -state => 'normal' );
2998 $run_button->configure( -state => 'normal' );
2999 $save_button->configure( -state => 'normal' );
3000 # $check_code_button->configure( -state => 'normal' );
3001  
3002 #$parameter_names_frame ->configure(
3003 # -state=>'disabled');
3004 # $parameter_values_button_frame ->configure(
3005 # -state=>'disabled');
3006  
3007 # turn on delete buttons
3008 $delete_from_flow_button->configure( -state => 'active', );
3009 $delete_whole_flow_button->configure( -state => 'active', );
3010  
3011 # turn on flow list item move up and down arrow buttons
3012 $flow_item_up_arrow_button->configure( -state => 'active', );
3013 $flow_item_down_arrow_button->configure( -state => 'active', );
3014  
3015 # turn on All ListBox(es) for possible later use
3016 $flow_listbox_grey_w->configure( -state => 'normal', );
3017 $flow_listbox_pink_w->configure( -state => 'normal', );
3018 $flow_listbox_green_w->configure( -state => 'normal', );
3019 $flow_listbox_blue_w->configure( -state => 'normal', );
3020  
3021 # print("conditions4flows, set4start_of_add2flow_button, color is: $color \n");
3022 return ();
3023 }
3024  
3025 =head2 sub set4start_of_sunix_select
3026  
3027  
3028 =cut
3029  
3030 sub set4start_of_sunix_select {
3031 my ($self) = @_;
3032  
3033 _reset();
3034 $conditions4flows->{_is_sunix_listbox} = $true;
3035  
3036 # print("conditions4flows, set4start_of_sunix_select, $conditions4flows->{_is_sunix_listbox}\n");
3037 $delete_from_flow_button->configure( -state => 'disabled', );
3038 $delete_whole_flow_button->configure( -state => 'disabled', );
3039 $flow_item_up_arrow_button->configure( -state => 'disabled', );
3040 $flow_item_down_arrow_button->configure( -state => 'disabled', );
3041  
3042 # for export via get_hash_ref
3043 $is_sunix_listbox = $true;
3044  
3045 return ();
3046 }
3047  
3048 =head2
3049  
3050  
3051 =cut
3052  
3053 sub set4start_of_superflow_run_button {
3054 my ($self) = @_;
3055  
3056 # location within GUI
3057 $conditions4flows->{_is_run_button} = $true;
3058 $is_run_button = $true;
3059  
3060 return ();
3061 }
3062  
3063 =head2 sub set4start_of_superflow_Save
3064  
3065  
3066 =cut
3067  
3068 sub set4start_of_superflow_Save {
3069 my ($self) = @_;
3070  
3071 $conditions4flows->{_is_Save_button} = $true;
3072  
3073 $is_Save_button = $true;
3074  
3075 }
3076  
3077 =head2 sub set4start_of_superflow_select
3078  
3079  
3080 =cut
3081  
3082 sub set4start_of_superflow_select {
3083 my ($self) = @_;
3084  
3085 # print("conditions4flows, set4superflow_open_data_file_start OK \n");
3086 use App::SeismicUnixGui::misc::L_SU_global_constants;
3087 my $get = L_SU_global_constants->new();
3088 my $flow_type_h = $get->flow_type_href();
3089 my $alias_FileDialog_button_label = $get->alias_FileDialog_button_label_aref;
3090  
3091 # For location within GUI
3092 $conditions4flows->{_flow_type} = $flow_type_h->{_pre_built_superflow};
3093 $conditions4flows->{_is_new_listbox_selection} = $true;
3094 $conditions4flows->{_is_pre_built_superflow} = $true;
3095 $conditions4flows->{_is_superflow} = $true;
3096 $conditions4flows->{_is_superflow_select_button} = $true;
3097 $conditions4flows->{_is_user_built_flow} = $false;
3098  
3099 # for re-export via get_hash-ref
3100 $flow_type = $flow_type_h->{_pre_built_superflow}; # see set_hash_ref
3101 $is_new_listbox_selection = $true;
3102 $is_pre_built_superflow = $true;
3103 $is_superflow = $true;
3104 $is_superflow_select_button = $true;
3105 $is_user_built_flow = $false;
3106  
3107 $delete_from_flow_button->configure( -state => 'disabled', );
3108 $delete_whole_flow_button->configure( -state => 'disabled', );
3109 $flow_item_up_arrow_button->configure( -state => 'disabled', );
3110 $flow_item_down_arrow_button->configure( -state => 'disabled', );
3111  
3112 # turn off Flow label
3113 $flow_listbox_grey_w->configure( -state => 'disabled' ); # turn off top left flow listbox
3114 $flow_listbox_pink_w->configure( -state => 'disabled' ); # turn off top-right flow listbox
3115 $flow_listbox_green_w->configure( -state => 'disabled' ); # turn off bottom-left flow listbox
3116 $flow_listbox_blue_w->configure( -state => 'disabled' ); # turn off bottom-right flow listbox
3117 $add2flow_button_grey->configure( -state => 'disable', ); # turn off Flow label
3118 $add2flow_button_pink->configure( -state => 'disable', ); # turn off Flow label
3119 $add2flow_button_green->configure( -state => 'disable', ); # turn off Flow label
3120 $add2flow_button_blue->configure( -state => 'disable', ); # turn off Flow label
3121 $run_button->configure( -state => 'normal' );
3122 $save_button->configure( -state => 'normal' );
3123  
3124 # $Data_menubutton->configure( -state => 'normal' );
3125 $Open_menubutton->configure( -state => 'normal' );
3126 $SaveAs_menubutton->configure( -state => 'disable' );
3127  
3128 # $check_code_button->configure( -state => 'disable' );
3129 }
3130  
3131 =head2 sub set4superflow_close_data_file_end
3132  
3133 =cut
3134  
3135 sub set4superflow_close_data_file_end {
3136 my ($self) = @_;
3137  
3138 # print("conditions4flows, set4superflow_close_data_file_end OK \n");
3139 # Forces a Save before the next Run
3140 $conditions4flows->{_has_used_Save_button} = $false;
3141  
3142 # for potential export
3143 $has_used_Save_button = $false;
3144  
3145 # Allows user to open a user-built perl flow
3146 $Open_menubutton->configure( -state => 'normal', );
3147  
3148 return ();
3149 }
3150  
3151 =head2 sub set4superflow_close_path_end
3152  
3153 =cut
3154  
3155 sub set4superflow_close_path_end {
3156 my ($self) = @_;
3157  
3158 # print("conditions4flows, set4superflow_close_path_end OK \n");
3159 # Forces a Save before the next Run
3160 $conditions4flows->{_has_used_Save_superflow} = $false;
3161  
3162 # for potential export
3163 $has_used_Save_superflow = $false;
3164  
3165 # Allows user to open a user-built perl flow
3166 $Open_menubutton->configure( -state => 'normal', );
3167  
3168 return ();
3169 }
3170  
3171 =head2 sub set4superflow_open_data_file_end
3172  
3173 =cut
3174  
3175 sub set4superflow_open_data_file_end {
3176 my ($self) = @_;
3177  
3178 # print("conditions4flows, set4end_of_superflow_select OK \n");
3179 $conditions4flows->{_is_pre_built_superflow} = $true;
3180 $conditions4flows->{_is_superflow} = $true;
3181  
3182 # $conditions4flows->{_is_superflow_select_button} = $true;
3183  
3184 # for potential export
3185 $is_pre_built_superflow = $true;
3186 $is_superflow = $true;
3187  
3188 # $is_superflow_select_button = $true;
3189  
3190 return ();
3191 }
3192  
3193 =head2 sub set4superflow_open_data_file_start
3194  
3195 =cut
3196  
3197 sub set4superflow_open_data_file_start {
3198 my ($self) = @_;
3199  
3200 # print("conditions4flows, set4superflow_open_data_file_start OK \n");
3201 use App::SeismicUnixGui::misc::L_SU_global_constants;
3202 my $get = L_SU_global_constants->new();
3203 my $flow_type_h = $get->flow_type_href();
3204 my $alias_FileDialog_button_label = $get->alias_FileDialog_button_label_aref;
3205  
3206 # For location within GUI
3207 $conditions4flows->{_flow_type} = $flow_type_h->{_pre_built_superflow};
3208 $conditions4flows->{_is_new_listbox_selection} = $true;
3209 $conditions4flows->{_is_pre_built_superflow} = $true;
3210 $conditions4flows->{_is_superflow} = $true;
3211  
3212 # $conditions4flows->{_is_superflow_select_button} = $true;
3213  
3214 # for re-export via get_hash-ref
3215 $flow_type = $flow_type_h->{_pre_built_superflow}; # see set_hash_ref
3216 $is_new_listbox_selection = $true;
3217 $is_superflow = $true;
3218 $is_pre_built_superflow = $true;
3219  
3220 # $is_superflow_select_button = $true;
3221  
3222 $delete_from_flow_button->configure( -state => 'disabled', );
3223 $delete_whole_flow_button->configure( -state => 'disabled', );
3224 $flow_item_up_arrow_button->configure( -state => 'disabled', );
3225 $flow_item_down_arrow_button->configure( -state => 'disabled', );
3226  
3227 # turn off Flow label
3228 $flow_listbox_grey_w->configure( -state => 'disabled' ); # turn off top left flow listbox
3229 $flow_listbox_pink_w->configure( -state => 'disabled' ); # turn off top-right flow listbox
3230 $flow_listbox_green_w->configure( -state => 'disabled' ); # turn off bottom-left flow listbox
3231 $flow_listbox_blue_w->configure( -state => 'disabled' ); # turn off bottom-right flow listbox
3232 $add2flow_button_grey->configure( -state => 'disable', ); # turn off Flow label
3233 $add2flow_button_pink->configure( -state => 'disable', ); # turn off Flow label
3234 $add2flow_button_green->configure( -state => 'disable', ); # turn off Flow label
3235 $add2flow_button_blue->configure( -state => 'disable', ); # turn off Flow label
3236 $run_button->configure( -state => 'normal' );
3237 $save_button->configure( -state => 'normal' );
3238  
3239 # $Data_menubutton->configure( -state => 'normal' );
3240 $Open_menubutton->configure( -state => 'disable', );
3241 $SaveAs_menubutton->configure( -state => 'disable' );
3242  
3243 # $check_code_button->configure( -state => 'disable' );
3244 }
3245  
3246 =head2 sub set4superflow_open_path_end
3247  
3248 =cut
3249  
3250 sub set4superflow_open_path_end {
3251  
3252 my ($self) = @_;
3253  
3254 # print("conditions4flows, set4superflow_open_path_end OK \n");
3255 $conditions4flows->{_is_pre_built_superflow} = $true;
3256 $conditions4flows->{_is_superflow} = $true;
3257  
3258 # for potential export
3259 $is_pre_built_superflow = $true;
3260 $is_superflow = $true;
3261  
3262 return ();
3263 }
3264  
3265 =head2 sub set4superflow_open_path_start
3266  
3267 =cut
3268  
3269 sub set4superflow_open_path_start {
3270 my ($self) = @_;
3271  
3272 # print("conditions4flows, set4superflow_open_path_start OK \n");
3273 use App::SeismicUnixGui::misc::L_SU_global_constants;
3274 my $get = L_SU_global_constants->new();
3275 my $flow_type_h = $get->flow_type_href();
3276  
3277 # my $alias_FileDialog_button_label = $get->alias_FileDialog_button_label_aref;
3278  
3279 # For location within GUI
3280 $conditions4flows->{_flow_type} = $flow_type_h->{_pre_built_superflow};
3281 $conditions4flows->{_is_new_listbox_selection} = $true;
3282 $conditions4flows->{_is_pre_built_superflow} = $true;
3283 $conditions4flows->{_is_superflow} = $true;
3284  
3285 # for re-export via get_hash-ref
3286 $flow_type = $flow_type_h->{_pre_built_superflow}; # see set_hash_ref
3287 $is_new_listbox_selection = $true;
3288 $is_superflow = $true;
3289 $is_pre_built_superflow = $true;
3290  
3291 $delete_from_flow_button->configure( -state => 'disabled', );
3292 $delete_whole_flow_button->configure( -state => 'disabled', );
3293 $flow_item_up_arrow_button->configure( -state => 'disabled', );
3294 $flow_item_down_arrow_button->configure( -state => 'disabled', );
3295  
3296 # turn off Flow label
3297 $flow_listbox_grey_w->configure( -state => 'disabled' ); # turn off top left flow listbox
3298 $flow_listbox_pink_w->configure( -state => 'disabled' ); # turn off top-right flow listbox
3299 $flow_listbox_green_w->configure( -state => 'disabled' ); # turn off bottom-left flow listbox
3300 $flow_listbox_blue_w->configure( -state => 'disabled' ); # turn off bottom-right flow listbox
3301 $add2flow_button_grey->configure( -state => 'disable', ); # turn off Flow label
3302 $add2flow_button_pink->configure( -state => 'disable', ); # turn off Flow label
3303 $add2flow_button_green->configure( -state => 'disable', ); # turn off Flow label
3304 $add2flow_button_blue->configure( -state => 'disable', ); # turn off Flow label
3305 $run_button->configure( -state => 'normal' );
3306 $save_button->configure( -state => 'normal' );
3307  
3308 # $Data_menubutton->configure( -state => 'normal' );
3309 $Open_menubutton->configure( -state => 'disable', );
3310 $SaveAs_menubutton->configure( -state => 'disable' );
3311  
3312 # $check_code_button->configure( -state => 'disable' );
3313 }
3314  
3315 =head2 sub set4superflow_Save
3316  
3317  
3318 =cut
3319  
3320 sub set4superflow_Save {
3321 my ($self) = @_;
3322  
3323 $conditions4flows->{_has_used_Save_superflow} = $true;
3324 $conditions4flows->{_has_used_Save_button} = $false;
3325  
3326 #for possible export
3327  
3328 $has_used_Save_superflow = $true;
3329 $has_used_Save_button = $false;
3330  
3331 return ();
3332  
3333 }
3334  
3335 =head2 sub set4superflow2user_flow_transition
3336  
3337 Used when transitioning from a pre-built superflow to a user-built flow
3338  
3339 =cut
3340  
3341 sub set4superflow2user_flow_transition {
3342  
3343 my ( $self) = @_;
3344  
3345 my $flow_listbox_color_w = _get_flow_listbox_color_w();
3346 $flow_listbox_color_w->selectionClear( 0, "end" );
3347 $flow_listbox_color_w->selectionSet("end");
3348  
3349 }
3350  
3351 =head2 sub set_flow_index_last_touched
3352  
3353  
3354 =cut
3355  
3356 sub set_flow_index_last_touched {
3357 my ( $self, $index ) = @_;
3358  
3359 if ( length($index) ) { # if defined
3360  
3361 if ( $index >= 0 ) { # -1 does exist in conditions4flows thru default definition
3362 $conditions4flows->{_last_flow_index_touched_grey} = $index; # internal
3363 $conditions4flows->{_last_flow_index_touched_pink} = $index; # internal
3364 $conditions4flows->{_last_flow_index_touched_green} = $index; # internal
3365 $conditions4flows->{_last_flow_index_touched_blue} = $index; # internal
3366 $conditions4flows->{_last_flow_index_touched} = $index; # internal
3367 $last_flow_index_touched_grey = $index; # for get_hash-ref
3368 $last_flow_index_touched_pink = $index; # for get_hash-ref
3369 $last_flow_index_touched_green = $index; # for get_hash-ref
3370 $last_flow_index_touched_blue = $index; # for get_hash-ref
3371 $last_flow_index_touched = $index; # for get_hash-ref
3372 $is_last_flow_index_touched_grey = $true; # for get_hash-ref
3373 $is_last_flow_index_touched_pink = $true; # for get_hash-ref
3374 $is_last_flow_index_touched_green = $true; # for get_hash-ref
3375 $is_last_flow_index_touched_blue = $true; # for get_hash-ref
3376 $is_last_flow_index_touched = $true; # for get_hash-ref
3377  
3378 #print("1. conditions4flows, set_flow_index_last_touched had index = $conditions4flows->{_last_flow_index_touched}\n");
3379 } else {
3380 print("conditions4flows,set_flow_index_touched, missing index\n");
3381 }
3382  
3383 } else {
3384  
3385 #print("conditions4flows,set_flow_index_touched, index is undefined but needed, so assume index=0\n");
3386 $index = 0;
3387 $conditions4flows->{_last_flow_index_touched_grey} = $index; # internal
3388 $conditions4flows->{_last_flow_index_touched_pink} = $index; # internal
3389 $conditions4flows->{_last_flow_index_touched_green} = $index; # internal
3390 $conditions4flows->{_last_flow_index_touched_blue} = $index; # internal
3391 $conditions4flows->{_last_flow_index_touched} = $index; # internal
3392 $last_flow_index_touched_grey = $index; # for get_hash-ref
3393 $last_flow_index_touched_pink = $index; # for get_hash-ref
3394 $last_flow_index_touched_green = $index; # for get_hash-ref
3395 $last_flow_index_touched_blue = $index; # for get_hash-ref
3396 $last_flow_index_touched = $index; # for get_hash-ref
3397 $is_last_flow_index_touched_grey = $true; # for get_hash-ref
3398 $is_last_flow_index_touched_pink = $true; # for get_hash-ref
3399 $is_last_flow_index_touched_green = $true; # for get_hash-ref
3400 $is_last_flow_index_touched_blue = $true; # for get_hash-ref
3401 $is_last_flow_index_touched = $true; # for get_hash-ref
3402 }
3403  
3404 # print("1. conditions4flows, set_flow_index_last_touched had index = $index\n");
3405 return ();
3406 }
3407  
3408 __PACKAGE__->meta->make_immutable;
3409 1;