Пример #1
0
"""
The implementation of a simple 'About' dialog.
"""

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

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

from toolkit import toolkit_object

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

AboutDialog = toolkit_object("about_dialog:AboutDialog")

# -- EOF ------------------------------------------------------------------------
Пример #2
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of access to system metrics (screen width and height
etc).
"""


# Import the toolkit specific version.
from toolkit import toolkit_object
SystemMetrics = toolkit_object('system_metrics:SystemMetrics')

#### EOF ######################################################################
Пример #3
0
"""
The implementation of a shared resource manager.
"""

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

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

from facets.lib.resource.api import ResourceManager

from toolkit import toolkit_object

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

PyfaceResourceFactory = toolkit_object("resource_manager:PyfaceResourceFactory")

# Define a shared instance:
resource_manager = ResourceManager(resource_factory=PyfaceResourceFactory())

# -- EOF ------------------------------------------------------------------------
Пример #4
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a top-level application window. """


# Import the toolkit specific version.
from toolkit import toolkit_object
ApplicationWindow = toolkit_object('application_window:ApplicationWindow')

#### EOF ######################################################################
Пример #5
0
"""
The implementation of a splash screen.
"""

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

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

from toolkit import toolkit_object

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

SplashScreen = toolkit_object("splash_screen:SplashScreen")

# -- EOF ------------------------------------------------------------------------
Пример #6
0
#------------------------------------------------------------------------------
# Copyright (c) 2009, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Evan Patterson
# Date: 06/26/09
#------------------------------------------------------------------------------

""" The interface for manipulating the toolkit clipboard.
"""

# Import the toolkit specific version
from toolkit import toolkit_object
Clipboard = toolkit_object('clipboard:Clipboard')

# Create a singleton clipboard object for convenience
clipboard = Clipboard()
Пример #7
0
#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought enable package component>
#------------------------------------------------------------------------------


# Import the toolkit specific version.
from toolkit import toolkit_object
font_metrics_provider = toolkit_object('font_metrics_provider')

#### EOF ######################################################################
Пример #8
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a splash screen. """


# Import the toolkit specific version.
from toolkit import toolkit_object
SplashScreen = toolkit_object('splash_screen:SplashScreen')

#### EOF ######################################################################
Пример #9
0
#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought enable package component>
#------------------------------------------------------------------------------


# Import the toolkit specific version.
from toolkit import toolkit_object
CompiledPath = toolkit_object('CompiledPath')

#### EOF ######################################################################
Пример #10
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a dialog that allows the user to open/save files etc.
"""

# Import the toolkit specific version.
from toolkit import toolkit_object
FileDialog = toolkit_object('file_dialog:FileDialog')

#### EOF ######################################################################
Пример #11
0
#------------------------------------------------------------------------------
""" The implementation of a dialog that prompts the user for confirmation. """


# Local imports.
from constant import NO


def confirm(parent, message, title=None, cancel=False, default=NO):
    """ Convenience function to show a confirmation dialog. """

    if title is None:
        title = "Confirmation"

    dialog = ConfirmationDialog(
        parent  = parent,
        message = message,
        cancel  = cancel,
        default = default,
        title   = title
    )

    return dialog.open()


# Import the toolkit specific version.
from toolkit import toolkit_object
ConfirmationDialog = toolkit_object('confirmation_dialog:ConfirmationDialog')

#### EOF ######################################################################
Пример #12
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought enable package component>
#------------------------------------------------------------------------------


# Import the toolkit specific version.
from toolkit import toolkit_object
NativeScrollBar = toolkit_object('NativeScrollBar')

#### EOF ######################################################################
Пример #13
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a pyface GUI. """


# Import the toolkit specific version.
from toolkit import toolkit_object
GUI = toolkit_object('gui:GUI')

#### EOF ######################################################################
Пример #14
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" Heading text. """


# Import the toolkit specific version.
from toolkit import toolkit_object
HeadingText = toolkit_object('heading_text:HeadingText')

#### EOF ######################################################################
Пример #15
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" A simple progress dialog window which allows itself to be updated
"""


# Import the toolkit specific version.
from toolkit import toolkit_object
ProgressDialog = toolkit_object('progress_dialog:ProgressDialog')

#### EOF ######################################################################
Пример #16
0
"""
The implementation of an interactive Python shell.
"""

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

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

from toolkit \
    import toolkit_object

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

PythonShell = toolkit_object( 'python_shell:PythonShell' )

#-- EOF ------------------------------------------------------------------------
Пример #17
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an interactive Python shell. """


# Import the toolkit specific version.
from toolkit import toolkit_object
PythonShell = toolkit_object('python_shell:PythonShell')

#### EOF ######################################################################
Пример #18
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a dialog that allows the user to browse for a
directory.
"""


# Import the toolkit specific version.
from toolkit import toolkit_object
DirectoryDialog = toolkit_object('directory_dialog:DirectoryDialog')

#### EOF ######################################################################
Пример #19
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" Mix-in class for split widgets. """


