Prima::ComboBox - standard combo box widget
use Prima qw(Application ComboBox);
my $combo = Prima::ComboBox-> new( style => cs::DropDown, items => [ 1 .. 10 ]);
$combo-> style( cs::DropDownList );
print $combo-> text;
Provides a combo box widget that consists of an input line, a list box of possible selections, and an eventual drop-down button. The combo box can be either in the form of a drop-down list that can be shown and hidden or in a form where the selection list is always visible.
The combo box is a grouping widget and contains neither painting nor user input code by itself. All such functionality is delegated to the children widgets: input line, list box, and drop button. Prima::ComboBox exports a fixed list of methods and properties from the namespaces of Prima::InputLine and Prima::ListBox. It is possible to tweak the Prima::ComboBox ( using its editClass and listClass create-only properties ) so the input line and list box widgets can be instantiated from other classes. The list of exported names is stored in package variables %listProps, %editProps, and %listDynas. These are also described in the "Exported names" section.
The module defines the cs:: package for the constants used by the style property.
If 1, adjusts the height of the widget automatically when its font changes. Only for styles not equal to cs::Simple.
Default value: 1
Assigns the drop-down button class.
Default value: Prima::Widget
Assigns the list of delegated notifications to the drop-down button.
Assigns a hash of properties passed to the drop-down button during the creation.
Selects whether the user input is case-sensitive or not, when a value is picked from the selection list.
Default value: 0
Assigns the input line class.
Default value: Prima::InputLine
Assigns a hash of properties passed to the input line during the creation.
Assigns the list of delegated notifications to the input line.
Selects the height of the input line.
Proxy of the list widget's items property. See Prima::Lists for details.
Assigns the list box class.
Default value: Prima::ListBox
Selects the height of the list box widget.
Default value: 100
Sets whether the list box is visible or not. Not writable when the style is cs::Simple.
Assigns a hash of properties passed to the list box during the creation.
Assigns the list of delegated notifications to the list box.
Selects whether the combo box user input routine should assume that the list box contains literal strings, that can be fetched via get_item_text ( see Prima::Lists ). An example when this property is set to 0 is Prima::ColorComboBox from the Prima::ComboBox package.
Selects one of three styles of the combo box:
The list box is always visible, but the drop-down button is not.
The list box is not visible, but the drop-down button is. When the user presses the drop-down button, the list box is shown; when the list-box is defocused, it gets hidden.
Same as cs::DropDown but the user is restricted in selection: the input line can only accept user input that is present in the list box. If literal is set to 1, the auto-completion feature is provided.
Alias of the input line's text property.
Triggered the value is changed.
ComboBox forwards SelectItem and DrawItem events from the list box, and these are executed in the List's context (therefore $self there is not ComboBox, but the ComboBox->List).
See more in Prima::Lists.
alignment autoScroll text text
charOffset maxLen insertMode firstChar
selection selStart selEnd writeOnly
copy cut delete paste
wordDelimiters readOnly passwordChar focus
integralHeight items itemHeight
topItem vScroll gridColor
Dmitry Karasik, <firstname.lastname@example.org>.
Prima, Prima::InputLine, Prima::Lists, Prima::Dialog::ColorDialog, Prima::Dialog::FileDialog, examples/listbox.pl.
To install Prima, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.