base.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """!
  2. @package location_wizard.base
  3. @brief Location wizard - base classes
  4. Classes:
  5. - base::BaseClass
  6. (C) 2007-2011 by the GRASS Development Team
  7. This program is free software under the GNU General Public License
  8. (>=v2). Read the file COPYING that comes with GRASS for details.
  9. @author Michael Barton
  10. @author Jachym Cepicky
  11. @author Martin Landa <landa.martin gmail.com>
  12. """
  13. import wx
  14. class BaseClass(wx.Object):
  15. """!Base class providing basic methods"""
  16. def __init__(self):
  17. pass
  18. def MakeLabel(self, text = "", style = wx.ALIGN_LEFT, parent = None):
  19. """!Make aligned label"""
  20. if not parent:
  21. parent = self
  22. return wx.StaticText(parent = parent, id = wx.ID_ANY, label = text,
  23. style = style)
  24. def MakeTextCtrl(self, text = '', size = (100,-1), style = 0, parent = None):
  25. """!Generic text control"""
  26. if not parent:
  27. parent = self
  28. return wx.TextCtrl(parent = parent, id = wx.ID_ANY, value = text,
  29. size = size, style = style)
  30. def MakeButton(self, text, id = wx.ID_ANY, size = (-1,-1), parent = None):
  31. """!Generic button"""
  32. if not parent:
  33. parent = self
  34. return wx.Button(parent = parent, id = id, label = text,
  35. size = size)