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.dialogs.eraseditor.controller import ErasEditorDialogController 22 from timelinelib.wxgui.framework import Dialog 23 2426 27 """ 28 <BoxSizerVertical> 29 <ListBox name="lb_eras" border="ALL" proportion="1" height="250" 30 event_EVT_LISTBOX_DCLICK="on_dclick" 31 /> 32 <DialogButtonsEditAddRemoveCloseSizer border="LEFT|RIGHT|BOTTOM" 33 event_EVT_BUTTON__ID_ADD="on_add" 34 event_EVT_BUTTON__ID_REMOVE="on_remove" 35 event_EVT_BUTTON__ID_EDIT="on_edit" 36 /> 37 </BoxSizerVertical> 38 """ 3973 8141 Dialog.__init__(self, ErasEditorDialogController, parent, {}, 42 title=_("Edit Era's"), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) 43 self.controller.on_init(db, config)4446 for era in eras: 47 self.lb_eras.Append(era.get_name(), era) 48 if len(eras) > 0: 49 self.lb_eras.SetSelection(0) 50 self._EnableDisableButtons()51 54 5759 self.lb_eras.Append(era.get_name(), era) 60 self.lb_eras.Select(self.lb_eras.GetCount() - 1) 61 self._EnableDisableButtons()6264 def select_era(inx): 65 if self.lb_eras.GetCount() == inx: 66 inx -= 1 67 if inx >= 0: 68 self.lb_eras.SetSelection(inx)69 inx = self.lb_eras.GetSelection() 70 self.lb_eras.Delete(inx) 71 select_era(inx) 72 self._EnableDisableButtons()
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jan 25 02:55:27 2019 | http://epydoc.sourceforge.net |