Commits

Herbert Breunung committed 4f12df5

building up toolbar prototype

Comments (0)

Files changed (1)

 
 sub OnInit {
 	my $app   = shift;
-	my $win = Wx::Frame->new( undef, -1, 'Splitter Demo',[-1, -1],[600, 600]);
+	$Kephra::Log::test_mode = 1; 
+	my $win = Wx::Frame->new( undef, -1, 'Toolbar Demo',[-1, -1],[600, 600]);
 
-	my $ed  = Kephra::App::Editor->new($win);
-	my $ed2 = Kephra::App::Editor->new($win);
-	$ed2->SetDocPointer( $ed->GetDocPointer() );
 
-	my $splitter = Kephra::App::Splitter->new({parent => $win, left => $ed, right => $ed2});
+	my $ed  = Kephra::App::Editor->new($win)->unmount_events();
+	my $left = Bar->new($win);
+	my $right = Bar->new($win);
+
 	Kephra::App::Focus::set($ed);
 
-	Wx::Event::EVT_KEY_DOWN ($ed, sub {
-		my ($ed, $event) = @_;
-		my $key = Kephra::KeyMap::keycode_from_event($event);
-		if ($key == &Wx::WXK_F2){ $splitter->toggle_split() }
-		else {$event->Skip}
-	});
+	my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );
+	$sizer->Add($left,  0, &Wx::wxGROW);
+	$sizer->Add($ed,    1, &Wx::wxGROW);
+	$sizer->Add($right, 0, &Wx::wxGROW);
+	$win->SetSizer($sizer);
+
 
 	$win->Center();
 	$win->Show(1);
 	1;
 }
 
+package Bar;
+our @ISA = 'Wx::ToolBar';
+
+
+sub new {
+	my $class = shift;
+	my $parent = shift;
+	my $self = $class->SUPER::new( $parent, -1, [-1,-1], [-1,-1], &Wx::wxTB_TEXT | &Wx::wxTB_VERTICAL);
+	
+	$self->Realize;
+	$self;
+}
+
 
 package main;
 Kephra::App::Window->new->MainLoop;