App-Guiio
view release on metacpan or search on metacpan
Author: nadim khemir <nadim@naquadim.(none)>
Date: Fri May 9 01:45:37 2008 +0200
CHANGED: shortcuts to zoomin zoom out
CHANGED: text edit box automatically focused and selected (thanks to Tian)
commit 08ae9b7e8d9fe1d4e3cb7b8d72623cc3e116cf3a
Author: nadim khemir <nadim@naquadim.(none)>
Date: Wed May 7 23:51:42 2008 +0200
FIXED: title has frame when text doesn't
commit ae1b8461e6698ae7df9f8ba49e0189794803e742
Author: nadim khemir <nadim@naquadim.(none)>
Date: Wed May 7 21:57:50 2008 +0200
ADDED: background and grid color changing
commit 611b3a181257daf60cb3ea771ee1631c7350b314
Merge: 637524b... 8a7f7d3...
Author: nadim khemir <nadim@naquadim.(none)>
- the user can add connectors with the same mechanism
- the connector must be handled when resizing the box object
by the box object or by the connector itself
#Box added via 'B' shortcut should be selected
#reselect elements after quick link
#select text an focus in text editing window
#error: title has frame when text doesn't
#link to camel box
#background color, grid color
#save file in exit dialog
#continuation _from_ diagonal is not correct
!allow diagonals in setup
lib/App/Guiio/stripes/editable_box2.pm view on Meta::CPAN
my ($title_width, @title_lines) = (0) ;
$title_text = '' unless defined $title_text ;
for my $title_line (split("\n", $title_text))
{
$title_width = max($title_width, length($title_line)) ;
push @title_lines, $title_line ;
}
my ($extra_width, $extra_height) = get_box_frame_size_overhead($box_type) ;
my $display_title = (defined $title_text and $title_text ne '') ? 1 : 0 ;
$text_width = max($text_width, $title_width) if $display_title;
#if($auto_shrink)
# {
# ($end_x, $end_y) = (-5, -5) ;
# }
$end_x = max($end_x, $text_width + $extra_width, $title_width + $extra_width) ;
$end_y = max($end_y, scalar(@lines) + $extra_height + scalar(@title_lines)) ;
my ($box_top, $box_left, $box_right, $box_bottom, $title_separator, $title_left, $title_right) = get_box_frame_elements($box_type, $end_x) ;
my $text = $box_top ;
for my $title_line (@title_lines)
{
my $pading = ($end_x - (length($title_left . $title_line . $title_right))) ;
my $left_pading = int($pading / 2) ;
my $right_pading = $pading - $left_pading ;
$text .= $title_left . (' ' x $left_pading) . $title_line . (' ' x $right_pading) . $title_right ."\n" ;
lib/App/Guiio/stripes/editable_box2.pm view on Meta::CPAN
Readonly my $TITLE_SEPARATOR => 1 ;
Readonly my $BODY_SEPARATOR => 2 ;
Readonly my $BOTTOM => 3;
Readonly my $DISPLAY => 0 ;
Readonly my $NAME => 1 ;
Readonly my $LEFT => 2 ;
Readonly my $BODY => 3 ;
Readonly my $RIGHT => 4 ;
sub get_box_frame_size_overhead
{
my ($box_type) = @_ ;
my @displayed_elements = grep { $_->[$DISPLAY] } @{$box_type} ;
my $extra_width = max(0, map {length} map {$_->[$LEFT]}@displayed_elements)
+ max(0, map {length} map {$_->[$RIGHT]}@displayed_elements) ;
my $extra_height = 0 ;
for ($TOP, $TITLE_SEPARATOR, $BOTTOM)
{
$extra_height++ if defined $box_type->[$_][$DISPLAY] && $box_type->[$_][$DISPLAY] ;
}
return($extra_width, $extra_height) ;
}
sub get_box_frame_elements
{
my ($box_type, $width) = @_ ;
my ($box_top, $box_left, $box_right, $box_bottom, $title_separator, $title_left, $title_right) = map {''} (1 .. 7) ;
if($box_type->[$TOP][$DISPLAY])
{
my $box_left_and_right_length = length($box_type->[$TOP][$LEFT]) + length($box_type->[$TOP][$RIGHT]) ;
$box_top = $box_type->[$TOP][$LEFT]
. ($box_type->[$TOP][$BODY] x ($width - $box_left_and_right_length))
setup/actions/context_menu_box.pl view on Meta::CPAN
use Clone ;
if(exists $box_types{$data->{TYPE}})
{
$self->create_undo_snapshot() ;
my $element_type = $data->{ELEMENT}->get_box_type() ;
my $new_type = Clone::clone($box_types{$data->{TYPE}}) ;
for (my $frame_element_index = 0 ; $frame_element_index < @{$new_type} ; $frame_element_index++)
{
$new_type->[$frame_element_index][$DISPLAY] = $element_type->[$frame_element_index][$DISPLAY]
}
$data->{ELEMENT}->set_box_type($new_type) ;
$self->update_display() ;
}
}
#----------------------------------------------------------------------------------------------
setup/actions/unsorted.pl view on Meta::CPAN
'Undo' => ['C00-z', \&undo],
'Display undo stack statistics' => ['C0S-Z', \&display_undo_stack_statistics],
'Redo' => ['C00-y', \&redo],
'Display keyboard mapping' => ['000-k', \&display_keyboard_mapping],
'Display commands' => ['C00-k', \&display_commands],
'Display action files' => ['C0S-K', \&display_action_files],
'Zoom in' => ['000-KP_Add', \&zoom, 2],
'Zoom out' => ['000-KP_Subtract', \&zoom, -2],
'Help' => ['000-F1', \&display_help],
'External command output in a box' => ['000-x', \&external_command_output, 1],
'External command output in a box no frame' => ['C00-x', \&external_command_output, 0],
) ;
#----------------------------------------------------------------------------------------------
sub display_help
{
my ($self) = @_ ;
$self->display_message_modal(<<EOM) ;
setup/stencils/computer view on Meta::CPAN
/::::/
EOA
'computer_small' => <<'EOA',
__ _
[__]|=|
/::/|_|
EOA
'mainframe' => <<'EOA',
________
|==|=====|
| | |
| | |
| | |
| | |
| |====°|
|__|_____|
EOA
( run in 0.599 second using v1.01-cache-2.11-cpan-e1769b4cff6 )