nkh / P5-App-Asciio

Plain ASCII diagram
https://nkh.github.io/P5-App-Asciio/
53 stars 4 forks source link

Refactor: display_edit_dialog #105

Closed nkh closed 1 year ago

nkh commented 1 year ago
sub display_edit_dialog
{
my ($self, $title, $text, $asciio, $X, $Y, $text_begin_x, $text_begin_y) = @_ ;
if(($asciio->{EDIT_TEXT_INLINE} != 0) && (defined $X) && (defined $Y))
    {
    return $self->display_edit_dialog_for_mini_edit_mode($title, $text, $asciio, $X, $Y, $text_begin_x, $text_begin_y) ;
    }
else
    {
    return $self->display_edit_dialog_for_normal_mode($title, $text, $asciio) ;
    }
}

@qindapao

why does display_edit_dialog_for_mini_edit_mode, take $self and $asciio

same here

sub select_all_elements_by_search_words_ignore_group
{
my ($self) = @_ ;

my $search_words = $self->display_edit_dialog("input search words", '', $self);

for my $element (@{$self->{ELEMENTS}}) 
    {
    $element->{SELECTED} = ++$self->{SELECTION_INDEX} if ($self->transform_elements_to_ascii_buffer($element) =~ m/$search_words/i);
    }
}

$self is send twice to display_edit_dialog and received as $self and $asciio

nkh commented 1 year ago

will re-open this ticket wit module names and lines