#1161 Implement dispose for wx simple TextEditor (base class)

Merged
Coverage Reach
wx/tree_editor.py wx/table_editor.py wx/tabular_editor.py wx/ui_panel.py wx/range_editor.py wx/list_str_editor.py wx/date_editor.py wx/table_model.py wx/list_editor.py wx/extra/bounds_editor.py wx/extra/windows/ie_html_editor.py wx/extra/windows/flash_editor.py wx/extra/led_editor.py wx/scrubber_editor.py wx/instance_editor.py wx/helper.py wx/toolkit.py wx/image_slice.py wx/enum_editor.py wx/set_editor.py wx/ui_live.py wx/code_editor.py wx/file_editor.py wx/color_editor.py wx/menu.py wx/ui_modal.py wx/dnd_editor.py wx/text_editor.py wx/check_list_editor.py wx/font_editor.py wx/ui_base.py wx/editor.py wx/ui_wizard.py wx/image_control.py wx/history_control.py wx/color_trait.py wx/image_enum_editor.py wx/key_binding_editor.py wx/font_trait.py wx/editor_factory.py wx/progress_editor.py wx/editors_gen.py wx/drop_editor.py wx/view_application.py wx/html_editor.py wx/search_editor.py wx/history_editor.py wx/button_editor.py wx/ui_window.py wx/time_editor.py wx/rgb_color_trait.py wx/compound_editor.py wx/animated_gif_editor.py wx/key_event_to_name.py wx/directory_editor.py wx/boolean_editor.py wx/constants.py wx/rgb_color_editor.py wx/image_editor.py wx/custom_editor.py wx/csv_list_editor.py wx/title_editor.py wx/null_editor.py wx/array_editor.py wx/value_editor.py wx/basic_editor_factory.py wx/tuple_editor.py wx/ui_editor.py wx/shell_editor.py wx/data_frame_editor.py wx/popup_editor.py wx/array_view_editor.py wx/color_column.py wx/__init__.py qt4/tree_editor.py qt4/table_editor.py qt4/ui_panel.py qt4/tabular_editor.py qt4/range_editor.py qt4/extra/bounds_editor.py qt4/extra/range_slider.py qt4/extra/checkbox_renderer.py qt4/extra/qt_view.py qt4/extra/table_image_renderer.py qt4/extra/progress_renderer.py qt4/extra/led_editor.py qt4/list_editor.py qt4/toolkit.py qt4/list_str_editor.py qt4/table_model.py qt4/instance_editor.py qt4/enum_editor.py qt4/set_editor.py qt4/editor.py qt4/ui_base.py qt4/tabular_model.py qt4/file_editor.py qt4/code_editor.py qt4/image_enum_editor.py qt4/menu.py qt4/list_str_model.py qt4/check_list_editor.py qt4/date_editor.py qt4/color_editor.py qt4/helper.py qt4/text_editor.py qt4/image_editor.py qt4/ui_modal.py qt4/font_editor.py qt4/ui_live.py qt4/font_trait.py qt4/button_editor.py qt4/key_binding_editor.py qt4/drop_editor.py qt4/styled_date_editor.py qt4/editor_factory.py qt4/datetime_editor.py qt4/progress_editor.py qt4/tree_node_renderers.py qt4/search_editor.py qt4/date_range_editor.py qt4/history_editor.py qt4/color_trait.py qt4/html_editor.py qt4/view_application.py qt4/boolean_editor.py qt4/time_editor.py qt4/compound_editor.py qt4/clipboard.py qt4/key_event_to_name.py qt4/rgb_color_trait.py qt4/directory_editor.py qt4/rgb_color_editor.py qt4/title_editor.py qt4/csv_list_editor.py qt4/constants.py qt4/custom_editor.py qt4/null_editor.py qt4/value_editor.py qt4/array_editor.py qt4/basic_editor_factory.py qt4/shell_editor.py qt4/ui_editor.py qt4/tuple_editor.py qt4/data_frame_editor.py qt4/array_view_editor.py qt4/__init__.py editors/table_editor.py editors/range_editor.py editors/array_editor.py editors/shell_editor.py editors/csv_list_editor.py editors/tuple_editor.py editors/html_editor.py editors/list_editor.py editors/api.py editors/tree_editor.py editors/tabular_editor.py editors/image_enum_editor.py editors/button_editor.py editors/popup_editor.py editors/value_editor.py editors/code_editor.py editors/list_str_editor.py editors/text_editor.py editors/date_editor.py editors/enum_editor.py editors/default_override.py editors/instance_editor.py editors/file_editor.py editors/scrubber_editor.py editors/custom_editor.py editors/progress_editor.py editors/color_editor.py editors/image_editor.py editors/search_editor.py editors/boolean_editor.py editors/font_editor.py editors/rgb_color_editor.py editors/title_editor.py editors/history_editor.py editors/set_editor.py editors/datetime_editor.py editors/styled_date_editor.py editors/time_editor.py editors/drop_editor.py editors/compound_editor.py editors/dnd_editor.py editors/null_editor.py editors/key_binding_editor.py editors/check_list_editor.py editors/date_range_editor.py editors/directory_editor.py editors/__init__.py testing/tester/wx/implementation/enum_editor.py testing/tester/wx/implementation/list_editor.py testing/tester/wx/implementation/check_list_editor.py testing/tester/wx/implementation/button_editor.py testing/tester/wx/implementation/range_editor.py testing/tester/wx/implementation/text_editor.py testing/tester/wx/implementation/instance_editor.py testing/tester/wx/implementation/ui_base.py testing/tester/wx/implementation/font_editor.py testing/tester/wx/helpers.py testing/tester/wx/default_registry.py testing/tester/wx/common_ui_targets.py testing/tester/wx/registry_helper.py testing/tester/qt4/implementation/enum_editor.py testing/tester/qt4/implementation/list_editor.py testing/tester/qt4/implementation/check_list_editor.py testing/tester/qt4/implementation/range_editor.py testing/tester/qt4/implementation/instance_editor.py testing/tester/qt4/implementation/text_editor.py testing/tester/qt4/implementation/button_editor.py testing/tester/qt4/implementation/ui_base.py testing/tester/qt4/implementation/font_editor.py testing/tester/qt4/helpers.py testing/tester/qt4/default_registry.py testing/tester/qt4/common_ui_targets.py testing/tester/qt4/registry_helper.py testing/tester/ui_wrapper.py testing/tester/ui_tester.py testing/tester/registry.py testing/tester/exceptions.py testing/tester/locator.py testing/tester/editors/layout.py testing/tester/common_ui_targets.py testing/tester/registry_helper.py testing/tester/default_registry.py testing/tester/command.py testing/tester/query.py testing/tester/compat.py tree_node.py extras/_demo_legacy.py extras/saving.py extras/has_dynamic_views.py extras/progress_column.py extras/checkbox_column.py extras/edit_column.py extras/api.py extras/_demo_info.py extras/demo.py ui.py table_column.py tabular_adapter.py editor.py ui_editors/data_frame_editor.py ui_editors/array_view_editor.py group.py table_filter.py undo.py file_dialog.py value_tree.py handler.py item.py list_str_adapter.py key_bindings.py view.py null/font_trait.py null/toolkit.py null/rgb_color_trait.py null/color_trait.py null/__init__.py editor_factory.py toolkit.py helper.py view_element.py ui_traits.py instance_choice.py view_elements.py base_panel.py theme.py dockable_view_element.py dock_window_theme.py delegating_handler.py api.py menu.py message.py color_column.py __init__.py ui_editor.py editors_gen.py basic_editor_factory.py help_template.py ui_info.py context_value.py tree_node_renderer.py toolkit_traits.py help.py include.py default_dock_window_theme.py image/image.py mimedata.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -15,6 +15,7 @@
Loading
15 15
    button_editor,
