Package Gnumed :: Package timelinelib :: Package wxgui :: Package dialogs :: Package categoryfinder :: Module view
[frames] | no frames]

Source Code for Module Gnumed.timelinelib.wxgui.dialogs.categoryfinder.view

 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.categoryfinder.controller import CategoryFinderDialogController 
22  from timelinelib.wxgui.framework import Dialog 
23   
24   
25 -class CategoryFinderDialog(Dialog):
26 27 """ 28 <BoxSizerVertical > 29 30 <TextCtrl name="txt_target" border="ALL" width="250" 31 event_EVT_TEXT="on_char" /> 32 33 <ListBox name="lst_categories" border="LEFT|RIGHT|BOTTOM" height="250" proportion="1" /> 34 35 <BoxSizerHorizontal> 36 <StretchSpacer /> 37 <Button label="$(check_button_text)" event_EVT_BUTTON="on_check" border="BOTTOM|LEFT" /> 38 <Button label="$(uncheck_button_text)" event_EVT_BUTTON="on_uncheck" border="BOTTOM|LEFT" /> 39 <DialogButtonsCloseSizer border="LEFT|RIGHT|BOTTOM" /> 40 </BoxSizerHorizontal> 41 42 </BoxSizerVertical> 43 """ 44
45 - def __init__(self, parent, db):
46 Dialog.__init__(self, CategoryFinderDialogController, parent, { 47 "check_button_text": _("Check"), 48 "uncheck_button_text": _("Uncheck"), 49 }, title=_("Category Finder"), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) 50 self.controller.on_init(db, parent)
51
52 - def GetTarget(self):
53 return self.txt_target.GetValue()
54
55 - def SetCategories(self, categories):
56 self.lst_categories.SetItems(categories)
57