Skip to content
Browse files

converting to unix line endings and removing excess whitespace

  • Loading branch information...
1 parent 9f71cb2 commit bd1352bff1da60d9cb6b4dd828d97d6193fdcde9 Ilan Schnell committed
Showing with 2,160 additions and 2,160 deletions.
  1. +7 −7 enthought/pyface/action/action.py
  2. +2 −2 enthought/pyface/action/action_event.py
  3. +8 −8 enthought/pyface/action/action_item.py
  4. +5 −5 enthought/pyface/action/action_manager.py
  5. +3 −3 enthought/pyface/action/action_manager_item.py
  6. +2 −2 enthought/pyface/action/api.py
  7. +16 −16 enthought/pyface/action/group.py
  8. +14 −14 enthought/pyface/action/images/image_LICENSE.txt
  9. +2 −2 enthought/pyface/action/menu_bar_manager.py
  10. +2 −2 enthought/pyface/action/menu_manager.py
  11. +2 −2 enthought/pyface/action/status_bar_manager.py
  12. +2 −2 enthought/pyface/action/tool_bar_manager.py
  13. +2 −2 enthought/pyface/action/tool_palette_manager.py
  14. +4 −4 enthought/pyface/action/window_action.py
  15. +2 −2 enthought/pyface/application_window.py
  16. +3 −3 enthought/pyface/confirmation_dialog.py
  17. +2 −2 enthought/pyface/constant.py
  18. +2 −2 enthought/pyface/dialog.py
  19. +2 −2 enthought/pyface/directory_dialog.py
  20. +7 −7 enthought/pyface/dock/__init__.py
  21. +14 −14 enthought/pyface/dock/api.py
  22. +5 −5 enthought/pyface/dock/dock_sizer.py
  23. +293 −293 enthought/pyface/dock/dock_window.py
  24. +227 −227 enthought/pyface/dock/dock_window_feature.py
  25. +54 −54 enthought/pyface/dock/dock_window_shell.py
  26. +455 −455 enthought/pyface/dock/feature_bar.py
  27. +54 −54 enthought/pyface/dock/feature_tool.py
  28. +8 −8 enthought/pyface/dock/idock_ui_provider.py
  29. +36 −36 enthought/pyface/dock/idockable.py
  30. +72 −72 enthought/pyface/dock/ifeature_tool.py
  31. +40 −40 enthought/pyface/dock/images/image_LICENSE.txt
  32. +12 −12 enthought/pyface/expandable_header.py
  33. +11 −11 enthought/pyface/expandable_panel.py
  34. +7 −7 enthought/pyface/filter.py
  35. +5 −5 enthought/pyface/grid/checkbox_image_renderer.py
  36. +5 −5 enthought/pyface/grid/checkbox_renderer.py
  37. +5 −5 enthought/pyface/grid/grid_cell_renderer.py
  38. +5 −5 enthought/pyface/grid/mapped_grid_cell_image_renderer.py
  39. +2 −2 enthought/pyface/gui.py
  40. +2 −2 enthought/pyface/heading_text.py
  41. +7 −7 enthought/pyface/i_application_window.py
  42. +2 −2 enthought/pyface/i_clipboard.py
  43. +6 −6 enthought/pyface/i_confirmation_dialog.py
  44. +2 −2 enthought/pyface/i_dialog.py
  45. +3 −3 enthought/pyface/i_directory_dialog.py
  46. +4 −4 enthought/pyface/i_heading_text.py
  47. +2 −2 enthought/pyface/i_image_cache.py
  48. +3 −3 enthought/pyface/i_image_resource.py
  49. +6 −6 enthought/pyface/i_message_dialog.py
  50. +38 −38 enthought/pyface/i_progress_dialog.py
  51. +5 −5 enthought/pyface/i_python_editor.py
  52. +4 −4 enthought/pyface/i_splash_screen.py
  53. +2 −2 enthought/pyface/i_split_widget.py
  54. +7 −7 enthought/pyface/i_system_metrics.py
  55. +2 −2 enthought/pyface/i_widget.py
  56. +14 −14 enthought/pyface/i_window.py
  57. +57 −57 enthought/pyface/image_button.py
  58. +2 −2 enthought/pyface/image_cache.py
  59. +3 −3 enthought/pyface/image_list.py
  60. +2 −2 enthought/pyface/image_resource.py
  61. +33 −33 enthought/pyface/image_widget.py
  62. +25 −25 enthought/pyface/images/image_LICENSE.txt
  63. +2 −2 enthought/pyface/ipython_widget.py
  64. +2 −2 enthought/pyface/key_pressed_event.py
  65. +16 −16 enthought/pyface/layered_panel.py
  66. +16 −16 enthought/pyface/list_box.py
  67. +3 −3 enthought/pyface/list_box_model.py
  68. +4 −4 enthought/pyface/mdi_window_menu.py
  69. +2 −2 enthought/pyface/message_dialog.py
  70. +12 −12 enthought/pyface/multi_toolbar_window.py
  71. +2 −2 enthought/pyface/preference/api.py
  72. +7 −7 enthought/pyface/preference/preference_node.py
  73. +5 −5 enthought/pyface/preference/preference_page.py
  74. +2 −2 enthought/pyface/progress_dialog.py
  75. +2 −2 enthought/pyface/python_editor.py
  76. +2 −2 enthought/pyface/resource_manager.py
  77. +4 −4 enthought/pyface/single_choice_dialog.py
  78. +41 −41 enthought/pyface/sizers/flow.py
  79. +9 −9 enthought/pyface/sorter.py
  80. +2 −2 enthought/pyface/splash_screen.py
  81. +6 −6 enthought/pyface/splash_screen_log_handler.py
  82. +3 −3 enthought/pyface/split_application_window.py
  83. +3 −3 enthought/pyface/split_dialog.py
  84. +2 −2 enthought/pyface/split_panel.py
  85. +2 −2 enthought/pyface/split_widget.py
  86. +2 −2 enthought/pyface/system_metrics.py
  87. +2 −2 enthought/pyface/tasks/action/dock_pane_toggle_action.py
  88. +3 −3 enthought/pyface/tasks/action/schema.py
  89. +1 −1 enthought/pyface/tasks/action/task_action_manager_builder.py
  90. +3 −3 enthought/pyface/tasks/i_dock_pane.py
  91. +3 −3 enthought/pyface/tasks/i_task_pane.py
  92. +2 −2 enthought/pyface/tasks/i_task_window_layout.py
  93. +2 −2 enthought/pyface/tasks/task.py
  94. +1 −1 enthought/pyface/tasks/task_window.py
  95. +3 −3 enthought/pyface/tasks/tests/test_action_manager_builder.py
  96. +15 −15 enthought/pyface/timer/api.py
  97. +13 −13 enthought/pyface/timer/do_later.py
  98. +5 −5 enthought/pyface/toolkit.py
  99. +3 −3 enthought/pyface/tree/api.py
  100. +17 −17 enthought/pyface/tree/images/image_LICENSE.txt
  101. +3 −3 enthought/pyface/tree/node_event.py
  102. +11 −11 enthought/pyface/tree/node_manager.py
  103. +2 −2 enthought/pyface/tree/node_tree.py
  104. +19 −19 enthought/pyface/tree/node_tree_model.py
  105. +24 −24 enthought/pyface/tree/node_type.py
  106. +1 −1 enthought/pyface/tree/trait_dict_node_type.py
  107. +1 −1 enthought/pyface/tree/trait_list_node_type.py
  108. +4 −4 enthought/pyface/tree/tree.py
  109. +15 −15 enthought/pyface/tree/tree_model.py
  110. +3 −3 enthought/pyface/ui/null/action/menu_bar_manager.py
  111. +2 −2 enthought/pyface/ui/null/action/menu_manager.py
  112. +5 −5 enthought/pyface/ui/null/action/status_bar_manager.py
  113. +2 −2 enthought/pyface/ui/null/action/tool_bar_manager.py
  114. +9 −9 enthought/pyface/ui/null/action/tool_palette.py
  115. +5 −5 enthought/pyface/ui/null/action/tool_palette_manager.py
  116. +2 −2 enthought/pyface/ui/null/clipboard.py
  117. +1 −1 enthought/pyface/ui/null/init.py
  118. +2 −2 enthought/pyface/ui/null/resource_manager.py
  119. +2 −2 enthought/pyface/ui/null/widget.py
  120. +2 −2 enthought/pyface/ui/null/window.py
  121. +2 −2 enthought/pyface/util/__init__.py
  122. +4 −4 enthought/pyface/util/fix_introspect_bug.py
  123. +3 −3 enthought/pyface/util/font_helper.py
  124. +2 −2 enthought/pyface/util/grid/__init__.py
  125. +2 −2 enthought/pyface/util/grid/api.py
  126. +27 −27 enthought/pyface/util/grid/grid.py
  127. +3 −3 enthought/pyface/util/grid/grid_column.py
  128. +32 −32 enthought/pyface/util/grid/grid_model.py
  129. +3 −3 enthought/pyface/util/grid/grid_row.py
  130. +41 −41 enthought/pyface/util/python_stc.py
  131. +2 −2 enthought/pyface/viewer/api.py
  132. +4 −4 enthought/pyface/viewer/column_provider.py
  133. +7 −7 enthought/pyface/viewer/content_provider.py
  134. +5 −5 enthought/pyface/viewer/content_viewer.py
  135. +10 −10 enthought/pyface/viewer/default_tree_content_provider.py
  136. +7 −7 enthought/pyface/viewer/label_provider.py
  137. +3 −3 enthought/pyface/viewer/table_column_provider.py
  138. +3 −3 enthought/pyface/viewer/table_content_provider.py
  139. +4 −4 enthought/pyface/viewer/table_label_provider.py
  140. +27 −27 enthought/pyface/viewer/table_viewer.py
