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

Source Code for Module Gnumed.wxpython.gmAbout

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