App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/big_streams/immodpg.pm  view on Meta::CPAN

		elsif ( ( $layer_current == $number_of_layers ) ) {

			$result = $layer_current - 1;

	   #			print("iCASE 1 E mmodpg, get_control_layer, layer=$layer_current\n");
	   # NADA

		}
		else {
			print("immodpg, get_control_layer, unexpected layer number\n");
			$result = $empty_string;
		}

	}
	elsif ( length( $immodpg->{_control_layer_external} ) == 0 ) {

		$result = 1;

#		print("CASE 2immodpg, get_control_layer, empty string layer updated to $result\n");

	}
	else {
		print("immodpg, get_control_layer, unexpected value\n");
	}

	return ($result);
}

=head2 sub get_max_index
 
max index = number of input variables -1
 
=cut

sub get_max_index {
	my ($self) = @_;
	my $max_index = 14;

	return ($max_index);
}

=head2 sub initialize_messages
Create widgets that show messages
Show warnings or errors in a message box
Message box is defined in main where it is
also made invisible (withdraw)
Here we turn on the message box (deiconify, raise)
The message does not release the program
until OK is clicked and wait variable changes from yes 
to no.

=cut

sub initialize_messages {

	my ($self) = @_;

	my $arial_14_b = ( $immodpg->{_mw} )->fontCreate(
		'arial_14_b',
		-family => 'arial',
		-weight => 'bold',
		-size   => -14
	);

=head2 message box
withdraw temporarily while filling
with widgets

=cut 

	$immodpg->{_message_box_w} =
	  $immodpg->{_mw}->Toplevel( -background => $var_L_SU->{_my_yellow}, );
	$immodpg->{_message_box_w}->withdraw;

	$immodpg->{_message_box_w}->geometry( $var_L_SU->{_message_box_geometry} );

	$immodpg->{_message_upper_frame} = $immodpg->{_message_box_w}->Frame(
		-borderwidth => $var_L_SU->{_no_borderwidth},
		-background  => $var_L_SU->{_my_yellow},
	);
	$immodpg->{_message_lower_frame} = $immodpg->{_message_box_w}->Frame(
		-borderwidth => $var_L_SU->{_no_borderwidth},
		-background  => $var_L_SU->{_my_yellow},
		-height      => '10',
	);
	$immodpg->{_message_label_w} = $immodpg->{_message_upper_frame}->Label(
		-background => $var_L_SU->{_my_yellow},
		-font       => $arial_14_b,
		-justify    => 'left',
	);

	$immodpg->{_message_box_wait}  = $var_L_SU->{_yes};
	$immodpg->{_message_ok_button} = $immodpg->{_message_box_w}->Button(
		-text    => "ok",
		-font    => $arial_14_b,
		-command => sub {
			$immodpg->{_message_box_w}->grabRelease;
			$immodpg->{_message_box_w}->withdraw;
		},
	);

=head2 Pack message box
This Toplevel window has 
geometry that is independent
of the main window widget.
Upper frame contains message.
Lower frame contains ok button.

=cut

	$immodpg->{_message_upper_frame}->pack();
	$immodpg->{_message_label_w}->pack( -side => 'top', );
	$immodpg->{_message_lower_frame}->pack( -side => 'top', );

	$immodpg->{_message_ok_button}->pack(
		-side   => "top",
		-fill   => 'none',
		-expand => 0,
	);

	return ();



( run in 0.539 second using v1.01-cache-2.11-cpan-39bf76dae61 )