summaryrefslogtreecommitdiff
path: root/efl
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2016-02-03 11:05:31 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2016-02-03 14:05:38 +0200
commitba7bf818d88d3331781b055622842ef4a3943d7d (patch)
treeca22809c7b6d9d8c44fc5033987d81d75f6b5035 /efl
parent1189e17fe0cd159190ebb6ae9b7a7f3dc9caee0b (diff)
Elm.MultiButtonEntry: Correct documentation
Diffstat (limited to 'efl')
-rw-r--r--efl/elementary/multibuttonentry.pxi92
1 files changed, 78 insertions, 14 deletions
diff --git a/efl/elementary/multibuttonentry.pxi b/efl/elementary/multibuttonentry.pxi
index 8c6e272..56e5329 100644
--- a/efl/elementary/multibuttonentry.pxi
+++ b/efl/elementary/multibuttonentry.pxi
@@ -163,6 +163,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
163 return self 163 return self
164 164
165 property selected: 165 property selected:
166 """Control the selected state of an item
167
168 :type: bool
169
170 """
166 def __get__(self): 171 def __get__(self):
167 return bool(elm_multibuttonentry_item_selected_get(self.item)) 172 return bool(elm_multibuttonentry_item_selected_get(self.item))
168 173
@@ -175,6 +180,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
175 return bool(elm_multibuttonentry_item_selected_get(self.item)) 180 return bool(elm_multibuttonentry_item_selected_get(self.item))
176 181
177 property prev: 182 property prev:
183 """Get the previous item in the multibuttonentry
184
185 :type: :class:`MultiButtonEntryItem`
186
187 """
178 def __get__(self): 188 def __get__(self):
179 return _object_item_to_python(elm_multibuttonentry_item_prev_get(self.item)) 189 return _object_item_to_python(elm_multibuttonentry_item_prev_get(self.item))
180 190
@@ -182,6 +192,11 @@ cdef class MultiButtonEntryItem(ObjectItem):
182 return _object_item_to_python(elm_multibuttonentry_item_prev_get(self.item)) 192 return _object_item_to_python(elm_multibuttonentry_item_prev_get(self.item))
183 193
184 property next: 194 property next:
195 """Get the next item in the multibuttonentry
196
197 :type: :class:`MultiButtonEntryItem`
198
199 """
185 def __get__(self): 200 def __get__(self):
186 return _object_item_to_python(elm_multibuttonentry_item_next_get(self.item)) 201 return _object_item_to_python(elm_multibuttonentry_item_next_get(self.item))
187 202
@@ -239,8 +254,11 @@ cdef class MultiButtonEntry(Object):
239 property expanded: 254 property expanded:
240 """Control the multibuttonentry to expanded state. 255 """Control the multibuttonentry to expanded state.
241 256
242 In expanded state, the complete entry will be displayed. 257 In expanded state the entry widget expands to accommodate all items.
243 Otherwise, only single line of the entry will be displayed. 258 Otherwise a single line of items will be displayed with a counter for
259 items that don't fit the line.
260
261 .. seealso:: :meth:`format_function_set`
244 262
245 :type: bool 263 :type: bool
246 264
@@ -257,6 +275,16 @@ cdef class MultiButtonEntry(Object):
257 return bool(elm_multibuttonentry_expanded_get(self.obj)) 275 return bool(elm_multibuttonentry_expanded_get(self.obj))
258 276
259 def item_prepend(self, label, func = None, *args, **kwargs): 277 def item_prepend(self, label, func = None, *args, **kwargs):
278 """Prepend a new item to the multibuttonentry
279
280 :param string label: The label of new item
281 :param func: The callback function to be invoked when this item is pressed.
282 :param \*args: The data to be attached for callback
283 :param \*\*kwargs: The data to be attached for callback
284
285 :return: :class:`MultiButtonEntryItem`
286
287 """
260 cdef: 288 cdef:
261 Elm_Object_Item *item 289 Elm_Object_Item *item
262 Evas_Smart_Cb cb = NULL 290 Evas_Smart_Cb cb = NULL
@@ -281,6 +309,16 @@ cdef class MultiButtonEntry(Object):
281 return None 309 return None
282 310
283 def item_append(self, label, func = None, *args, **kwargs): 311 def item_append(self, label, func = None, *args, **kwargs):
312 """Append a new item to the multibuttonentry
313
314 :param string label: The label of new item
315 :param func: The callback function to be invoked when this item is pressed.
316 :param \*args: The data to be attached for callback
317 :param \*\*kwargs: The data to be attached for callback
318
319 :return: :class:`MultiButtonEntryItem`
320
321 """
284 cdef: 322 cdef:
285 Elm_Object_Item *item 323 Elm_Object_Item *item
286 Evas_Smart_Cb cb = NULL 324 Evas_Smart_Cb cb = NULL
@@ -305,6 +343,17 @@ cdef class MultiButtonEntry(Object):
305 return None 343 return None
306 344
307 def item_insert_before(self, MultiButtonEntryItem before, label, func = None, *args, **kwargs): 345 def item_insert_before(self, MultiButtonEntryItem before, label, func = None, *args, **kwargs):
346 """Add a new item to the multibuttonentry before the indicated object
347
348 :param MultiButtonEntryItem before: The item before which to add it
349 :param string label: The label of new item
350 :param func: The callback function to be invoked when this item is pressed.
351 :param \*args: The data to be attached for callback
352 :param \*\*kwargs: The data to be attached for callback
353
354 :return: :class:`MultiButtonEntryItem`
355
356 """
308 cdef: 357 cdef:
309 Elm_Object_Item *item 358 Elm_Object_Item *item
310 Evas_Smart_Cb cb = NULL 359 Evas_Smart_Cb cb = NULL
@@ -330,6 +379,17 @@ cdef class MultiButtonEntry(Object):
330 return None 379 return None
331 380
332 def item_insert_after(self, MultiButtonEntryItem after, label, func = None, *args, **kwargs): 381 def item_insert_after(self, MultiButtonEntryItem after, label, func = None, *args, **kwargs):
382 """Add a new item to the multibuttonentry after the indicated object
383
384 :param MultiButtonEntryItem before: The item after which to add it
385 :param string label: The label of new item
386 :param func: The callback function to be invoked when this item is pressed.
387 :param \*args: The data to be attached for callback
388 :param \*\*kwargs: The data to be attached for callback
389
390 :return: :class:`MultiButtonEntryItem`
391
392 """
333 cdef: 393 cdef:
334 Elm_Object_Item *item 394 Elm_Object_Item *item
335 Evas_Smart_Cb cb = NULL 395 Evas_Smart_Cb cb = NULL
@@ -407,20 +467,19 @@ cdef class MultiButtonEntry(Object):
407 elm_multibuttonentry_clear(self.obj) 467 elm_multibuttonentry_clear(self.obj)
408 468
409 def filter_append(self, func, *args, **kwargs): 469 def filter_append(self, func, *args, **kwargs):
410 """Append an item filter function for text inserted in the Multibuttonentry 470 """Append an item filter function for items inserted in the Multibuttonentry
411 471
412 Append the given callback to the list. This function will be called 472 Append the given callback to the list. This function will be called
413 whenever any text is inserted into the Multibuttonentry, with the text to be inserted 473 when a new text item is inserted into the Multibuttonentry, with the
414 as a parameter. The callback function is free to alter the text in any way 474 text to be inserted as a parameter.
415 it wants with the modified text passed back as return value. 475
416 If the new text is to be left intact, the function can return ``None``. 476 If the item is wanted the function should return ``True``, else return
417 If the new text is to be discarded, the function must raise 477 ``False``. Returning ``False`` will also prevent any subsequent filters
418 :class:`MultiButtonEntryFilterOut`. 478 from being called.
419 This will also prevent any following filters from being called.
420 479
421 Callback signature:: 480 Callback signature::
422 481
423 func(obj, text, *args, **kwargs) -> modified text or None 482 func(obj, text, *args, **kwargs) -> bool
424 483
425 """ 484 """
426 if not self._item_filters: 485 if not self._item_filters:
@@ -433,7 +492,7 @@ cdef class MultiButtonEntry(Object):
433 self._item_filters.append(cbdata) 492 self._item_filters.append(cbdata)
434 493
435 def filter_prepend(self, func, *args, **kwargs): 494 def filter_prepend(self, func, *args, **kwargs):
436 """Prepend a filter function for text inserted in the Multibuttonentry 495 """Prepend a filter function for items inserted in the Multibuttonentry
437 496
438 Prepend the given callback to the list. See :meth:`filter_append` 497 Prepend the given callback to the list. See :meth:`filter_append`
439 for more information 498 for more information
@@ -454,6 +513,8 @@ cdef class MultiButtonEntry(Object):
454 Removes the given callback from the filter list. See :meth:`filter_append` 513 Removes the given callback from the filter list. See :meth:`filter_append`
455 for more information. 514 for more information.
456 515
516 .. versionadded:: 1.17
517
457 """ 518 """
458 cbdata = (func, args, kwargs) 519 cbdata = (func, args, kwargs)
459 self._item_filters.remove(cbdata) 520 self._item_filters.remove(cbdata)
@@ -485,8 +546,11 @@ cdef class MultiButtonEntry(Object):
485 return bool(elm_multibuttonentry_editable_get(self.obj)) 546 return bool(elm_multibuttonentry_editable_get(self.obj))
486 547
487 def format_function_set(self, func, *args, **kwargs): 548 def format_function_set(self, func, *args, **kwargs):
488 """Set a function to format the string that will be used to display 549 """Set a function to format the string for the counter
489 the hidden items counter. 550
551 Sets a function to format the string that will be used to display a
552 counter for items that don't fit the line when the widget is not in
553 :attr:`expanded` state.
490 554
491 :param func: The actual format function. 555 :param func: The actual format function.
492 signature: (int count, args, kwargs)->string 556 signature: (int count, args, kwargs)->string