"""
A status bar manager realizes itself in a status bar control.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

StatusBarManager = toolkit_object(
    'action.status_bar_manager:StatusBarManager'
)

#-- EOF ------------------------------------------------------------------------
Example #2
0
# Define a reusable, default ImageSlice object:
default_image_slice = ImageSlice()

#-------------------------------------------------------------------------------
#  Helper Functions:
#-------------------------------------------------------------------------------

image_slice_cache = {}

def image_slice_for ( image ):
    """ Returns a (possibly cached) ImageSlice.
    """
    global image_slice_cache

    result = image_slice_cache.get( image )
    if result is None:
        image_slice_cache[ image ] = result = ImageSlice( image = image )

    return result

#-------------------------------------------------------------------------------
# Add the toolkit specific extensions:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

toolkit_object( 'image_slice:ImageSliceX' )

#-- EOF ------------------------------------------------------------------------
Example #3
0
"""
A menu bar manager realizes itself in errr, a menu bar control.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

MenuBarManager = toolkit_object( 'action.menu_bar_manager:MenuBarManager' )

#-- EOF ------------------------------------------------------------------------
"""
A tool bar manager realizes itself in a tool palette control.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

ToolPaletteManager = toolkit_object(
    'action.tool_palette_manager:ToolPaletteManager'
)

#-- EOF ------------------------------------------------------------------------
Example #5
0
# -------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
# -------------------------------------------------------------------------------

# -------------------------------------------------------------------------------
#  Imports:
# -------------------------------------------------------------------------------

from facets.ui.pyface.toolkit import toolkit_object

# -------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
# -------------------------------------------------------------------------------

DoLaterTimer = toolkit_object("timer.do_later:DoLaterTimer")

# -------------------------------------------------------------------------------
#  Function Definitions:
# -------------------------------------------------------------------------------


def do_later(callable, *args, **kw_args):
    """ Does something 50 milliseconds from now.
    """
    DoLaterTimer(50, callable, args, kw_args)


def do_after(interval, callable, *args, **kw_args):
    """ Does something after some specified time interval.
    """
Example #6
0
    import Any, Instance, List, Property, Str

from action \
    import Action

from action_manager_item \
    import ActionManagerItem

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

_MenuItem    = toolkit_object( 'action.action_item:_MenuItem' )
_Tool        = toolkit_object( 'action.action_item:_Tool' )
_PaletteTool = toolkit_object( 'action.action_item:_PaletteTool' )

#-------------------------------------------------------------------------------
#  'ActionItem' class:
#-------------------------------------------------------------------------------

class ActionItem ( ActionManagerItem ):
    """ An action manager item that represents an actual action.
    """

    #-- 'ActionManagerItem' interface ------------------------------------------

    # The item's unique identifier ('unique' in this case means unique within
    # its group).
Example #7
0
"""
A menu manager realizes itself in a menu control.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

MenuManager = toolkit_object( 'action.menu_manager:MenuManager' )

#-- EOF ------------------------------------------------------------------------
Example #8
0
"""
A tool bar manager realizes itself in a tool bar control.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

ToolBarManager = toolkit_object( 'action.tool_bar_manager:ToolBarManager' )

#-- EOF ------------------------------------------------------------------------
Example #9
0
"""
A timer that invokes a specified callback periodically.
"""

#-------------------------------------------------------------------------------
#  License: See sections (A) and (B) of the .../facets/LICENSE.txt file.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from facets.ui.pyface.toolkit \
    import toolkit_object

#-------------------------------------------------------------------------------
#  Defines the GUI toolkit specific implementation:
#-------------------------------------------------------------------------------

Timer = toolkit_object( 'timer.timer:Timer' )

#-- EOF ------------------------------------------------------------------------