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 import wx 20 21 from timelinelib.wxgui.components.propertyeditors.baseeditor import BaseEditor 22 2325 29 3277 7834 self.btn_add = self._create_add_button() 35 self.btn_clear = self._create_clear_button() 36 self.input_panel = self._create_input_controls() 37 return (self.btn_add, self.btn_clear, self.input_panel)3840 btn_add, btn_clear, input_panel = controls 41 sizer.Add(btn_add, wx.GBPosition(0, 0), wx.GBSpan(1, 1)) 42 sizer.Add(btn_clear, wx.GBPosition(0, 1), wx.GBSpan(1, 1)) 43 sizer.Add(input_panel, wx.GBPosition(1, 0), wx.GBSpan(4, 5))44 49 5456 alert_panel = wx.Panel(self) 57 alert_panel.on_return = self._on_return 58 time_type = self.editor.timeline.get_time_type() 59 self.dtp_start = time_type.create_time_picker(alert_panel, config=self.editor.config) 60 self.text_data = wx.TextCtrl(alert_panel, size=(300, 80), style=wx.TE_MULTILINE) 61 self.data = self.dtp_start 62 self._layout_input_controls(alert_panel) 63 return alert_panel64 6769 when = wx.StaticText(alert_panel, label=_("When:")) 70 text = wx.StaticText(alert_panel, label=_("Text:")) 71 sizer = wx.GridBagSizer(5, 10) 72 sizer.Add(when, wx.GBPosition(0, 0), wx.GBSpan(1, 1)) 73 sizer.Add(self.dtp_start, wx.GBPosition(0, 1), wx.GBSpan(1, 3)) 74 sizer.Add(text, wx.GBPosition(1, 0), wx.GBSpan(1, 1)) 75 sizer.Add(self.text_data, wx.GBPosition(1, 1), wx.GBSpan(1, 9)) 76 alert_panel.SetSizerAndFit(sizer)8013582 BaseEditor.__init__(self, parent, editor) 83 AlertEditorGuiCreator.__init__(self, parent) 84 self.create_gui() 85 self._initialize_data()86 9193 if self.editor.event is not None: 94 self.dtp_start.set_value(self.editor.event.get_start_time()) 95 else: 96 self.dtp_start.set_value(self.editor.start)9799 self.text_data.SetValue("")100102 if self.input_visible: 103 time = self.dtp_start.get_value() 104 text = self.text_data.GetValue() 105 return (time, text) 106 else: 107 return None108110 if data is None: 111 self._set_visible(False) 112 else: 113 self._set_visible(True) 114 time, text = data 115 self.dtp_start.set_value(time) 116 self.text_data.SetValue(text)117 120122 self.clear_data()123 128
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Mar 25 02:55:27 2020 | http://epydoc.sourceforge.net |