Source

Kephra / lib / Kephra / App / Part / Editor.pm

Full commit
use strict;
use warnings;
use Cwd;
use File::Find;
use File::Spec;
use Kephra::API;

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

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

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

	#my @lib = @{ get_modules_and_paths('lib') };
	#my $root_ID = $self->AddRoot( 'Root', -1, -1, Wx::TreeItemData->new( ));
	#for (0 .. $#lib){
		#my $data = Wx::TreeItemData->new; 
		#$data->SetData( $lib[$_][1] );
		#my $ItemID = $self->AppendItem( $root_ID, $lib[$_][0] );
		#$self->SetItemData( $ItemID, $data );
	#}
#
	#Wx::Event::EVT_TREE_ITEM_ACTIVATED( $self, -1, sub {
		#my ($fb, $event) = @_;
		#Kephra::File::open( $fb->GetItemData( $event->GetItem )->GetData );
		#Wx::Window::SetFocus( $fb );
	#} );
	#Wx::Event::EVT_KEY_DOWN ($self, sub {
		#my ($fb, $event) = @_;
		#my $key = Kephra::KeyMap::code_from_event($event);
		#Kephra::API::log("pressed key $key inside the filebrowser");
		#if    ($key ==  &Wx::WXK_ESCAPE) {Kephra::API::focus_back() }
		#elsif ($key ==  &Wx::WXK_F2)     {Kephra::API::focus_back() }
		#elsif ($key ==  &Wx::WXK_F11)    {Kephra::API::main_window()->toggle_fullscreen() } 
		#else { $event->Skip }
	#});
#
	# selection only visible when browser has focus
	#Wx::Event::EVT_SET_FOCUS($self, sub { $_[0]->SelectItem( $_[0]->GetSelection, 1) });
	#Wx::Event::EVT_KILL_FOCUS($self, sub { $_[0]->SelectItem( $_[0]->GetSelection, 0) });
#
	#my ($fi_ID, $cookie) = $self->GetFirstChild($root_ID);
	#$self->SelectItem( $fi_ID, 1 ); # hack tor eall start when focus at number 1 not 0
	#$self->SelectItem( $fi_ID, 0 );
	#return $self;
}

1;