App-SeismicUnixGui

 view release on metacpan or  search on metacpan

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN

$L_SU->initialize_my_dialogs( $ok_button, $label, $cancel_button, $top_level );

$main_href->{_blank_button_spacer_center} =
  $main_href->{_my_dialog_box_w}->Button(
	-text                => " ",
	-relief              => 'flat',
	-highlightbackground => $var->{_my_yellow},
	-background          => $var->{_my_yellow},
	-state               => "disabled",
  );
$main_href->{_blank_button_spacer_left} =
  $main_href->{_my_dialog_box_w}->Button(
	-text                => "",
	-relief              => 'flat',
	-highlightbackground => $var->{_my_yellow},
	-background          => $var->{_my_yellow},
	-state               => "disabled",
  );
$main_href->{_blank_button_spacer_right} =
  $main_href->{_my_dialog_box_w}->Button(
	-text                => "",
	-relief              => 'flat',
	-highlightbackground => $var->{_my_yellow},
	-background          => $var->{_my_yellow},
	-state               => "disabled",
  );

=head2 Frame for the left-side menu in main gui

=cut

$side_menu_frame = ( $main_href->{_mw} )->Frame(
	-borderwidth => $var->{_no_borderwidth},
	-background  => $var->{_my_purple},
	-relief      => 'groove'
);

=head2 load images
Button bitmaps and pixmaps
XXX_cartoon image is used to delete
a seismic unix program from the flow

=cut

my $cross_cartoon = ( $main_href->{_mw} )
  ->Pixmap( -file => $global_libs->{_images} . 'cross.xpm', );
my $minus_cartoon = ( $main_href->{_mw} )
  ->Pixmap( -file => $global_libs->{_images} . 'minus.xpm', );
my $flow_item_up_arrow = ( $main_href->{_mw} )
  ->Bitmap( -file => $global_libs->{_images} . 'file_item_up_arrow.xbm', );
my $flow_item_down_arrow = ( $main_href->{_mw} )
  ->Bitmap( -file => $global_libs->{_images} . 'file_item_down_arrow.xbm', );

=head2  top menu frame

Contains:
(1) top menus
for superflows
and (2) icons for (a) wiping plots 
 
MB3 goes to superflow bindings 

=cut

$main_href->{_superflow_select} = $top_menu_frame->Menubutton(
	-text               => 'Tools',
	-font               => $arial_16,
	-height             => $var->{_1_character},
	-width              => $var->{_6_characters},
	-padx               => $var->{_five_pixels},
	-background         => $var->{_my_yellow},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat'
);

my $top_menu_bar =
  ( $main_href->{_superflow_select} )->Menu( -font => $arial_16 );

$top_menu_bar->bind(
	'<ButtonRelease-3>' => [ \&_L_SU_superflow_bindings, 'get_help' ], );

=head2 Top menu frame icon
wipe background plots
enable from the start

=cut 

$main_href->{_wipe_plots_button} = $top_menu_frame->Button(
	-image              => $cross_cartoon,
	-height             => $var->{_18_pixels},
	-border             => 0,
	-padx               => 8,
	-width              => $var->{_18_pixels},
	-background         => $var->{_my_light_grey},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat',
	-state              => 'active',
);

=head2 Top title reminders for Selected flow and Superflow names


=cut 

my $top_menu_frame_spacer_left = $top_menu_frame->Label(
	-text               => "\t\t\t\t",
	-font               => $arial_16,
	-height             => $var->{_one_character},
	-border             => $var->{_no_pixel},
	-anchor             => 'center',
	-width              => 0,
	-padx               => 0,
	-height             => $var->{_1_character},
	-width              => $var->{_thirty_characters},
	-padx               => $var->{_five_pixels},
	-background         => $var->{_my_purple},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat'
);

