Gtk2-Ex-SearchBox
view release on metacpan or search on metacpan
lib/Gtk2/Ex/SearchBox.pm view on Meta::CPAN
} elsif ($x->{operator} eq 'contains') {
push @condition, $fieldname.' like '.'\'%'.$x->{field}.'%\'';
} elsif ($x->{operator} eq 'doesn\'t contain') {
push @condition, $fieldname.' not like '.'\'%'.$x->{field}.'%\'';
}
}
my $str = join ' or ', @condition;
return $str;
}
sub attach_popup_to {
my ($self, $parent) = @_;
my $popupwindow = Gtk2::Ex::PopupWindow->new($parent);
$popupwindow->set_move_with_parent(TRUE);
my $frame = Gtk2::Frame->new;
$frame->add($self->{widget});
$self->{popup} = $popupwindow;
$popupwindow->{window}->add($frame);
return $popupwindow;
}
sub _create_widget {
my ($self) = @_;
my @column_types;
$column_types[OR_______COLUMN] = 'Glib::String';
$column_types[OPERATOR_COLUMN] = 'Glib::String';
$column_types[MODEL____COLUMN] = 'Gtk2::ListStore';
$column_types[NAME_____COLUMN] = 'Glib::String';
lib/Gtk2/Ex/SearchBox.pm view on Meta::CPAN
Returns the C<$model>
For example,
$model = [
{'operator' => 'contains', 'field' => 'this pattern'},
{'operator' => 'equals', 'field' => 'that exact pattern'},
]
=head2 attach_popup_to($parent);
This method returns a C<Gtk2::Ex::PopupWindow>. The popup window will contain
a C<Gtk2::Ex::SearchBox> widget.
=head2 to_sql_condition($datefieldname, $model);
Converts the C<$model> into an SQL condition so that it can be used directly in
and SQL statement. C<$fieldname> is the fieldname that will be used inside
the SQL condition.
=head2 signal_connect($signal, $callback);
( run in 0.695 second using v1.01-cache-2.11-cpan-364913b4093 )