Commits

Herbert Breunung committed 6ff280f

instert filebrowser visually

  • Participants
  • Parent commits b7ed2c6

Comments (0)

Files changed (6)

     qw/Benchmark Encode Encode::Guess /,
     qw/File::Find File::Spec File::UserConfig Config::General YAML::Tiny/,
     qw/PPI Moo/,
-    qw/Wx Wx::Perl::ProcessStream/
+    qw/Wx Wx::Perl::ProcessStream/, # Wx::Scintilla
 );
 our @used_wx_modules = qw/Wx::AUI Wx::STC/;
 

lib/Kephra/App/EditPanel.pm

 use strict;
 use warnings;
+require Wx;
 require Wx::STC;
+#require Wx::Scintilla;
 
 package Kephra::App::EditPanel;
 our @ISA = 'Wx::StyledTextCtrl';
+#our @ISA = 'Wx::ScintillaTextCtrl';
 
 require Kephra::App::Helper;
 my $mk_color = Kephra::App::Helper::get('make_color');
         $ep->SetMarginWidth(2,  0);
     }
     $ep->SetMargins(2, 2 );
+    $ep->SetScrollWidth(200);
 }
 
 sub set_colors {

lib/Kephra/App/Helper.pm

 sub put_on_panel {
     my $widget = shift;
     die "no widget given to __PACKAGE__::put_on_panel" unless is_widget($widget);
-
     my $panel = Wx::Panel->new( $widget->GetParent );
     $widget->Reparent( $panel );
     my $sizer = Wx::BoxSizer->new( &Wx::wxVERTICAL );

lib/Kephra/App/Panel/FileBrowser.pm

 use warnings;
 
 package Kephra::App::Panel::FileBrowser;
+our @ISA = 'Wx::ListCtrl';
+
+sub new {
+    my( $class, $parent) = @_;
+    my $fb = $class->SUPER::new($parent, -1);
+}
 
 
 1;

lib/Kephra/App/Window.pm

     $sizer{'centercolumn'} = Wx::BoxSizer->new( &Wx::wxVERTICAL );
     $sizer{'rightcolumn'} = Wx::BoxSizer->new( &Wx::wxHORIZONTAL );
 
+    require Kephra::App::Panel::FileBrowser;
+    my $fb = Kephra::App::Panel::FileBrowser->new($panel);
+    $sizer{'leftcolumn'}->Add($fb, 1, &Wx::wxGROW);
+
     require Kephra::App::TabBar;
     my $nb = Kephra::App::TabBar->new($panel);
     $sizer{'centercolumn'}->Add($nb, 1, &Wx::wxGROW);

t/100-apphelper.t

 my $testpanel = Kephra::App::Helper::get('is_panel');
 my $button = Wx::Button->new(undef,-1,'');
 my $panel = Wx::Panel->new(undef);
-is( $testpanel->($white), 0, 'can detect what is not a panel');
-is( $testpanel->($panel), 1, 'can detect panel');
+is( $testpanel->( $white ), 0, 'can detect what is not a panel');
+is( $testpanel->( $panel ), 1, 'can detect panel');
 is( $testpanel->( $popanel->($button) ), 1, 'can detect panel');
 
 exit(0);