$main_href->{_flowNsuperflow_name_w} = $top_menu_frame->Label(
	-text               => 'Flow Name',
	-anchor             => 'center',
	-font               => $arial_italic_large,
	-height             => $var->{_one_character},
	-border             => $var->{_no_pixel},
	-padx               => 0,
	-height             => $var->{_1_character},
	-width              => $var->{_37_characters},
	-padx               => $var->{_five_pixels},
	-background         => $var->{_my_yellow},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN


( $main_href->{_help_menubutton} )->configure( -menu => $side_menu_bar_right );

my @Help_option;
$Help_option[0] = $help_menubutton_type->{_About};
$Help_option[1] = $help_menubutton_type->{_InstallationGuide};
$Help_option[2] = $help_menubutton_type->{_Tutorial};

# Help is always enabled and from the start
$main_href->{_install_menubutton} =
  ( $main_href->{_help_menubutton} )->command(
	-label     => @$alias_help_menubutton_label[0],
	-underline => 0,
	-command   => [ \&_L_SU, 'help_menubutton', \$Help_option[0] ],
	-font      => $arial_16,
  );
$main_href->{_install_menubutton} =
  ( $main_href->{_help_menubutton} )->command(
	-label     => @$alias_help_menubutton_label[1],
	-underline => 0,
	-command   => [ \&_L_SU, 'help_menubutton', \$Help_option[1] ],
	-font      => $arial_16,
  );
$main_href->{_install_menubutton} =
  ( $main_href->{_help_menubutton} )->command(
	-label     => @$alias_help_menubutton_label[2],
	-underline => 0,
	-command   => [ \&_L_SU, 'help_menubutton', \$Help_option[2] ],
	-font      => $arial_16,
  );
=pod
    $args[0] = $superflow_names->{_ProjectVariables}; (OLD)
	print("main, _Project: $args[0]\n");
	print("main,sflows:$sflows\n");
	print("main,$length_sflows\n");
	
=cut

=head2 give user superflow names

=cut

@args = @$superflow_names_gui_aref;
my $length_sflows = ( scalar @args ) - 1;    # last member is "temp"

( $main_href->{_superflow_select} )->configure( -menu => $top_menu_bar );

for ( my $sflows = 0 ; $sflows < $length_sflows ; $sflows++ ) {
	$main_href->{_superflow_select}->command(
		-label     => $args[$sflows],
		-underline => 0,
		-font      => $arial_16,
		-command   =>
		  [ \&_L_SU_superflows, 'pre_built_superflows', \$args[$sflows] ],
	);
}

=pod tied button widgets
to a tool_array
for easier management
bind MB3 to get_help
my @who;
my $this=0;

$who[$this] = $top_menu_bar->focusCurrent;
print(" who is @who\n");
my $a =$top_menu_bar->bind();
print(" bind is @$a\n");
my $class = ref $top_menu_bar;
print "Button \\$top_menu_bar is an instance of class '$class'.\n" .
      "This class has bindings for these events:\n\n";
print join("\n", $top_menu_bar->bind($class) ), "\n";

=cut

=head2 side menu frame

 contains side menus
 1. for files

=cut

$main_href->{_file_menubutton} = $side_menu_frame->Menubutton(
	-text               => 'Flow',
	-font               => $arial_16,
	-height             => $var->{_1_character},
	-relief             => 'flat',
	-background         => $var->{_my_yellow},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
);

my $side_menu_bar_left =
  ( $main_href->{_file_menubutton} )->Menu( -font => $arial_16 );

( $main_href->{_file_menubutton} )->configure( -menu => $side_menu_bar_left );

#	( $main_href->{_file_menubutton} )->separator;
my @File_option;

$File_option[0] = $file_dialog_type->{_Open};
$File_option[1] = $file_dialog_type->{_SaveAs};
$File_option[2] = $file_dialog_type->{_Delete};

# Open is the only button enabled from the start
# Its purpose is to open a user-built perl flow
( $main_href->{_file_menubutton} )->separator;
$main_href->{_Open_menubutton} = ( $main_href->{_file_menubutton} )->command(
	-label     => @$alias_FileDialog_button_label[0],
	-underline => 0,
	-command   => [ \&_L_SU, 'FileDialog_button', \$File_option[0] ],
	-font      => $arial_16,
);

( $main_href->{_file_menubutton} )->separator;
$main_href->{_SaveAs_menubutton} = ( $main_href->{_file_menubutton} )->command(
	-label     => @$alias_FileDialog_button_label[1],
	-underline => 0,
	-command   => [ \&_L_SU, 'FileDialog_button', \$File_option[1] ],
	-font      => $arial_16
);

( $main_href->{_file_menubutton} )->separator;
$main_href->{_Delete_menubutton} = ( $main_href->{_file_menubutton} )->command(
	-label     => @$alias_FileDialog_button_label[2],
	-underline => 0,
	-command   => [ \&_L_SU, 'FileDialog_button', \$File_option[2] ],
	-font      => $arial_16
);

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN

	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat',
	-state              => 'disabled',
  );

