<commit_before>#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the GPL v2
# license.
#
# Author: Riverbank Computing Limited
#------------------------------------------------------------------------------

""" Defines the various list editors and the list editor factory for the 
    PyQt user interface toolkit..
"""

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

from PyQt4 import QtCore, QtGui

from enthought.traits.api \
    import Trait, HasTraits, BaseTraitHandler, Range, Str, Any, Instance, \
           Property, false
    
from enthought.traits.trait_base \
    import user_name_for, enumerate
    
from enthought.traits.ui.api \
    import View, Item, EditorFactory
    
from enthought.traits.ui.ui_traits \
    import style_trait, AView
    
from editor_factory \
    import EditorFactory
    
from editor \
    import Editor
    
from helper \
    import IconButton, UnboundedScrollArea

from menu \
    import MakeMenu
    
#-------------------------------------------------------------------------------
#  Trait definitions:
#-------------------------------------------------------------------------------

# Trait whose value is a BaseTraitHandler object
handler_trait = Instance( BaseTraitHandler )

# The visible number of rows displayed
rows_trait = Range( 1, 50, 5,
                    desc = 'the number of list rows to display' )
                    
editor_trait = Instance( EditorFactory )                    

#-------------------------------------------------------------------------------
#  'ToolkitEditorFactory' class:
#-------------------------------------------------------------------------------

class ToolkitEditorFactory ( EditorFactory ):
    """ PyQt editor factory for list editors.
    """
    
    #---------------------------------------------------------------------------
    #  Trait definitions:
    #---------------------------------------------------------------------------
    
    # The editor to use for each list item:
    editor = editor_trait
    
    # The style of editor to use for each item:
    style = style_trait
    
    # The trait handler for each list item:
    trait_handler = handler_trait 
    
    # Number of list rows to display:
    rows = rows_trait 

    # Use a notebook for a custom view?
    use_notebook = false
    
    #-- Notebook Specific Traits -----------------------------------------------
    <commit_msg>Tracked a bug fix to the wx list editor.<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the GPL v2
# license.
#
# Author: Riverbank Computing Limited
#------------------------------------------------------------------------------

""" Defines the various list editors and the list editor factory for the 
    PyQt user interface toolkit..
"""

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

from PyQt4 import QtCore, QtGui

from enthought.traits.api \
    import Trait, HasTraits, BaseTraitHandler, Range, Str, Any, Instance, \
           Property, false
    
from enthought.traits.trait_base \
    import user_name_for, enumerate
    
from enthought.traits.ui.api \
    import View, Item, EditorFactory as UIEditorFactory
    
from enthought.traits.ui.ui_traits \
    import style_trait, AView
    
from editor_factory \
    import EditorFactory
    
from editor \
    import Editor
    
from helper \
    import IconButton, UnboundedScrollArea

from menu \
    import MakeMenu
    
#-------------------------------------------------------------------------------
#  Trait definitions:
#-------------------------------------------------------------------------------

# Trait whose value is a BaseTraitHandler object
handler_trait = Instance( BaseTraitHandler )

# The visible number of rows displayed
rows_trait = Range( 1, 50, 5,
                    desc = 'the number of list rows to display' )
                    
editor_trait = Instance( UIEditorFactory )                    

#-------------------------------------------------------------------------------
#  'ToolkitEditorFactory' class:
#-------------------------------------------------------------------------------

class ToolkitEditorFactory ( EditorFactory ):
    """ PyQt editor factory for list editors.
    """
    
    #---------------------------------------------------------------------------
    #  Trait definitions:
    #---------------------------------------------------------------------------
    
    # The editor to use for each list item:
    editor = editor_trait
    
    # The style of editor to use for each item:
    style = style_trait
    
    # The trait handler for each list item:
    trait_handler = handler_trait 
    
    # Number of list rows to display:
    rows = rows_trait 

    # Use a notebook for a custom view?
    use_notebook = false
    
    #-- Notebook Specific Traits -----------------------------------------------
    
{'fraction_non_alphanumeric': 0.34908088235294116, 'fraction_numerical': 0.003676470588235294, 'mean_word_length': 0.9930402930402931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3938116', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1128, 'n_words': 394}