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 """ 20 The search bar is a gui component displayed in the status bar whenever 21 the user presses Ctrl+F. It consists of the following visual components. 22 * A close button 23 * A search button 24 * A text field 25 * A backward navigation button 26 * A forward navigation button 27 * A 'display list' button 28 * Report labels for 'no event found' and 'one event found' 29 30 The parent of the component is the TimelinePanel. 31 32 As with all gui components all business logic is handles by a controller. 33 Actions on the components are directly delegated to the controller. 34 35 The component (or actually the controller) needs a Canvas object in order 36 to find events containing the given text. The Canvas object is injected 37 with the SetTimelineCanvas() function. 38 39 """ 40 41 import wx 42 43 from timelinelib.wxgui.components.searchbar.controller import SearchBarController 44 from timelinelib.wxgui.components.searchbar.guicreator.guicreator import GuiCreator 45 46488850 wx.ToolBar.__init__(self, parent, style=wx.TB_HORIZONTAL | wx.TB_BOTTOM) 51 self._controller = SearchBarController(self) 52 self._create_gui() 53 self.UpdateButtons()54 55 # 56 # Parent API 57 # 5860 self._controller.set_timeline_canvas(timeline_canvas)61 62 # 63 # Controller APIs 64 # 6567 return self._search.GetValue()6870 return self._period.GetString()71 7577 self.EnableTool(wx.ID_BACKWARD, self._controller.enable_backward()) 78 self.EnableTool(wx.ID_FORWARD, self._controller.enable_forward()) 79 self.EnableTool(wx.ID_MORE, self._controller.enable_list())8082 self._period.SetPeriodChoices(choices)83
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Mar 25 02:55:27 2020 | http://epydoc.sourceforge.net |