Wx::DBI::Form::ListBox - a database aware list box


NAME

Wx::DBI::Form::ListBox - a database aware list box

Back to Top


SYNOPSIS

use Wx::DBI::Form::ListBox

Back to Top


DESCRIPTION

Wx::DBI::Form::ListBox is a class combining Wx::ListBox and Wx::DBI::Form.

Back to Top


FUNCTIONS

new($class, @args)
Parameters:

@args is passed on to the Wx::ListBox constructor: $parent, $wxWindowID, $pos, $size, $value, $choices, $style, $validator, $name

Functionality:

Constructor for the Wx::DBI::Form::ListBox class.

Return value:

New Wx::DBI::Form::ListBox object.

SetSelection($self, $setvalue)
Functionality:

Set the selected value of the listbox.

The regular Combo Box setvalue takes a string as its argument and the shows the item that matches in the list.

Look for the item in the -value list and then activate the corresponding idx in the combo box list.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

replace_items($self, $choices)
Functionality:

If the where clause changes then the listbox will need to be 'refreshed'. This function eliminates all the existing list items and populates the new items.

Return value:

None.

Insert($self, $item, $pos)
Parameters:

$item is a reference to an array or hash to insert.

Functionality:

Insert an item into the list of choices at a particular position.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

InsertItems($self, $list, $pos)
Parameters:

$list is a reference (an array or arrays or hashes) for the items to insert.

Functionality:

Insert items into the list of choices at a particular position.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

Set($self, @items)
Paramters:

@items is the array of items passed into the replace_items() call. (replace_items($self, $choices))

Functionality:

Set the list box items.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

GetSelection($self)
Functionality:

Returns the index of the currently selected item in the ListBox.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

The index of the currently selected item in the ListBox.

GetValue($self, @_)
Parameters:

Any parameters are passed directly to GetSelection().

Functionality:

Wraps the GetSelection() method.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

The index of the currently selected item in the ListBox.

GetCount($self)
Functionality:

Return a count of items in choices.

This is mainly to see if we have data to determine the need to update the set.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

A count of items in choices.

get_list_vals($self)
Functionality:

Return a list of values from the ListBox.

Return value:

A list of values from the ListBox.

valtoidx($self, $val)
Parameters:

$val is the database value for which an index is required.

Functionality:

Translate a database value to an index in the widget.

Return value:

An index in the widget corresponding to the database value passed in.

Delete($self, $id)
Parameters:

$id is the database value to delete from the widget.

Functionality:

Delete the specified item from the ListBox widget.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

Note:

#######################################

The remainder are untested or unfinished subroutines to duplicate the combobox functionality or to disable it so that it does not mess up our current functionality.

#######################################

Create($self)
Functionality:

Override so that it does not go to the base class.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

1

Cut($self)
Functionality:

Remove the currently selected item from the ListBox entirely.

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

Clear($self)
Functionality:

Clear the ListBox's current selection (i.e., make it so nothing is selected).

Note: this function has a camel case name because it overrides a super-class function.

Return value:

None.

Back to Top


AUTHORS

Doug Breshears <doug@jshfarms.com>
Roberto C. Sanchez <roberto@connexer.com>

Back to Top


BUGS

No known bugs.

Back to Top


SEE ALSO

README

Back to Top


COPYRIGHT

Copyright 2008-2009 JSH Farms, Inc.

Wx::DBI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or under the terms of the Artistic License as published by the Perl Foundation, either version 2.0 of the license, or (at your option) any later version.

Wx::DBI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License or the Artistic License for more details.

You should have received a copy of the GNU General Public License and a copy of the Artistic License along with Wx::DBI. If not, see <http://www.gnu.org/licenses/> and <http://www.perlfoundation.org/artistic_license_2_0>, respectively.

Back to Top

 Wx::DBI::Form::ListBox - a database aware list box