=pod button that moves items

(program names) UP in a flow (color grey, pink, green or blue);
up within a listbox

=cut

$main_href->{_flow_item_up_arrow_button} =
  ( $main_href->{_parameter_menu_frame} )->Button(
	-image              => $flow_item_up_arrow,
	-height             => $var->{_24_pixels},
	-border             => 0,
	-padx               => 8,
	-width              => $var->{_12_pixels},
	-background         => $var->{_my_light_grey},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat',
	-state              => 'disabled',
  );

=pod button that moves items (program names)
 
 DOWN in a flow (color grey, pink, green or blue);
 down within a listbox

=cut

$main_href->{_flow_item_down_arrow_button} =
  ( $main_href->{_parameter_menu_frame} )->Button(
	-image              => $flow_item_down_arrow,
	-height             => $var->{_24_pixels},
	-border             => 0,
	-padx               => 8,
	-width              => $var->{_12_pixels},
	-background         => $var->{_my_light_grey},
	-foreground         => $var->{_my_black},
	-disabledforeground => $var->{_my_dark_grey},
	-activeforeground   => $var->{_my_white},
	-activebackground   => $var->{_my_dark_grey},
	-relief             => 'flat',
	-state              => 'disabled',
  );

=head2 Listbox widgets

tied to button action
for easier management

=cut

( $main_href->{_delete_from_flow_button} )
  ->bind(
	'<1>' => [ \&_L_SU_flow_bindings_any_color, 'delete_from_flow_button' ], );

( $main_href->{_flow_item_up_arrow_button} )
  ->bind(
	'<1>' => [ \&_L_SU_flow_bindings_any_color, 'flow_item_up_arrow_button' ],
  );

( $main_href->{_flow_item_down_arrow_button} )
  ->bind(
	'<1>' => [ \&_L_SU_flow_bindings_any_color, 'flow_item_down_arrow_button' ],
  );

( $main_href->{_delete_whole_flow_button} )
  ->bind(
	'<1>' => [ \&_L_SU_flow_bindings_any_color, 'delete_whole_flow_button' ], );

( $main_href->{_wipe_plots_button} )
  ->bind( '<1>' => [ \&_L_SU_bindings_shell, 'wipe_plots_button' ], );

$work_frame = ( $main_href->{_mw} )->Frame(
	-borderwidth => $var->{_one_pixel_borderwidth},
	-background  => 'yellow',
	-relief      => 'groove'
);

=head2 work frame

has menu items to its left
contains a sunix_frame at its top, 
a parameters_pane (with names value buttons and values) in the middle left
and four listboxes contained in a module-sequences frame on the middle right
and a message text area across the whole bottom
 
=cut

=head2 sunix_frame

The sunix_frame itself contains five stories
sub-frames called sunix_frame_I through and sunix_frame_V
(levels 1 through 5)
 
=cut 

