line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::ebug::Wx::View::Output; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2062
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(Wx::Panel Devel::ebug::Wx::View::Base); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
768
|
|
5
|
|
|
|
|
|
|
use Devel::ebug::Wx::Plugin qw(:plugin); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_ro_accessors( qw(stdout stderr) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Wx qw(:textctrl :sizer); |
10
|
|
|
|
|
|
|
use Wx::Event qw(EVT_BUTTON); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub tag { 'output' } |
13
|
|
|
|
|
|
|
sub description { 'Console output' } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new : View { |
16
|
|
|
|
|
|
|
my( $class, $parent, $wxebug, $layout_state ) = @_; |
17
|
|
|
|
|
|
|
my $self = $class->SUPER::new( $parent, -1 ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$self->wxebug( $wxebug ); |
20
|
|
|
|
|
|
|
$self->{stdout} = Wx::TextCtrl->new( $self, -1, "", [-1,-1], [-1, -1], |
21
|
|
|
|
|
|
|
wxTE_MULTILINE|wxTE_READONLY ); |
22
|
|
|
|
|
|
|
$self->{stderr} = Wx::TextCtrl->new( $self, -1, "", [-1,-1], [-1,-1], |
23
|
|
|
|
|
|
|
wxTE_MULTILINE|wxTE_READONLY ); |
24
|
|
|
|
|
|
|
my $refresh = Wx::Button->new( $self, -1, 'Refresh' ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $sz = Wx::BoxSizer->new( wxVERTICAL ); |
27
|
|
|
|
|
|
|
my $f = Wx::BoxSizer->new( wxHORIZONTAL ); |
28
|
|
|
|
|
|
|
my $s = Wx::BoxSizer->new( wxHORIZONTAL ); |
29
|
|
|
|
|
|
|
$f->Add( Wx::StaticText->new( $self, -1, 'Standard output' ), 0, |
30
|
|
|
|
|
|
|
wxALIGN_CENTER_VERTICAL | wxALL, 2 ); |
31
|
|
|
|
|
|
|
$f->Add( $refresh, 0, wxALIGN_RIGHT, wxALL, 2 ); |
32
|
|
|
|
|
|
|
$sz->Add( $f, 0, wxGROW ); |
33
|
|
|
|
|
|
|
$sz->Add( $self->stdout, 1, wxGROW ); |
34
|
|
|
|
|
|
|
$s->Add( Wx::StaticText->new( $self, -1, 'Standard error' ), 0, |
35
|
|
|
|
|
|
|
wxALIGN_CENTER_VERTICAL | wxALL, 2 ); |
36
|
|
|
|
|
|
|
$sz->Add( $s, 0, wxGROW ); |
37
|
|
|
|
|
|
|
$sz->Add( $self->stderr, 1, wxGROW ); |
38
|
|
|
|
|
|
|
$self->SetSizer( $sz ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$self->load_output if $wxebug->ebug->is_running; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
EVT_BUTTON( $self, $refresh, sub { $self->load_output } ); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$self->set_layout_state( $layout_state ) if $layout_state; |
45
|
|
|
|
|
|
|
$self->register_view; |
46
|
|
|
|
|
|
|
$self->SetSize( $self->default_size ); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub load_output { |
52
|
|
|
|
|
|
|
my( $self ) = @_; |
53
|
|
|
|
|
|
|
my( $stdout, $stderr ) = $self->wxebug->ebug->output; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$self->stdout->SetValue( $stdout ); |
56
|
|
|
|
|
|
|
$self->stderr->SetValue( $stderr ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |