Commits

Herbert Breunung committed 93db458

put panel under entire design

Comments (0)

Files changed (2)

lib/Kephra/App/Helper.pm

     else          { return $method_ref[0] }
 }
 
-sub is_a_wiget {
+sub is_a_widget {
     return 0 unless $_[0]
              and substr( ref $_[0], 0, 4 ) eq 'Wx::';
              and $_[0]->isa('Wx::Control');
 
 sub put_on_panel {
     my $widget = shift;
-    return 0 unless is_a_wiget($widget);
+    return 0 unless is_a_widget($widget);
     my $sizer = Wx::BoxSizer->new(&Wx::wxVERTICAL);;
     $sizer->Add( $widget, 1, &Wx::wxGROW );
     my $panel = Wx::Panel->new( $this );
     return $panel;
 }
 
+sub is_a_color {
+    return 0 unless $_[0]
+             and substr( ref $_[0], 0, 4 ) eq 'Wx::';
+             and $_[0]->isa('Wx::Colour');
+    return 1;
+}
+
 sub make_color_object {
     my ($r,$g,$b) = @_;
     unless (defined $g){

lib/Kephra/App/Window.pm

     my( $win ) = $class->SUPER::new (      # create window with the super class
         undef, -1, $title, [-1,-1],[700, 500]
     );
-    #my $panel = Wx::Panel->new( $this );
-    
+
     my %sizer;
+    $sizer{'panel'} = Wx::BoxSizer->new(&Wx::wxHORIZONTAL);
     $sizer{'main'} = Wx::BoxSizer->new(&Wx::wxHORIZONTAL);
     $sizer{'leftcolumn'} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
     $sizer{'centercolumn'} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
 
     $sizer{'main'}->Add($sizer{'centercolumn'}, 1, &Wx::wxGROW);
     $sizer{'centercolumn'}->Add($nb, 1, &Wx::wxGROW);
-    $win->SetSizer( $sizer{'main'});
+
+    my $panel = Wx::Panel->new( $this );
+    $sizer{'panel'}->Add( $panel, 1, &Wx::wxGROW );
+    $panel->SetSizer( $sizer{'main'});
+    $win->SetSizer( $sizer{'panel'});
 
     #Wx::Event::EVT_CLOSE($frame, sub{$frame->Close; $_[1]->Skip });