$sunix_frame_top_row = ( $main_href->{_mw} )->Frame(
	-borderwidth => $var->{_no_borderwidth},
	-relief      => 'flat',

	#-width       	=> $var->{_11_characters},
	-background => $var->{_my_purple},
);
$sunix_frame_bottom_row = ( $main_href->{_mw} )->Frame(
	-borderwidth => $var->{_no_borderwidth},
	-relief      => 'flat',

	#-width       	=> $var->{_11_characters},
	-background => $var->{_my_purple},
);
my $sunix_frame_V = $sunix_frame_top_row->Frame(
	-borderwidth => $var->{_no_borderwidth},
	-relief      => 'flat',
	-width       => $var->{_11_characters},
	-height      => '10',
	-background  => $var->{_my_purple},
);
my $sunix_frame_IV = $sunix_frame_top_row->Frame(
	-borderwidth => $var->{_no_borderwidth},

	#                          	-pady			=> $var->{_one_pixel},
	-relief     => 'flat',
	-width      => $var->{_11_characters},
	-height     => '10',
	-background => $var->{_my_purple},
);
my $sunix_frame_III = $sunix_frame_top_row->Frame(
	-borderwidth => $var->{_no_borderwidth},
	-relief      => 'flat',
	-width       => $var->{_11_characters},
	-height      => '10',

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN

$sunix_shell_programs_listbox->insert( "end", sort @sunix_shell_programs, );

$sunix_statsMath_programs_listbox->insert( "end",
	sort @sunix_statsMath_programs,
);

=head2 Notebooks within 

sunix_frame_I (bottom row)
 
=cut 

my $sunix_programs_I_book = $sunix_frame_I->NoteBook(
	-font          => $arial_notebooks,
	-borderwidth   => $var->{_no_borderwidth},
	-backpagecolor => $var->{_my_purple},
);

my $sunix_transform_programs_tab =
  $sunix_programs_I_book->add( "transform programs tab",
	-label => "transform" );

my $sunix_well_programs_tab =
  $sunix_programs_I_book->add( "well programs tab", -label => "well", );

my $sunix_transform_programs_listbox = $sunix_transform_programs_tab->Scrolled(
	"Listbox",
	-scrollbars  => "osoe",
	-height      => $var->{_2_lines},
	-width       => $var->{_11_characters},
	-selectmode  => "single",
	-borderwidth => $var->{_no_borderwidth}
);

my $sunix_well_programs_listbox = $sunix_well_programs_tab->Scrolled(
	"Listbox",
	-scrollbars  => "osoe",
	-height      => $var->{_2_lines},
	-width       => $var->{_11_characters},
	-selectmode  => "single",
	-borderwidth => $var->{_no_borderwidth}
);

$sunix_transform_programs_listbox->insert( "end",
	sort @sunix_transform_programs,
);

$sunix_well_programs_listbox->insert( "end", sort @sunix_well_programs, );

=head2 Notebooks within

sunix_frame_I (bottom row )

=cut	             			             			             											

=head2 tied listbox widgets

  to a tool_array
  for easier management
  
  This binding occurs inside L_SU.pm and NOT
  within the current program

=cut

$sunix_data_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'data' ] );
$sunix_datum_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'datum' ] );
$sunix_plot_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'plot' ] );
$sunix_filter_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'filter' ] );
$sunix_header_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'header' ] );
$sunix_inversion_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'inversion' ]
);
$sunix_migration_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'migration' ]
);

$sunix_model_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'model' ] );
$sunix_NMO_Vel_Stk_programs_listbox->bind( '<1>' =>
	  [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'NMO_Vel_Stk' ] );
$sunix_par_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'par' ] );
$sunix_picks_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'picks' ] );

$sunix_shapeNcut_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'shapeNcut' ]
);

# TODO return to 'neutral'
$sunix_shell_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'shell' ] );
$sunix_statsMath_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'statsMath' ]
);
$sunix_transform_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'transform' ]
);
$sunix_well_programs_listbox->bind(
	'<1>' => [ \&_L_SU_sunix_bindings, 'sunix_select', 'neutral', 'well' ] );

