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 2123 2777 78 def check_item_corresponding_to_config(): 79 if self._config._get(spec['config-name']): 80 self.toolbar.ToggleTool(first_tool.GetId(), True) 81 else: 82 self.toolbar.ToggleTool(second_tool.GetId(), True) 83 self._parent.Bind(wx.EVT_TOOL, on_first_tool_click, first_tool) 84 self._parent.Bind(wx.EVT_TOOL, on_second_tool_click, second_tool) 85 self._config.listen_for_any(check_item_corresponding_to_config) 86 check_item_corresponding_to_config() 8729 self.toolbar = self._parent.CreateToolbar() 30 self._add_event_text_alignment() 31 self.toolbar.AddSeparator() 32 self._add_point_event_alignment() 33 self.toolbar.Realize() 34 self._set_visibility() 35 self._config.listen_for_any(self._set_visibility) 36 return self.toolbar3739 spec = {'tool-1-name': _("Center"), 40 'tool-2-name': _("Left"), 41 'tool-1-image': 'format-justify-center.png', 42 'tool-2-image': 'format-justify-left.png', 43 'config-name': 'center_event_texts', 44 } 45 self._toggle_toolbar(spec)4648 spec = {'tool-1-name': _("Left"), 49 'tool-2-name': _("Center"), 50 'tool-1-image': 'event-line-left.png', 51 'tool-2-image': 'event-line-center.png', 52 'config-name': 'draw_point_events_to_right', 53 } 54 self._toggle_toolbar(spec)5557 return self.toolbar.AddRadioLabelTool( 58 wx.ID_ANY, 59 text, 60 self._parent.BitmapFromIcon(icon), 61 shortHelp=text 62 )63 6769 first_tool = self._add_radio(spec['tool-1-name'], spec['tool-1-image']) 70 second_tool = self._add_radio(spec['tool-2-name'], spec['tool-2-image']) 71 72 def on_first_tool_click(event): 73 self._config._set(spec['config-name'], True)74 75 def on_second_tool_click(event): 76 self._config._set(spec['config-name'], False)
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jan 25 02:55:27 2019 | http://epydoc.sourceforge.net |