16 16
    check_list_editor,
17 17
    enum_editor,
18 +
    font_editor,
18 19
    instance_editor,
19 20
    list_editor,
20 21
    range_editor,
@@ -45,6 +46,9 @@
Loading
45 46
    # EnumEditor
46 47
    enum_editor.register(registry)
47 48
49 +
    # FontEditor
50 +
    font_editor.register(registry)
51 +
48 52
    # TextEditor
49 53
    text_editor.register(registry)
50 54

@@ -15,6 +15,7 @@
Loading
15 15
    button_editor,
16 16
    check_list_editor,
17 17
    enum_editor,
18 +
    font_editor,
18 19
    instance_editor,
19 20
    list_editor,
20 21
    range_editor,
@@ -45,6 +46,9 @@
Loading
45 46
    # EnumEditor
46 47
    enum_editor.register(registry)
47 48
49 +
    # FontEditor
50 +
    font_editor.register(registry)
51 +
48 52
    # TextEditor
49 53
    text_editor.register(registry)
50 54

@@ -0,0 +1,31 @@
Loading
1 +
#  Copyright (c) 2005-2020, Enthought, Inc.
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
6 +
#  under 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 +
#
11 +
12 +
from traitsui.testing.tester.wx.registry_helper import (
13 +
    register_editable_textbox_handlers,
14 +
)
15 +
from traitsui.wx.font_editor import TextFontEditor
16 +
17 +
18 +
def register(registry):
19 +
    """ Register interactions pertaining to (wx) FontEditor for the given
20 +
    registry.
21 +
22 +
    Parameters
23 +
    ----------
24 +
    registry : TargetRegistry
25 +
        The registry being registered to.
26 +
    """
