1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed 9c41ed9

better layout of the iounit

  • Participants
  • Parent commits 198749f
  • Branches default

Comments (0)

Files changed (1)

File lib/Kephra/App/Panel/IOUnit.pm

View file
  • Ignore whitespace
 use strict;
 use warnings;
-use Wx::RichText;
+use Wx::AUI;
 
 package Kephra::App::Panel::IOUnit;
 our @ISA = 'Wx::Panel';
 
-my $input;
-my %output;
-# shell perl kephra
+my ($input, $output, %outputtext);
+my @slot = qw/output perl shell drum log all/;
 
 sub new {
     my( $class, $parent) = @_;
     my $op = $class->SUPER::new($parent, -1);
     
     $input = Wx::RichTextCtrl->new($op, -1, '', [-1,-1], [-1, 29]);
-    $output{'all'}  = Wx::RichTextCtrl->new(
-        $op, -1, '', [-1,-1], [-1,-1], &Wx::wxRE_MULTILINE
+    $output = Wx::AuiNotebook->new(
+        $op, -1, [-1,-1], [-1, -1],
+        &Wx::wxAUI_NB_TOP | &Wx::wxAUI_NB_TAB_MOVE
     );
+    for my $slot (@slot) {
+        $outputtext{ $slot } = Wx::TextCtrl->new(
+            $output, -1, '', [-1,-1], [-1,-1],
+            &Wx::wxTE_MULTILINE | &Wx::wxTE_READONLY
+        );
+        #$outputtext{ $slot }->SetDefaultStyle(
+        #    
+        #);
+        $output->AddPage ( $outputtext{ $slot }, $slot, 0 );
 
+        #Wx::Event::EVT_TEXT_ENTER(id, func);
+    }
 
     my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
-    $sizer->Add( $output{'all'}, 1, &Wx::wxGROW);
-    $sizer->Add( $input,         0, &Wx::wxGROW);
+    $sizer->Add( $output, 1, &Wx::wxGROW);
+    $sizer->Add( $input,  0, &Wx::wxGROW);
     $op->SetSizer( $sizer );
 
     return $op;
 }
 
+sub set_focus { Wx::Window::SetFocus( $input ) }
 
 1;