line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::ebug::Wx::Command::Standard; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1968
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use Devel::ebug::Wx::Plugin qw(:plugin); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
137
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
409
|
use Wx qw(wxOK wxVERSION_STRING); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub commands : Command { |
9
|
|
|
|
|
|
|
return |
10
|
|
|
|
|
|
|
( file_menu => { tag => 'file', |
11
|
|
|
|
|
|
|
label => 'File', |
12
|
|
|
|
|
|
|
priority => 0, |
13
|
|
|
|
|
|
|
}, |
14
|
|
|
|
|
|
|
help_menu => { tag => 'help', |
15
|
|
|
|
|
|
|
label => 'Help', |
16
|
|
|
|
|
|
|
priority => 10000, |
17
|
|
|
|
|
|
|
}, |
18
|
|
|
|
|
|
|
load_file => { sub => \&load_file, |
19
|
|
|
|
|
|
|
menu => 'file', |
20
|
|
|
|
|
|
|
label => 'Load file', |
21
|
|
|
|
|
|
|
priority => 10, |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
quit => { sub => \&quit, |
24
|
|
|
|
|
|
|
menu => 'file', |
25
|
|
|
|
|
|
|
label => 'Exit', |
26
|
|
|
|
|
|
|
priority => 1000, |
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
about => { sub => \&about, |
29
|
|
|
|
|
|
|
menu => 'help', |
30
|
|
|
|
|
|
|
label => 'About...', |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub quit { |
36
|
|
|
|
|
|
|
my( $wx ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$wx->Close; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub about { |
42
|
|
|
|
|
|
|
my( $wx ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $message = sprintf <
|
45
|
|
|
|
|
|
|
ebug_wx %s, (c) 2007 Mattia Barbon |
46
|
|
|
|
|
|
|
wxPerl %s, %s |
47
|
|
|
|
|
|
|
EOT |
48
|
|
|
|
|
|
|
Devel::ebug::Wx->VERSION, $Wx::VERSION, wxVERSION_STRING; |
49
|
|
|
|
|
|
|
Wx::MessageBox( $message, "About wxebug", wxOK, $wx ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub load_file { |
53
|
|
|
|
|
|
|
my( $wx ) = @_; |
54
|
|
|
|
|
|
|
# FIXME better file selector, add arguments |
55
|
|
|
|
|
|
|
my $file = Wx::FileSelector( "Select a Perl file" ); |
56
|
|
|
|
|
|
|
if( defined $file ) { |
57
|
|
|
|
|
|
|
$wx->ebug->load_program( [ $file ] ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |