__init__.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """
  2. Command line layout definitions
  3. -------------------------------
  4. The layout of a command line interface is defined by a Container instance.
  5. There are two main groups of classes here. Containers and controls:
  6. - A container can contain other containers or controls, it can have multiple
  7. children and it decides about the dimensions.
  8. - A control is responsible for rendering the actual content to a screen.
  9. A control can propose some dimensions, but it's the container who decides
  10. about the dimensions -- or when the control consumes more space -- which part
  11. of the control will be visible.
  12. Container classes::
  13. - Container (Abstract base class)
  14. |- HSplit (Horizontal split)
  15. |- VSplit (Vertical split)
  16. |- FloatContainer (Container which can also contain menus and other floats)
  17. `- Window (Container which contains one actual control
  18. Control classes::
  19. - UIControl (Abstract base class)
  20. |- TokenListControl (Renders a simple list of tokens)
  21. |- FillControl (Fills control with one token/character.)
  22. `- BufferControl (Renders an input buffer.)
  23. Usually, you end up wrapping every control inside a `Window` object, because
  24. that's the only way to render it in a layout.
  25. There are some prepared toolbars which are ready to use::
  26. - SystemToolbar (Shows the 'system' input buffer, for entering system commands.)
  27. - ArgToolbar (Shows the input 'arg', for repetition of input commands.)
  28. - SearchToolbar (Shows the 'search' input buffer, for incremental search.)
  29. - CompletionsToolbar (Shows the completions of the current buffer.)
  30. - ValidationToolbar (Shows validation errors of the current buffer.)
  31. And one prepared menu:
  32. - CompletionsMenu
  33. """
  34. from __future__ import unicode_literals
  35. from .containers import Float, FloatContainer, HSplit, VSplit, Window, ConditionalContainer
  36. from .controls import TokenListControl, FillControl, BufferControl