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

# Source Code for Module Gnumed.wxGladeWidgets.wxgGenericListSelectorDlg

      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 wxgGenericListSelectorDlg(wx.Dialog):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgGenericListSelectorDlg.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
     20                  wx.Dialog.__init__(self, *args, **kwds)
     21                  self.SetSize((640, 500))
     22                  self._LBL_message = wx.StaticText(self, wx.ID_ANY, "")
     23                  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     24                  self._LCTRL_items = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
     25                  self._BTN_ok = wx.Button(self, wx.ID_OK, "")
     26                  self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
     27                  self._BTN_new = wx.Button(self, wx.ID_ADD, "", style=wx.BU_EXACTFIT)
     28                  self._BTN_edit = wx.Button(self, wx.ID_ANY, _("&Edit"), style=wx.BU_EXACTFIT)
     29                  self._BTN_delete = wx.Button(self, wx.ID_DELETE, "", style=wx.BU_EXACTFIT)
     30                  self._BTN_extra_left = wx.Button(self, wx.ID_ANY, _("1"), style=wx.BU_EXACTFIT)
     31                  self._BTN_extra_middle = wx.Button(self, wx.ID_ANY, _("2"), style=wx.BU_EXACTFIT)
     32                  self._BTN_extra_right = wx.Button(self, wx.ID_ANY, _("3"), style=wx.BU_EXACTFIT)
     33
     34                  self.__set_properties()
     35                  self.__do_layout()
     36
     37                  self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self._on_list_item_deselected, self._LCTRL_items)
     38                  self.Bind(wx.EVT_BUTTON, self._on_new_button_pressed, self._BTN_new)
     39                  self.Bind(wx.EVT_BUTTON, self._on_edit_button_pressed, self._BTN_edit)
     40                  self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._BTN_delete)
     41                  self.Bind(wx.EVT_BUTTON, self._on_left_extra_button_pressed, self._BTN_extra_left)
     42                  self.Bind(wx.EVT_BUTTON, self._on_middle_extra_button_pressed, self._BTN_extra_middle)
     43                  self.Bind(wx.EVT_BUTTON, self._on_right_extra_button_pressed, self._BTN_extra_right)
     44                  # end wxGlade
     45
     46 -        def __set_properties(self):
     47                  # begin wxGlade: wxgGenericListSelectorDlg.__set_properties
     48                  self.SetSize((640, 500))
     49                  self._LCTRL_items.SetToolTip(_("Select the items you want to work on.\n\nA discontinuous selection may depend on your holding down a platform-dependent modifier key (<ctrl>, <alt>, etc) or key combination (eg. <ctrl-shift> or <ctrl-alt>) while clicking."))
     50                  self._LCTRL_items.SetFocus()
     51                  self._BTN_ok.SetToolTip(_("Act on the items selected in the above list."))
     52                  self._BTN_ok.Enable(False)
     53                  self._BTN_cancel.SetToolTip(_("Cancel this dialog."))
     54                  self._BTN_cancel.SetDefault()
     55                  self._BTN_new.SetToolTip(_("Add a new item to the list above."))
     56                  self._BTN_new.Enable(False)
     57                  self._BTN_edit.SetToolTip(_("Edit the (first or only) item selected in the list above."))
     58                  self._BTN_edit.Enable(False)
     59                  self._BTN_delete.SetToolTip(_("Delete - if possible - the (first or only) item selected in the list above."))
     60                  self._BTN_delete.Enable(False)
     61                  self._BTN_extra_left.Enable(False)
     62                  self._BTN_extra_middle.Enable(False)
     63                  self._BTN_extra_right.Enable(False)
     64                  # end wxGlade
     65
     66 -        def __do_layout(self):
     67                  # begin wxGlade: wxgGenericListSelectorDlg.__do_layout
     68                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     69                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     70                  __szr_main.Add(self._LBL_message, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     71                  __szr_main.Add(self._LCTRL_items, 1, wx.ALL | wx.EXPAND, 3)
     72                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     73                  __szr_buttons.Add(self._BTN_ok, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     74                  __szr_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     75                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     76                  __szr_buttons.Add(self._BTN_new, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     77                  __szr_buttons.Add(self._BTN_edit, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     78                  __szr_buttons.Add(self._BTN_delete, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     79                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     80                  __szr_buttons.Add(self._BTN_extra_left, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     81                  __szr_buttons.Add(self._BTN_extra_middle, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     82                  __szr_buttons.Add(self._BTN_extra_right, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
     83                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     84                  __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 3)
     85                  self.SetSizer(__szr_main)
     86                  self.Layout()
     87                  self.Centre()
     88                  # end wxGlade
     89
     90 -        def _on_list_item_deselected(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
     91                  print("Event handler '_on_list_item_deselected' not implemented!")
     92                  event.Skip()
     93
     94 -        def _on_new_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
     95                  print("Event handler '_on_new_button_pressed' not implemented!")
     96                  event.Skip()
     97
     98 -        def _on_edit_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
     99                  print("Event handler '_on_edit_button_pressed' not implemented!")
    100                  event.Skip()
    101
    102 -        def _on_delete_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
    103                  print("Event handler '_on_delete_button_pressed' not implemented!")
    104                  event.Skip()
    105
    106 -        def _on_left_extra_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
    107                  print("Event handler '_on_left_extra_button_pressed' not implemented!")
    108                  event.Skip()
    109
    110 -        def _on_middle_extra_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
    111                  print("Event handler '_on_middle_extra_button_pressed' not implemented!")
    112                  event.Skip()
    113
    114 -        def _on_right_extra_button_pressed(self, event):  # wxGlade: wxgGenericListSelectorDlg.<event_handler>
    115                  print("Event handler '_on_right_extra_button_pressed' not implemented!")
    116                  event.Skip()
    117
    118  # end of class wxgGenericListSelectorDlg
    119