enthought / enthought/traitsui

DateEditor and DateRangeEditor issues

Open
#962 8 comments 0 reactions 0 assignees View on GitHub
component: examples type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Issues found by testing `Date_editor_demo.py` and `Date_range_editor_demo.py` in `examples/demos/Advanced` on MacOS.

- [ ] 1. Qt simple style `DateEditor` shows the date "01/01/2000" when the underlying trait value is `None`. All other editor styles and wx simple style implementation show the current date.

- [ ] 2. Wx `DateEditor` feels broken from UX perspective - the moths disappear, marking of the days is not consistent. With every click on a day in the calendar the following error is thrown (both wx 4.0 and wx 4.1):
```
wx._core.wxAssertionError: C++ assertion "retval != __null" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/osx/carbon/graphics.cpp(141) in wxMacCreateCGColor():

The above exception was the direct cause of the following exception:

SystemError: returned a result with an error set
```

- [ ] 3. Qt `DateEditor` also feels broken from UX perspective, but the issue seems to be not frequent enough updates. Switching between the months doesn't update the days. They are updated one by one after clicking on them. The issue is seen with `PySide2 5.11.0`, `PyQt5 5.14.2; PyQt5-sip 12.7.2; Qt 5.12.6` but not with `PyQt 4.11.4; Qt 4.8.7`.

- [ ] 4. `DateRangeEditor` is not implemented in wx, but rather than giving an informative error message it attempts to use `DateEditor` and the `Date_range_editor_demo.py` fails with the following error:
```
Traceback (most recent call last):
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/view_application.py", line 152, in OnInit
args=self.args,
File "/Users/icernyte/Documents/repos/traitsui/traitsui/view.py", line 462, in ui
ui.ui(parent, kind)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/ui.py", line 246, in ui
self.rebuild(self, parent)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/toolkit.py", line 125, in ui_live
ui_live.ui_live(ui, parent)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_live.py", line 52, in ui_live
_ui_dialog(ui, parent, BaseDialog.NONMODAL)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_live.py", line 88, in _ui_dialog
BaseDialog.display_ui(ui, parent, style)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_base.py", line 71, in display_ui
ui.owner.init(ui, parent, style)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_live.py", line 203, in init
sw = panel(ui, window)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_panel.py", line 272, in panel
panel, content[0], ui
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_panel.py", line 431, in fill_panel_for_group
panel, group, ui, suppress_label, is_dock_window, create_panel
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_panel.py", line 587, in __init__
self.add_items(content, panel, self.sizer)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/ui_panel.py", line 908, in add_items
editor.prepare(item_panel)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/editor.py", line 264, in prepare
self.init(parent)
File "/Users/icernyte/Documents/repos/traitsui/traitsui/wx/date_editor.py", line 829, in init
raise ValueError("Multi-select is True, but editing a non-list.")
ValueError: Multi-select is True, but editing a non-list.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.