Package Gnumed :: Package wxGladeWidgets :: Module wxgSelectPersonDTOFromListDlg
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgSelectPersonDTOFromListDlg

 1  # -*- coding: UTF-8 -*- 
 2  # 
 3  # generated by wxGlade 
 4  # 
 5   
 6  import wx 
 7   
 8  # begin wxGlade: dependencies 
 9  import gettext 
10  # end wxGlade 
11   
12  # begin wxGlade: extracode 
13  # end wxGlade 
14   
15   
16 -class wxgSelectPersonDTOFromListDlg(wx.Dialog):
17 - def __init__(self, *args, **kwds):
18 # begin wxGlade: wxgSelectPersonDTOFromListDlg.__init__ 19 kwds["style"] = kwds.get("style", 0) | wx.CAPTION | wx.CLOSE_BOX | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER 20 wx.Dialog.__init__(self, *args, **kwds) 21 self.SetSize((600, 400)) 22 self._lbl_message = wx.StaticText(self, wx.ID_ANY, _("Please select a person from the list below.")) 23 from Gnumed.wxpython.gmListWidgets import cReportListCtrl 24 self._LCTRL_persons = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES) 25 self._BTN_select = wx.Button(self, wx.ID_OK, _("Select")) 26 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel")) 27 28 self.__set_properties() 29 self.__do_layout() 30 31 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_list_item_activated, self._LCTRL_persons) 32 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_list_item_selected, self._LCTRL_persons)
33 # end wxGlade 34
35 - def __set_properties(self):
36 # begin wxGlade: wxgSelectPersonDTOFromListDlg.__set_properties 37 self.SetTitle(_("Select person from list")) 38 self.SetSize((600, 400)) 39 self._LCTRL_persons.SetToolTip(_("Displays the list of persons to select from.")) 40 self._LCTRL_persons.SetFocus() 41 self._BTN_select.SetToolTip(_("Select the person highlighted in the list above.")) 42 self._BTN_select.Enable(False) 43 self._BTN_select.SetDefault() 44 self._BTN_cancel.SetToolTip(_("Cancel person selection."))
45 # end wxGlade 46
47 - def __do_layout(self):
48 # begin wxGlade: wxgSelectPersonDTOFromListDlg.__do_layout 49 _szr_main = wx.BoxSizer(wx.VERTICAL) 50 _szr_buttons = wx.BoxSizer(wx.HORIZONTAL) 51 _szr_main.Add(self._lbl_message, 0, wx.EXPAND, 0) 52 _szr_main.Add(self._LCTRL_persons, 1, wx.EXPAND, 0) 53 _szr_buttons.Add((20, 20), 1, 0, 0) 54 _szr_buttons.Add(self._BTN_select, 0, 0, 0) 55 _szr_buttons.Add(self._BTN_cancel, 0, 0, 0) 56 _szr_main.Add(_szr_buttons, 0, wx.EXPAND, 0) 57 self.SetSizer(_szr_main) 58 self.Layout() 59 self.Centre()
60 # end wxGlade 61
62 - def _on_list_item_activated(self, event): # wxGlade: wxgSelectPersonDTOFromListDlg.<event_handler>
63 print("Event handler '_on_list_item_activated' not implemented!") 64 event.Skip()
65
66 - def _on_list_item_selected(self, event): # wxGlade: wxgSelectPersonDTOFromListDlg.<event_handler>
67 print("Event handler '_on_list_item_selected' not implemented!") 68 event.Skip() 69 70 # end of class wxgSelectPersonDTOFromListDlg 71