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

# Source Code for Module Gnumed.wxGladeWidgets.wxgDataMiningPnl

      1  #!/usr/bin/env python
      2  # -*- coding: UTF8 -*-
      3  #
      4  # generated by wxGlade 0.6.8
      5  #
      6
      7  import wx
      8
      9  # begin wxGlade: dependencies
     10  import gettext
     11  # end wxGlade
     12
     13  # begin wxGlade: extracode
     14  from Gnumed.wxpython import gmPhraseWheel
     15  from Gnumed.wxpython.gmDataMiningWidgets import cPatientListingCtrl
     16  # end wxGlade
     17
     18
     19 -class wxgDataMiningPnl(wx.ScrolledWindow):
     20 -        def __init__(self, *args, **kwds):
     21                  # begin wxGlade: wxgDataMiningPnl.__init__
     22                  kwds["style"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
     23                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     24                  self._splitter = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_3D | wx.SP_BORDER)
     25                  self.splitter_top_panel = wx.Panel(self._splitter, wx.ID_ANY, style=wx.NO_BORDER | wx.TAB_TRAVERSAL)
     26                  self._PRW_report_name = gmPhraseWheel.cPhraseWheel(self.splitter_top_panel, wx.ID_ANY, "", style=wx.NO_BORDER)
     27                  self._TCTRL_query = wx.TextCtrl(self.splitter_top_panel, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_WORDWRAP | wx.NO_BORDER)
     28                  self._BTN_run = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Run"), style=wx.BU_EXACTFIT)
     29                  self._BTN_clear = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Clear"), style=wx.BU_EXACTFIT)
     30                  self._BTN_save = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Save"), style=wx.BU_EXACTFIT)
     31                  self._BTN_delete = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Delete"), style=wx.BU_EXACTFIT)
     32                  self._BTN_contribute = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Contribute"), style=wx.BU_EXACTFIT)
     33                  self._BTN_visualize = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Plot"), style=wx.BU_EXACTFIT)
     34                  self._BTN_waiting_list = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Wait.List"), style=wx.BU_EXACTFIT)
     35                  self._BTN_schema = wx.Button(self.splitter_top_panel, wx.ID_ANY, _("Schema"), style=wx.BU_EXACTFIT)
     36                  self._splitter_bottom_panel = wx.Panel(self._splitter, wx.ID_ANY, style=wx.NO_BORDER | wx.TAB_TRAVERSAL)
     37                  self._LCTRL_result = cPatientListingCtrl(self._splitter_bottom_panel, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.SIMPLE_BORDER)
     38
     39                  self.__set_properties()
     40                  self.__do_layout()
     41
     42                  self.Bind(wx.EVT_BUTTON, self._on_run_button_pressed, self._BTN_run)
     43                  self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear)
     44                  self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
     45                  self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._BTN_delete)
     46                  self.Bind(wx.EVT_BUTTON, self._on_contribute_button_pressed, self._BTN_contribute)
     47                  self.Bind(wx.EVT_BUTTON, self._on_visualize_button_pressed, self._BTN_visualize)
     48                  self.Bind(wx.EVT_BUTTON, self._on_waiting_list_button_pressed, self._BTN_waiting_list)
     49                  self.Bind(wx.EVT_BUTTON, self._on_schema_button_pressed, self._BTN_schema)
     50                  # end wxGlade
     51
     52 -        def __set_properties(self):
     53                  # begin wxGlade: wxgDataMiningPnl.__set_properties
     54                  self.SetScrollRate(10, 10)
     55                  self._PRW_report_name.SetToolTipString(_("If you want to save this query into the database for later use you must provide a descriptive label for it here."))
     56                  self._TCTRL_query.SetToolTipString(_("Enter the SQL commands to run here. It doesn't matter whether or not you enter a trailing \";\".\n\nNote that:\n- the query is run in a read-only transaction\n- the result list will be artificially limited to the first 1000 rows\n- you can include a column named \"pk_patient\" to make the result rows activate the corresponding patient on double-clicking"))
     57                  self._BTN_run.SetToolTipString(_("Run the query and present the results below."))
     58                  self._BTN_run.SetDefault()
     59                  self._BTN_clear.SetToolTipString(_("Clear all fields."))
     60                  self._BTN_save.SetToolTipString(_("Save the report definition."))
     61                  self._BTN_delete.SetToolTipString(_("Delete this report definition."))
     62                  self._BTN_contribute.SetToolTipString(_("Contribute this report definition to the GNUmed community. The report name and SQL command will be sent to the mailing list.\n\nPatient data will NOT be put AT RISK.\n\nYou may want to be careful about the SQL itself as it just might contain bits of sensitive data in, say, the WHERE conditions."))
     63                  self._BTN_visualize.SetToolTipString(_("Visualize (plot) data from two numeric columns of the result list below."))
     64                  self._BTN_visualize.Enable(False)
     65                  self._BTN_waiting_list.SetToolTipString(_("Put all or selected results onto a waiting list."))
     66                  self._BTN_waiting_list.Enable(False)
     67                  self._BTN_schema.SetToolTipString(_("Show the database schema definition in your web browser."))
     68                  # end wxGlade
     69
     70 -        def __do_layout(self):
     71                  # begin wxGlade: wxgDataMiningPnl.__do_layout
     72                  _szr_main = wx.BoxSizer(wx.VERTICAL)
     73                  __szr_splitter_bottom = wx.BoxSizer(wx.VERTICAL)
     74                  _fgszr_top = wx.FlexGridSizer(3, 2, 1, 4)
     75                  _szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     76                  __LBL_report_name = wx.StaticText(self.splitter_top_panel, wx.ID_ANY, _("Report"))
     77                  _fgszr_top.Add(__LBL_report_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     78                  _fgszr_top.Add(self._PRW_report_name, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     79                  __LBL_query = wx.StaticText(self.splitter_top_panel, wx.ID_ANY, _("\nCommand\n(SQL)"))
     80                  _fgszr_top.Add(__LBL_query, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     81                  _fgszr_top.Add(self._TCTRL_query, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     82                  _fgszr_top.Add((20, 20), 0, wx.EXPAND, 0)
     83                  _szr_buttons.Add(self._BTN_run, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     84                  _szr_buttons.Add(self._BTN_clear, 0, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
     85                  _szr_buttons.Add(self._BTN_save, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     86                  _szr_buttons.Add(self._BTN_delete, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     87                  _szr_buttons.Add(self._BTN_contribute, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     88                  _szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     89                  _LBL_results = wx.StaticText(self.splitter_top_panel, wx.ID_ANY, _("Results:"))
     90                  _szr_buttons.Add(_LBL_results, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     91                  _szr_buttons.Add(self._BTN_visualize, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
     92                  _szr_buttons.Add(self._BTN_waiting_list, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     93                  _szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     94                  _szr_buttons.Add(self._BTN_schema, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     95                  _fgszr_top.Add(_szr_buttons, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
     96                  self.splitter_top_panel.SetSizer(_fgszr_top)
     97                  _fgszr_top.AddGrowableRow(1)
     98                  _fgszr_top.AddGrowableCol(1)
     99                  __szr_splitter_bottom.Add(self._LCTRL_result, 1, wx.EXPAND, 0)
    100                  self._splitter_bottom_panel.SetSizer(__szr_splitter_bottom)
    101                  self._splitter.SplitHorizontally(self.splitter_top_panel, self._splitter_bottom_panel, 125)
    102                  _szr_main.Add(self._splitter, 1, wx.EXPAND, 0)
    103                  self.SetSizer(_szr_main)
    104                  _szr_main.Fit(self)
    105                  # end wxGlade
    106
    107 -        def _on_run_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    108                  print "Event handler '_on_run_button_pressed' not implemented!"
    109                  event.Skip()
    110
    111 -        def _on_clear_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    112                  print "Event handler '_on_clear_button_pressed' not implemented!"
    113                  event.Skip()
    114
    115 -        def _on_save_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    116                  print "Event handler '_on_save_button_pressed' not implemented!"
    117                  event.Skip()
    118
    119 -        def _on_delete_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    120                  print "Event handler '_on_delete_button_pressed' not implemented!"
    121                  event.Skip()
    122
    123 -        def _on_contribute_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    124                  print "Event handler '_on_contribute_button_pressed' not implemented!"
    125                  event.Skip()
    126
    127 -        def _on_visualize_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    128                  print "Event handler '_on_visualize_button_pressed' not implemented!"
    129                  event.Skip()
    130
    131 -        def _on_waiting_list_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    132                  print "Event handler '_on_waiting_list_button_pressed' not implemented!"
    133                  event.Skip()
    134
    135 -        def _on_schema_button_pressed(self, event):  # wxGlade: wxgDataMiningPnl.<event_handler>
    136                  print "Event handler '_on_schema_button_pressed' not implemented!"
    137                  event.Skip()
    138
    139  # end of class wxgDataMiningPnl
    140