Commits

Herbert Breunung committed c8f0f29

unsplit now works once

  • Participants
  • Parent commits 64e5412
  • Branches sp2

Comments (0)

Files changed (3)

lib/ded/Kephra/App/DocBar.pm

 	$self->refresh_internal_page_order;
 }
 
+sub remove_all_pages {
+	my ($self) = @_;
+	$self->remove_page(0) while $self->GetPageCount;
+}
+
 
 sub Destroy {
 	my ($self) = @_;
 	#$_->del_instance($self) for Kephra::API::all_documents();
+	$self->remove_all_pages();
 	$self->SUPER::Destroy( );
 	1;
 }

lib/ded/Kephra/App/Part/Main.pm

 sub split {
 	my ($self) = @_;
 	if ($self->{'number'} < 2){
-		$self->{'doc_bar'}[$self->{'number'}] = Kephra::App::DocBar->new( $self );
+		$self->{'doc_bar'}[$self->{'number'}] = Kephra::App::DocBar->new( $self )
+			unless $self->{'doc_bar'}[$self->{'number'}];
 		Kephra::DocumentStash::add_doc_bar( $self->{'doc_bar'}[$self->{'number'}] );
 		$self->{'number'}++;
 	}
 	my ($self) = @_;
 
 	if ($self->{'number'} == 2){
+		#$self->{'splitter'}[0]->set({'left' => $self->{'doc_bar'}[0]});
 		$self->{'splitter'}[0]->unsplit();
-		$self->{'doc_bar'}[ 0 ]->Update;
-		#$self->{'splitter'}[0]->set({'left' => $self->{'doc_bar'}[0]});
-		#$self->{'splitter'}[0]->unsplit() if $self->{'splitter'}[0]->is_split();
-		#
+		$self->GetSizer->Layout;
 	} elsif ($self->{'number'} == 3){
 	} elsif ($self->{'number'} == 4){
 	}
 	if ($self->{'number'} > 1){
 		$self->{'number'}--;
 		Kephra::DocumentStash::remove_doc_bar( $self->{'doc_bar'}[ $self->{'number'} ] );
-		$self->{'doc_bar'}[ $self->{'number'} ]->Destroy;
+		$self->{'doc_bar'}[ $self->{'number'} ]->Destroy();
+		#delete $self->{'doc_bar'}[ $self->{'number'} ];
+		$self->{'active'} = 0 if $self->{'active'} == $self->{'number'};
 	}
 
 	focus_back();
 	my $bar = $self->active_doc_bar();
 	Kephra::DocumentStash::set_active_doc_by_panel( $bar->GetPage( $bar->GetSelection() ) );
 	focus( editor() );
-	#$self->active_doc_bar()->raise_page();
 }
 
 

lib/ded/Kephra/Log.pm

 
 sub msg_text{ 
 	my ($text, $name_parent) = @_;
-	my $msg = timestamp() . ' ' . calling_sub(3) . ': "'. $text.'"';
+	my $msg = timestamp() . ' ' . calling_sub(4) . ': "'. $text.'"';
 	$msg .= ', when called by '. calling_sub(3 + $name_parent) if $name_parent;
 	return $msg;
 }