# Import the toolkit specific version.
from toolkit import toolkit_object
SplitWidget = toolkit_object('split_widget:SplitWidget')

#### EOF ######################################################################
Пример #20
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an image resource. """

# Import the toolkit specific version.
from toolkit import toolkit_object
ImageResource = toolkit_object('image_resource:ImageResource')

#### EOF ######################################################################
Пример #21
0
"""
A widget for editing Python code.
"""

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

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

from toolkit \
    import toolkit_object

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

PythonEditor = toolkit_object( 'python_editor:PythonEditor' )

#-- EOF ------------------------------------------------------------------------
Пример #22
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an image cache. """


# Import the toolkit specific version.
from toolkit import toolkit_object
ImageCache = toolkit_object('image_cache:ImageCache')

#### EOF ######################################################################
Пример #23
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" A widget for editing Python code. """

# Import the toolkit specific version.
from toolkit import toolkit_object
PythonEditor = toolkit_object('python_editor:PythonEditor')

#### EOF ######################################################################
Пример #24
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" Heading text. """


# Import the toolkit specific version.
from toolkit import toolkit_object
HeadingText = toolkit_object('heading_text:HeadingText')

#### EOF ######################################################################
Пример #25
0
#------------------------------------------------------------------------------
# Copyright (c) 2008, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an IPython shell. """

# Import the toolkit specific version.
try:
    import IPython.frontend
except ImportError:
    raise ImportError, '''
________________________________________________________________________________
Could not load the Wx frontend for ipython. 
You need to have ipython >= 0.9 installed to use the ipython widget.'''

from toolkit import toolkit_object
IPythonWidget = toolkit_object('ipython_widget:IPythonWidget')

#### EOF ######################################################################
Пример #26
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a pyface GUI. """

# Import the toolkit specific version.
from toolkit import toolkit_object
GUI = toolkit_object('gui:GUI')

#### EOF ######################################################################
Пример #27
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" Mix-in class for split widgets. """

# Import the toolkit specific version.
from toolkit import toolkit_object
SplitWidget = toolkit_object('split_widget:SplitWidget')

#### EOF ######################################################################
Пример #28
0
# Copyright (c) 2008, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
# ------------------------------------------------------------------------------
""" The implementation of an IPython shell. """


# Import the toolkit specific version.
try:
    import IPython.frontend
except ImportError:
    raise ImportError, """
________________________________________________________________________________
Could not load the Wx frontend for ipython. 
You need to have ipython >= 0.9 installed to use the ipython widget."""


from toolkit import toolkit_object

IPythonWidget = toolkit_object("ipython_widget:IPythonWidget")

#### EOF ######################################################################
Пример #29
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The base implementation of all pyface widgets. """

# Import the toolkit specific version.
from toolkit import toolkit_object
Widget = toolkit_object('widget:Widget')

#### EOF ######################################################################
Пример #30
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a simple 'About' dialog. """

# Import the toolkit specific version.
from toolkit import toolkit_object
AboutDialog = toolkit_object('about_dialog:AboutDialog')

### EOF #######################################################################
Пример #31
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The abstract implementation of all pyface dialogs. """

# Import the toolkit specific version.
from toolkit import toolkit_object
Dialog = toolkit_object('dialog:Dialog')

#### EOF ######################################################################
Пример #32
0
# Copyright 2012 Philip Chimento
"""Sound the system bell."""

# Import the toolkit-specific version
from toolkit import toolkit_object
beep = toolkit_object('beep:beep')
Пример #33
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought enable package component>
#------------------------------------------------------------------------------


# Import the toolkit specific version.
from toolkit import toolkit_object
Window = toolkit_object('Window')

#### EOF ######################################################################
Пример #34
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a dialog that allows the user to browse for a
directory.
"""

# Import the toolkit specific version.
from toolkit import toolkit_object
DirectoryDialog = toolkit_object('directory_dialog:DirectoryDialog')

#### EOF ######################################################################
Пример #35
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The abstract implementation of all pyface top-level windows. """

# Import the toolkit specific version.
from toolkit import toolkit_object

Window = toolkit_object('window:Window')

#### EOF ######################################################################
Пример #36
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a shared resource manager. """

# Enthought library imports.
from enthought.resource.api import ResourceManager

# Import the toolkit specific version.
from toolkit import toolkit_object
PyfaceResourceFactory = toolkit_object(
    'resource_manager:PyfaceResourceFactory')

# A shared instance.
resource_manager = ResourceManager(resource_factory=PyfaceResourceFactory())

#### EOF ######################################################################
Пример #37
0
def warning ( parent, message, title = 'Warning' ):
    """ Convenience function to show a warning message dialog.
    """
    MessageDialog(
        parent   = parent and parent(),
        message  = message,
        title    = title,
        severity = 'warning'
    ).open()


def error ( parent, message, title = 'Error' ):
    """ Convenience function to show an error message dialog.
    """
    MessageDialog(
        parent   = parent and parent(),
        message  = message,
        title    = title,
        severity = 'error'
    ).open()

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

