Console.pkg 1.9 KB

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