Hello,
I've created new module for entering customer data. This module is based on
Wx::Dialog. There is one multiline input on it with validator assigned. If
I create new dialog instance in main frame event handler everything is ok.
If I create the same dialog from another modal dialog (customer list) no
text can't be entered into this multiline edit (except newlines). If this
input file is initialized with any value the 'Validation conflict' is
reported. It looks very strange to me - once code works good and once when
instantiated from different dialog behave diferrently. It is also strange
that only this one multiline input behave differently in these two cases.

Input control creation code:

    $this->{input_poznamka} = Wx::TextCtrl->new($this, 
$main::ID_TEXTCTRL_POZNAMKA,
        "", wxDefaultPosition, [$width,60], wxTE_MULTILINE);

Validator creation and assignment code:

    $this->{validator_poznamka} = Wx::Perl::TextValidator->new(qr//,
        \($data->{poznamka}));
    $this->{input_poznamka}->SetValidator($this->{validator_poznamka})

Data::Dumper reports in both cases the same

                 'validator_poznamka' => bless( {
                                                  'data' => 
\$VAR1->{'customer_data'}{'poznamka'},
                                                  'validate' => qr/(?-xism:)/
                                                }, 'Wx::Perl::TextValidator' ),

In handler is following init code

    $dialog  = My::Dialog::Zakaznik->new($this, -1,
        &main::_T('Udaje o zakaznikovi'),
            wxDefaultPosition, wxDefaultSize,
            wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | wxRESIZE_BORDER,
        );
    $data   = $this->{data}->{firma}->get_data();
    $dialog->BindData($data);
    $tmp = $dialog->ShowModal();
    
In customer list dialog is initialization 

        $eval_command   = $dlg_class .
            '->new($this, -1, &main::_T($dlg_name),
            wxDefaultPosition, wxDefaultSize,
            wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | wxRESIZE_BORDER);';
        $dlg_object = eval $eval_command;
        warn $@ if $@;
        $dlg_data   = $data_object->get_data();
        $dlg_object->BindData($dlg_data);
        $dlg_result = $dlg_object->ShowModal();


Do you have any idea?

Regards,
Roman

Reply via email to