Commits

Herbert Breunung  committed 4d6a1ff

moce default main menu in its fiel and use it

  • Participants
  • Parent commits 3df5730

Comments (0)

Files changed (3)

File lib/Kephra/App/Bar/Menu.pm

 
 use Kephra::API;
 use Kephra::File;
+use Kephra::Config::Default;
 
 package Kephra::App::Bar::Menu;
 
 sub get {
     my $bar = Wx::MenuBar->new();
+    
+    my $menu = Kephra::Config::Default::mainmenu;
+    my $win = Kephra::API::widget('main_window');
+
     my $file_menu = Wx::Menu->new();
     my $mi = $file_menu->Append( 1000, "New\tCtrl+N");
     #$mi->SetText("New\tCtrl+N´");
     $help_menu->Append( 8003, 'Info');
     $bar->Append($help_menu, 'Help');
 
-    my $win = Kephra::API::widget('main_window');
     #print "--- $win", keys %$win;
     Wx::Event::EVT_MENU( $win, 1000, sub { Kephra::File::new() } );
     Wx::Event::EVT_MENU( $win, 1010, sub { Kephra::App::exit() } );
 
 __END__
 
-[menu_file => [
-    file_open,
-    file_save,
-    file_close,
-    ,
-    app_close_save,
-],],
-[menu_config => [
-    config_dialog,
-],],
-[menu_help => [
-    help_documentation,
-    help_goto_website,
-    help_goto_bugreport,
-    help_info_dialog,
-],]
-
 
 file_open => {
    call  => '',
    state => '',
    event => '',
    label => 'Open',
+   help  => 'open one ore multiple files',
    keys  => 'Ctrl + O',
    icon  => '',
 },

File lib/Kephra/Config/Default.pm

 }
 sub commandlist {}
 sub localisation {}
-sub mainmenu {}
+sub mainmenu {
+	require Kephra::Config::Default::MainMenu;
+	return Kephra::Config::Default::MainMenu::get();
+}
 sub maintoolbar {}
 sub statusbar {}
 

File lib/Kephra/Config/Default/MainMenu.pm

+use strict;
+use warnings;
+
+package Kephra::Config::Default::MainMenu;
+
+sub get {
+	return [
+		[menu_file => [
+			'file_open',
+			'file_save',
+			'file_close',
+			,
+			'app_close_save',
+		],],
+		[menu_config => [
+			'config_dialog',
+		],],
+		[menu_help => [
+			'help_documentation',
+			'help_goto_homepage',
+			'help_goto_bugreport',
+			'help_info_dialog',
+		],]
+	];
+}
+
+1;