App-SeismicUnixGui

 view release on metacpan or  search on metacpan

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

my $on                  = $var->{_on};
my $off                 = $var->{_off};
my $nu                  = $var->{_nu};
my $no                  = $var->{_no};
my $true                = $var->{_true};
my $false               = $var->{_false};
my $empty_string        = $var->{_empty_string};
my $param_widgets       = $gui_history->get_defaults();

# default is good
# my $first                  = $param_widgets->{_first_idx};



=head2 _changes

 to only one parameter
 some changes will be false and should be rejected

 If you are at this subroutine it means that
 a possible change has been detected in
 the Entry Widget TODO: yet to be ratified

 Currently if we reach this subroutine we assume that changes always occur to 
 all parameters and so we 
 forcibly check for changes always
 
=cut

sub _changes {
	my ($index) = @_;
	my $idx = $index;    # individual parameter line

	my $control = control->new();

	# two cases possible
	# in general L_SU
	if ( $param_widgets->{_current_program_name} ) {
		
		# use the internal program name instead of the alias
#		print(" param_widgets4pre_built_streams,_changes, program_name: $param_widgets->{_current_program_name}\n");
		my $prog_name = $param_widgets->{_current_program_name};

		# print(" param_widgets4pre_built_streams, changes, prog_name: $prog_name \n");
#		print(" 110 param_widgets4pre_built_streams, _changes, index: $idx \n");
        

#		my $max_idx = $control->get_max_index($prog_name);
		# print(" param_widgets4pre_built_streams,max_index, $max_idx \n");
		if ( $idx >= 0 && $idx <= $control->get_max_index($prog_name) ) {    # cautious, index must be reasonable

			local_set_entry_change_status($true);
			my $changed_entry = $param_widgets->{_changed_entry};            # always

			# print("param_widgets4pre_built_streams,changes,changed 1-yes 0 -no? $changed_entry\n");
			local_update_check_button_setting($idx);

			# local_set_last_changed_entry_index($idx);
		}

		return ($true);    # for Entry widget to say there is no error

		# second case is when we are using project_selector
		# project_selector does not yet have a max_index defined in a separate module
	}
	else {
		return ($true);    # for Entry widget to say there is no error
	}

}

=head2 sub error_check

 When entry values are in error 

=cut

sub error_check {
	my ($self) = @_;
	print("param_widgets4pre_built_streams,error_check return is $true\n");
	return ($true);
}

=head2 sub get_check_buttons_w_aref


=cut

sub get_check_buttons_w_aref {
	my ($self) = @_;

	if ( $param_widgets->{_check_buttons_w_aref} ) {

		my $check_buttons_w_aref = $param_widgets->{_check_buttons_w_aref};
		return ($check_buttons_w_aref);

	}
	else {
		print( "param_widgets4pre_built_streams, get_check_buttons_w_aref, missing check_buttons_w_aref \n" );
		return ();
	}
}

=head2 sub 

=cut

sub get_current_program {

	my ( $self, $widget_ref ) = @_;
	my @selection_index = $$widget_ref->curselection();
	my $prog_name       = $$widget_ref->get( $selection_index[0] );

	# print("param_widgets get_current_program: $prog_name,index:$selection_index[0] \n");
	return ( \$prog_name );
}

=head2 sub get_entry_change_status

=cut

sub get_entry_change_status {
	my @self   = @_;
	my $status = $param_widgets->{_changed_entry};

	# print("param_widgets4pre_built_streams, get_entry_change_status,changed_entry: $param_widgets->{_changed_entry}\n");
	return ($status);



( run in 0.358 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )