Package Gnumed :: Package wxpython :: Module gmAbout |
[frames] | no frames]

# Source Code for Module Gnumed.wxpython.gmAbout

      1  # -*- coding: utf8 -*-
      2  #====================================================================
      3  # About GNUmed
      4  #====================================================================
      5  __version__ = "$Revision: 1.35 $"
      6  __author__ = "M.Bonert"
      7  __license__ = "GPL"
      8
      9  import sys
     10
     11
     12  import wx
     13
     14
     15  from Gnumed.pycommon import gmTools
     16
     17  try:
     18          _('dummy-no-need-to-translate-but-make-epydoc-happy')
     19  except NameError:
     20          _ = lambda x:x
     21
     22  ID_MENU = wx.NewId()
     23  ID_EXIT = wx.NewId()
     24  #====================================================================
     25 -class ScrollTxtWin (wx.Window):
     26          """
     27          Scrolling Text!
     28          """
     29
     30          # control parameters
     31          __scroll_speed=.3       # pixels/milliseconds (?)
     32          __delay=500             # milliseconds
     33          name_list = [
     34                  u'Dr Horst Herb',
     35                  u'Karsten Hilbert',
     36                  u'Dr Gerardo Arnaez',
     37                  u'Dr Hilmar Berger',
     38                  u'Michael Bonert',
     39                  u'Dr Elizabeth Dodd',
     40                  u'Dr David Guest',
     41                  u'Ian Haywood',
     42                  u'Dr Tony Lembke',
     43                  u'Dr Richard Terry',
     44                  u'Syan J Tan',
     45                  u'Andreas Tille',
     46                  u'Dr Carlos Moro',
     47                  u'Dr James Busser',
     48                  u'Dr Rogerio Luz',
     49                  u'Dr Sebastian Hilbert',
     50                  u'Dr John Jaarsveld',
     51                  u'et alii'
     52          ]
     53
     54          # initializations
     55          __scroll_ctr = +230
     56          __name_ctr = 1
     57          __delay_ctr = 1
     58
     59 -        def __init__ (self, parent):
     60                  wx.Window.__init__(self, parent, -1, size=(230,20), style=wx.SUNKEN_BORDER)
     61                  self.SetBackgroundColour(wx.Colour(255, 255, 255))
     62                  self.__delay_ctr_reset=self.__delay*self.__scroll_speed
     63
     64                  self.moving_txt=wx.StaticText(self, -1, "", size=(230,20), style=wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE)
     65                  self.moving_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
     66                  self.moving_txt.SetLabel(self.name_list[0])
     67
     68                  wx.EVT_TIMER(self, -1, self.OnTimer)
     69                  self.timer = wx.Timer(self, -1)
     70                  #self.timer.Start(self.__scroll_speed)
     71                  self.timer.Start(milliseconds = 1./self.__scroll_speed)
     72
     73 -        def OnTimer(self, evt):
     74                  if(self.__scroll_ctr<-2 and self.__delay_ctr<self.__delay_ctr_reset):
     75                          # pause at centre
     76                          self.__delay_ctr=self.__delay_ctr+1
     77                  else:
     78                          self.__scroll_ctr=self.__scroll_ctr-1
     79                          self.moving_txt.MoveXY(self.__scroll_ctr, 0)
     80                  if(self.__scroll_ctr<-230):
     81                          # reset counters
     82                          self.__scroll_ctr=+230
     83                          self.__delay_ctr=1
     84
     85                          # get next name in dict.
     86                          self.moving_txt.SetLabel(self.name_list[self.__name_ctr])
     87                          self.__name_ctr=self.__name_ctr+1
     88                          if(self.__name_ctr>len(self.name_list)-1):
     89                                  self.__name_ctr=0
     90
     91 -class AboutFrame (wx.Frame):
     92          """
     93          About GNUmed
     94          """
     95 -        def __init__(self, parent, ID, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, version='???'):
     96                  wx.Frame.__init__(self, parent, ID, title, pos, size, style)
     97
     98                  self.SetIcon(gmTools.get_icon(wx = wx))
     99
    100                  box = wx.BoxSizer(wx.VERTICAL)
    101                  if wx.Platform == '__WXMAC__':
    102                          box.Add((0,0), 2)
    103                  else:
    104                          box.Add((0,0), 2)
    105                  intro_txt=wx.StaticText(self, -1, _("Monty the Serpent && the FSF Present"))
    106                  intro_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,''))
    107                  box.Add(intro_txt, 0, wx.ALIGN_CENTRE)
    108                  if wx.Platform == '__WXMAC__':
    109                          box.Add((0,0), 3)
    110                  else:
    111                          box.Add((0,0), 3)
    112                  gm_txt=wx.StaticText(self, -1, "GNUmed")
    113                  gm_txt.SetFont(wx.Font(30, wx.SWISS, wx.NORMAL, wx.NORMAL))
    114                  box.Add(gm_txt, 0, wx.ALIGN_CENTRE)
    115
    116                  motto_txt=wx.StaticText(self, -1, _("Free eMedicine"))
    117                  motto_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,''))
    118                  box.Add(motto_txt, 0, wx.ALIGN_CENTRE)
    119                  if wx.Platform == '__WXMAC__':
    120                          box.Add((0,0), 4)
    121                  else:
    122                          box.Add((0,0), 4)
    123                  ver_txt=wx.StaticText(self, -1, _("Version %s brought to you by") % version)
    124                  ver_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
    125                  box.Add(ver_txt, 0, wx.ALIGN_CENTRE)
    126
    127                  admins_txt=wx.StaticText(self, -1, "")
    128                  admins_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
    129                  box.Add(admins_txt, 0, wx.ALIGN_CENTRE)
    130
    131                  self.win=ScrollTxtWin(self)
    132                  box.Add(self.win, 0, wx.ALIGN_CENTRE)
    133                  if wx.Platform == '__WXMAC__':
    134                          box.Add((0,0), 1)
    135                  else:
    136                          box.Add((0,0), 1)
    137                  info_txt=wx.StaticText(self, -1, _("Please visit http://www.gnumed.org"))
    138                  info_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL))
    139                  box.Add(info_txt, 0, wx.ALIGN_CENTRE)
    140                  if wx.Platform == '__WXMAC__':
    141                          box.Add((0,0), 1)
    142                  else:
    143                          box.Add((0,0), 1)
    144                  btn = wx.Button(self, ID_MENU , _("Close"))
    145                  box.Add(btn,0, wx.ALIGN_CENTRE)
    146                  if wx.Platform == '__WXMAC__':
    147                          box.Add((0,0), 1)
    148                  else:
    149                          box.Add((0,0), 1)
    150                  wx.EVT_BUTTON(btn, ID_MENU, self.OnClose)
    151
    152                  self.SetAutoLayout(True)
    153                  self.SetSizer(box)
    154                  self.Layout()
    155
    156 -        def OnClose (self, event):
    157                  self.win.timer.Stop ()
    158                  self.Destroy ()
    159  #====================================================================
    160 -class cContributorsDlg(wx.Dialog):
    161          # people who don't want to be listed here:
    162          # ...
    163          contributors = _(
    164  'The following people kindly contributed to GNUmed.\n'
    165  'Please write to <gnumed-devel@gnu.org> to have your\n'
    166  'contribution duly recognized in this list or to have\n'
    167  'your name removed from it for, say, privacy reasons.\n\n'
    168  'Note that this list is sorted alphabetically by last\n'
    169  'name, first name. If the only identifier is an email\n'
    170  'address it is sorted under the first character of\n'
    171  'the user name.\n'
    172  '%s'
    173  ) % u"""
    174  == B ===========================================
    175
    176  James Busser, MD
    177   British Columbia
    178
    179   - test results handling
    180   - documentation would be nothing without him
    181   - encouragement, testing, bug reporting
    182   - testing on MacOSX
    183
    184  == F ===========================================
    185
    186  Joachim Fischer
    187   GP Fischer + Lintz
    188   Fachärzte Allgemeinmedizin
    189   Wolfschlugen
    190
    191   - Karteieintragsarten passend für Deutschland
    192
    193  == H ===========================================
    194
    195  Sebastian Hilbert, MD
    196   Germany
    197
    198   - packaging, PR
    199
    200  Anne te Harvik
    201   Netherlands
    202
    203   - Dutch translation
    204
    205  == J ===========================================
    206
    207  John Jaarsveld, MD
    208   Netherlands
    209
    210   - lots of help with the visual progress notes
    211   - Dutch l10n
    212
    213  == L ===========================================
    214
    215  Steffi Leibner, Leipzig
    216   Germany
    217
    218   - Testen, Fehlerberichte
    219   - Dokumentenvorlage
    220
    221  Rogerio Luz, Brasil
    222
    223   - testing, bug reporting
    224   - SOAP handling discussion
    225   - providing LaTeX form templates
    226
    227  == N ===========================================
    228
    229  Clemens Nietfeld, Oldenburg
    230
    231   - Information zur Anbindung von DocConcept
    232
    233  == P ===========================================
    234
    235  Martin Preuss, Hamburg
    236
    237   - Chipkartenansteuerung
    238
    239  == R ===========================================
    240
    241  Thomas Reus, Düsseldorf
    242
    243   - Testen, Fehlerberichte
    244   - Dokumentenvorlage
    245
    246  == T ===========================================
    247
    248  Andreas Tille, Wernigerode
    249
    250   - Debian packages
    251   - encouragement, wisdom
    252
    253  """
    254          #----------------------------------------------
    255 -        def __init__(self, *args, **kwargs):
    256                  wx.Dialog.__init__(self, *args, **kwargs)
    257                  contributor_listing = wx.TextCtrl (
    258                          self,
    259                          -1,
    260                          cContributorsDlg.contributors,
    261                          style = wx.TE_MULTILINE | wx.TE_READONLY,
    262                          size = wx.Size(500, 300)
    263                  )
    264  #               contributor_listing.SetFont(wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL))
    265                  # arrange widgets
    266                  szr_outer = wx.BoxSizer(wx.VERTICAL)
    267                  szr_outer.Add(contributor_listing, 1, wx.EXPAND, 0)
    268                  # and do layout
    269                  self.SetAutoLayout(1)
    270                  self.SetSizerAndFit(szr_outer)
    271                  szr_outer.SetSizeHints(self)
    272                  self.Layout()
    273  #====================================================================
    274  # Main
    275  #====================================================================
    276  if __name__ == '__main__':
    277          # set up dummy app
    278 -        class TestApp (wx.App):
    279 -                def OnInit (self):
    280                          frame = AboutFrame(None, -1, u"About GNUmed", size=wx.Size(300, 250))
    281                          frame.Show(1)
    282                          return 1
    283          #---------------------
    284          if len(sys.argv) > 1 and sys.argv[1] == 'test':
    285                  app = TestApp()
    286                  app.MainLoop()
    287
    288  #------------------------------------------------------------
    289