Commits

Herbert Breunung  committed 66dc5a4

put menu into its module

  • Participants
  • Parent commits e003494

Comments (0)

Files changed (3)

File lib/Kephra.pm

     qw/Wx Wx::Scintilla Wx::Perl::ProcessStream/,
     
 );
-our @used_wx_modules = qw/Wx::AUI Wx::STC/;
+our @used_wx_modules = qw/Wx::AUI/; # Wx::STC
 
 our @needed_at_first = qw/App API/;
 

File lib/Kephra/App/Menu.pm

 
 package Kephra::App::Menu;
 
+sub main_bar {
+    my $bar = Wx::MenuBar->new();
+    my $file_menu = Wx::Menu->new();
+    $file_menu->Append(-1, 'Open');
+    $file_menu->Append(-1, 'Save');
+    $file_menu->Append(-1, 'Close');
+    $bar->Append($file_menu, 'File');
+    return $bar;
+}
+
+sub get {
+    my $which_menu = shift;
+}
+
 
 1;

File lib/Kephra/App/Window.pm

 use strict;
 use warnings;
-require Wx;
+use Wx;
+use Kephra::App::Menu;
+use Kephra::App::TabBar;
+use Kephra::App::Panel::FileBrowser;
+use Kephra::App::Panel::TreeLib;
 
 package Kephra::App::Window;
 our @ISA = 'Wx::Frame';
 sub new {
     my( $class, $title ) = @_;
     my( $win ) = $class->SUPER::new ( undef, -1, $title, [-1,-1],[800, 600] );
+    $win->SetMenuBar( Kephra::App::Menu::main_bar() );
     my $panel = Wx::Panel->new( $win );
 
+
+
     my %sizer;
     $sizer{'panel'} = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
     $sizer{'main'} = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
     $sizer{'centercolumn'} = Wx::BoxSizer->new( &Wx::wxVERTICAL );
     $sizer{'rightcolumn'} = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
 
-    require Kephra::App::Panel::FileBrowser;
     #my $fb = Kephra::App::Panel::FileBrowser->new($panel);
 
-    require Kephra::App::TabBar;
     my $nb = Kephra::App::TabBar->new($panel);
 
-    require Kephra::App::Panel::TreeLib;
     #my $tl = Kephra::App::Panel::TreeLib->new($panel);