groupedelements.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. .. _groupedelements:
  2. Grouped Elements Module
  3. =======================
  4. .. module:: groupedelements
  5. .. py:class:: GroupWarning
  6. This is a simple Warning issued when elements or groups are not existend
  7. .. py:class:: GroupedObjects
  8. Class that keeps track of the groups and its objects and offers methods to enable/disable objects
  9. .. py:method:: __init__(self)
  10. Initialising the GroupedElementsObject
  11. .. _add_item:
  12. .. py:method:: addItem(self, group, item)
  13. Add an element `item` to group `group`
  14. :param str group: Desired group
  15. :param any item: Item to add
  16. .. py:method:: setChecked(self, group, state)
  17. For CheckBoxes this will set the state of all Checkboxes in `group` to `state`.
  18. This calls the setChecked method for all elements in group.
  19. :param str group: Desired group
  20. :param bool state: New state of the Checkboxes
  21. .. py:method:: setEnabled(self, group, state)
  22. Sets the elements to Enabled/Disabled if state is True/False.
  23. This calls the setEnabled method for all elements in group.
  24. :param str group: Desired group
  25. :param bool state: New State
  26. .. py:method:: addMenuItem(self, group, item)
  27. Deprecated use :ref:`addItem <add_item>`.
  28. Remains for backwards compatibility.
  29. .. py:method:: addButton(self, group, item)
  30. Deprecated use :ref:`addItem <add_item>`.
  31. Remains for backwards compatibility.
  32. .. py:method:: addCheckbox(self, group, item)
  33. Deprecated use :ref:`addItem <add_item>`.
  34. Remains for backwards compatibility.
  35. .. py:method:: removeItem(self, group, item)
  36. Remove an item from a group.
  37. :param str group: Desired group
  38. :param any item: Item to remove
  39. .. py:method:: removeGroup(self, group)
  40. Remove a group.
  41. :param str group: Group to remove
  42. .. py:method:: getElements(self, group)
  43. Returns list of all elements in a group
  44. :param str group: Desired group
  45. :return: List of all elements in group
  46. :rtype: list
  47. .. py:method:: createEmptyGroup(self, group)
  48. Creates a empty group
  49. :param str group: Desired Group
  50. .. py:attribute:: Buttons
  51. GroupedObjects instance see :ref:`Elements <elements>`
  52. .. py:attribute:: Checkboxes
  53. GroupedObjects instance see :ref:`Elements <elements>`
  54. .. py:attribute:: MenuItems
  55. GroupedObjects instance see :ref:`Elements <elements>`
  56. .. _elements:
  57. .. py:attribute:: Elements
  58. GroupedObjects instance. This is the same instance as Buttons, Checkboxes, MenuItems. Those are only
  59. references to the same object and are only used to improve readability.