Tk-IDElayout

 view release on metacpan or  search on metacpan

IDElayout.pm  view on Meta::CPAN


L<Tk::Frame> object that holds the menu bar at the top of the main window.

=item mainPW

L<Tk::IDEanedWindow> object used for main display of widgets.
	
=item toolbarFrame

L<Tk::Frame> object that holds the toolbar (if used).

=item statusLineFrame

L<Tk::Frame> object that holds the status-line widget.
	
=back

=head1 ATTRIBUTES

=over 1

=item   indicator

L<Tk::Frame> object used to indicate drop target areas. This will appear as a horizontal or vertical Bar on the
sides or top/bottom of a frame to indicate where a drag/drop operation can be dropped.

        
=item currentFrame

Current frame that the mouse pointer is over during a drag/drop operation.
        
=item currentSide

Current side of the frame (e.g. left, right, top, bot) that the mouse pointer is over during a drag/drop operation.
        
=item lastSide

The last side of the frame (e.g. left, right, top, bot) that the mouse pointer was over during a drag/drop operation.

=back

=head1 Methods

=cut

package Tk::IDElayout;

our ($VERSION) = ('0.37');

use strict;

use Carp;

use Tk;
use Tk::Font;

use Tk::IDEpanedwindow;
use Graph::Directed;  # Used for representation and manipulation of the frame layout structure
use Tk::IDElayoutDropSite;

use base qw/ Tk::Derived Tk::Frame/;

Tk::Widget->Construct("IDElayout");

sub Populate {
	my ( $cw, $args ) = @_;

	my $frameStructure;
	if ( defined( $args->{-frameStructure} ) ) {
		$frameStructure = $args->{-frameStructure};
	}
	my $frameGraph;
	if ( defined( $args->{-frameGraph} ) ) {
		$frameGraph = $args->{-frameGraph};
	}

	
	if( !defined($frameGraph) && !defined($frameStructure) ){
		croak("Error: -frameGraph or -frameStructure option not supplied when creating IDElayout widget\n");
	}
	
	my $widgets;
	if ( defined( $args->{-widgets} ) ) {
		$widgets = $args->{-widgets};
                $cw->{Configure}{-widgets} = $widgets; # Make sure $widgets is populated before other options

	}
	else {
		croak("Error: -widgets not supplied when creating IDElayout widget\n");
	}

        # Get the default tabFrame config, for setting if IDEtabFrameConfig not supplied
        my $defaultIDEtabFrameConfig = $cw->defaultIDEtabFrameConfig();

        # Set the default IDEpanedwindow config. This is not broken out as a separate method,
        #    because it is not used outside of this routine.
        my $defaultIDEpanedwindowConfig = 
            [   -sashpad   => 1,
                -sashwidth => 6,
                -sashrelief=> 'ridge'
            ];
        
	# Create Placeholder frames
        # We use the grid geometry manager here for better control
        #    Using the pack geom manager, the status line along the bottom would disappear when
        #    the frame was shrunk vertically.
	my $menuFrame       = $cw->Frame()->grid( -column => 0, -row => 0, -sticky => 'ew');
	my $toolbarFrame    = $cw->Frame()->grid( -column => 0, -row => 1, -sticky => 'ew');
	my $mainPW          = $cw->Frame()->grid( -column => 0, -row => 2, -sticky => 'nsew');
	my $statusLineFrame = $cw->Frame()->grid( -column => 0, -row => 3, -sticky => 'ew');

        # 
        $cw->gridColumnconfigure(0, -weight => 1); # Allow the whole column to expand
        $cw->gridRowconfigure(2, -weight => 1); # The mainPW window can expand, anything else doesn't
	
	$cw->SUPER::Populate($args);
	$cw->ConfigSpecs(	
		-frameStructure =>
		               [ qw/ METHOD frameStructure frameStructure /, $frameStructure ],
		-frameGraph => [ qw/ METHOD frameGraph frameGraph /, $frameGraph ],
		-widgets    => [ qw/ PASSIVE widgets widgets /,      $widgets ],



( run in 1.005 second using v1.01-cache-2.11-cpan-364913b4093 )