MLColumn | Package Info | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tutorial | FAQ | Changes/Bug fixes |
|
||||||||||||
MLColumn is a composite widget used to display the contents of one column of data (including the header) within the MListbox widget. This widget is not meant to be used outside of the MListbox widget, and it should never be instatiated by itself. The tight coupling between the two prevents it from being useful in any other capacity. It is documented here only because it can be accessed and returned by some MListbox's methods, and it and it's subwidgets can be configured directly if necessary.
Subwidgets: | |||||
|
|||||
|
|||||
|
|||||
|
MListbox defined: | |||||
|
Inherited from Frame: | |||||
|
|
Sets the background color for the base widget, the internal Pane, and the default background color for all columns. If configured after initial construction, this option will override the background options for all columns. | |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
| ||||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
| |||||||||
|
|
MListbox defined: | |
void | activate( index ) |
void | bindColumns( sequence, callback ) |
void | bindRows( sequence, callback ) |
void | bindSeparators( sequence, callback ) |
arrayref | columnConfigure( index, ?option => value, ... ) |
(MLColumn) | columnGet( first, ?last ) |
void | columnHide( first, ?last ) |
integer | columnIndex( index ) |
MLColumn | columnInsert( index, ?option => value, ... ) |
void | columnPack( array ) |
array | columnPackInfo() |
void | columnShow( index, ?option => value, ... ) |
array | curselection() |
void | delete( first, ?last ) |
arrayref | get( first, ?last ) |
arrayref | getRow( index ) |
void | index( descending, index, ... ) |
void | sort( descending, index, ... ) |
addItem( string, ?option => value, ... )
Appends a new List item to be used in the Popup Listbox. string is a scalar variable that is displayed in the Listbox. This method takes two options: -selected and -value.
Options:
Example:
$jcb->addItem('ALASKA', -value => 'AK', -selected => 1);
clearSelection()
Clears the currently selected item in the JComboBox if one is selected
getItemIndex( string, ?option => value, ... )
Searches the JCombobox for the first item that matches the given string and returns that item's index. If no match is found, the method returns undef. This method has two optional parameters: -mode and -type.
Options:
Example:
my $index = $jcb->getItemIndex('AK', -type => 'value');
getItemCount()
Returns the number of list items stored in the JComboBox.
getSelectedIndex()
Returns the index of the current selected item or undef if there isn't one selected.
getSelectedValue()
Returns the value of the current selected item or undef if there isn't one selected. In the case of an editable JComboBox, if no items are selected, then the text in the entry is returned.
getItemNameAt( index )
Returns the string displayed in the listbox at the given index.
getItemValueAt( index )
Returns the alternate text associated with the list item at the given index if it's set. Otherwise, will return the the displayed item.
hidePopup()
Causes the popup listbox to be withdrawn from the screen, unmapping it. Hiding and showing the popup listbox is generally handled by various event handlers, but is available for use in custom handlers or other use.
index( index )
Returns the integer index value that corresponds to index. If index is end then return value is a count of the number of elements in the listbox (not the index of the last element).
insertItemAt( index, string, ?option => value, ... )
Inserts a new list item into the JComboBox at the specified index. string is a scalar variable that is displayed in the Listbox. This method takes two options: -selected and -value. Refer to this section on indices in the Listbox documention.
Options:
Example:
$jcb->insertItemAt('end', 'ALASKA', -value => 'AK', -selected => 1);
popupIsVisible()
Returns 1 if the popup is mapped, 0 if it isn't
removeAllItems()
Completely removes all list items from the JComboBox, and clears any selected item if present.
removeItemAt( index )
Deletes a single list item from the JCombobox at the specified index.
see( index )
Adjusts the JComboBox so that the list item indicated by the given index is visible. If the Listbox is hidden, it will be made visible, and the the list will shift so that the item is viewable as necessary.
setSelectedIndex( index )
Selects the list item that exists at the given index.
showPopup()
Displays the popup listbox ( normally triggered by the JComboBox button )