help.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """!
  2. @package help.py
  3. @brief Help window
  4. @todo Needs improvements...
  5. Classes:
  6. - HelpWindow
  7. (C) 2008-2009 by the GRASS Development Team
  8. This program is free software under the GNU General Public
  9. License (>=v2). Read the file COPYING that comes with GRASS
  10. for details.
  11. @author Martin Landa <landa.martin gmail.com>
  12. """
  13. import wx
  14. class HelpWindow(wx.Frame):
  15. """!GRASS Quickstart help window"""
  16. def __init__(self, parent, id, title, size, file):
  17. wx.Frame.__init__(self, parent=parent, id=id, title=title, size=size)
  18. sizer = wx.BoxSizer(wx.VERTICAL)
  19. # text
  20. helpFrame = wx.html.HtmlWindow(parent=self, id=wx.ID_ANY)
  21. helpFrame.SetStandardFonts (size = 10)
  22. helpFrame.SetBorders(10)
  23. wx.InitAllImageHandlers()
  24. helpFrame.LoadFile(file)
  25. self.Ok = True
  26. sizer.Add(item=helpFrame, proportion=1, flag=wx.EXPAND)
  27. self.SetAutoLayout(True)
  28. self.SetSizer(sizer)
  29. # sizer.Fit(self)
  30. # sizer.SetSizeHints(self)
  31. self.Layout()