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

# Source Code for Module Gnumed.wxpython.gmAbout

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