« blib/lib/App/Asciio/GTK/Asciio/stripes/editable_box2.pm
↑ Summary
blib/lib/App/Asciio/Options.pm »
| 1 | package App::Asciio::Actions::Shapes ; | ||
| 2 | |||
| 3 | use strict ; use warnings ; | ||
| 4 | |||
| 5 | use App::Asciio::Boxes ':const' ; | ||
| 6 | |||
| 7 | #---------------------------------------------------------------------------------------------- | ||
| 8 | |||
| 9 | sub context_menu | ||
| 10 | { | ||
| 11 | my ($self, $popup_x, $popup_y) = @_ ; | ||
| 12 | my @context_menu_entries ; | ||
| 13 | |||
| 14 | my @selected_elements = $self->get_selected_elements(1) ; | ||
| 15 | my $element = $selected_elements[0] ; | ||
| 16 | |||
| 17 | if (@selected_elements == 1 && ('App::Asciio::stripes::triangle_up' eq ref $element)) | ||
| 18 | { | ||
| 19 | push @context_menu_entries, | ||
| 20 | [ '/box type/normal', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'triangle_up_normal' } ], | ||
| 21 | [ '/box type/dot', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'triangle_up_dot' } ] ; | ||
| 22 | } | ||
| 23 | |||
| 24 | if (@selected_elements == 1 && ('App::Asciio::stripes::triangle_down' eq ref $element)) | ||
| 25 | { | ||
| 26 | push @context_menu_entries, | ||
| 27 | [ '/box type/normal', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'triangle_down_normal' } ], | ||
| 28 | [ '/box type/dot', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'triangle_down_dot' } ] ; | ||
| 29 | } | ||
| 30 | |||
| 31 | if(@selected_elements == 1 && 'App::Asciio::stripes::rhombus' eq ref $element) | ||
| 32 | { | ||
| 33 | push @context_menu_entries, | ||
| 34 | [ '/box type/normal', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'rhombus_normal' } ], | ||
| 35 | [ '/box type/normal_with_filler_star', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'rhombus_normal_with_filler_star' } ], | ||
| 36 | [ '/box type/unicode_slash', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'rhombus_unicode_slash' } ], | ||
| 37 | [ '/box type/sparseness', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'rhombus_sparseness' } ] ; | ||
| 38 | } | ||
| 39 | if(@selected_elements == 1 && 'App::Asciio::stripes::ellipse' eq ref $element) | ||
| 40 | { | ||
| 41 | push @context_menu_entries, | ||
| 42 | [ '/box type/normal', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'ellipse_normal' } ], | ||
| 43 | [ '/box type/normal_with_filler_star', \&App::Asciio::Boxes::change_type, { ELEMENT => $element, TYPE => 'ellipse_normal_with_filler_star' } ] ; | ||
| 44 | } | ||
| 45 | |||
| 46 | return @context_menu_entries ; | ||
| 47 | } | ||
| 48 | |||
| 49 | #---------------------------------------------------------------------------------------------- | ||
| 50 | |||
| 51 | 1 ; | ||
| 52 |