| 1 |
# (C) Copyright 2007-2025 Enthought, Inc., Austin, TX |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# This software is provided without warranty under the terms of the BSD |
| 5 |
# license included in LICENSE.txt and may be redistributed only under |
| 6 |
# the conditions described in the aforementioned license. The license |
| 7 |
# is also available online at http://www.enthought.com/licenses/BSD.txt |
| 8 |
# |
| 9 |
# Thanks for using Enthought open source! |
| 10 |
""" The *definition* of a group in a tool bar or menu. """ |
| 11 |
|
| 12 |
|
| 13 |
# Enthought library imports. |
| 14 |
from traits.api import Bool, Str |
| 15 |
|
| 16 |
# Local imports. |
| 17 |
from .location import Location |
| 18 |
|
| 19 |
|
| 20 |
class Group(Location): |
| 21 |
"""The *definition* of a group in a tool bar or menu.""" |
| 22 |
|
| 23 |
# The group's unique identifier (unique within the tool bar, menu bar or |
| 24 |
# menu that the group is to be added to). |
| 25 |
id = Str |
| 26 |
|
| 27 |
# Does this group require a separator? |
| 28 |
separator = Bool(True) |
| 29 |
|
| 30 |
# The optional name of a class that implements the group. The class must |
| 31 |
# support the **pyface.action.Group** protocol. |
| 32 |
class_name = Str |
| 33 |
|
| 34 |
########################################################################### |
| 35 |
# 'object' interface |
| 36 |
########################################################################### |
| 37 |
|
| 38 |
def __str__(self): |
| 39 |
"""Return the 'informal' string representation of the object.""" |
| 40 |
|
| 41 |
return "Group(%s)" % self.id |
| 42 |
|
| 43 |
__repr__ = __str__ |