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  ID_MENU = wx.NewId() 
 15  #==================================================================== 
16 -class ScrollTxtWin (wx.Window):
17 """ 18 Scrolling Text! 19 """ 20 # control parameters 21 __scroll_speed=.3 # pixels/milliseconds (?) 22 __delay=500 # milliseconds 23 name_list = [ 24 'Dr Horst Herb', 25 'Karsten Hilbert', 26 'Dr Gerardo Arnaez', 27 'Dr Hilmar Berger', 28 'Michael Bonert', 29 'Dr Elizabeth Dodd', 30 'Dr David Guest', 31 'Ian Haywood', 32 'Dr Tony Lembke', 33 'Dr Richard Terry', 34 'Syan J Tan', 35 'Andreas Tille', 36 'Dr Carlos Moro', 37 'Dr James Busser', 38 'Dr Rogerio Luz', 39 'Dr Sebastian Hilbert', 40 'Dr John Jaarsveld', 41 'Uwe Koch Kronberg', 42 'Dr Jerzy Luszawski', 43 'et alii' 44 ] 45 46 # initializations 47 __scroll_ctr = +230 48 __name_ctr = 1 49 __delay_ctr = 1 50
51 - def __init__ (self, parent):
52 wx.Window.__init__(self, parent, -1, size=(230,20), style=wx.SUNKEN_BORDER) 53 self.SetBackgroundColour(wx.Colour(255, 255, 255)) 54 self.__delay_ctr_reset=self.__delay*self.__scroll_speed 55 56 self.moving_txt=wx.StaticText(self, -1, "", size=(230,20), style=wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE) 57 self.moving_txt.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) 58 self.moving_txt.SetLabel(self.name_list[0]) 59 60 #wx.EVT_TIMER(self, -1, self.OnTimer) 61 self.Bind(wx.EVT_TIMER, self.OnTimer) 62 self.timer = wx.Timer(self, -1) 63 #self.timer.Start(self.__scroll_speed) 64 self.timer.Start(milliseconds = 1./self.__scroll_speed)
65
66 - def OnTimer(self, evt):
67 if(self.__scroll_ctr<-2 and self.__delay_ctr<self.__delay_ctr_reset): 68 # pause at centre 69 self.__delay_ctr=self.__delay_ctr+1 70 else: 71 self.__scroll_ctr=self.__scroll_ctr-1 72 self.moving_txt.Move(self.__scroll_ctr, 0) 73 if(self.__scroll_ctr<-230): 74 # reset counters 75 self.__scroll_ctr=+230 76 self.__delay_ctr=1 77 78 # get next name in dict. 79 self.moving_txt.SetLabel(self.name_list[self.__name_ctr]) 80 self.__name_ctr=self.__name_ctr+1 81 if(self.__name_ctr>len(self.name_list)-1): 82 self.__name_ctr=0
83
84 -class AboutFrame (wx.Frame):
85 """ 86 About GNUmed 87 """
88 - def __init__(self, parent, ID, title, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, version='???', debug=False):
89 wx.Frame.__init__(self, parent, ID, title, pos, size, style) 90 91 self.SetIcon(gmTools.get_icon(wx = wx)) 92 93 box = wx.BoxSizer(wx.VERTICAL) 94 if wx.Platform == '__WXMAC__': 95 box.Add((0,0), 2) 96 else: 97 box.Add((0,0), 2) 98 intro_txt=wx.StaticText(self, -1, _("Monty the Serpent && the FSF Present")) 99 intro_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,'')) 100 box.Add(intro_txt, 0, wx.ALIGN_CENTRE) 101 if wx.Platform == '__WXMAC__': 102 box.Add((0,0), 3) 103 else: 104 box.Add((0,0), 3) 105 gm_txt=wx.StaticText(self, -1, "GNUmed") 106 gm_txt.SetFont(wx.Font(30, wx.SWISS, wx.NORMAL, wx.NORMAL)) 107 box.Add(gm_txt, 0, wx.ALIGN_CENTRE) 108 109 motto_txt=wx.StaticText(self, -1, _("Free eMedicine")) 110 motto_txt.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL,False,'')) 111 box.Add(motto_txt, 0, wx.ALIGN_CENTRE) 112 if wx.Platform == '__WXMAC__': 113 box.Add((0,0), 4) 114 else: 115 box.Add((0,0), 4) 116 ver_txt=wx.StaticText ( 117 self, 118 -1, 119 _('Version %s%s brought to you by') % ( 120 version, 121 gmTools.bool2subst(debug, ' (%s)' % _('debug'), '') 122 ) 123 ) 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 ) % """ 174 == A =========================================== 175 176 Marc ANGERMANN, MD 177 Germany 178 179 - Rechnungsvorlage 180 - bug reports 181 182 == B =========================================== 183 184 James BUSSER, MD 185 British Columbia 186 187 - test results handling 188 - documentation would be nothing without him 189 - encouragement, testing, bug reporting 190 - testing on MacOSX 191 192 Vaibhav BANAIT, MD, DNB, DM 193 India 194 195 - bug reports 196 - feature suggestions 197 - testing 198 199 == F =========================================== 200 201 Joachim FISCHER 202 GP Fischer + Lintz 203 Fachärzte Allgemeinmedizin 204 Wolfschlugen 205 206 - Karteieintragsarten passend für Deutschland 207 208 == H =========================================== 209 210 Sebastian HILBERT, MD 211 Germany 212 213 - packaging, PR 214 215 Anne te HARVIK 216 Netherlands 217 218 - Dutch translation 219 220 == J =========================================== 221 222 John JAARSVELD, MD 223 Netherlands 224 225 - lots of help with the visual progress notes 226 - Dutch l10n 227 228 == K =========================================== 229 230 Uwe Koch KRONBERG 231 Chile 232 233 - Spanish 234 - Chilean demographics 235 236 == L =========================================== 237 238 Nico LATZER 239 Germany 240 241 - invoice handling code 242 243 Steffi LEIBNER, Leipzig 244 Germany 245 246 - Testen, Fehlerberichte 247 - Dokumentenvorlage 248 249 Jerzy LUSZAWSKI 250 Poland 251 252 - list sorting 253 - plugins 254 - printing 255 256 Rogerio LUZ, Brasil 257 258 - testing, bug reporting 259 - SOAP handling discussion 260 - providing LaTeX form templates 261 262 == N =========================================== 263 264 Clemens NIETFELD, Oldenburg 265 266 - Information zur Anbindung von DocConcept 267 268 == P =========================================== 269 270 Martin PREUSS, Hamburg 271 272 - Chipkartenansteuerung 273 274 == R =========================================== 275 276 Thomas REUS, Düsseldorf 277 278 - Testen, Fehlerberichte 279 - Dokumentenvorlage 280 281 == T =========================================== 282 283 Andreas TILLE, Wernigerode 284 285 - Debian packages 286 - encouragement, wisdom 287 288 """ 289 #----------------------------------------------
290 - def __init__(self, *args, **kwargs):
291 wx.Dialog.__init__(self, *args, **kwargs) 292 contributor_listing = wx.TextCtrl ( 293 self, 294 -1, 295 cContributorsDlg.contributors, 296 style = wx.TE_MULTILINE | wx.TE_READONLY, 297 size = wx.Size(500, 300) 298 ) 299 # contributor_listing.SetFont(wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL)) 300 # arrange widgets 301 szr_outer = wx.BoxSizer(wx.VERTICAL) 302 szr_outer.Add(contributor_listing, 1, wx.EXPAND, 0) 303 # and do layout 304 self.SetAutoLayout(1) 305 self.SetSizerAndFit(szr_outer) 306 szr_outer.SetSizeHints(self) 307 self.Layout()
308 #==================================================================== 309 # Main 310 #==================================================================== 311 if __name__ == '__main__': 312 # set up dummy app
313 - class TestApp (wx.App):
314 - def OnInit (self):
315 frame = AboutFrame(None, -1, "About GNUmed", size=wx.Size(300, 250)) 316 frame.Show(1) 317 return 1
318 #--------------------- 319 if len(sys.argv) > 1 and sys.argv[1] == 'test': 320 app = TestApp() 321 app.MainLoop() 322 323 #------------------------------------------------------------ 324