$sunix_data_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'data' ]    #TODO return to 'neutral'
);
$sunix_datum_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'datum' ]    #TODo return to 'neutral'
);
$sunix_plot_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'plot' ]     #TODo return to 'neutral'
);
$sunix_filter_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'filter' ]    #TODo return to 'neutral'
);

$sunix_header_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'header' ]    #TODo return to 'neutral'
);
$sunix_inversion_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'inversion' ]    #TODo return to 'neutral'
);
$sunix_migration_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'migration' ]    #TODo return to 'neutral'
);
$sunix_model_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'model' ]        #TODo return to 'neutral'
);
$sunix_NMO_Vel_Stk_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'NMO_Vel_Stk' ]    #TODo return to 'neutral'
);
$sunix_par_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'par' ]            #TODo return to 'neutral'
);
$sunix_picks_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'picks' ]          #TODo return to 'neutral'
);

$sunix_shapeNcut_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'shapeNcut' ]      #TODo return to 'neutral'
);
$sunix_shell_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'shell' ]          #TODo return to 'neutral'
);
$sunix_statsMath_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'statsMath' ]      #TODo return to 'neutral'
);
$sunix_transform_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'transform' ]      #TODo return to 'neutral'
);
$sunix_well_programs_listbox->bind(
	'<3>' => [ \&_L_SU_sunix_bindings, 'get_help', 'neutral',
		'well' ]           #TODo return to 'neutral'
);

=head2 parameter_titles label

 immediteley above the parameters frame
 both of which are contained in the work frame
 contains Titles only 

=cut  

my $parameter_titles_label = $parameter_titles_frame->Label(
	-text       => "\t" . 'Parameter Names' . "\t\t\t" . 'Values',
	-font       => $arial_16,
	-height     => $var->{_one_character},
	-border     => $var->{_no_pixel},
	-width      => 0,
	-padx       => 0,
	-background => $var->{_light_gray},
	-relief     => 'groove'
);

=head2 parameters frame

 Parameters from
 Tools and Su Modules


=cut

$parameters_pane = $work_frame->Scrolled(
	"Pane",
	-background => $var->{_my_purple},
	-relief     => 'groove',
	-scrollbars => "e",
	-sticky     => 'ns',

	#-width			=> 400,
	#-padx			=> 10,
);

=head2  input frame

 Contains, left-to-right:

 a parameter_names_frame 
 a stack of radio buttons 
 and a values_frame  

 Choose whether to ignore/deactivate or apply
 the parameter-value pairs later on

 To solicit and modify
 possibly existing
 parameter value input
 
 N.B. widths are controlled within label_box.pm and value_box.pm

=cut

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN

	-relief           => 'flat',
	-selectforeground => $var->{_my_white},
	-selectbackground => $var->{_my_dark_grey},
	-state            => 'disabled',
);

$main_href->{_flow_listbox_pink_w} = $flow_control_frame_top_row->Scrolled(
	"Listbox",
	-scrollbars       => "osoe",
	-height           => $var->{_7_lines},
	-width            => $var->{_12_characters},
	-selectmode       => "single",
	-borderwidth      => $var->{_one_pixel_borderwidth},
	-foreground       => $var->{_my_black},
	-background       => $var->{_my_pink},
	-relief           => 'flat',
	-selectforeground => $var->{_my_white},
	-selectbackground => $var->{_my_dark_grey},
	-state            => 'disabled',
);

$main_href->{_flow_listbox_green_w} = $flow_control_frame_bottom_row->Scrolled(
	"Listbox",
	-scrollbars       => "osoe",
	-height           => $var->{_7_lines},
	-width            => $var->{_12_characters},
	-selectmode       => "single",
	-borderwidth      => $var->{_one_pixel_borderwidth},
	-foreground       => $var->{_my_black},
	-background       => $var->{_my_light_green},
	-relief           => 'flat',
	-selectforeground => $var->{_my_white},
	-selectbackground => $var->{_my_dark_grey},
	-state            => 'disabled',
);

