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  # $Source: /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/client/wxpython/gmAbout.py,v $ 
  6  # $Id: gmAbout.py,v 1.35 2010-02-06 20:54:54 ncq Exp $ 
  7  __version__ = "$Revision: 1.35 $" 
  8  __author__ = "M.Bonert" 
  9  __license__ = "GPL" 
 10   
 11  import zlib, cPickle, sys 
 12   
 13   
 14  import wx 
 15   
 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 Gerardo Arnaez', 35 u'Dr Hilmar Berger', 36 u'Michael Bonert', 37 u'Dr Elizabeth Dodd', 38 u'Dr David Guest', 39 u'Ian Haywood', 40 u'Dr Tony Lembke', 41 u'Dr Richard Terry', 42 u'Syan J Tan', 43 u'Andreas Tille', 44 u'Dr Carlos Moro', 45 u'Dr James Busser', 46 u'Dr Rogerio Luz', 47 u'Dr Sebastian Hilbert', 48 u'Dr John Jaarsveld', 49 u'et alii' 50 ] 51 52 # initializations 53 __scroll_ctr = +230 54 __name_ctr = 1 55 __delay_ctr = 1 56
57 - def __init__ (self, parent):
58 wx.Window.__init__(self, parent, -1, size=(230,20), style=wx.SUNKEN_BORDER) 59 self.SetBackgroundColour(wx.Colour(255, 255, 255)) 60 self.__delay_ctr_reset=self.__delay*self.__scroll_speed 61 62 self.moving_txt=wx.StaticText(self, -1, "", size=(230,20), style=wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE) 63 self.moving_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) 64 self.moving_txt.SetLabel(self.name_list[0]) 65 66 wx.EVT_TIMER(self, -1, self.OnTimer) 67 self.timer = wx.Timer(self, -1) 68 #self.timer.Start(self.__scroll_speed) 69 self.timer.Start(milliseconds = 1./self.__scroll_speed)
70
71 - def OnTimer(self, evt):
72 if(self.__scroll_ctr<-2 and self.__delay_ctr<self.__delay_ctr_reset): 73 # pause at centre 74 self.__delay_ctr=self.__delay_ctr+1 75 else: 76 self.__scroll_ctr=self.__scroll_ctr-1 77 self.moving_txt.MoveXY(self.__scroll_ctr, 0) 78 if(self.__scroll_ctr<-230): 79 # reset counters 80 self.__scroll_ctr=+230 81 self.__delay_ctr=1 82 83 # get next name in dict. 84 self.moving_txt.SetLabel(self.name_list[self.__name_ctr]) 85 self.__name_ctr=self.__name_ctr+1 86 if(self.__name_ctr>len(self.name_list)-1): 87 self.__name_ctr=0
88
89 -class AboutFrame (wx.Frame):
90 """ 91 About GNUmed 92 """ 93 94 icon_serpent='x\xdae\x8f\xb1\x0e\x83 \x10\x86w\x9f\xe2\x92\x1blb\xf2\x07\x96\xeaH:0\xd6\ 95 \xc1\x85\xd5\x98N5\xa5\xef?\xf5N\xd0\x8a\xdcA\xc2\xf7qw\x84\xdb\xfa\xb5\xcd\ 96 \xd4\xda;\xc9\x1a\xc8\xb6\xcd<\xb5\xa0\x85\x1e\xeb\xbc\xbc7b!\xf6\xdeHl\x1c\ 97 \x94\x073\xec<*\xf7\xbe\xf7\x99\x9d\xb21~\xe7.\xf5\x1f\x1c\xd3\xbdVlL\xc2\ 98 \xcf\xf8ye\xd0\x00\x90\x0etH \x84\x80B\xaa\x8a\x88\x85\xc4(U\x9d$\xfeR;\xc5J\ 99 \xa6\x01\xbbt9\xceR\xc8\x81e_$\x98\xb9\x9c\xa9\x8d,y\xa9t\xc8\xcf\x152\xe0x\ 100 \xe9$\xf5\x07\x95\x0cD\x95t:\xb1\x92\xae\x9cI\xa8~\x84\x1f\xe0\xa3ec' 101
102 - def __init__(self, parent, ID, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, version='???'):
103 wx.Frame.__init__(self, parent, ID, title, pos, size, style) 104 105 icon = wx.EmptyIcon() 106 icon.CopyFromBitmap(wx.BitmapFromXPMData(cPickle.loads(zlib.decompress(self.icon_serpent)))) 107 self.SetIcon(icon) 108 109 box = wx.BoxSizer(wx.VERTICAL) 110 if wx.Platform == '__WXMAC__': 111 box.Add((0,0), 2) 112 else: 113 box.Add((0,0), 2) 114 intro_txt=wx.StaticText(self, -1, _("Monty the Serpent && the FSF Present")) 115 intro_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,'')) 116 box.Add(intro_txt, 0, wx.ALIGN_CENTRE) 117 if wx.Platform == '__WXMAC__': 118 box.Add((0,0), 3) 119 else: 120 box.Add((0,0), 3) 121 gm_txt=wx.StaticText(self, -1, "GNUmed") 122 gm_txt.SetFont(wx.Font(30, wx.SWISS, wx.NORMAL, wx.NORMAL)) 123 box.Add(gm_txt, 0, wx.ALIGN_CENTRE) 124 125 motto_txt=wx.StaticText(self, -1, _("Free eMedicine")) 126 motto_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,'')) 127 box.Add(motto_txt, 0, wx.ALIGN_CENTRE) 128 if wx.Platform == '__WXMAC__': 129 box.Add((0,0), 4) 130 else: 131 box.Add((0,0), 4) 132 ver_txt=wx.StaticText(self, -1, _("Version %s brought to you by") % version) 133 ver_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) 134 box.Add(ver_txt, 0, wx.ALIGN_CENTRE) 135 136 admins_txt=wx.StaticText(self, -1, _("Drs Horst Herb && Karsten Hilbert")) 137 admins_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) 138 box.Add(admins_txt, 0, wx.ALIGN_CENTRE) 139 140 self.win=ScrollTxtWin(self) 141 box.Add(self.win, 0, wx.ALIGN_CENTRE) 142 if wx.Platform == '__WXMAC__': 143 box.Add((0,0), 1) 144 else: 145 box.Add((0,0), 1) 146 info_txt=wx.StaticText(self, -1, _("Please visit http://www.gnumed.org")) 147 info_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) 148 box.Add(info_txt, 0, wx.ALIGN_CENTRE) 149 if wx.Platform == '__WXMAC__': 150 box.Add((0,0), 1) 151 else: 152 box.Add((0,0), 1) 153 btn = wx.Button(self, ID_MENU , _("Close")) 154 box.Add(btn,0, wx.ALIGN_CENTRE) 155 if wx.Platform == '__WXMAC__': 156 box.Add((0,0), 1) 157 else: 158 box.Add((0,0), 1) 159 wx.EVT_BUTTON(btn, ID_MENU, self.OnClose) 160 161 self.SetAutoLayout(True) 162 self.SetSizer(box) 163 self.Layout()
164
165 - def OnClose (self, event):
166 self.win.timer.Stop () 167 self.Destroy ()
168 #====================================================================
169 -class cContributorsDlg(wx.Dialog):
170 # people who don't want to be listed here: 171 # ... 172 contributors = _( 173 'The following people kindly contributed to GNUmed.\n' 174 'Please write to <gnumed-devel@gnu.org> to have your\n' 175 'contribution duly recognized in this list or to have\n' 176 'your name removed from it for, say, privacy reasons.\n\n' 177 'Note that this list is sorted alphabetically by last\n' 178 'name, first name. If the only identifier is an email\n' 179 'address it is sorted under the first character of\n' 180 'the user name.\n' 181 '%s' 182 ) % u""" 183 == B =========================================== 184 185 James Busser, MD 186 British Columbia 187 188 - test results handling 189 - documentation would be nothing without him 190 - encouragment 191 - testing on MacOSX 192 193 == F =========================================== 194 195 Joachim Fischer 196 GP Fischer + Lintz 197 Fachärzte Allgemeinmedizin 198 Wolfschlugen 199 200 - Karteieintragsarten passend für Deutschland 201 202 == H =========================================== 203 204 Sebastian Hilbert, MD 205 Germany 206 207 - packaging, PR 208 209 Anne te Harvik 210 Netherlands 211 212 - Dutch translation 213 214 == J =========================================== 215 216 John Jaarsveld, MD 217 Netherlands 218 219 - lots of help with the visual progress notes 220 - Dutch l10n 221 222 == L =========================================== 223 224 Steffi Leibner, Leipzig 225 Germany 226 227 - Testen, Fehlerberichte 228 - Dokumentenvorlage 229 230 Rogerio Luz, Brasil 231 232 - testing, bug reporting 233 - SOAP handling discussion 234 - providing LaTeX form templates 235 236 == N =========================================== 237 238 Clemens Nietfeld, Oldenburg 239 240 - Information zur Anbindung von DocConcept 241 242 == P =========================================== 243 244 Martin Preuss, Hamburg 245 246 - Chipkartenansteuerung 247 248 == R =========================================== 249 250 Thomas Reus, Düsseldorf 251 252 - Testen, Fehlerberichte 253 - Dokumentenvorlage 254 255 == T =========================================== 256 257 Andreas Tille, Wernigerode 258 259 - Debian packages 260 - encouragement, wisdom 261 262 """ 263 #----------------------------------------------
264 - def __init__(self, *args, **kwargs):
265 wx.Dialog.__init__(self, *args, **kwargs) 266 contributor_listing = wx.TextCtrl ( 267 self, 268 -1, 269 cContributorsDlg.contributors, 270 style = wx.TE_MULTILINE | wx.TE_READONLY, 271 size = wx.Size(500, 300) 272 ) 273 # contributor_listing.SetFont(wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL)) 274 # arrange widgets 275 szr_outer = wx.BoxSizer(wx.VERTICAL) 276 szr_outer.Add(contributor_listing, 1, wx.EXPAND, 0) 277 # and do layout 278 self.SetAutoLayout(1) 279 self.SetSizerAndFit(szr_outer) 280 szr_outer.SetSizeHints(self) 281 self.Layout()
282 #==================================================================== 283 # Main 284 #==================================================================== 285 if __name__ == '__main__': 286 # set up dummy app
287 - class TestApp (wx.App):
288 - def OnInit (self):
289 frame = AboutFrame(None, -1, u"About GNUmed", size=wx.Size(300, 250)) 290 frame.Show(1) 291 return 1
292 #--------------------- 293 if len(sys.argv) > 1 and sys.argv[1] == 'test': 294 app = TestApp() 295 app.MainLoop() 296 297 #------------------------------------------------------------ 298 # $Log: gmAbout.py,v $ 299 # Revision 1.35 2010-02-06 20:54:54 ncq 300 # - fix Jim's entry 301 # 302 # Revision 1.34 2010/01/21 08:41:56 ncq 303 # - properly acknowledge Rogerio 304 # 305 # Revision 1.33 2010/01/13 21:51:00 ncq 306 # - adjust supporters 307 # 308 # Revision 1.32 2009/01/15 11:35:06 ncq 309 # - cleanup 310 # 311 # Revision 1.31 2008/09/09 20:18:06 ncq 312 # - cleanup 313 # 314 # Revision 1.30 2008/07/28 20:41:58 ncq 315 # - support version in about box 316 # 317 # Revision 1.29 2007/09/20 19:34:04 ncq 318 # - cleanup 319 # 320 # Revision 1.28 2007/09/10 12:35:08 ncq 321 # - make accessible to epydoc 322 # 323 # Revision 1.27 2007/08/29 14:37:00 ncq 324 # - add Clemens Nietfeld 325 # 326 # Revision 1.26 2007/08/20 14:22:24 ncq 327 # - add more helpful people 328 # 329 # Revision 1.25 2006/10/23 15:48:07 ncq 330 # - fix unicode/latin1 string issue 331 # 332 # Revision 1.24 2005/12/27 18:46:20 ncq 333 # - define _() 334 # 335 # Revision 1.23 2005/12/24 10:27:42 shilbert 336 # - gui fixes 337 # 338 # Revision 1.22 2005/11/27 14:29:27 shilbert 339 # - more wx24 --> wx26 cleanup 340 # 341 # Revision 1.21 2005/09/28 21:27:30 ncq 342 # - a lot of wx2.6-ification 343 # 344 # Revision 1.20 2005/09/28 15:57:47 ncq 345 # - a whole bunch of wx.Foo -> wx.Foo 346 # 347 # Revision 1.19 2005/09/27 20:44:58 ncq 348 # - wx.wx* -> wx.* 349 # 350 # Revision 1.18 2005/09/26 18:01:50 ncq 351 # - use proper way to import wx26 vs wx2.4 352 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 353 # - time for fixup 354 # 355 # Revision 1.17 2005/07/24 11:35:59 ncq 356 # - use robustified gmTimer.Start() interface 357 # 358 # Revision 1.16 2005/07/18 20:45:25 ncq 359 # - make contributors dialog slightly larger 360 # 361 # Revision 1.15 2005/07/11 16:16:21 ncq 362 # - display contributor dialog in a proper size 363 # 364 # Revision 1.14 2005/07/11 09:04:27 ncq 365 # - add contributors dialog 366 # 367 # Revision 1.13 2005/07/02 18:19:01 ncq 368 # - one more GnuMed -> GNUmed 369 # 370 # Revision 1.12 2005/06/30 10:05:47 cfmoro 371 # String corrections 372 # 373 # Revision 1.11 2005/06/21 04:57:12 rterry 374 # fix this to run under wxPython26 375 # -e.g incorrect sizer attributes 376 # 377 # Revision 1.10 2005/05/30 09:20:51 ncq 378 # - add Carlos Moro 379 # 380 # Revision 1.9 2004/07/18 20:30:53 ncq 381 # - wxPython.true/false -> Python.True/False as Python tells us to do 382 # 383 # Revision 1.8 2004/06/30 15:56:14 shilbert 384 # - more wxMAC fixes -they don't stop surfacing :-) 385 # 386 # Revision 1.7 2003/11/17 10:56:37 sjtan 387 # 388 # synced and commiting. 389 # 390 # Revision 1.1 2003/10/23 06:02:39 sjtan 391 # 392 # manual edit areas modelled after r.terry's specs. 393 # 394 # Revision 1.6 2003/05/17 18:18:19 michaelb 395 # added $Log statement 396 # 397 # 30/01/03: inital version 398