コード例 #1
0
"""
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 ------------------------------------------------------------------------
コード例 #2
0
ファイル: image_slice.py プロジェクト: davidmorrill/facets
# 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 ------------------------------------------------------------------------
コード例 #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 ------------------------------------------------------------------------
コード例 #4
0
"""
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 ------------------------------------------------------------------------
コード例 #5
0
ファイル: do_later.py プロジェクト: davidmorrill/facets
# -------------------------------------------------------------------------------
#  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.
    """
コード例 #6
0
ファイル: action_item.py プロジェクト: davidmorrill/facets
    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).
コード例 #7
0
ファイル: menu_manager.py プロジェクト: davidmorrill/facets
"""
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 ------------------------------------------------------------------------
コード例 #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 ------------------------------------------------------------------------
コード例 #9
0
ファイル: timer.py プロジェクト: davidmorrill/facets
"""
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 ------------------------------------------------------------------------