27 +
    register_editable_textbox_handlers(
28 +
        registry=registry,
29 +
        target_class=TextFontEditor,
30 +
        widget_getter=lambda wrapper: wrapper.target.control,
31 +
    )

@@ -116,6 +116,19 @@
Loading
116 116
        parent.Bind(wx.EVT_TEXT_ENTER, self.update_object, id=self.control.GetId())
117 117
        self.set_tooltip()
118 118
119 +
    def dispose(self):
120 +
        """ Disposes of the contents of an editor.
121 +
        """
122 +
        if self.control is not None:   # just in-case
123 +
            parent = self.control.GetParent()
124 +
            parent.Unbind(
125 +
                wx.EVT_TEXT_ENTER,
126 +
                handler=self.update_object,
127 +
                id=self.control.GetId(),
128 +
            )
129 +
            self.control.Unbind(wx.EVT_KILL_FOCUS, handler=self.update_object)
130 +
        super().dispose()
131 +
119 132
    def update_object(self, event):
120 133
        """ Handles the user changing the contents of the edit control.
121 134
        """

@@ -0,0 +1,31 @@
Loading
1 +
#  Copyright (c) 2005-2020, Enthought, Inc.
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
6 +
#  under 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 +
#
11 +
12 +
from traitsui.testing.tester.qt4.registry_helper import (
13 +
    register_editable_textbox_handlers,
14 +
)
15 +
from traitsui.qt4.font_editor import TextFontEditor
16 +
17 +
18 +
def register(registry):
19 +
    """ Register interactions pertaining to (Qt) FontEditor for the given
20 +
    registry.
21 +
22 +
    Parameters
23 +
    ----------
24 +
    registry : TargetRegistry
25 +
        The registry being registered to.
26 +
    """
27 +
    register_editable_textbox_handlers(
28 +
        registry=registry,
29 +
        target_class=TextFontEditor,
30 +
        widget_getter=lambda wrapper: wrapper.target.control,
31 +
    )

Learn more Showing 35 files with coverage changes found.

