Commits

Herbert Breunung committed 130b420

command call option for command groups and filled command module arrays in Kephra.pm

Comments (0)

Files changed (6)

 our @used_wx_modules = qw/Wx::AUI Wx::DND Wx::RichText/; # Wx::STC
 
 our @needed_at_first = qw/App API/;
-our @starttime_modules = qw/App App::Util API Config Config::Default Config::File Document DocumentStash CommandList Edit EventTable File PluginRegistrar SandrumInterpreter Works/;
-our @runtime_namespaces = qw/App::Dialog Config::Default EventTable PluginRegistrar/;
-our @command_modules = qw/App::Window File/;
+our @starttime_modules = qw/
+	App App::Util API Config Config::Default Config::File
+	Document DocumentStash CommandList Edit EventTable 
+	File PluginRegistrar SandrumInterpreter Works/;
+our @runtime_namespaces = qw/App::Dialog Config::Default/;
+our @command_modules = 
+	qw/App App::Panel::Editor App::Panel::FileBrowser App::Panel::IOUnit
+	App::Panel::OrgPad App::Panel::ProjectManager App::Panel::SratchSheet
+	App::Panel::TextLab App::Panel::TreeLib
+	CommandList Config 
+	Edit File EventTable PluginRegistrar SandrumInterpreter/;
 our @oop_interfaces = qw/App::Editor App::Bar::Document Document/;
 
 sub start {

lib/Kephra/App/Editor.pm

 #use Wx::DND;
 #use Wx::STC;
 use Wx::Scintilla;
+
 use Kephra::App::Util;
+use Kephra::Edit;
 
 package Kephra::App::Editor;
 #our @ISA = 'Wx::StyledTextCtrl';
 	#Wx::Event::EVT_STC_AUTOCOMP_SELECTION(id, sub{})
 }
 
-sub focus {  Wx::Window::SetFocus( $_[0] ) }
-
 sub set_margin {
 	my ($self, $style) = @_;
 	$style = 'default' unless defined $style;
 	$self->StyleSetFont( &Wx::wxSTC_STYLE_DEFAULT, $wx_font ) if $wx_font->Ok > 0;
 }
 
+sub focus {  Wx::Window::SetFocus( $_[0] ) }
+
 sub set_perlhighlight {
 	my ($self) = @_;
 	$self->StyleClearAll;

lib/Kephra/App/Panel/Editor.pm

 my %doc_bar;
 #my $active;
 
-sub _active_docbar{ $doc_bar{'leftup'} }
+sub active_docbar{ $doc_bar{'leftup'} }
 
 sub new {
 	my( $class, $parent) = @_;
 	my $file = shift;
 	my $doc = Kephra::API::active_document();
 	my $win = Kephra::API::widget('main_window');
-	my $main_doc_bar = _active_docbar();
+	my $main_doc_bar = active_docbar();
 
 	if ($doc and $doc->editor->is_empty and $file) { # overwrite empty doc
 		$doc->assign_file($file);
 sub remove_document {
 	my $doc = shift;
 	return unless ref $doc and $doc->isa('Kephra::Document');
-	my $main_doc_bar = _active_docbar();
+	my $main_doc_bar = active_docbar();
 	if ($main_doc_bar->GetPageCount > 1) {
 		$main_doc_bar->remove_page( $main_doc_bar->GetPageIndex( $doc->editor ) );
 	} else {
 
 sub raise_file {
 	my $file = shift;
-	_active_docbar()->raise_panel( 
+	active_docbar()->raise_panel( 
 		Kephra::DocumentStash::doc_by_path($file)->{panel}
 	);
 }
-sub select_tab_leftmost {_active_docbar()->select_panel_leftmost }
-sub select_tab_rightmost{_active_docbar()->select_panel_rightmost }
-sub select_tab_left     {_active_docbar()->select_panel_left }
-sub select_tab_right    {_active_docbar()->select_panel_right }
-sub move_tab_leftmost   {_active_docbar()->move_panel_leftmost }
-sub move_tab_rightmost  {_active_docbar()->move_panel_rightmost }
-sub move_tab_left       {_active_docbar()->move_panel_left }
-sub move_tab_right      {_active_docbar()->move_panel_right }
+sub select_tab_leftmost {active_docbar()->select_panel_leftmost }
+sub select_tab_rightmost{active_docbar()->select_panel_rightmost }
+sub select_tab_left     {active_docbar()->select_panel_left }
+sub select_tab_right    {active_docbar()->select_panel_right }
+sub move_tab_leftmost   {active_docbar()->move_panel_leftmost }
+sub move_tab_rightmost  {active_docbar()->move_panel_rightmost }
+sub move_tab_left       {active_docbar()->move_panel_left }
+sub move_tab_right      {active_docbar()->move_panel_right }
 
 sub active_title {
-	my $nb = _active_docbar();
+	my $nb = active_docbar();
 	$nb->GetPageText( $nb->GetSelection );
 }
 
-1;
+1;

lib/Kephra/Config/Default/CommandList.pm

 			keys  => '',
 		},
 		'document-select-leftmost' => {
-			function  => 'Kephra::App::Panel::Editor::select_tab_leftmost()',
+			function  => 'Kephra::App::Panel::Editor::select_tab_leftmost',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-select-rightmost' => {
-			function  => 'Kephra::App::Panel::Editor::select_tab_rightmost()',
+			function  => 'Kephra::App::Panel::Editor::select_tab_rightmost',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-select-left' => {
-			function  => 'Kephra::App::Panel::Editor::select_tab_left()',
+			function  => 'Kephra::App::Panel::Editor::select_tab_left',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-select-right' => {
-			function  => 'Kephra::App::Panel::Editor::select_tab_right()',
+			function  => 'Kephra::App::Panel::Editor::select_tab_right',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-move-leftmost' => {
-			function  => 'Kephra::App::Panel::Editor::move_tab_leftmost()',
+			function  => 'Kephra::App::Panel::Editor::move_tab_leftmost',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-move-rightmost' => {
-			function  => 'Kephra::App::Panel::Editor::move_tab_rightmost()',
+			function  => 'Kephra::App::Panel::Editor::move_tab_rightmost',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-move-left' => {
-			function  => 'Kephra::App::Panel::Editor::move_tab_left()',
+			function  => 'Kephra::App::Panel::Editor::move_tab_left',
 			name => '',
 			help  => '',
 			keys  => '',
 		},
 		'document-move-right' => {
-			function  => 'Kephra::App::Panel::Editor::move_tab_right()',
+			function  => 'Kephra::App::Panel::Editor::move_tab_right',
 			name => '',
 			help  => '',
 			keys  => '',
 __END__
 
 file_new => {
-	callref   => compiled function
+	callref   => compiled function with maybe one option
 	function  => 'Kephra::File::new',
+	options   => [],
 	state     => '',
 	event     => '',
 	name      => 'New',

lib/Kephra/Document/Syntaxmode.pm

+use strict;
+use warnings;
+
+package Kephra::Document::Syntaxmode;
+
+
+
+1;

lib/Kephra/Edit.pm

 
 package Kephra::Edit;
 
+package Kephra::App::Editor;
+
+
 
 1;