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

# Source Code for Module Gnumed.wxGladeWidgets.wxgItemPickerDlg

      1  #!/usr/bin/env python
      2  # -*- coding: utf-8 -*-
      3  # generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgItemPickerDlg.wxg"
      4
      5  import wx
      6
      7  # begin wxGlade: extracode
      8  # end wxGlade
      9
     10
     11
     12 -class wxgItemPickerDlg(wx.Dialog):
     13 -    def __init__(self, *args, **kwds):
     14
     15          from Gnumed.wxpython import gmListWidgets
     16
     17          # begin wxGlade: wxgItemPickerDlg.__init__
     18          kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
     19          wx.Dialog.__init__(self, *args, **kwds)
     20          self._LBL_msg = wx.StaticText(self, -1, _("label_1"))
     21          self._LCTRL_left = gmListWidgets.cReportListCtrl(self, -1, style=wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES|wx.NO_BORDER)
     22          self._BTN_left2right = wx.Button(self, -1, _(">>>"), style=wx.BU_EXACTFIT)
     23          self._BTN_right2left = wx.Button(self, -1, _("<<<"), style=wx.BU_EXACTFIT)
     24          self._LCTRL_right = gmListWidgets.cReportListCtrl(self, -1, style=wx.LC_REPORT|wx.LC_HRULES|wx.LC_VRULES|wx.NO_BORDER)
     25          self._BTN_ok = wx.Button(self, wx.ID_OK, "")
     26          self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
     27
     28          self.__set_properties()
     29          self.__do_layout()
     30
     31          self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self._on_left_list_item_deselected, self._LCTRL_left)
     32          self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_left_list_item_selected, self._LCTRL_left)
     33          self.Bind(wx.EVT_BUTTON, self._on_button_left2right_pressed, self._BTN_left2right)
     34          self.Bind(wx.EVT_BUTTON, self._on_button_right2left_pressed, self._BTN_right2left)
     35          self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self._on_right_list_item_deselected, self._LCTRL_right)
     36          self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_right_list_item_selected, self._LCTRL_right)
     37          # end wxGlade
     38
     39 -    def __set_properties(self):
     40          # begin wxGlade: wxgItemPickerDlg.__set_properties
     41          self.SetSize((600, 350))
     42          self._BTN_left2right.SetToolTipString(_("Move selected items from left to right."))
     43          self._BTN_left2right.Enable(False)
     44          self._BTN_right2left.SetToolTipString(_("Move selected items from right to left."))
     45          self._BTN_right2left.Enable(False)
     46          self._BTN_cancel.SetToolTipString(_("Cancel picking items."))
     47          # end wxGlade
     48
     49 -    def __do_layout(self):
     50          # begin wxGlade: wxgItemPickerDlg.__do_layout
     51          __szr_main = wx.BoxSizer(wx.VERTICAL)
     52          __szr_action_buttons = wx.BoxSizer(wx.HORIZONTAL)
     53          __szr_lists = wx.BoxSizer(wx.HORIZONTAL)
     54          __szr_move_buttons = wx.BoxSizer(wx.VERTICAL)
     55          __szr_main.Add(self._LBL_msg, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 3)
     56          __szr_lists.Add(self._LCTRL_left, 1, wx.EXPAND, 0)
     57          __szr_move_buttons.Add((20, 20), 2, wx.EXPAND, 0)
     58          __szr_move_buttons.Add(self._BTN_left2right, 0, 0, 0)
     59          __szr_move_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     60          __szr_move_buttons.Add(self._BTN_right2left, 0, 0, 0)
     61          __szr_move_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     62          __szr_lists.Add(__szr_move_buttons, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
     63          __szr_lists.Add(self._LCTRL_right, 1, wx.EXPAND, 0)
     64          __szr_main.Add(__szr_lists, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 3)
     65          __szr_action_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     66          __szr_action_buttons.Add(self._BTN_ok, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     67          __szr_action_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     68          __szr_action_buttons.Add(self._BTN_cancel, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     69          __szr_action_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     70          __szr_main.Add(__szr_action_buttons, 0, wx.ALL|wx.EXPAND, 3)
     71          self.SetSizer(__szr_main)
     72          self.Layout()
     73          # end wxGlade
     74
     75 -    def _on_button_left2right_pressed(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     76          print "Event handler `_on_button_left2right_pressed' not implemented!"
     77          event.Skip()
     78
     79 -    def _on_button_right2left_pressed(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     80          print "Event handler `_on_button_right2left_pressed' not implemented!"
     81          event.Skip()
     82
     83 -    def _on_left_list_item_deselected(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     84          print "Event handler `_on_left_list_item_deselected' not implemented"
     85          event.Skip()
     86
     87 -    def _on_left_list_item_selected(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     88          print "Event handler `_on_left_list_item_selected' not implemented"
     89          event.Skip()
     90
     91 -    def _on_right_list_item_deselected(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     92          print "Event handler `_on_right_list_item_deselected' not implemented"
     93          event.Skip()
     94
     95 -    def _on_right_list_item_selected(self, event): # wxGlade: wxgItemPickerDlg.<event_handler>
     96          print "Event handler `_on_right_list_item_selected' not implemented"
     97          event.Skip()
     98
     99  # end of class wxgItemPickerDlg
    100
    101
    102  if __name__ == "__main__":
    103      app = wx.PySimpleApp(0)
    104      wx.InitAllImageHandlers()
    105      dialog_1 = wxgItemPickerDlg(None, -1, "")
    106      app.SetTopWindow(dialog_1)
    107      dialog_1.Show()
    108      app.MainLoop()
    109