$main_href->{_flow_listbox_blue_w} = $flow_control_frame_bottom_row->Scrolled(
	"Listbox",
	-scrollbars  => "osoe",
	-height      => $var->{_7_lines},
	-width       => $var->{_12_characters},
	-selectmode  => "single",
	-borderwidth => $var->{_one_pixel_borderwidth},
	-foreground  => $var->{_my_black},
	-background  => $var->{_my_light_blue},

	-relief           => 'flat',
	-selectforeground => $var->{_my_white},
	-selectbackground => $var->{_my_dark_grey},
	-state            => 'disabled',
);

=head2 tied flow listbox widgets

  to a tool_array
  for easier management

=cut

( $main_href->{_flow_listbox_grey_w} )
  ->bind( '<1>' => [ \&_L_SU_flow_bindings, 'flow_select', 'grey' ], );
( $main_href->{_flow_listbox_grey_w} )
  ->bind( '<3>' => [ \&_L_SU_flow_bindings, 'get_help', 'grey' ] );

( $main_href->{_flow_listbox_pink_w} )
  ->bind( '<1>' => [ \&_L_SU_flow_bindings, 'flow_select', 'pink' ], );
( $main_href->{_flow_listbox_pink_w} )
  ->bind( '<3>' => [ \&_L_SU_flow_bindings, 'get_help', 'pink' ] );

( $main_href->{_flow_listbox_green_w} )
  ->bind( '<1>' => [ \&_L_SU_flow_bindings, 'flow_select', 'green' ], );
( $main_href->{_flow_listbox_green_w} )
  ->bind( '<3>' => [ \&_L_SU_flow_bindings, 'get_help', 'green' ] );

( $main_href->{_flow_listbox_blue_w} )
  ->bind( '<1>' => [ \&_L_SU_flow_bindings, 'flow_select', 'blue' ], );
( $main_href->{_flow_listbox_blue_w} )
  ->bind( '<3>' => [ \&_L_SU_flow_bindings, 'get_help', 'blue' ] );

=head2 Pack my dialog box

Upper frame contains my message.
Lower frame contains an  'ok' and a 'cancel' button.

=cut

$main_href->{_my_dialog_upper_frame}->pack(
	-side   => "top",
	-fill   => 'x',
	-expand => 0,
	-anchor => "nw",
);

$main_href->{_my_dialog_label_w}->pack;

$main_href->{_my_dialog_lower_frame}->pack(
	-side   => "top",
	-fill   => 'x',
	-expand => 1,
	-anchor => "nw",
);

$main_href->{_blank_button_spacer_left}->pack(
	-side   => 'left',
	-fill   => 'x',
	-expand => 0,
);

$main_href->{_my_dialog_ok_button}->pack(
	-side   => "left",
	-fill   => 'x',
	-expand => 0,
);

$main_href->{_blank_button_spacer_center}->pack(
	-side   => 'left',
	-fill   => 'x',
	-expand => 1,
);

$main_href->{_my_dialog_cancel_button}->pack(
	-side   => "left",
	-fill   => 'x',
	-expand => 0,
);

$main_href->{_blank_button_spacer_right}->pack(
	-side   => 'left',
	-fill   => 'x',
	-expand => 0,
);

=head2 Pack message box

Upper frame contains message.
Lower frame contains ok button.

=cut

lib/App/SeismicUnixGui/script/L_SU.pl  view on Meta::CPAN


$flow_control_frame_bottom_row->pack(
	-side   => "top",
	-fill   => "both",
	-expand => 1,
);

( $main_href->{_flow_name_grey_w} )->pack(
	-side => "left",
	-fill => "x",
);

( $main_href->{_flow_name_pink_w} )->pack(
	-side => "right",
	-fill => "x",
);

( $main_href->{_flow_listbox_grey_w} )->pack(
	-side => "left",
	-fill => "x",
);

( $main_href->{_flow_listbox_pink_w} )->pack(
	-side => "left",
	-fill => "x",
);

( $main_href->{_flow_name_green_w} )->pack(
	-side => "left",
	-fill => "x",
);

