App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/misc/param_widgets4pre_built_streams.pm  view on Meta::CPAN

	# button for L_SU and no button for project selector
	elsif ($ref_hash->{_is_superflow_select_button}
		|| $ref_hash->{_is_superflow} )
	{

		$param_widgets->{_first_idx} = $ref_hash->{_superflow_first_idx};
		$param_widgets->{_length}    = $ref_hash->{_superflow_length};

#		print("4. param_widgets4pre_built_,range, (superflows) first idx:$param_widgets->{_first_idx}, and length:$param_widgets->{_length}\n");

		# case of now pre-existing color (not even neutral) and the perl flow is selected
		# this case actually does not need range because the following subroutines estimate
		# the length from the scalar of the array and all correctly assume that the first index=0
		#		elsif ($ref_hash->{_is_user_built_flow} && $ref_hash->{_is_new_listbox_selection} )   {
		#
		#	 		$param_widgets->{_first_idx}		= $ref_hash->{_param_flow_first_idx};
		#  			$param_widgets->{_length}			= $ref_hash->{_param_flow_length};
		#	 		print("5. param_widgets4pre_built_streams,range, (user-built-flow)  first idx:$param_widgets->{_first_idx}, and length:$param_widgets->{_length}\n");
		#
		#		}

		# case of now pre-existing color (not even neutral) and the perl flow is selected
		# this case actually does not need range because the following subroutines estimate
		# the length fromt he scalar of the array and all correctly assume that the first index=0
	}
	else {
		#NADA print ("6. param_widgets4pre_built_streams,range, _missing ref_hash\n");
	}

	# print ("6. param_widgets4pre_built_streams,range, _values_w_aref:  $param_widgets->{_values_w_aref}\n");
	return ();
}

=head2 sub redisplay_check_buttons 
    
    update colors in check button boxes

=cut

sub redisplay_check_buttons {
	my ($self)        = @_;
	my $button_w_aref = $param_widgets->{_check_buttons_w_aref};
	my $first         = $param_widgets->{_first_idx};
#	my $length        = scalar @{ $param_widgets->{_check_buttons_settings_aref} };
	my $length        = scalar @{ $param_widgets->{_labels_aref} };

	my $settings_aref = $param_widgets->{_check_buttons_settings_aref};

	# print("1. param_widgets4pre_built_streams,redisplay_check_buttons,settings @{$settings_aref}[0]\n");
	# print("2. param_widgets4pre_built_streams,redisplay_check_buttons,settings @{$param_widgets->{_check_buttons_settings_aref}}[0]\n");
#	print("2. param_widgets4pre_built_streams,redisplay_check_buttons,length: $length\n");

	if ( $button_w_aref && $settings_aref ) {

		for ( my $i = $first; $i < $length; $i++ ) {

			@$button_w_aref[$i]->configure(
				-onvalue          => 'on',
				-offvalue         => 'off',
				-selectcolor      => 'green',
				-activebackground => 'red',
				-background       => 'red',
				-variable         => \@$settings_aref[$i],
			);
		}
	}
	else {
		print("param_widgets4pre_built_streams, redisplay_check_buttons missing parameters\n");
	}
	return ();
}

=head2 sub redisplay_labels 

  print("1. redisplay, resdisplay_labels, text is @{$label_array_ref}[$i]\n");
  print("redisplay, resdisplay_labels, i is $i\n");
  print("2. redisplay, resdisplay_labels, text is @{$LSU->{_label_array_ref}}[$i]\n");

=cut

sub redisplay_labels {
	my ($self)        = @_;
	my $labels_w_aref = $param_widgets->{_labels_w_aref};
	my $labels_aref   = $param_widgets->{_labels_aref};
	my $first         = $param_widgets->{_first_idx};
	my $length        = scalar @{ $param_widgets->{_labels_aref} };
	my $i;

	# my $length 			= $param_widgets->{_length};

	if ($labels_w_aref) {
		
		for ( $i = $first; $i < $length; $i++ ) {

			# print("i:$i   param_widgets4pre_built_streams,redisplay_labels length:$length\n");
			# print(" text is @{$labels_aref}\n");
			@$labels_w_aref[$i]->configure( -text => @$labels_aref[$i], );
		}
	}
	else {
		print( "param_widgets4pre_built_streams,redisplay labels, Warning parameters or labels_w_aref missing \n" );
	}
	return ();
}

=head2 sub redisplay_values 

  display parameter values without quotes
  although internally we always have quotes for strings
  and no quotes if the value looks like a number
  
  i/p: 2 array references
  o/p: array reference

  N.B. This is an ENTRY widget
  textvariables must be a reference in order
  for -validatecommand to work. BEWARE!

  9.27.23
  Clear the GUI first and then redisplay values

=cut 



( run in 0.822 second using v1.01-cache-2.11-cpan-f56aa216473 )