1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed 0af3d4a

switching tabbars works

  • Participants
  • Parent commits b9cfdfa
  • Branches sp1

Comments (0)

Files changed (3)

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

View file
  'docbar-select-right'    =>{sub=>'$docbar->select_page_right',    label=>'Next Tab',      keys=>'ctrl+pagedown'},
  #'docbar-select-leftmost'=>{sub=>'$docbar->select_page_leftmost', label=>'First Tab',     keys=>'ctrl+shift+pageup'},
  #'docbar-select-rightmost'=>{sub=>'$docbar->select_page_rightmost',label=>'Last Tab',      keys=>'ctrl+shift+pagedown'},
- 'docbar-move-left'       =>{sub=>'$docbar->move_page_left',       label=>'Move Left',     keys=>'alt+pageup'},
- 'docbar-move-right'      =>{sub=>'$docbar->move_page_right',      label=>'Move Right',    keys=>'alt+pagedown'},
+ 'docbar-move-left'       =>{sub=>'$docbar->move_page_left',       label=>'Move Left',     keys=>'ctrl+shift+pageup'},
+ 'docbar-move-right'      =>{sub=>'$docbar->move_page_right',      label=>'Move Right',    keys=>'ctrl+shift+pagedown'},
  #'docbar-move-leftmost'   =>{sub=>'$docbar->move_page_leftmost',   label=>'Move Leftmost', keys=>'alt+shift+pageup'},
  #'docbar-move-rightmost'  =>{sub=>'$docbar->move_page_rightmost',  label=>'Move Rightmost',keys=>'alt+shift+pagedown'},
 });

File lib/Kephra/App/Part/Editor.pm

View file
-use strict;
+use v5.10;
 use warnings;
 use Cwd;
 use File::Find;
 our @ISA = 'Kephra::App::Panel';
 my ($active_bar, @passive_bar, $panel);
 
+Kephra::API::Command::register({
+ 'docbar-prev' =>{sub=>'select_docbar_prev', label=>'Prev Docbar',  keys=>'alt+pageup'},
+ 'docbar-next' =>{sub=>'select_docbar_next', label=>'Next Docbar',  keys=>'alt+pagedown'},
+});
+
+
 sub docbar         { $active_bar }
 sub passive_docbars{ @passive_bar}
 sub all_docbars    { ($active_bar, @passive_bar) }
 	$self->append( \$splitter );
 	$splitter->resize('equal');
 
-	$active_bar = $db2;
-	@passive_bar = ($db);
+	$active_bar = $db;
+	@passive_bar = ($db2);
 
 	$self;
 }
 
-sub switch_bar {
+sub select_docbar_next {
+	push @passive_bar, $active_bar;
+	$active_bar = shift @passive_bar;
+	$active_bar->raise_page( $active_bar->GetSelection );
+}
+sub select_docbar_prev {
+	unshift @passive_bar, $active_bar;
+	$active_bar = pop @passive_bar;
+	$active_bar->raise_page( $active_bar->GetSelection );
+}
+
+sub switch_bar{
 	
 }
 

File lib/edpart.pl

View file
 	my $ep = Kephra::App::Part::Editor->new($win);
 
 	Kephra::File::new();
-	Kephra::API::focus( Kephra::API::document() );
-	my $doc = Kephra::API::document();
+	Kephra::API::focus( Kephra::API::editor() );
 
 	$win->Center();
 	$win->Show(1);