Changeset 10471
- Timestamp:
- 02/02/10 13:41:54 (2 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/Wx/Dialog/RegexEditor.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Wx/Dialog/RegexEditor.pm
r10470 r10471 60 60 61 61 return ( 62 'Character Classes' => ( 63 '.' => Wx::gettext('Any character except a newline'), 64 '\d' => Wx::gettext('Any decimal digit'), 65 '\D' => Wx::gettext('Any non-digit'), 66 '\s' => Wx::gettext('Any whitespace character'), 67 '\S' => Wx::gettext('Any non-whitespace character'), 68 '\w' => Wx::gettext('Any word character'), 69 '\W' => Wx::gettext('Any non-word character'), 70 ), 71 'Quantifiers' => ( 72 '*' => Wx::gettext('Zero or more of the preceding block'), 73 '+' => Wx::gettext('One or more of the preceding block'), 74 '?' => Wx::gettext('Zero or one of the preceding block'), 75 '{m}' => Wx::gettext('Exactly m of the preceding block'), 76 '{m,n}' => Wx::gettext('m to n of the preceding block'), 77 ), 78 'Miscellaneous' => ( 79 '|' => Wx::gettext('Alternation'), 80 '[ ]' => 'Character set', 81 '^' => 'Beginning of line', 82 '$' => 'End of line', 83 '\b' => 'A word boundary', 84 '\B' => 'Not a word boundary', 85 ), 86 'Grouping constructs' => ( 87 '( )' => Wx::gettext('A group'), 88 '(?: )' => 'Non-capturing group', 89 '(?= )' => 'Positive lookahead assertion', 90 '(?! )' => 'Negative lookahead assertion', 91 '\n' => 'Backreference to the nth group', 92 ) 62 '01' => { 63 label => Wx::gettext('Character Classes'), 64 value => { 65 '.' => Wx::gettext('Any character except a newline'), 66 '\d' => Wx::gettext('Any decimal digit'), 67 '\D' => Wx::gettext('Any non-digit'), 68 '\s' => Wx::gettext('Any whitespace character'), 69 '\S' => Wx::gettext('Any non-whitespace character'), 70 '\w' => Wx::gettext('Any word character'), 71 '\W' => Wx::gettext('Any non-word character'), 72 } 73 }, 74 '02' => { 75 label => Wx::gettext('Quantifiers'), 76 value => { 77 '*' => Wx::gettext('Zero or more of the preceding block'), 78 '+' => Wx::gettext('One or more of the preceding block'), 79 '?' => Wx::gettext('Zero or one of the preceding block'), 80 '{m}' => Wx::gettext('Exactly m of the preceding block'), 81 '{m,n}' => Wx::gettext('m to n of the preceding block'), 82 } 83 }, 84 '03' => { 85 label => Wx::gettext('Miscellaneous'), 86 value => { 87 '|' => Wx::gettext('Alternation'), 88 '[ ]' => Wx::gettext('Character set'), 89 '^' => Wx::gettext('Beginning of line'), 90 '$' => Wx::gettext('End of line'), 91 '\b' => Wx::gettext('A word boundary'), 92 '\B' => Wx::gettext('Not a word boundary'), 93 } 94 }, 95 '04' => { 96 label => Wx::gettext('Grouping constructs'), 97 value => { 98 '( )' => Wx::gettext('A group'), 99 '(?: )' => Wx::gettext('Non-capturing group'), 100 '(?= )' => Wx::gettext('Positive lookahead assertion'), 101 '(?! )' => Wx::gettext('Negative lookahead assertion'), 102 '\n' => Wx::gettext('Backreference to the nth group'), 103 } 104 } 93 105 ); 94 106 } … … 134 146 } 135 147 148 $self->{menu} = Wx::Menu->new; 149 # my %regex_syntax = $self->_regex_syntax; 150 # foreach my $name (keys %regex_syntax) { 151 # my %subgroup = $regex_syntax{$name}; 152 # $self->{menu}->Append( -1, $subgroup{label} ); 153 # $self->{menu}->AppendSeparator(); 154 # my $subgroup_value = $subgroup{value}; 155 # foreach my $name (keys %subgroup_value) { 156 # my $menu_item = $self->{menu}->Append( -1, $subgroup_value{$name} ); 157 # $self->{menu}->AppendSeparator(); 158 # } 159 # } 160 # Wx::Event::EVT_MENU( 161 # $self, 162 # $self->{menu}, 163 # sub { 164 # }, 165 # ); 166 167 136 168 $self->{matching} = Wx::RadioButton->new( 137 169 $self, … … 143 175 -1, 144 176 'Substituting', 177 ); 178 179 $self->{button_menu} = Wx::Button->new( 180 $self, 181 -1, 182 Wx::gettext('&Insert'), 145 183 ); 146 184 … … 172 210 $left->Add( $modifiers, 0, Wx::wxALL | Wx::wxEXPAND, 1 ); 173 211 $left->Add( $operation, 0, Wx::wxALL | Wx::wxEXPAND, 1 ); 212 $left->Add( $self->{button_menu}, 0, Wx::wxALIGN_CENTER_HORIZONTAL, 1 ); 174 213 $left->Add( $regex_label, 0, Wx::wxALL | Wx::wxEXPAND, 1 ); 175 214 $left->Add( … … 212 251 my $self = shift; 213 252 253 Wx::Event::EVT_BUTTON( 254 $self, 255 $self->{button_menu}, 256 sub { 257 my ($self, $event) = @_; 258 $self->PopupMenu( $self->{menu}, 0, 0 ); 259 } 260 ); 214 261 Wx::Event::EVT_TEXT( 215 262 $self, … … 275 322 276 323 $self->Show; 277 }278 279 #280 # $self->button_match;281 #282 # handler called when the Match button has been clicked.283 #284 sub button_match {285 my $self = shift;286 $self->run();287 return;288 324 } 289 325
Note: See TracChangeset
for help on using the changeset viewer.
