| 68 | | '.' => Wx::gettext('Any character except a newline'), |
| 69 | | '\d' => Wx::gettext('Any decimal digit'), |
| 70 | | '\D' => Wx::gettext('Any non-digit'), |
| 71 | | '\s' => Wx::gettext('Any whitespace character'), |
| 72 | | '\S' => Wx::gettext('Any non-whitespace character'), |
| 73 | | '\w' => Wx::gettext('Any word character'), |
| 74 | | '\W' => Wx::gettext('Any non-word character'), |
| | 68 | '00.' => Wx::gettext('Any character except a newline'), |
| | 69 | '01\d' => Wx::gettext('Any decimal digit'), |
| | 70 | '02\D' => Wx::gettext('Any non-digit'), |
| | 71 | '03\s' => Wx::gettext('Any whitespace character'), |
| | 72 | '04\S' => Wx::gettext('Any non-whitespace character'), |
| | 73 | '05\w' => Wx::gettext('Any word character'), |
| | 74 | '06\W' => Wx::gettext('Any non-word character'), |
| | 75 | } |
| | 76 | }, |
| | 77 | '01' => { |
| | 78 | label => Wx::gettext('Quantifiers'), |
| | 79 | value => { |
| | 80 | '00*' => Wx::gettext('Zero or more of the preceding block'), |
| | 81 | '01+' => Wx::gettext('One or more of the preceding block'), |
| | 82 | '02?' => Wx::gettext('Zero or one of the preceding block'), |
| | 83 | '03{m}' => Wx::gettext('Exactly m of the preceding block'), |
| | 84 | '04{m,n}' => Wx::gettext('m to n of the preceding block'), |
| 80 | | '*' => Wx::gettext('Zero or more of the preceding block'), |
| 81 | | '+' => Wx::gettext('One or more of the preceding block'), |
| 82 | | '?' => Wx::gettext('Zero or one of the preceding block'), |
| 83 | | '{m}' => Wx::gettext('Exactly m of the preceding block'), |
| 84 | | '{m,n}' => Wx::gettext('m to n of the preceding block'), |
| | 90 | '00|' => Wx::gettext('Alternation'), |
| | 91 | '01[ ]' => Wx::gettext('Character set'), |
| | 92 | '02^' => Wx::gettext('Beginning of line'), |
| | 93 | '03$' => Wx::gettext('End of line'), |
| | 94 | '04\b' => Wx::gettext('A word boundary'), |
| | 95 | '05\B' => Wx::gettext('Not a word boundary'), |
| 88 | | label => Wx::gettext('Miscellaneous'), |
| 89 | | value => { |
| 90 | | '|' => Wx::gettext('Alternation'), |
| 91 | | '[ ]' => Wx::gettext('Character set'), |
| 92 | | '^' => Wx::gettext('Beginning of line'), |
| 93 | | '$' => Wx::gettext('End of line'), |
| 94 | | '\b' => Wx::gettext('A word boundary'), |
| 95 | | '\B' => Wx::gettext('Not a word boundary'), |
| 96 | | } |
| 97 | | }, |
| 98 | | '04' => { |
| 101 | | '( )' => Wx::gettext('A group'), |
| 102 | | '(?: )' => Wx::gettext('Non-capturing group'), |
| 103 | | '(?= )' => Wx::gettext('Positive lookahead assertion'), |
| 104 | | '(?! )' => Wx::gettext('Negative lookahead assertion'), |
| 105 | | '\n' => Wx::gettext('Backreference to the nth group'), |
| | 101 | '00( )' => Wx::gettext('A group'), |
| | 102 | '01(?: )' => Wx::gettext('Non-capturing group'), |
| | 103 | '02(?= )' => Wx::gettext('Positive lookahead assertion'), |
| | 104 | '03(?! )' => Wx::gettext('Negative lookahead assertion'), |
| | 105 | '04\n' => Wx::gettext('Backreference to the nth group'), |
| 160 | | # $self->{menu}->Append( -1, $subgroup{label} ); |
| 161 | | # $self->{menu}->AppendSeparator(); |
| 162 | | # my $subgroup_value = $subgroup{value}; |
| 163 | | # foreach my $name (keys %subgroup_value) { |
| 164 | | # my $menu_item = $self->{menu}->Append( -1, $subgroup_value{$name} ); |
| 165 | | # $self->{menu}->AppendSeparator(); |
| 166 | | # } |
| 167 | | } |
| 168 | | |
| 169 | | # Wx::Event::EVT_MENU( |
| 170 | | # $self, |
| 171 | | # $self->{menu}, |
| 172 | | # sub { |
| 173 | | # }, |
| 174 | | # ); |
| | 159 | my $menu_name = $code . '_menu'; |
| | 160 | $self->{$menu_name} = Wx::Menu->new; |
| | 161 | my %sub_group_value = %{$sub_group{value}}; |
| | 162 | foreach my $element (sort keys %sub_group_value) { |
| | 163 | my $label = $element; |
| | 164 | $label =~ s/^\d{2}//; |
| | 165 | $self->{$menu_name}->Append( |
| | 166 | -1, $label . "\t" . $sub_group_value{$element} ); |
| | 167 | } |
| | 168 | } |
| | 237 | |
| | 238 | my %regex_groups = $self->_regex_groups; |
| | 239 | foreach my $code ( keys %regex_groups ) { |
| | 240 | my %sub_group = %{ $regex_groups{$code} }; |
| | 241 | my $button_name = $code . '_button'; |
| | 242 | my $menu_name = $code . '_menu'; |
| | 243 | Wx::Event::EVT_BUTTON( |
| | 244 | $self, |
| | 245 | $self->{$button_name}, |
| | 246 | sub { |
| | 247 | my @pos = $self->{$button_name}->GetPositionXY; |
| | 248 | my @size = $self->{$button_name}->GetSizeWH; |
| | 249 | $self->PopupMenu($self->{$menu_name}, $pos[0], $pos[1] + $size[1]); |
| | 250 | }, |
| | 251 | ); |
| | 252 | } |
| | 253 | |
| | 254 | # Wx::Event::EVT_MENU( |
| | 255 | # $self, |
| | 256 | # $self->{menu}, |
| | 257 | # sub { |
| | 258 | # }, |
| | 259 | # ); |