( $main_href->{_flow_name_blue_w} )->pack(
	-side => "right",
	-fill => "x",
);
( $main_href->{_flow_listbox_green_w} )->pack(
	-side => "left",
	-fill => "y",
);
( $main_href->{_flow_listbox_blue_w} )->pack(
	-fill => "y",
	-side => "left",
);

# send widgets to the L_SU package from the current perl program
# once BUT transfer must ALSO be repeated within each subroutine
# outside MainLoop
# print("setting up first hash from main\n");
$L_SU->set_hash_ref($main_href);

$L_SU->set_param_widgets();    # Initialize screen parameter names and values

# last in MainLoop allows all previous widgets to appear
# properly
# set up interactive message widgets
$L_SU->initialize_messages();

MainLoop;

=head2 sub _L_SU_bindings

For help in pre-built superflows and 
for get_help in user-built listbox flows

color not needed but $self is needed

=cut 

sub _L_SU_bindings {    #

	my ( $self, $set_method ) = @_;

	# print("1 main,_L_SU_bindings ,method:$set_method,\n");
	if ($set_method) {

		$L_SU->set_hash_ref($main_href);

		# print("2 main,_L_SU_bindings,method:$set_method\n");
		$L_SU->$set_method();

		# print("1. main, _L_SU_sunix_bindings: writing gui_history.txt\n");
		# $gui_history->view();

	}
	else {
		print("main, _L_SU_bindings, no method name: $set_method error 1,\n");
	}

	return ();
}

=head2 sub _L_SU_bindings_shell

 for any plot(s) in the background

=cut

sub _L_SU_bindings_shell {
	my ( $self, $set_method ) = @_;

	# print("1 main,_L_SU_bindings_shell, method:$set_method,\n");
	if ( length $set_method ) {

		my $button = $set_method;
		$gui_history->set_button($button);
		$main_href = $gui_history->get_defaults();

		$L_SU->set_hash_ref($main_href);

		# print("2 main,_L_SU, _L_SU_bindings_shell,method:$set_method\n");
		$L_SU->$set_method();

	  # print("1. main, _L_SU_sunix_bindings_shell: writing gui_history.txt\n");
	  # $gui_history->view();

	}
	else {
		print("_L_SU,_L_SU_bindings_shell, no method: $set_method error 1,\n");
	}

	return ();
}

=head2 sub _L_SU_sunix_bindings

used for 
	sunix_listbox get_help (MB3)
	sunix_select		   (MB1) 
method='sunix_select'
color='neutral'

=cut

sub _L_SU_sunix_bindings {
	my ( $self, $method, $color, $prog_group ) = @_;

# print("1 main,_L_SU_sunix_bindings,method,color,prog_group: $method,$color,$prog_group \n");
	if ( $method && $color && $prog_group ) {

		_set_prog_group($prog_group);
		my $button = $method;

#			print ("main,_L_SU_sunix_bindings,sunix_listbox:$main_href->{_sunix_listbox}\n");

		$gui_history->set_sunix_prog_group($prog_group);
		$gui_history->set_sunix_prog_group_color($color);
		$gui_history->set_button($button);

		#			print("1. main, _L_SU_sunix_bindings: writing gui_history.txt\n");
		#			$gui_history->view();

		$L_SU->set_hash_ref($main_href);
		$L_SU->user_built_flows($method);

	}
	else {
		print(
"main, _L_SU_sunix_bindings, no method, color or group : $method error 1,\n"
		);
	}

	return ();
}

=head2 sub _L_SU_flow_bindings

used for:
	sunix_listbox get_help (MB3)
	flow-item selection ('flow_select') (MB1)

Main
	L_SU, user_built_flows
			color_flow, flow_select

N.B. flow_select is activated both here and
independently 
within gui_history by set_button

=cut

