Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document entries parameter not supported qt for FileEditor/DirectoryEditor #1557

Merged
merged 2 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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