Wx::DBI::Form::ComboBox - a database aware wrapper for Wx::ComboBox


NAME

Wx::DBI::Form::ComboBox - a database aware wrapper for Wx::ComboBox

Back to Top


SYNOPSIS

use Wx::DBI::Form::ComboBox

Back to Top


DESCRIPTION

Wx::DBI::Form::ComboBox is a database aware object wrapper around Wx::ComboBox that can take can display a textual item and return a numeric (database index) item when queried.

Back to Top


FUNCTIONS

new($class, @args)
Parameters:

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

Functionality:

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

Return value:

New Wx::DBI::Form::ComboBox object.

on_key_up($self, $evt)
Functionality:

Adapted from: http://wxforum.shadonet.com/viewtopic.php?t=7221

Return value:

None.

SetValue($self, $setvalue)
Functionality:

The regular ComboBox SetValue takes a string as its argument and then shows the item that matches in the list. What we want is to 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)
Parameters:

$choices is an array reference to the list of items for populating the control.

Functionality:

Replace all items currently in the ComboBox with those passed in.

If the where clause changes then the combo will need to be 'refreshed'. In this case we get rid of all the existing combo items and put new in.

Return value:

None.

append_items($self, $choices)
Paramters:

$choices is an array reference to the list of items for populating the control.

Functionality:

This should be called 'Replace' items as we are not appending at all but creating a whole new list.

Return value:

None.

GetValue($self)
Functionality:

Return the current value selected in the ComboBox.

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

Return value:

The index of the selected value, or undef if nothing is selected.

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:

Return a count of items in choices.

GetCurrentSelection($self)
Functionality:

None, really. A stub function of uncertain origins. It needs testing.

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 it will not go to the parent class.

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

Return value:

1

Cut($self)
Functionality:

Get the item from the selection and remove from the original list as well.

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

Return value:

None.

Remove($self, $from, $to)
Functionality:

Remove the range of selected items from the ComboBox.

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

Return value:

None.

Clear($self)
Functionality:

Make it so that the ComboBox has nothing selected.

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

Return value:

None.

Replace($self)
Functionality:

Currently does not do anything.

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

Return value:

None.

Paste($self)
Functionality:

Currently does not do anything.

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

Return value:

None.

CanPaste($self)
Functionality:

Currently does not do anything.

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

Return value:

0

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::ComboBox - a database aware wrapper for Wx::ComboBox