sub _L_SU_flow_bindings {
	my ( $self, $method, $color ) = @_;

	#	print("1 main,_L_SU_flow_bindings ,method:$method,\n");
	if ( $method && $color ) {

		my $button = $method;

		$gui_history->set_flow_type($user_built);

		#		print("2. main, _L_SU_flow_bindings: writing gui_history.txt\n");
		# $gui_history->view();

		$gui_history->set_flow_select_color($color);

#					print("1. main,_L_SU_flow_bindings,color:$color\n");

		$L_SU->set_hash_ref($main_href);

		#			print("2. main,_L_SU_flow_bindings,method:$method\n");

		$L_SU->user_built_flows($method);

	}
	elsif ( not($method) && $color ) {

		print("main,_L_SU_flow_bindings, missing method\n");

	}
	else {
		print(
			"main, _L_SU_flow_bindings, no method, color : $method error 1,\n");
	}

	return ();
}

=head2 sub _L_SU_flow_bindings_any_color

 for any colored flow
 use to delete an item from a flow
 'delete_from_flow_button'
 used to move up and down a list of flow items
 'flow_item_up_arrow_button'
 'flow_item_down_arrow_button'
 'delete_whole_flow_button'

=cut

sub _L_SU_flow_bindings_any_color {
	my ( $self, $method ) = @_;

	#	print("1 main,_L_SU_flow_bindings ,method:$method,\n");
	if ($method) {

		my $button = $method;

		$gui_history->set_button($button);

		$main_href = $gui_history->get_defaults();

		$L_SU->set_hash_ref($main_href);

		# print("main,_L_SU_flow_bindings_any_color,method:$method\n");
		# print("main,_L_SU_flow_bindings_any_color,value: any_color\n");
		$L_SU->user_built_flows($method);

		# print("1 main,_L_SU_flow_bindings , print gui_history.txt\n");
		#$gui_history->view();

	}
	else {
		print("main _L_SU_flow_bindings, no method: $method error 1,\n");
	}

	return ();
}

=head2 sub _L_SU_superflow_bindings

Redirect user selections to L_SU.pm
for the case of: Help for superflows 
(mouse-button 3 bindings)


=cut

sub _L_SU_superflow_bindings {
	my ( $self, $set_method ) = @_;

	# print("1 main,_L_SU,method:$set_method,\n");
	if ($set_method) {

		$L_SU->set_hash_ref($main_href);

		# print("2 main,_L_SU, superflow_bindings,method:$set_method\n");
		$L_SU->$set_method();

#			print("1 main,_L_SU_bindings , print gui_superflow_bindings, history.txt\n");
		$gui_history->view();

	}
	else {
		print(
			"main,_L_SU_superflow_bindings, no method: $set_method error 1,\n");
	}

	return ();
}

=head2 sub _L_SU

Invoke a method in L_SU from a button click
in L_SU
	-save_button
	-run_button
	-FileDialog_button with one of 3
	possible values: 'Open', 'SaveAs'
	possible values: 'Delete'	
	
	-help_menubutton with possible values:
	 About
	 InstallationGuide
	 Tutorial

=cut

sub _L_SU {
	my ( $set_method, $value ) = @_;

	if ( $set_method && $value ) {

		my $button = $set_method;
		my $name   = $$value;

		$gui_history->set_button($button);

		if ( $button eq 'FileDialog_button' ) {

			$gui_history->set_FileDialog_type($name);

		}
		elsif ( $button eq 'help_menubutton' ) {

			$gui_history->set_help_menubutton_type($name);

	 #				print("1. main,_L_SU,method:$set_method, ref scalar value:$$value\n");

		}
		else {
  # print("2 main,_L_SU,method:$set_method, deref scalar value:$$value NADA\n");
		}

		$main_href = $gui_history->get_defaults();

		$L_SU->set_hash_ref($main_href);

		#			print(" main,_L_SU , button=$button, print gui_history.txt\n");
		# $gui_history->view();

	 #			print("2 main,_L_SU,method:$set_method, deref scalar value:$$value\n");
		$L_SU->$set_method($value);

	}
	else {



( run in 0.409 second using v1.01-cache-2.11-cpan-2398b32b56e )