Console.pkg 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $#include "Console.h"
  2. /// %Console window with log history and AngelScript prompt.
  3. class Console : public Object
  4. {
  5. public:
  6. /// Set UI elements' style from an XML file.
  7. void SetDefaultStyle(XMLFile* style);
  8. /// Show or hide. Showing automatically focuses the line edit.
  9. void SetVisible(bool enable);
  10. /// Toggle visibility.
  11. void Toggle();
  12. /// Set number of displayed rows.
  13. void SetNumRows(unsigned rows);
  14. /// Set command history maximum size, 0 disables history.
  15. void SetNumHistoryRows(unsigned rows);
  16. /// Update elements to layout properly. Call this after manually adjusting the sub-elements.
  17. void UpdateElements();
  18. /// Return the UI style file.
  19. XMLFile* GetDefaultStyle() const;
  20. /// Return the background element.
  21. BorderImage* GetBackground() const { return background_; }
  22. /// Return the line edit element.
  23. LineEdit* GetLineEdit() const { return lineEdit_; }
  24. /// Return whether is visible.
  25. bool IsVisible() const;
  26. /// Return number of displayed rows.
  27. unsigned GetNumRows() const { return rows_.Size(); }
  28. /// Return history maximum size.
  29. unsigned GetNumHistoryRows() const { return historyRows_; }
  30. /// Return current history position.
  31. unsigned GetHistoryPosition() const { return historyPosition_; }
  32. /// Return history row at index.
  33. const String& GetHistoryRow(unsigned index) const;
  34. };
  35. Console* GetConsole();