1Prima::ComboBox(3)    User Contributed Perl Documentation   Prima::ComboBox(3)
2
3
4

NAME

6       Prima::ComboBox - standard combo box widget
7

SYNOPSIS

9               use Prima::ComboBox;
10
11               my $combo = Prima::ComboBox-> create( style => cs::DropDown, items => [ 1 .. 10 ]);
12               $combo-> style( cs::DropDownList );
13               print $combo-> text;
14

DESCRIPTION

16       Provides a combo box widget which consists of an input line, list box
17       of possible selections and eventual drop-down button. The combo box can
18       be either in form with a drop-down selection list, that is shown by the
19       command of the user, or in form when the selection list is always
20       visible.
21
22       The combo box is a grouping widget, and contains neither painting nor
23       user-input code. All such functionality is delegated into the children
24       widgets: input line, list box and button. "Prima::ComboBox" exports a
25       fixed list of methods and properties from namespaces of
26       Prima::InputLine and Prima::ListBox. Since, however, it is possible to
27       tweak the "Prima::ComboBox" ( using its editClass and listClass create-
28       only properties ) so the input line and list box would be other
29       classes, it is not necessarily that all default functionality would
30       work.  The list of exported names is stored in package variables
31       %listProps, %editProps and %listDynas. These also described in
32       "Exported names" section.
33
34       The module defines "cs::" package for the constants used by style
35       property.
36

API

38   Properties
39       autoHeight BOOLEAN
40           If 1, adjusts the height of the widget automatically when its font
41           changes.  Only when style is not "cs::Simple".
42
43           Default value: 1
44
45       buttonClass STRING
46           Assigns a drop-down button class.
47
48           Create-only property.
49
50           Default value: "Prima::Widget"
51
52       buttonDelegations ARRAY
53           Assigns a drop-down button list of delegated notifications.
54
55           Create-only property.
56
57       buttonProfile HASH
58           Assigns hash of properties, passed to the drop-down button during
59           the creation.
60
61           Create-only property.
62
63       caseSensitive BOOLEAN
64           Selects whether the user input is case-sensitive or not, when a
65           value is picked from the selection list.
66
67           Default value: 0
68
69       editClass STRING
70           Assigns an input line class.
71
72           Create-only property.
73
74           Default value: "Prima::InputLine"
75
76       editProfile HASH
77           Assigns hash of properties, passed to the input line during the
78           creation.
79
80           Create-only property.
81
82       editDelegations ARRAY
83           Assigns an input line list of delegated notifications.
84
85           Create-only property.
86
87       editHeight INTEGER
88           Selects height of an input line.
89
90       items ARRAY
91           Mapped onto the list widget's "items" property. See Prima::Lists
92           for details.
93
94       listClass STRING
95           Assigns a listbox class.
96
97           Create-only property.
98
99           Default value: "Prima::ListBox"
100
101       listHeight INTEGER
102           Selects height of the listbox widget.
103
104           Default value: 100
105
106       listVisible BOOLEAN
107           Sets whether the listbox is visible or not. Not writable when style
108           is "cs::Simple".
109
110       listProfile HASH
111           Assigns hash of properties, passed to the listbox during the
112           creation.
113
114           Create-only property.
115
116       listDelegations ARRAY
117           Assigns a selection listbox list of delegated notifications.
118
119           Create-only property.
120
121       literal BOOLEAN
122           Selects whether the combo box user input routine assume that the
123           listbox contains literal strings, that can be fetched via
124           "get_item_text" ( see Prima::Lists ). As an example when this
125           property is set to 0 is "Prima::ColorComboBox" from Prima::ComboBox
126           package.
127
128           Default value: 1
129
130       style INTEGER
131           Selected one of three styles:
132
133           cs::Simple
134               The listbox is always visible, and the drop-down button is not.
135
136           cs::DropDown
137               The listbox is not visible, but the drop-down button is. When
138               the use presses the drop-down button, the listbox is shown;
139               when the list-box is defocused, it gets hidden.
140
141           cs::DropDownList
142               Same as "cs::DropDown", but the user is restricted in the
143               selection: the input line can only accept user input that is
144               contained in listbox.  If literal set to 1, the auto completion
145               feature is provided.
146
147       text STRING
148           Mapped onto the edit widget's "text" property.
149
150   Events
151       Change
152           Triggered with ComboBox value is changed.
153
154       List events
155           ComboBox forwards "SelectItem" and "DrawItem" events from the list
156           box, and these are executed in the List's context (therefore $self
157           there is not ComboBox, but the ComboBox->List). If you use
158           "SelectItem" you probably need "Change" instead.
159
160           See more in Prima::Lists.
161
162   Exported names
163       %editProps
164                   alignment      autoScroll  text         text
165                   charOffset     maxLen      insertMode   firstChar
166                   selection      selStart    selEnd       writeOnly
167                   copy           cut         delete       paste
168                   wordDelimiters readOnly    passwordChar focus
169                   select_all
170
171       %listProps
172                                  focusedItem    hScroll
173                   integralHeight items          itemHeight
174                   topItem        vScroll        gridColor
175                   multiColumn    offset
176
177       %listDynas
178                   onDrawItem
179                   onSelectItem
180

AUTHOR

182       Dmitry Karasik, <dmitry@karasik.eu.org>.
183

SEE ALSO

185       Prima, Prima::InputLine, Prima::Lists, Prima::ColorDialog,
186       Prima::FileDialog, examples/listbox.pl.
187
188
189
190perl v5.28.0                      2017-02-28                Prima::ComboBox(3)
Impressum