Changes in traitsui/testing/tester/qt4/implementation/list_editor.py
-4
Loading file...
Changes in traitsui/testing/tester/wx/helpers.py
+9
Loading file...
Changes in traitsui/testing/tester/locator.py
+1
Loading file...
Changes in traitsui/testing/tester/wx/implementation/check_list_editor.py
-4
Loading file...
Changes in traitsui/testing/tester/wx/implementation/range_editor.py
-2
Loading file...
Changes in traitsui/testing/tester/wx/common_ui_targets.py
+6
Loading file...
Changes in traitsui/testing/tester/qt4/implementation/check_list_editor.py
-4
Loading file...
Changes in traitsui/testing/tester/ui_wrapper.py
New
Loading file...
Changes in traitsui/testing/tester/qt4/default_registry.py
+1
Loading file...
Changes in traitsui/testing/tester/wx/default_registry.py
+1
Loading file...
Changes in traitsui/testing/tester/wx/implementation/list_editor.py
-4
Loading file...
Changes in traitsui/testing/tester/qt4/common_ui_targets.py
+6
Loading file...
New file traitsui/testing/tester/qt4/implementation/font_editor.py
New
Loading file...
New file traitsui/testing/tester/wx/implementation/font_editor.py
New
Loading file...
Changes in traitsui/qt4/toolkit.py
-1
+1
Loading file...
Changes in traitsui/qt4/table_model.py
-1
+1
Loading file...
Changes in traitsui/qt4/enum_editor.py
-1
+1
Loading file...
Changes in traitsui/qt4/table_editor.py
-5
+5
Loading file...
Changes in traitsui/qt4/list_str_editor.py
-1
-1
+2
Loading file...
Changes in traitsui/ui.py
-2
-1
+3
Loading file...
Changes in traitsui/qt4/text_editor.py
-1
+1
Loading file...
Changes in traitsui/qt4/ui_base.py
-2
+2
Loading file...
Changes in traitsui/qt4/instance_editor.py
-5
+3
+2
Loading file...
Changes in traitsui/qt4/file_editor.py
-1
-1
+2
Loading file...
Changes in traitsui/key_bindings.py
-1
-1
+2
Loading file...
Changes in traitsui/testing/tester/qt4/helpers.py
-1
+8
Loading file...
Changes in traitsui/qt4/datetime_editor.py
-1
-1
+2
Loading file...
Changes in traitsui/qt4/font_trait.py
-3
+3
Loading file...
Changes in traitsui/qt4/range_editor.py
-18
+18
Loading file...
Changes in traitsui/qt4/helper.py
-1
-4
+5
Loading file...
Changes in traitsui/testing/tester/ui_tester.py
-1
-1
+2
Loading file...
Changes in traitsui/helper.py
-11
+9
+2
Loading file...
Changes in traitsui/testing/tester/qt4/registry_helper.py
-1
+1
Loading file...
Changes in traitsui/testing/tester/qt4/implementation/range_editor.py
-1
-2
+1
Loading file...
Changes in traitsui/qt4/font_editor.py
-42
+42
Loading file...
Files Coverage
editors 68.9%
extras 3.3%
null 78.3%
qt4 +1.1% 53.6%
testing/tester 0.7% 57.2%
ui_editors 65.1%
wx -<.1% 0.1%
__init__.py 82.7%
api.py 89.2%
base_panel.py 65.0%
basic_editor_factory.py 82.4%
color_column.py 70.9%
context_value.py 100.0%
default_dock_window_theme.py 0.0%
delegating_handler.py 0.0%
dock_window_theme.py 61.6%
dockable_view_element.py 0.0%
editor.py 89.6%
editor_factory.py 69.5%
editors_gen.py 0.0%
file_dialog.py 0.0%
group.py 80.7%
handler.py 51.5%
help.py 50.0%
help_template.py 82.4%
helper.py +10.6% 74.2%
image/image.py 0.0%
include.py 100.0%
instance_choice.py 57.2%
item.py 75.6%
key_bindings.py +1.7% 50.0%
list_str_adapter.py 82.7%
menu.py 100.0%
message.py 60.0%
mimedata.py 0.0%
table_column.py 58.7%
table_filter.py 46.2%
tabular_adapter.py 71.4%
theme.py 54.2%
toolkit.py 97.9%
toolkit_traits.py 100.0%
tree_node.py 57.6%
tree_node_renderer.py 83.4%
ui.py 0.8% 69.8%
ui_editor.py 78.3%
ui_info.py 100.0%
ui_traits.py 52.2%
undo.py 49.0%
value_tree.py 45.6%
view.py 91.0%
view_element.py 87.2%
view_elements.py 86.9%
Folder Totals (52 files) 34.4%
Project Totals (293 files) 34.4%
Loading