Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Rickard Lindberg, Roger Lindberg 2 # 3 # This file is part of Timeline. 4 # 5 # Timeline is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # Timeline is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Timeline. If not, see <http://www.gnu.org/licenses/>. 17 18 19 from timelinelib.calendar.bosparanian.timetype import BosparanianTimeType 20 from timelinelib.calendar.bosparanian.timetype import has_nonzero_time 21 from timelinelib.canvas.data import TimePeriod 22 from timelinelib.wxgui.framework import Controller 23 from timelinelib.wxgui.framework import Panel 24 2527 28 """ 29 <BoxSizerVertical> 30 <BoxSizerHorizontal> 31 <TimePicker 32 name="start_time" 33 time_type="$(time_type)" 34 config="$(config)" 35 /> 36 <Spacer /> 37 <StaticText 38 label="$(to_label)" 39 name="to_label" 40 align="ALIGN_CENTER_VERTICAL" 41 /> 42 <Spacer /> 43 <TimePicker 44 name="end_time" 45 time_type="$(time_type)" 46 config="$(config)" 47 /> 48 </BoxSizerHorizontal> 49 <Spacer /> 50 <BoxSizerHorizontal> 51 <CheckBox 52 name="period_checkbox" 53 event_EVT_CHECKBOX="on_period_checkbox_changed" 54 label="$(period_checkbox_text)" /> 55 <CheckBox 56 name="show_time_checkbox" 57 event_EVT_CHECKBOX="on_show_time_checkbox_changed" 58 label="$(show_time_checkbox_text)" 59 /> 60 </BoxSizerHorizontal> 61 </BoxSizerVertical> 62 """ 63111 11265 Panel.__init__(self, BosparanianPeriodPickerController, parent, { 66 "time_type": BosparanianTimeType(), 67 "config": config, 68 "to_label": _("to"), 69 "period_checkbox_text": _("Period"), 70 "show_time_checkbox_text": _("Show time"), 71 })72 75 78 81 84 87 9092 return self.period_checkbox.GetValue()9395 self.period_checkbox.SetValue(show) 96 self.to_label.Show(show) 97 self.end_time.Show(show) 98 self.Layout()99101 return self.show_time_checkbox.GetValue()102104 self.show_time_checkbox.SetValue(show) 105 self.start_time.show_time(show) 106 self.end_time.show_time(show)107114138116 return TimePeriod(self._get_start(), self._get_end())117119 self.view.SetStartValue(time_period.get_start_time()) 120 self.view.SetEndValue(time_period.get_end_time()) 121 self.view.SetShowPeriod(time_period.is_period()) 122 self.view.SetShowTime(has_nonzero_time(time_period))123 126 129 132134 if self.view.GetShowPeriod(): 135 return self.view.GetEndValue() 136 else: 137 return self._get_start()
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jan 25 02:55:27 2019 | http://epydoc.sourceforge.net |