~ubuntu-branches/ubuntu/wily/padre/wily

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/Menu/Window.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2009-08-12 14:44:55 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090812144455-yvk90oa92khfcnls
Tags: 0.42-1
* New Upstream Version
  + add explicit dependency on libtest-simple-perl (>= 0.88)
  + rules: use dh --with quilt (and bump quilt build-dependency to 0.46-7)
  + rules: no need to re-generate .mo files from .po. Upstream does it now
  + copyright: describe share/icons/padre/16x16/logo.png
    - describe share/icons/padre/16x16/toggle-comments.png
    - Padre license is the same as Perl (i.e. not Perl 5)
    - update list of copright holders
    - also list translators
  + drop libtest-most-perl from build-dependencies
  + add liblocale-msgfmt-perl to build-dependencies
  + add libcapture-tiny-perl to (build-)dependencies
  + add libfile-remove-perl (>= 1.42) to (build-)dependencies
  + drop libmodule-inspector-perl from (build-)dependencies
  + add libppix-editortools-perl to (build-)dependencies
  + add libparse-exuberantctags-perl to (build-)dependencies
  + patches:
    - drop lower-wx-requirement-to-2.8.7.patch and replace it with
      SKIP_WXWIDGETS_VERSION_CHECK=1 when configuring
      adjust README.debian accordingly
    - refresh disable-tcp-server.patch
    - drop don't-require-new-file-path.patch (applied upstream)
    - rework fix-pod2-errors.patch (new release, new errors :))
* add fix-perl-interpreter-path.patch fixing the path to the perl interpreter
  in three examples (thanks lintian)
* add more lintian overrides about script-not-executable for scripts that are
  treated as examples/templates
* add fix-whatis.patch fixing the whatis entry of Padre::Wx
* add menu and .desktop file

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
use Padre::Wx::Menu ();
10
10
use Padre::Current qw{_CURRENT};
11
11
 
12
 
our $VERSION = '0.36';
 
12
our $VERSION = '0.42';
13
13
our @ISA     = 'Padre::Wx::Menu';
14
14
 
15
15
#####################################################################
27
27
        $self->{alt}  = [];
28
28
 
29
29
        # Split Window
