Пример #1
0
def custom_view_allow_no_range():
    """DateRangeEditor with allow_no_selection set to True."""
    view = View(
        Item(
            name="date_range",
            style="custom",
            editor=DateRangeEditor(allow_no_selection=True),
        ))
    return view
Пример #2
0
def default_custom_view():
    """ Default view of DateRangeEditor """
    view = View(
        Item(
            name='date_range',
            style="custom",
            editor=DateRangeEditor(),
        )
    )
    return view
Пример #3
0
class DateRangeEditorDemo(HasTraits):
    """ Demo class to show DateRangeEditor. """
    date_range = Tuple(Date, Date)

    traits_view = View(Group(Item('date_range',
                                  editor=DateRangeEditor(),
                                  style='custom',
                                  label='Date range'),
                             label='Date range'),
                       resizable=True)

    def _date_range_changed(self):
        print(self.date_range)
Пример #4
0
 def test_date_range_multi_select_is_constant(self):
     with self.assertRaises(TraitError):
         DateRangeEditor(multi_select=False)