Ignore:
Timestamp:
Dec 14, 2009, 6:28:34 PM (14 years ago)
Author:
ronosman
Message:

Bug 1326 fixed : tag auto-completion partially works on Ubuntu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm

    r4478 r4490  
    5252        search_result
    5353        previous_autocompleted
     54                autocomplete_from
     55                autocomplete_to
     56                autocomplete_set_selection
    5457      /
    5558);
    5659
    5760use Wx::Event qw(EVT_CHECKLISTBOX EVT_LISTBOX EVT_SEARCHCTRL_SEARCH_BTN EVT_SEARCHCTRL_CANCEL_BTN
    58                  EVT_TEXT EVT_TEXT_ENTER EVT_RADIOBOX);
     61                 EVT_TEXT EVT_TEXT_ENTER EVT_IDLE EVT_RADIOBOX);
    5962
    6063
     
    7881    EVT_TEXT_ENTER( $self, $self->search, \&OnSearchEnter );
    7982    EVT_RADIOBOX( $self, $self->btn_show, \&OnShow );
     83        # fix for linux : can not call SetSelection before the current event is processed.
     84        # call when idle
     85        EVT_IDLE(
     86            $self,
     87                sub {
     88                    my ($self, $event)=@_;
     89                        $self->search->SetSelection(
     90                            $self->autocomplete_from,
     91                            $self->autocomplete_to
     92                        ) if $self->autocomplete_set_selection;
     93                        $self->autocomplete_set_selection(0);
     94                }
     95        );
    8096
    8197    $self;
     
    330346        my $value = $self->search_result->[0]->{name};
    331347        unless(  $value eq $self->previous_autocompleted ){
    332             my $from = $self->search->GetLastPosition;
     348            $self->autocomplete_from(
     349                            $self->search->GetLastPosition
     350                    );
    333351            $self->search->ChangeValue($value);
    334             my $to = $self->search->GetLastPosition;
    335             $self->search->SetSelection($from, $to);
     352            $self->autocomplete_to(
     353                            $self->search->GetLastPosition
     354                    );
     355            $self->autocomplete_set_selection(1);
    336356            $self->previous_autocompleted($value);
    337357        }       
     
    340360        $self->previous_autocompleted(undef);
    341361    }
     362       
     363        $event->Skip;
    342364}
    343365
Note: See TracChangeset for help on using the changeset viewer.