home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pytho152.zip / emx / lib / python1.5 / lib-stdwin / Abstract.py next >
Text File  |  2000-08-10  |  2KB  |  64 lines

  1. # Abstract classes for parents and children.
  2. #
  3. # Do not use as base class -- this is for documentation only.
  4. #
  5. # Note that the tree must be built top down (create the parent,
  6. # then add the children).
  7. #
  8. # Also note that the creation methods are not standardized --
  9. # these have extra parameters dependent on the widget type.
  10. # For historical reasons, button creation methods are called
  11. # define() while split creation methods are called create().
  12.  
  13. class AbstractParent:
  14.     #
  15.     # Upcalls from child to parent
  16.     #
  17.     def addchild(self, child): unimpl()
  18.     def delchild(self, child): unimpl()
  19.     #
  20.     def need_mouse(self, child): unimpl()
  21.     def no_mouse(self, child): unimpl()
  22.     #
  23.     def need_timer(self, child): unimpl()
  24.     def no_timer(self, child): unimpl()
  25.     #
  26.     # XXX need_kbd, no_kbd; focus???
  27.     #
  28.     def begindrawing(self): return unimpl()
  29.     def beginmeasuring(self): return unimpl()
  30.     def getwindow(self): return unimpl() # Only for very special cases
  31.     #
  32.     def change(self, area): unimpl()
  33.     def scroll(self, area, (dh, dv)): unimpl()
  34.     def settimer(self, itimer): unimpl()
  35.  
  36. class AbstractChild:
  37.     #
  38.     # Downcalls from parent to child
  39.     #
  40.     def destroy(self): unimpl()
  41.     #
  42.     def realize(self): return unimpl()
  43.     def getminsize(self, m, (width, height)): return unimpl()
  44.     def getbounds(self): return unimpl()
  45.     def setbounds(self, bounds): unimpl()
  46.     def draw(self, d, area): unimpl()
  47.     #
  48.     # Downcalls only made after certain upcalls
  49.     #
  50.     def mouse_down(self, detail): unimpl()
  51.     def mouse_move(self, detail): unimpl()
  52.     def mouse_up(self, detail): unimpl()
  53.     #
  54.     def timer(self): unimpl()
  55.  
  56. # A "Split" is a child that manages one or more children.
  57. # (This terminology is due to DEC SRC, except for CSplits.)
  58. # A child of a split may be another split, a button, a slider, etc.
  59. # Certain upcalls and downcalls can be handled transparently, but
  60. # for others (e.g., all geometry related calls) this is not possible.
  61.  
  62. class AbstractSplit(AbstractChild, AbstractParent):
  63.     pass
  64.