Source

Kephra / lib / edpart.pl

Full commit
use v5.12;
use warnings;

package Kephra;
BEGIN {
	our $NAME = __PACKAGE__;
	our $VERSION = 'sp1';
}

package Kephra::App;
use Wx;
use Kephra::API;
use Kephra::App::Bar::Document;
use Kephra::App::Dialog;
use Kephra::App::Editor;
use Kephra::App::Frame;
use Kephra::App::Splitter;
use Kephra::File;
use base qw(Wx::App);
our $_ref;

sub OnInit {
	my $app  = $_ref = shift;
	$Kephra::Log::test_mode = 1; 
	my $win = Kephra::App::Frame->new( 'DDD - double docbar demo' );
	my $ep = Kephra::App::Part::Editor->new($win);

	Kephra::File::new();
	Kephra::API::focus( Kephra::API::document()->panel );
	my $doc = Kephra::API::document();

	$win->Center();
	$win->Show(1);
	$app->SetTopWindow($win);
	1;
}

package Kephra::App::Part::Editor;
our @ISA = 'Kephra::App::Panel';

my @docbar;
my $docbar;
my $panel;

sub new {
	my( $class, $parent) = @_;
	my $self = $panel = $class->SUPER::new($parent);

	my $db  = Kephra::App::Bar::Document->new($self);
	my $db2 = Kephra::App::Bar::Document->new($self);

	my $splitter = Kephra::App::Splitter->new
		({parent => $self, left => $db, right => $db2, dominant_child => 'left'});
	$self->append( \$splitter );
	$splitter->resize('equal');

	$self;
}

package main;
Kephra::App->new->MainLoop;