from toolkit \
    import toolkit_object

MessageDialog = toolkit_object( 'message_dialog:MessageDialog' )

#-- EOF ------------------------------------------------------------------------
Пример #38
0
def warning(parent, message, title='Warning'):
    """ Convenience function to show a warning message dialog. """

    dialog = MessageDialog(parent=parent,
                           message=message,
                           title=title,
                           severity='warning')
    dialog.open()

    return


def error(parent, message, title='Error'):
    """ Convenience function to show an error message dialog. """

    dialog = MessageDialog(parent=parent,
                           message=message,
                           title=title,
                           severity='error')
    dialog.open()

    return


# Import the toolkit specific version.
from toolkit import toolkit_object
MessageDialog = toolkit_object('message_dialog:MessageDialog')

#### EOF ######################################################################
Пример #39
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a simple 'About' dialog. """


# Import the toolkit specific version.
from toolkit import toolkit_object
AboutDialog = toolkit_object('about_dialog:AboutDialog')

### EOF #######################################################################
Пример #40
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an image resource. """


# Import the toolkit specific version.
from toolkit import toolkit_object
ImageResource = toolkit_object('image_resource:ImageResource')

#### EOF ######################################################################
Пример #41
0
The implementation of an IPython shell.
"""

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

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

# Import the toolkit specific version:
try:
    import IPython.frontend
except ImportError:
    raise ImportError, '''
________________________________________________________________________________
Could not load the Wx frontend for ipython.
You need to have ipython >= 0.9 installed to use the ipython widget.'''


from toolkit \
    import toolkit_object

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

IPythonWidget = toolkit_object( 'ipython_widget:IPythonWidget' )

#-- EOF ------------------------------------------------------------------------
Пример #42
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of an image cache. """

# Import the toolkit specific version.
from toolkit import toolkit_object

ImageCache = toolkit_object('image_cache:ImageCache')

#### EOF ######################################################################
Пример #43
0
#------------------------------------------------------------------------------
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought enable package component>
#------------------------------------------------------------------------------


# Import the toolkit specific version.
from toolkit import toolkit_object
GraphicsContext = toolkit_object('GraphicsContext')

#### EOF ######################################################################
Пример #44
0
    dialog = MessageDialog(parent=parent, message=message, title=title, severity="information")
    dialog.open()

    return


def warning(parent, message, title="Warning"):
    """ Convenience function to show a warning message dialog. """

    dialog = MessageDialog(parent=parent, message=message, title=title, severity="warning")
    dialog.open()

    return


def error(parent, message, title="Error"):
    """ Convenience function to show an error message dialog. """

    dialog = MessageDialog(parent=parent, message=message, title=title, severity="error")
    dialog.open()

    return


# Import the toolkit specific version.
from toolkit import toolkit_object

MessageDialog = toolkit_object("message_dialog:MessageDialog")

#### EOF ######################################################################
Пример #45
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of access to system metrics (screen width and height
etc).
"""

# Import the toolkit specific version.
from toolkit import toolkit_object
SystemMetrics = toolkit_object('system_metrics:SystemMetrics')

#### EOF ######################################################################
Пример #46
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a top-level application window. """

# Import the toolkit specific version.
from toolkit import toolkit_object
ApplicationWindow = toolkit_object('application_window:ApplicationWindow')

#### EOF ######################################################################
Пример #47
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The base implementation of all pyface widgets. """


# Import the toolkit specific version.
from toolkit import toolkit_object
Widget = toolkit_object('widget:Widget')

#### EOF ######################################################################
Пример #48
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The abstract implementation of all pyface dialogs. """


# Import the toolkit specific version.
from toolkit import toolkit_object
Dialog = toolkit_object('dialog:Dialog')

#### EOF ######################################################################
Пример #49
0
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" A simple progress dialog window which allows itself to be updated
"""


# Import the toolkit specific version.
from toolkit import toolkit_object
ProgressDialog = toolkit_object('progress_dialog:ProgressDialog')

#### EOF ######################################################################
Пример #50
0
"""
The implementation of a dialog that allows the user to open/save files etc.
"""

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

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

from toolkit \
    import toolkit_object

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

FileDialog = toolkit_object( 'file_dialog:FileDialog' )

#-- EOF ------------------------------------------------------------------------
Пример #51
0
#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" The implementation of a dialog that prompts the user for confirmation. """

# Local imports.
from constant import NO


def confirm(parent, message, title=None, cancel=False, default=NO):
    """ Convenience function to show a confirmation dialog. """

    if title is None:
        title = "Confirmation"

    dialog = ConfirmationDialog(parent=parent,
                                message=message,
                                cancel=cancel,
                                default=default,
                                title=title)

    return dialog.open()


# Import the toolkit specific version.
from toolkit import toolkit_object
ConfirmationDialog = toolkit_object('confirmation_dialog:ConfirmationDialog')

#### EOF ######################################################################