Source

App::Harmonograph / lib / Wx / Perl / Smart / LabeledBox.pm

Full commit
use v5.12;
use warnings;
use Wx;
use Wx::Perl::Smart::Sizer;

package Wx::Perl::Smart::LabeledBox;
use base qw(Wx::Panel);
sub new {
	my ($class, $parent, $label, $widgets, $orientation, $init_arg) = @_;
	return unless ref $widgets eq 'ARRAY';
	my ($self) = $class->SUPER::new( $parent );
	my ($sizer) = Wx::StaticBoxSizer->new 
			(Wx::StaticBox->new($self, -1, " $label "), &Wx::wxVERTICAL);
	$sizer->Add( Wx::Perl::Smart::Sizer->new
			($self, $widgets, $orientation, $init_arg), 0, &Wx::wxGROW);
	$self->SetSizerAndFit( $sizer );
	$self;
}

1;