Herbert Breunung avatar Herbert Breunung committed 739c9a2

move some now broken examples from sp1 to sp2

Comments (0)

Files changed (3)

+use v5.12;
+use warnings;
+
+package Kephra;
+BEGIN {
+        our $NAME = __PACKAGE__;
+        our $VERSION = 'sp1';
+}
+
+package Kephra::App;
+use Wx;
+use Kephra::API;
+use Kephra::App::Bar::Document;
+use Kephra::App::Dialog;
+use Kephra::App::Editor;
+use Kephra::App::Frame;
+use Kephra::Log;
+use Kephra::File;
+use base qw(Wx::App);
+our $_ref;
+
+sub OnInit {
+        my $app  = $_ref = shift;
+        Kephra::Log::off(); 
+        my $win = Kephra::App::Frame->new( 'DBD - docbar demo' );
+        my $db = Kephra::App::Bar::Document->new($win);
+
+        Kephra::File::new();
+        Kephra::API::focus( Kephra::API::document()->panel );
+        my $doc = Kephra::API::document();
+
+        $win->Center();
+        $win->Show(1);
+        $app->SetTopWindow($win);
+        1;
+}
+
+
+package main;
+Kephra::App->new->MainLoop;
+use v5.12;
+use warnings;
+use FindBin;
+BEGIN { unshift @INC, $FindBin::Bin, '.' }
+
+
+package Kephra;
+BEGIN {
+	our $NAME = __PACKAGE__;
+	our $VERSION = 'sp1';
+}
+
+package Kephra::App;
+use Wx;
+use Kephra::API;
+use Kephra::App::Bar::Document;
+use Kephra::App::Dialog;
+use Kephra::App::Editor;
+use Kephra::App::Frame;
+use Kephra::App::Splitter;
+use Kephra::App::Part::Editor;
+use Kephra::File;
+use Kephra::Log;
+
+use base qw(Wx::App);
+our $_ref;
+
+sub OnInit {
+	my $app  = $_ref = shift;
+	Kephra::Log::off(); 
+	my $win = Kephra::App::Frame->new( 'DDD - double docbar demo' );
+	#my $win = Wx::Frame->new(undef, -1, '');
+	my $ep = Kephra::App::Part::Editor->new($win);
+	Kephra::File::new();
+
+	$win->Center();
+	$win->Show(1);
+	$app->SetTopWindow($win);
+	1;
+}
+
+
+package main;
+Kephra::App->new->MainLoop;
+use strict;
+use warnings;
+
+package Kephra::App::Window;
+use Wx;
+use Wx::AUI;
+use Wx::STC;
+use Kephra::API;
+use Kephra::App::Bar::Document;
+use Kephra::App::Editor;
+use Kephra::App::Splitter;
+use Kephra::File;
+use base qw(Wx::App);
+
+sub OnInit {
+	my $app   = shift;
+	$Kephra::Log::test_mode = 1; 
+	my $win = Wx::Frame->new( undef, -1, 'Splitter Demo',[-1, -1],[600, 600]);
+
+	my $ed  = Kephra::App::Editor->new($win)->unmount_events();
+	my $ed2 = Kephra::App::Editor->new($win)->unmount_events();
+	$ed2->SetDocPointer( $ed->GetDocPointer() );
+
+	my $splitter = Kephra::App::Splitter->new
+		({parent => $win, left => $ed, right => $ed2, dominant_child => 'left'});
+	Kephra::App::Focus::set($ed);
+
+	Wx::Event::EVT_SET_FOCUS ($ed,  sub { $splitter->set({dominant_child => 'left', split => 'keep'});$_[1]->Skip });
+	Wx::Event::EVT_SET_FOCUS ($ed2, sub { $splitter->set({dominant_child => 'right', split => 'keep'}); $_[1]->Skip });
+	Wx::Event::EVT_LEFT_DOWN ($ed,  sub { Kephra::App::Focus::set($ed); $_[1]->Skip });
+	Wx::Event::EVT_LEFT_DOWN ($ed2, sub { Kephra::App::Focus::set($ed2); $_[1]->Skip });
+	Wx::Event::EVT_KEY_DOWN ($ed, sub {
+		my ($self, $event) = @_;
+		my $key = Kephra::API::KeyMap::keycode_from_event($event);
+		if   ($key ==        &Wx::WXK_F2) { $splitter->toggle_split() }
+		elsif($key == 2000 + &Wx::WXK_TAB){ Kephra::App::Focus::set($ed2) }
+		else {$event->Skip}
+	});
+	Wx::Event::EVT_KEY_DOWN ($ed2, sub {
+		my ($self, $event) = @_;
+		my $key = Kephra::API::KeyMap::keycode_from_event($event);
+		if   ($key ==        &Wx::WXK_F2) { $splitter->toggle_split() }
+		elsif($key == 2000 + &Wx::WXK_TAB){ Kephra::App::Focus::set($ed) }
+		else {$event->Skip}
+	});
+
+	$win->Center();
+	$win->Show(1);
+	$app->SetTopWindow($win);
+	1;
+}
+
+
+package main;
+Kephra::App::Window->new->MainLoop;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.