30
 
        Wx::Event::EVT_MENU(
31
 
                $main,
32
 
                $self->Append(
33
 
                        -1,
34
 
                        Wx::gettext("&Split window")
35
 
                ),
36
 
                sub {
 
30
        $self->{window_split_window} = $self->add_menu_item(
 
31
                $self,
 
32
                name       => 'window.split_window',
 
33
                label      => Wx::gettext('&Split window'),
 
34
                menu_event => sub {
37
35
                        Padre::Wx::Main::on_split_window(@_);
38
36
                },
39
37
        );
41
39
        $self->AppendSeparator;
42
40
 
43
41
        # File Navigation
44
 
        Wx::Event::EVT_MENU(
45
 
                $main,
46
 
                $self->Append(
47
 
                        -1,
48
 
                        Wx::gettext("Next File\tCtrl-TAB")
49
 
                ),
50
 
                sub {
 
42
        $self->{window_next_file} = $self->add_menu_item(
 
43
                $self,
 
44
                name       => 'window.next_file',
 
45
                label      => Wx::gettext('Next File'),
 
46
                shortcut   => 'Ctrl-TAB',
 
47
                menu_event => sub {
51
48
                        Padre::Wx::Main::on_next_pane(@_);
52
49
                },
53
50
        );
54
51
 
55
 
        Wx::Event::EVT_MENU(
56
 
                $main,
57
 
                $self->Append(
58
 
                        -1,
59
 
                        Wx::gettext("Previous File\tCtrl-Shift-TAB")
60
 
                ),
61
 
                sub {
 
52
        $self->{window_previous_file} = $self->add_menu_item(
 
53
                $self,
 
54
                name       => 'window.previous_file',
 
55
                label      => Wx::gettext('Previous File'),
 
56
                shortcut   => 'Ctrl-Shift-TAB',
 
57
                menu_event => sub {
62
58
                        Padre::Wx::Main::on_prev_pane(@_);
63
59
                },
64
60
        );
65
61
 
66
 
        Wx::Event::EVT_MENU(
67
 
                $main,
68
 
                $self->Append(
69
 
                        -1,
70
 
                        Wx::gettext("Last Visited File\tCtrl-6")
71
 
                ),
72
 
                sub {
 
62
        $self->{window_last_visited_file} = $self->add_menu_item(
 
63
                $self,
 
64
                name       => 'window.last_visited_file',
 
65
                label      => Wx::gettext('Last Visited File'),
 
66
                shortcut   => 'Ctrl-Shift-P',
 
67
                menu_event => sub {
73
68
                        Padre::Wx::Main::on_last_visited_pane(@_);
74
69
                },
75
70
        );
76
71
 
77
 
        Wx::Event::EVT_MENU(
78
 
                $main,
79
 
                $self->Append(
80
 
                        -1,
81
 
                        Wx::gettext("Right Click\tAlt-/")
82
 
                ),
83
 
                sub {
 
72
        $self->{window_right_click} = $self->add_menu_item(
 
73
                $self,
 
74
                name       => 'window.right_click',
 
75
                label      => Wx::gettext('Right Click'),
 
76
                shortcut   => 'Alt-/',
 
77
                menu_event => sub {
84
78
                        my $editor = $_[0]->current->editor;
85
79
                        if ($editor) {
86
80
                                $editor->on_right_down( $_[1] );
91
85
        $self->AppendSeparator;
92
86
 
93
87
        # Window Navigation
94
 
        Wx::Event::EVT_MENU(
95
 
                $main,
96
 
                $self->Append(
97
 
                        -1,
98
 
                        Wx::gettext("GoTo Subs Window")
99
 
                ),
100
 
                sub {
 
88
        $self->{window_goto_subs_window} = $self->add_menu_item(
 
89
                $self,
 
90
                name       => 'window.goto_subs_window',
 
91
                label      => Wx::gettext('GoTo Subs Window'),
 
92
                menu_event => sub {
101
93
                        $_[0]->refresh_functions( $_[0]->current );
102
94
                        $_[0]->show_functions(1);
103
95
                        $_[0]->functions->SetFocus;
104
96
                },
105
97
        );
106
98
 
107
 
        Wx::Event::EVT_MENU(
108
 
                $main,
109
 
                $self->Append(
110
 
                        -1,
111
 
                        Wx::gettext("GoTo Outline Window\tAlt-L")
112
 
                ),
113
 
                sub {
 
99
        $self->{window_goto_outline_window} = $self->add_menu_item(
 
100
                $self,
 
101
                name       => 'window.goto_outline_window',
 
102
                label      => Wx::gettext('GoTo Outline Window'),
 
103
                shortcut   => 'Alt-L',
 
104
                menu_event => sub {
114
105
                        $_[0]->show_outline(1);
115
106
                        $_[0]->outline->SetFocus;
116
107
                },
117
108
        );
118
109
 
119
 
        Wx::Event::EVT_MENU(
120
 
                $main,
121
 
                $self->Append(
122
 
                        -1,
123
 
                        Wx::gettext("GoTo Output Window\tAlt-O")
124
 
                ),
125
 
                sub {
 
110
        $self->{window_goto_outline_window} = $self->add_menu_item(
 
111
                $self,
 
112
                name       => 'window.goto_output_window',
 
113
                label      => Wx::gettext('GoTo Output Window'),
 
114
                shortcut   => 'Alt-O',
 
115
                menu_event => sub {
126
116
                        $_[0]->show_output(1);
127
117
                        $_[0]->output->SetFocus;
128
118
                },
129
119
        );
130
120
 
131
 
        $self->{goto_syntax_check} = $self->Append(
132
 
                -1,
133
 
                Wx::gettext("GoTo Syntax Check Window\tAlt-C")
134
 
        );
135
 
        Wx::Event::EVT_MENU(
136
 
                $main,
137
 
                $self->{goto_syntax_check},
138
 
                sub {
 
121
        $self->{window_goto_syntax_check_window} = $self->add_menu_item(
 
122
                $self,
 
123
                name       => 'window.goto_syntax_check_window',
 
124
                label      => Wx::gettext('GoTo Syntax Check Window'),
 
125
                shortcut   => 'Alt-C',
 
126
                menu_event => sub {
139
127
                        $_[0]->show_syntax(1);
140
128
                        $_[0]->syntax->SetFocus;
141
129
                },
142
130
        );
143
131
 
144
 
        Wx::Event::EVT_MENU(
145
 
                $main,
146
 
                $self->Append(
147
 
                        -1,
148
 
                        Wx::gettext("GoTo Main Window\tAlt-M")
149
 
                ),
150
 
                sub {
 
132
        $self->{window_goto_main_window} = $self->add_menu_item(
 
133
                $self,
 
134
                name       => 'window.goto_main_window',
 
135
                label      => Wx::gettext('GoTo Main Window'),
 
136
                shortcut   => 'Alt-M',
 
137
                menu_event => sub {
151
138
                        my $editor = $_[0]->current->editor or return;
152
139
                        $editor->SetFocus;
153
140
                },
200
187
                        $self->Destroy( delete $self->{separator} );
201
188
                }
202
189
        }
 
190
        $self->{window_split_window}->Enable($pages);
 
191
        $self->{window_next_file}->Enable($pages);
 
192
        $self->{window_previous_file}->Enable($pages);
 
193
        $self->{window_last_visited_file}->Enable($pages);
 
194
        $self->{window_right_click}->Enable($pages);
203
195
 
204
196
        # Update the labels to match the notebooks
205
 
        my $config_shorten_path = 1;    # TODO should be configurable ?
 
197
        my $config_shorten_path = 1; # TODO should be configurable ?
206
198
        my $prefix_length       = 0;
207
199
        if ($config_shorten_path) {
208
200
                $prefix_length = length get_common_prefix( $#$alt, $notebook );