Sorry, we could not display the entire diff because it was too big.
View
14 enthought/pyface/action/action.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
@@ -33,14 +33,14 @@ class Action(HasTraits):
"""
#### 'Action' interface ###################################################
-
+
# Keyboard accelerator (by default the action has NO accelerator).
accelerator = Unicode
# Is the action checked? This is only relevant if the action style is
# 'radio' or 'toggle'.
checked = Bool(False)
-
+
# A longer description of the action (used for context sensitive help etc).
# If no description is specified, the tooltip is used instead (and if there
# is no tooltip, then well, maybe you just hate your users ;^).
@@ -69,7 +69,7 @@ class Action(HasTraits):
# A short description of the action used for tooltip text etc.
tooltip = Unicode
-
+
###########################################################################
# 'Action' interface.
###########################################################################
@@ -98,7 +98,7 @@ def perform(self, event):
if self.on_perform is not None:
self.on_perform()
-
+
return
-
+
#### EOF ######################################################################
View
4 enthought/pyface/action/action_event.py
@@ -12,7 +12,7 @@ class ActionEvent(HasTraits):
""" The event passed to an action's 'perform' method. """
#### 'ActionEvent' interface ##############################################
-
+
# When the action was performed (time.time()).
when = Float
@@ -36,7 +36,7 @@ def __init__(self, **traits):
# When the action was performed.
self.when = time.time()
-
+
return
#### EOF ######################################################################
View
16 enthought/pyface/action/action_item.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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.enth373ought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
-#
+#
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
@@ -84,7 +84,7 @@ def _visible_changed(self, trait_name, old, new):
self.action.visible = True
return
-
+
###########################################################################
# 'ActionItem' interface.
###########################################################################
@@ -92,7 +92,7 @@ def _visible_changed(self, trait_name, old, new):
def add_to_menu(self, parent, menu, controller):
""" Adds the item to a menu. """
- if (controller is None) or controller.can_add_to_menu(self.action):
+ if (controller is None) or controller.can_add_to_menu(self.action):
wrapper = _MenuItem(parent, menu, self, controller)
# fixme: Martin, who uses this information?
@@ -108,11 +108,11 @@ def add_to_toolbar(self, parent, tool_bar, image_cache, controller,
show_labels=True):
""" Adds the item to a tool bar. """
- if (controller is None) or controller.can_add_to_toolbar(self.action):
+ if (controller is None) or controller.can_add_to_toolbar(self.action):
wrapper = _Tool(
parent, tool_bar, image_cache, self, controller, show_labels
)
-
+
# fixme: Martin, who uses this information?
if controller is None:
self.control = wrapper.control
@@ -124,7 +124,7 @@ def add_to_toolbar(self, parent, tool_bar, image_cache, controller,
def add_to_palette(self, tool_palette, image_cache, show_labels=True):
""" Adds the item to a tool palette. """
-
+
wrapper = _PaletteTool(tool_palette, image_cache, self, show_labels)
self._wrappers.append(wrapper)
@@ -138,7 +138,7 @@ def destroy(self):
"""
self.action.destroy()
-
+
return
#### EOF ######################################################################
View
10 enthought/pyface/action/action_manager.py
@@ -47,7 +47,7 @@ class ActionManager(HasTraits):
# Is the action manager enabled?
enabled = Bool(True)
-
+
# All of the contribution groups in the manager.
groups = Property(List(Group))
@@ -56,7 +56,7 @@ class ActionManager(HasTraits):
# Is the action manager visible?
visible = Bool(True)
-
+
#### Events ####
# fixme: We probably need more granular events than this!
@@ -139,7 +139,7 @@ def _visible_changed(self, trait_name, old, new):
group.visible = new
return
-
+
#### Methods ##############################################################
def append(self, item):
@@ -161,7 +161,7 @@ def destroy(self):
for group in self.groups:
group.destroy()
-
+
return
def insert(self, index, item):
@@ -257,7 +257,7 @@ def walk(self, fn):
""" Walk the manager applying a function at every item. """
fn(self)
-
+
for group in self._groups:
self.walk_group(group, fn)
View
6 enthought/pyface/action/action_manager_item.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
@@ -55,7 +55,7 @@ def add_to_menu(self, parent, menu, controller):
def add_to_toolbar(self, parent, tool_bar, image_cache, controller):
""" Adds the item to a tool bar. """
-
+
raise NotImplementedError
#### EOF ######################################################################
View
4 enthought/pyface/action/api.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
32 enthought/pyface/action/group.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
@@ -41,17 +41,17 @@ class Group(HasTraits):
# Is the group visible?
visible = Bool(True)
-
+
# The group's unique identifier (only needs to be unique within the action
# manager that the group belongs to).
id = Str
# All of the items in the group.
items = Property
-
+
# The action manager that the group belongs to.
parent = Any#Instance('enthought.pyface.action.ActionManager')
-
+
# Does this group require a separator when it is visualized?
separator = Bool(True)
@@ -73,15 +73,15 @@ def __init__(self, *items, **traits):
# Add any specified items.
for item in items:
self.append(item)
-
+
return
-
+
###########################################################################
# 'Group' interface.
###########################################################################
#### Trait Properties #####################################################
-
+
def _get_items(self):
""" Returns the items in the group. """
@@ -96,7 +96,7 @@ def _enabled_changed(self, trait_name, old, new):
item.enabled = new
return
-
+
#### Methods ##############################################################
def append(self, item):
@@ -136,7 +136,7 @@ def insert(self, index, item):
In which case the item is simply inserted into the group.
2) An 'Action' instance.
-
+
In which case an 'ActionItem' instance is created with the action
and then inserted into the group.
@@ -144,7 +144,7 @@ def insert(self, index, item):
In which case an 'Action' is created that calls the callable when
it is performed, and the action is then wrapped as in 2).
-
+
"""
if isinstance(item, Action):
@@ -153,7 +153,7 @@ def insert(self, index, item):
elif callable(item):
text = user_name_for(item.func_name)
item = ActionItem(action=Action(text=text, on_perform=item))
-
+
item.parent = self
self._items.insert(index, item)
@@ -175,7 +175,7 @@ def insert_before(self, before, item):
"""
index = self._items.index(before)
-
+
self.insert(index, item)
return (index, item)
@@ -188,7 +188,7 @@ def insert_after(self, after, item):
"""
index = self._items.index(after)
-
+
self.insert(index + 1, item)
return (index, item)
@@ -206,7 +206,7 @@ def find(self, id):
else:
item = None
-
+
return item
@@ -225,7 +225,7 @@ class Separator(Group):
Hopefully, 'Separator' is more readable than 'Group'...
"""
-
+
pass
#### EOF ######################################################################
View
28 enthought/pyface/action/images/image_LICENSE.txt
@@ -1,14 +1,14 @@
-The icons are mostly derived work from other icons. As such they are
-licensed accordingly to the original license:
-
-Project License File
-----------------------------------------------------------------------------
-Eclipse Eclipse Public License image_LICENSE_Eclipse.txt
-
-Unless stated in this file, icons are the work of Enthought, and are
-released under a 3 clause BSD license.
-
-Files and orginal authors:
-----------------------------------------------------------------------------
-enthought/pyface/action/images:
- action.png | Eclipse
+The icons are mostly derived work from other icons. As such they are
+licensed accordingly to the original license:
+
+Project License File
+----------------------------------------------------------------------------
+Eclipse Eclipse Public License image_LICENSE_Eclipse.txt
+
+Unless stated in this file, icons are the work of Enthought, and are
+released under a 3 clause BSD license.
+
+Files and orginal authors:
+----------------------------------------------------------------------------
+enthought/pyface/action/images:
+ action.png | Eclipse
View
4 enthought/pyface/action/menu_bar_manager.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/action/menu_manager.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/action/status_bar_manager.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/action/tool_bar_manager.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/action/tool_palette_manager.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
8 enthought/pyface/action/window_action.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
@@ -26,8 +26,8 @@ class WindowAction(Action):
""" Abstract base class for all window actions. """
#### 'WindowAction' interface #############################################
-
+
# The window that the action is in.
window = Instance(Window)
-
+
#### EOF ######################################################################
View
4 enthought/pyface/application_window.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
6 enthought/pyface/confirmation_dialog.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
@@ -20,7 +20,7 @@
def confirm(parent, message, title=None, cancel=False, default=NO):
""" Convenience function to show a confirmation dialog. """
-
+
if title is None:
title = "Confirmation"
View
4 enthought/pyface/constant.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/dialog.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
4 enthought/pyface/directory_dialog.py
@@ -1,13 +1,13 @@
#------------------------------------------------------------------------------
# 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>
#------------------------------------------------------------------------------
View
14 enthought/pyface/dock/__init__.py
@@ -2,25 +2,25 @@
#
# 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: David C. Morrill
# Date: 10/18/2005
#
#-------------------------------------------------------------------------------
-""" Pyface 'DockWindow' support.
-
+""" Pyface 'DockWindow' support.
+
This package implements a Pyface 'dockable' window component that allows
child windows to be reorganized within the DockWindow using drag and drop.
- The component also allows multiple sub-windows to occupy the same
- sub-region of the DockWindow, in which case each sub-window appears as a
+ The component also allows multiple sub-windows to occupy the same
+ sub-region of the DockWindow, in which case each sub-window appears as a
separate notebook-like tab within the region.
-"""
+"""
View
28 enthought/pyface/dock/api.py
@@ -2,35 +2,35 @@
#
# 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: David C. Morrill
# Date: 10/18/2005
#
#-------------------------------------------------------------------------------
-""" Pyface 'DockWindow' support.
-
+""" Pyface 'DockWindow' support.
+
This package implements a Pyface 'dockable' window component that allows
child windows to be reorganized within the DockWindow using drag and drop.
- The component also allows multiple sub-windows to occupy the same
- sub-region of the DockWindow, in which case each sub-window appears as a
+ The component also allows multiple sub-windows to occupy the same
+ sub-region of the DockWindow, in which case each sub-window appears as a
separate notebook-like tab within the region.
-"""
+"""
#-------------------------------------------------------------------------------
-# Imports:
+# Imports:
#-------------------------------------------------------------------------------
from dock_window \
import DockWindow, DockWindowHandler
-
+
from dock_sizer \
import DockSizer, DockSection, DockRegion, DockControl, DockStyle, \
DOCK_LEFT, DOCK_RIGHT, DOCK_TOP, DOCK_BOTTOM, SetStructureHandler, \
@@ -38,16 +38,16 @@
from idockable \
import IDockable
-
+
from idock_ui_provider \
import IDockUIProvider
-
+
from ifeature_tool \
import IFeatureTool
-
+
from dock_window_shell \
import DockWindowShell
-
+
from dock_window_feature \
import DockWindowFeature
-
+
View
10 enthought/pyface/dock/dock_sizer.py
@@ -208,7 +208,7 @@ def clear_window ( window ):
"""
bg_color = SystemMetrics().dialog_background_color
bg_color = wx.Colour(bg_color[0]*255, bg_color[1]*255, bg_color[2]*255)
-
+
dx, dy = window.GetSizeTuple()
dc = wx.PaintDC( window )
dc.SetBrush( wx.Brush( bg_color, wx.SOLID ) )
@@ -805,7 +805,7 @@ def fill_bg_color ( self, dc, x, y, dx, dy ):
""" Fills a specified region with the control's background color.
"""
dc.SetPen( wx.TRANSPARENT_PEN )
-
+
dc.SetBrush( wx.Brush( self.get_bg_color() ) )
dc.DrawRectangle( x, y, dx, dy )
@@ -2501,7 +2501,7 @@ def draw ( self, dc ):
return
self.fill_bg_color( dc, *self.bounds )
-
+
if self.active >= len(self.contents):
# on some platforms, if the active tab was destroyed
# the new active tab may not have been set yet
@@ -2940,7 +2940,7 @@ def _draw_notebook ( self, dc ):
x, y, dx, dy = self.bounds
self.fill_bg_color( dc, x, y, dx, dy )
-
+
# Draws a box around the frame containing the tab contents, starting
# below the tab
pen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
@@ -3109,7 +3109,7 @@ def initial_recalc_sizes ( self, x, y, dx, dy ):
# Allocate the remainder to those parts that didn't request a width.
if remain > 0:
remain = int( avail / remain )
-
+
for i, sz in enumerate( sizes ):
if sz < 0:
sizes[i] = remain
View
586 enthought/pyface/dock/dock_window.py
@@ -2,30 +2,30 @@
#
# 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: David C. Morrill
# Date: 10/18/2005
#
#-------------------------------------------------------------------------------
-""" Pyface 'DockWindow' support.
-
+""" Pyface 'DockWindow' support.
+
This package implements a Pyface 'dockable' window component that allows
child windows to be reorganized within the DockWindow using drag and drop.
- The component also allows multiple sub-windows to occupy the same
- sub-region of the DockWindow, in which case each sub-window appears as a
+ The component also allows multiple sub-windows to occupy the same
+ sub-region of the DockWindow, in which case each sub-window appears as a
separate notebook-like tab within the region.
-"""
+"""
#-------------------------------------------------------------------------------
-# Imports:
+# Imports:
#-------------------------------------------------------------------------------
import shelve
@@ -37,22 +37,22 @@
from enthought.traits.api \
import HasPrivateTraits, Instance, Tuple, Property, Any, Str, List, false
-
+
from enthought.traits.trait_base \
- import traits_home
-
+ import traits_home
+
from enthought.traits.ui.api \
import View, HGroup, VGroup, Item, Handler, error
-
+
from enthought.traits.ui.helper \
import user_name_for
-
+
from enthought.traits.ui.menu \
import Menu, Action, Separator
-
+
from enthought.traits.ui.dockable_view_element \
import DockableViewElement
-
+
from enthought.traits.ui.dock_window_theme \
import dock_window_theme, DockWindowTheme
@@ -61,81 +61,81 @@
from enthought.pyface.message_dialog \
import error as warning
-
+
from dock_sizer \
import DockSizer, DockControl, DockRegion, DockStyle, DockSplitter, \
no_dock_info, clear_window, features
-
+
from idockable \
import IDockable
-
+
from idock_ui_provider \
import IDockUIProvider
is_mac = (sys.platform == 'darwin')
#-------------------------------------------------------------------------------
-# Global data:
+# Global data:
#-------------------------------------------------------------------------------
-
+
# Dictionary of cursors in use:
cursor_map = {}
#-------------------------------------------------------------------------------
-# DockWindow context menu:
+# DockWindow context menu:
#-------------------------------------------------------------------------------
min_max_action = Action( name = 'Maximize',
action = 'on_min_max' )
-
+
undock_action = Action( name = 'Undock',
action = 'on_undock' )
-
+
lock_action = Action( name = 'Lock Layout',
action = 'on_lock_layout',
style = 'toggle' )
-
+
layout_action = Action( name = 'Switch Layout',
action = 'on_switch_layout' )
-
+
save_action = Action( name = 'Save Layout...',
action = 'on_save_layout' )
-
+
#hide_action = Action( name = 'Hide',
# action = 'on_hide' )
-#
+#
#show_action = Action( name = 'Show',
# action = 'on_show' )
-
+
edit_action = Action( name = 'Edit Properties...',
action = 'on_edit' )
-
+
enable_features_action = Action( name = 'Show All',
action = 'on_enable_all_features' )
-
+
disable_features_action = Action( name = 'Hide All',
action = 'on_disable_all_features' )
-
+
#-------------------------------------------------------------------------------
# 'DockWindowHandler' class/interface:
#-------------------------------------------------------------------------------
class DockWindowHandler ( HasPrivateTraits ):
-
+
#---------------------------------------------------------------------------
- # Returns whether or not a specified object can be inserted into the view:
+ # Returns whether or not a specified object can be inserted into the view:
#---------------------------------------------------------------------------
-
+
def can_drop ( self, object ):
""" Returns whether or not a specified object can be inserted into the
view.
"""
return True
-
+
#---------------------------------------------------------------------------
- # Returns the DockControl object for a specified object:
+ # Returns the DockControl object for a specified object:
#---------------------------------------------------------------------------
-
+
def dock_control_for ( self, parent, object ):
""" Returns the DockControl object for a specified object.
"""
@@ -148,7 +148,7 @@ def dock_control_for ( self, parent, object ):
name = ''
if name == '':
name = user_name_for( object.__class__.__name__ )
-
+
image = None
export = ''
if isinstance( object, DockControl ):
@@ -159,17 +159,17 @@ def dock_control_for ( self, parent, object ):
close = dockable.dockable_should_close()
if close:
dock_control.close( force = True )
-
+
control = dockable.dockable_get_control( parent )
-
- # If DockControl was closed, then reset it to point to the new
+
+ # If DockControl was closed, then reset it to point to the new
# control:
if close:
dock_control.set( control = control,
style = parent.owner.style )
dockable.dockable_init_dockcontrol( dock_control )
return dock_control
-
+
elif isinstance( object, IDockable ):
dockable = object
control = dockable.dockable_get_control( parent )
@@ -178,71 +178,71 @@ def dock_control_for ( self, parent, object ):
dockable = DockableViewElement( ui = ui )
export = ui.view.export
control = ui.control
-
+
dc = DockControl( control = control,
name = name,
export = export,
style = parent.owner.style,
image = image,
closeable = True )
-
+
dockable.dockable_init_dockcontrol( dc )
-
+
return dc
-
+
#---------------------------------------------------------------------------
- # Creates a new view of a specified control:
+ # Creates a new view of a specified control:
#---------------------------------------------------------------------------
-
+
def open_view_for ( self, control, use_mouse = True ):
""" Creates a new view of a specified control.
"""
from dock_window_shell import DockWindowShell
-
+
DockWindowShell( control, use_mouse = use_mouse )
-
+
#---------------------------------------------------------------------------
- # Handles the DockWindow becoming empty:
+ # Handles the DockWindow becoming empty:
#---------------------------------------------------------------------------
-
+
def dock_window_empty ( self, dock_window ):
""" Handles the DockWindow becoming empty.
"""
if dock_window.auto_close:
dock_window.control.GetParent().Destroy()
-
+
# Create a singleton handler:
dock_window_handler = DockWindowHandler()
#-------------------------------------------------------------------------------
-# 'LayoutName' class:
+# 'LayoutName' class:
#-------------------------------------------------------------------------------
class LayoutName ( Handler ):
-
+
#---------------------------------------------------------------------------
- # Trait definitions:
+ # Trait definitions:
#---------------------------------------------------------------------------
-
+
# Name the user wants to assign to the layout:
name = Str
-
+
# List of currently assigned names:
names = List( Str )
-
+
#---------------------------------------------------------------------------
- # Traits view definitions:
+ # Traits view definitions:
#---------------------------------------------------------------------------
-
+
view = View( Item( 'name', label = 'Layout name' ),
title = 'Save Layout',
kind = 'modal',
buttons = [ 'OK', 'Cancel' ] )
-
+
#---------------------------------------------------------------------------
# Handles a request to close a dialog-based user interface by the user:
#---------------------------------------------------------------------------
-
+
def close ( self, info, is_ok ):
if is_ok:
name = info.object.name.strip()
@@ -251,53 +251,53 @@ def close ( self, info, is_ok ):
title = 'Save Layout Error' )
return False
if name in self.names:
- return error( message = '%s is already defined. Replace?' %
+ return error( message = '%s is already defined. Replace?' %
name,
title = 'Save Layout Warning',
parent = info.ui.control )
-
+
return True
-
+
#-------------------------------------------------------------------------------
-# 'DockWindow' class:
+# 'DockWindow' class:
#-------------------------------------------------------------------------------
class DockWindow ( HasPrivateTraits ):
-
+
#---------------------------------------------------------------------------
- # Trait definitions:
+ # Trait definitions:
#---------------------------------------------------------------------------
-
+
# The wx.Window being used as the DockWindow:
control = Instance( wx.Window )
-
+
# The handler used to determine how certain events should be processed:
handler = Any( dock_window_handler )
-
+
# The 'extra' arguments to be passed to each handler call:
handler_args = Tuple
-
+
# Close the parent window if the DockWindow becomes empty:
auto_close = false
-
+
# The DockWindow graphical theme style information:
theme = Instance( DockWindowTheme, allow_none = False )
-
+
# Default style for external objects dragged into the window:
style = DockStyle
-
+
# Return the sizer associated with the control (i.e. window)
sizer = Property
-
+
# The id used to identify this DockWindow:
id = Str
#---------------------------------------------------------------------------
- # Initializes the object:
+ # Initializes the object:
#---------------------------------------------------------------------------
-
+
def __init__ ( self, parent, wid = -1, pos = wx.DefaultPosition,
- size = wx.DefaultSize, style = wx.FULL_REPAINT_ON_RESIZE,
+ size = wx.DefaultSize, style = wx.FULL_REPAINT_ON_RESIZE,
**traits ):
super( DockWindow, self ).__init__( **traits )
@@ -308,7 +308,7 @@ def __init__ ( self, parent, wid = -1, pos = wx.DefaultPosition,
# Set up the 'paint' event handler:
wx.EVT_PAINT( control, self._paint )
wx.EVT_SIZE( control, self._size )
-
+
# Set up mouse event handlers:
wx.EVT_LEFT_DOWN( control, self._left_down )
wx.EVT_LEFT_UP( control, self._left_up )
@@ -317,81 +317,81 @@ def __init__ ( self, parent, wid = -1, pos = wx.DefaultPosition,
wx.EVT_RIGHT_UP( control, self.right_up )
wx.EVT_MOTION( control, self._mouse_move )
wx.EVT_LEAVE_WINDOW( control, self._mouse_leave )
-
+
control.SetDropTarget( PythonDropTarget( self ) )
-
+
# Initialize the window background color:
if self.theme.use_theme_color:
color = self.theme.tab.image_slice.bg_color
else:
color = SystemMetrics().dialog_background_color
color = wx.Colour(color[0]*255, color[1]*255, color[2]*255)
-
+
self.control.SetBackgroundColour( color )
-
+
#-- Default Trait Values ---------------------------------------------------
-
+
def _theme_default ( self ):
return dock_window_theme()
-
+
#-- Trait Event Handlers ---------------------------------------------------
-
+
def _theme_changed ( self, theme ):
if self.control is not None:
if theme.use_theme_color:
color = theme.tab.image_slice.bg_color
else:
- color = wx.NullColour
+ color = wx.NullColour
self.control.SetBackgroundColour( color )
-
- self.update_layout()
-
+
+ self.update_layout()
+
#---------------------------------------------------------------------------
- # Notifies the DockWindow that its contents are empty:
+ # Notifies the DockWindow that its contents are empty:
#---------------------------------------------------------------------------
-
+
def dock_window_empty ( self ):
""" Notifies the DockWindow that its contents are empty.
"""
self.handler.dock_window_empty( self )
-
+
#---------------------------------------------------------------------------
# Sets the cursor to a specified cursor shape:
#---------------------------------------------------------------------------
-
+
def set_cursor ( self, cursor = None ):
""" Sets the cursor to a specified cursor shape.
"""
if cursor is None:
self.control.SetCursor( wx.NullCursor )
return
-
+
global cursor_map
-
+
if cursor not in cursor_map:
cursor_map[ cursor ] = wx.StockCursor( cursor )
-
+
self.control.SetCursor( cursor_map[ cursor ] )
-
+
#---------------------------------------------------------------------------
- # Releases ownership of the mouse capture:
+ # Releases ownership of the mouse capture:
#---------------------------------------------------------------------------
-
+
def release_mouse ( self ):
""" Releases ownership of the mouse capture.
"""
if self._owner is not None:
self._owner = None
self.control.ReleaseMouse()
-
+
#---------------------------------------------------------------------------
- # Updates the layout of the window:
+ # Updates the layout of the window:
#---------------------------------------------------------------------------
-
+
def update_layout ( self ):
""" Updates the layout of the window.
"""
- # There are cases where a layout has been scheduled for a DockWindow,
+ # There are cases where a layout has been scheduled for a DockWindow,
# but then the DockWindow is destroyed, which will cause the calls
# below to fail. So we catch the 'PyDeadObjectError' exception and
# ignore it:
@@ -400,9 +400,9 @@ def update_layout ( self ):
self.control.Refresh()
except wx.PyDeadObjectError:
pass
-
+
#---------------------------------------------------------------------------
- # Minimizes/Maximizes a specified DockControl:
+ # Minimizes/Maximizes a specified DockControl:
#---------------------------------------------------------------------------
def min_max ( self, dock_control ):
@@ -414,31 +414,31 @@ def min_max ( self, dock_control ):
self.update_layout()
#---------------------------------------------------------------------------
- # Pops up the feature bar for a specified DockControl:
+ # Pops up the feature bar for a specified DockControl:
#---------------------------------------------------------------------------
-
+
def feature_bar_popup ( self, dock_control ):
""" Pops up the feature bar for a specified DockControl.
"""
fb = self._feature_bar
if fb is None:
from feature_bar import FeatureBar
-
+
self._feature_bar = fb = FeatureBar( parent = self.control )
fb.on_trait_change( self._feature_bar_closed, 'completed' )
-
+
fb.dock_control = dock_control
fb.show()
#---------------------------------------------------------------------------
# Handles closing the feature bar:
#---------------------------------------------------------------------------
-
+
def _feature_bar_closed ( self ):
fb = self._feature_bar
fb.dock_control.feature_bar_closed()
fb.hide()
-
+
#---------------------------------------------------------------------------
# Perform all operations needed to close the window:
#---------------------------------------------------------------------------
@@ -474,23 +474,23 @@ def _unregister_event_handlers ( self ):
wx.EVT_LEAVE_WINDOW( control, None )
#---------------------------------------------------------------------------
- # Handles repainting the window:
+ # Handles repainting the window:
#---------------------------------------------------------------------------
-
+
def _paint ( self, event ):
""" Handles repainting the window.
"""
# There is a problem on macs where we get paints when the update
- # is entirely within children.
+ # is entirely within children.
if is_mac and self._is_child_paint():
return
-
+
sizer = self.sizer
if isinstance( sizer, DockSizer ):
sizer.Draw( self.control )
else:
clear_window( self.control )
-
+
#---------------------------------------------------------------------------
# Uses wx calls to determine if we really need to paint or the children will
# do it.
@@ -508,9 +508,9 @@ def _is_child_paint ( self ):
return False
#---------------------------------------------------------------------------
- # Handles the window being resized:
+ # Handles the window being resized:
#---------------------------------------------------------------------------
-
+
def _size ( self, event ):
""" Handles the window being resized.
"""
@@ -523,11 +523,11 @@ def _size ( self, event ):
# fixme: This is temporary code to work around a problem in
# ProAVA2 that we are still trying to track down...
pass
-
+
#---------------------------------------------------------------------------
- # Handles the left mouse button being pressed:
+ # Handles the left mouse button being pressed:
#---------------------------------------------------------------------------
-
+
def _left_down ( self, event ):
""" Handles the left mouse button being pressed.
"""
@@ -538,11 +538,11 @@ def _left_down ( self, event ):
self._owner = object
self.control.CaptureMouse()
object.mouse_down( event )
-
+
#---------------------------------------------------------------------------
- # Handles the left mouse button being released:
+ # Handles the left mouse button being released:
#---------------------------------------------------------------------------
-
+
def _left_up ( self, event ):
""" Handles the left mouse button being released.
"""
@@ -551,7 +551,7 @@ def _left_up ( self, event ):
window.ReleaseMouse()
self._owner.mouse_up( event )
self._owner = None
-
+
# Check for the user requesting that the layout structure be reset:
if event.ShiftDown():
if event.ControlDown():
@@ -567,11 +567,11 @@ def _left_up ( self, event ):
elif event.AltDown():
self.sizer.ToggleLock()
self.update_layout()
-
+
#---------------------------------------------------------------------------
- # Handles the left mouse button being double clicked:
+ # Handles the left mouse button being double clicked:
#---------------------------------------------------------------------------
-
+
def _left_dclick ( self, event ):
""" Handles the left mouse button being double clicked.
"""
@@ -580,7 +580,7 @@ def _left_dclick ( self, event ):
object = sizer.ObjectAt( event.GetX(), event.GetY(), True )
if isinstance( object, DockControl ):
dockable = object.dockable
- if (((dockable is None) or
+ if (((dockable is None) or
(dockable.dockable_dclick( object, event ) is False)) and
(object.style != 'fixed')):
self.min_max( object )
@@ -588,20 +588,20 @@ def _left_dclick ( self, event ):
self._owner = object
self.control.CaptureMouse()
object.mouse_down( event )
-
+
#---------------------------------------------------------------------------
- # Handles the right mouse button being pressed:
+ # Handles the right mouse button being pressed:
#---------------------------------------------------------------------------
def _right_down ( self, event ):
""" Handles the right mouse button being pressed.
"""
pass
-
+
#---------------------------------------------------------------------------
- # Handles the right mouse button being released:
+ # Handles the right mouse button being released:
#---------------------------------------------------------------------------
-
+
def right_up ( self, event ):
""" Handles the right mouse button being released.
"""
@@ -612,13 +612,13 @@ def right_up ( self, event ):
popup_menu = None
window = self.control
is_dock_control = isinstance( object, DockControl )
-
+
if (is_dock_control and (object.dockable is not None) and
- (event.ShiftDown() or event.ControlDown() or
+ (event.ShiftDown() or event.ControlDown() or
event.AltDown())):
self._menu_self = object.dockable
popup_menu = object.dockable.dockable_menu( object, event )
-
+
if popup_menu is None:
self._menu_self = self
section = self.sizer.GetContents()
@@ -635,12 +635,12 @@ def right_up ( self, event ):
min_max_action.name = 'Restore'
min_max_action.enabled = is_dock_control
undock_action.enabled = is_dock_control
- edit_action.enabled = (not is_splitter)
+ edit_action.enabled = (not is_splitter)
controls = section.get_controls( False )
lock_action.checked = ((len( controls ) > 0) and
controls[0].locked)
save_action.enabled = (self.id != '')
-
+
feature_menu = self._get_feature_menu()
restore_menu, delete_menu = self._get_layout_menus()
popup_menu = Menu( min_max_action,
@@ -660,22 +660,22 @@ def right_up ( self, event ):
Separator(),
edit_action,
name = 'popup' )
-
+
window.PopupMenuXY( popup_menu.create_menu( window, self ),
event.GetX() - 10, event.GetY() - 10 )
self._object = None
-
+
#---------------------------------------------------------------------------
- # Handles the mouse moving over the window:
+ # Handles the mouse moving over the window:
#---------------------------------------------------------------------------
-
+
def _mouse_move ( self, event ):
""" Handles the mouse moving over the window.
"""
if self._last_dock_control is not None:
self._last_dock_control.reset_feature_popup()
self._last_dock_control = None
-
+
if self._owner is not None:
self._owner.mouse_move( event )
else:
@@ -684,26 +684,26 @@ def _mouse_move ( self, event ):
object = (self._object or
sizer.ObjectAt( event.GetX(), event.GetY() ))
self._set_cursor( event, object )
-
+
if object is not self._hover:
if self._hover is not None:
self._hover.hover_exit( event )
-
+
if object is not None:
object.hover_enter( event )
-
+
self._hover = object
-
+
# Handle feature related processing:
if (isinstance( object, DockControl ) and
object.feature_activate( event )):
self._last_dock_control = object
-
-
+
+
#---------------------------------------------------------------------------
- # Handles the mouse leaving the window:
+ # Handles the mouse leaving the window:
#---------------------------------------------------------------------------
-
+
def _mouse_leave ( self, event ):
""" Handles the mouse leaving the window.
"""
@@ -713,9 +713,9 @@ def _mouse_leave ( self, event ):
self._set_cursor( event )
#---------------------------------------------------------------------------
- # Sets the cursor for a specified object:
+ # Sets the cursor for a specified object:
#---------------------------------------------------------------------------
-
+
def _set_cursor ( self, event, object = None ):
""" Sets the cursor for a specified object.
"""
@@ -723,22 +723,22 @@ def _set_cursor ( self, event, object = None ):
self.set_cursor()
else:
self.set_cursor( object.get_cursor( event ) )
-
+
#-- Context menu action handlers -----------------------------------------------
#---------------------------------------------------------------------------
- # Handles the user asking for a DockControl to be maximized/restored:
+ # Handles the user asking for a DockControl to be maximized/restored:
#---------------------------------------------------------------------------
def on_min_max ( self ):
""" Handles the user asking for a DockControl to be maximized/restored.
"""
self.min_max( self._object )
-
+
#---------------------------------------------------------------------------
- # Handles the user requesting an element to be undocked:
+ # Handles the user requesting an element to be undocked:
#---------------------------------------------------------------------------
-
+
def on_undock ( self ):
""" Handles the user requesting an element to be undocked.
"""
@@ -747,7 +747,7 @@ def on_undock ( self ):
#---------------------------------------------------------------------------
# Handles the user requesting an element to be hidden:
#---------------------------------------------------------------------------
-
+
def on_hide ( self ):
""" Handles the user requesting an element to be hidden.
"""
@@ -756,7 +756,7 @@ def on_hide ( self ):
#---------------------------------------------------------------------------
# Handles the user requesting an element to be shown:
#---------------------------------------------------------------------------
-
+
def on_show ( self ):
""" Handles the user requesting an element to be shown.
"""
@@ -764,52 +764,52 @@ def on_show ( self ):
if isinstance( object, DockControl ):
object = object.parent
self._hidden_group_for( object ).show( True )
-
+
#---------------------------------------------------------------------------
- # Handles the user requesting that the current layout be switched:
+ # Handles the user requesting that the current layout be switched:
#---------------------------------------------------------------------------
-
+
def on_switch_layout ( self ):
""" Handles the user requesting that the current layout be switched.
"""
self.sizer.ResetStructure( self.control )
self.update_layout()
-
+
#---------------------------------------------------------------------------
- # Handles the user requesting that the layout be locked/unlocked:
+ # Handles the user requesting that the layout be locked/unlocked:
#---------------------------------------------------------------------------
-
+
def on_lock_layout ( self ):
""" Handles the user requesting that the layout be locked/unlocked.
"""
self.sizer.ToggleLock()
self.update_layout()
-
+
#---------------------------------------------------------------------------
# Handles the user requesting that the layout be saved:
#---------------------------------------------------------------------------
-
+
def on_save_layout ( self ):
""" Handles the user requesting that the layout be saved.
"""
layout_name = LayoutName( names = self._get_layout_names() )
if layout_name.edit_traits( parent = self.control ).result:
self._set_layout( layout_name.name, self.sizer.GetStructure() )
-
+
#---------------------------------------------------------------------------
- # Handles the user requesting a specified layout to be restored:
+ # Handles the user requesting a specified layout to be restored:
#---------------------------------------------------------------------------
-
+
def on_restore_layout ( self, name ):
""" Handles the user requesting a specified layout to be restored.
"""
self.sizer.SetStructure( self.control, self._get_layout( name ) )
self.update_layout()
-
+
#---------------------------------------------------------------------------
- # Handles the user reqesting a specified layout to be deleted:
+ # Handles the user reqesting a specified layout to be deleted:
#---------------------------------------------------------------------------
-
+
def on_delete_layout ( self, name ):
""" Handles the user reqesting a specified layout to be deleted.
"""
@@ -817,11 +817,11 @@ def on_delete_layout ( self, name ):
title = 'Delete Layout Warning',
parent = self.control ):
self._delete_layout( name )
-
+
#---------------------------------------------------------------------------
# Handles the user requesting to edit an item:
#---------------------------------------------------------------------------
-
+
def on_edit ( self, object = None ):
""" Handles the user requesting to edit an item.
"""
@@ -833,25 +833,25 @@ def on_edit ( self, object = None ):
name = control_info.name.strip()
if name != '':
object.name = name
- object.set( **control_info.get( 'user_name',
+ object.set( **control_info.get( 'user_name',
'style', 'user_style' ) )
self.update_layout()
-
+
#---------------------------------------------------------------------------
- # Enables all features:
+ # Enables all features:
#---------------------------------------------------------------------------
-
+
def on_enable_all_features ( self, action ):
""" Enables all features.
"""
for feature in features:
if (feature.feature_name != '') and (feature.state != 1):
feature.toggle_feature( action )
-
+
#---------------------------------------------------------------------------
- # Disables all features:
+ # Disables all features:
#---------------------------------------------------------------------------
-
+
def on_disable_all_features ( self, action ):
""" Disables all features.
"""
@@ -864,11 +864,11 @@ def on_disable_all_features ( self, action ):
#---------------------------------------------------------------------------
def on_toggle_feature ( self, action ):
- """ Toggles the enabled/disabled state of the action's associated
+ """ Toggles the enabled/disabled state of the action's associated
feature.
"""
action._feature.toggle_feature( action )
-
+
#-- DockWindow user preference database methods --------------------------------
#---------------------------------------------------------------------------
@@ -885,11 +885,11 @@ def _get_layouts ( self ):
layouts = db.get( id )
db.close()
return layouts
-
+
return None
-
+
#---------------------------------------------------------------------------
- # Gets the names of all current layouts defined for the DockWindow:
+ # Gets the names of all current layouts defined for the DockWindow:
#---------------------------------------------------------------------------
def _get_layout_names ( self ):
@@ -898,26 +898,26 @@ def _get_layout_names ( self ):
layouts = self._get_layouts()
if layouts is not None:
return layouts.keys()
-
+
return []
-
+
#---------------------------------------------------------------------------
- # Gets the layout data for a specified layout name:
+ # Gets the layout data for a specified layout name:
#---------------------------------------------------------------------------
-
+
def _get_layout ( self, name ):
""" Gets the layout data for a specified layout name.
"""
layouts = self._get_layouts()
if layouts is not None:
return layouts.get( name )
-
+
return None
-
+
#---------------------------------------------------------------------------
- # Deletes the layout data for a specified layout name:
+ # Deletes the layout data for a specified layout name:
#---------------------------------------------------------------------------
-
+
def _delete_layout ( self, name ):
""" Deletes the layout data for a specified layout name.
"""
@@ -930,11 +930,11 @@ def _delete_layout ( self, name ):
del layouts[ name ]
db[ id ] = layouts
db.close()
-
+
#---------------------------------------------------------------------------
- # Sets the layout data for a specified layout name:
+ # Sets the layout data for a specified layout name:
#---------------------------------------------------------------------------
-
+
def _set_layout ( self, name, layout ):
""" Sets the layout data for a specified layout name.
"""