Commits

Herbert Breunung committed 88aa002

break up broken oop model of iounit

Comments (0)

Files changed (3)

lib/Kephra/App/Part/IOUnit.pm

 package Kephra::App::Part::IOUnit;
 
 our @ISA = 'Wx::Panel';
-our $_ref;
 
 Kephra::CommandList::register_cmd_namespace('iounit');
-Kephra::CommandList::register_cmd({'+-focus'=>{sub=>'focus_on_input', label => ' ', keys => 'esc'},});
 Kephra::KeyMap::register_map({'iounit'=>{'esc' => 1, 'window-fullscreen-toggle' => '' } });
 
 
 sub new {
 	my( $class, $parent) = @_;
-	my $self = $_ref = $class->SUPER::new($parent, -1);
+	my $self = $class->SUPER::new($parent, -1);
 	$self->{'input'} = my $input = Wx::TextCtrl->new
 		($self, -1, '', [-1,-1], [-1, -1], &Wx::wxTE_PROCESS_ENTER );
 	$self->{'output_book'} = my $output_book = Wx::Notebook->new (
 	}
 	Kephra::API::focus_back();
 }
-sub focus_on_input { Kephra::API::focus( $_ref->{'input'} ) }
+sub focus_on_input { Kephra::API::focus( shift->{'input'} ) }
 
 sub get_line  {}
 sub get_click {}

lib/Kephra/App/SidePanelController.pm

 use warnings;
 
 package Kephra::App::SidePanelController;
+our @ISA = 'Wx::Panel';
 
+sub new {}
 sub add {}
 sub remove {}
 

lib/Kephra/App/Window.pm

 
 Kephra::CommandList::register_cmd({
  'window-fullscreen-toggle'=>{sub => '$win->toggle_fullscreen', label=>'Fullscreen', keys=>'F11'},
+ 'iounit-focus'            =>{sub =>'$win->{"part"}{"iounit"}->focus_on_input', label => ' ', keys => 'esc'},
 });