Skip to content

Commit

Permalink
Document entries parameter not supported qt for FileEditor/Director…
Browse files Browse the repository at this point in the history
…yEditor (#1557)

* fix History_demo.py on wx backend

* better document that entries is only supported on wx not qt
  • Loading branch information
aaronayres35 committed Mar 26, 2021
1 parent 8b65dcd commit ac9077b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/source/traitsui_user_manual/factories_basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,11 @@ the local system hierarchy. The styles of this editor are shown in Figure 31.

The default version of the simply style displays a text box and a :guilabel:`Browse`
button. Clicking :guilabel:`Browse` opens a platform-specific file selection dialog box.
If you specify the *entries* keyword parameter with an integer value to the
On the wx backend, if you specify the *entries* keyword parameter with an integer value to the
factory function, the simple style is a combo box and a button labeled :guilabel:`...`.
The user can type a file path in the combo box, or select one of *entries*
previous values. Clicking the :guilabel:`...` button opens a browser panel similar to the
previous values. Support for the *entries* parameter is yet to be implemented on
the qt backend. Clicking the :guilabel:`...` button opens a browser panel similar to the
custom style of editor. When the user selects a file in this browser, the panel
collapses, and control is returned to the original editor widget, which is
automatically populated with the new path string.
Expand Down
3 changes: 2 additions & 1 deletion traitsui/editors/file_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class ToolkitEditorFactory(EditorFactory):
enter_set = True

#: The number of history entries to maintain:
#: FIXME: add support
#: FIXME: This is currently only supported on wx. Qt support needs to be
#: added
entries = Int(10)

#: The root path of the file tree view ('custom' style only, not supported
Expand Down
2 changes: 1 addition & 1 deletion traitsui/wx/file_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def init(self, parent):
pad = 8

self._file_name = control
sizer.Add(control, 1, wx.EXPAND | wx.ALIGN_CENTER)
sizer.Add(control, 1, wx.EXPAND)
sizer.Add(button, 0, wx.LEFT | wx.ALIGN_CENTER, pad)
panel.Bind(wx.EVT_BUTTON, self.show_file_dialog, id=button.GetId())
panel.SetDropTarget(FileDropTarget(self))
Expand Down

0 comments on commit ac9077b

Please sign in to comment.