You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
785 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SDL_LOG_WIDGET_HEADER__
  2. #define __SDL_LOG_WIDGET_HEADER__
  3. #include "../core/coreWidget.h"
  4. #include "../core/coreLabel.h"
  5. #include "../../components/base/basicMutex.h"
  6. #include "../../components/base/basicLoggingService.h"
  7. #define SDL_DEFAULT_LOG_FONT_SIZE 10
  8. #define SDL_DEFAULT_LOG_ROW_SIZE 12
  9. class sdlLog :public basicLoggingService, public sdlCoreWidget {
  10. private:
  11. sdlLabel ** m_ppLines;
  12. int m_nLines;
  13. int m_nCurrentLine;
  14. basicMutex m_mProtector;
  15. protected:
  16. virtual void draw(SDL_Renderer *pRenderer);
  17. public:
  18. explicit sdlLog(int x, int y, int width, int height, sdlCoreWidget * pWnd = NULL);
  19. virtual ~sdlLog();
  20. virtual void logMessage(CSTR Msg);
  21. virtual void logMessage(const char *Msg);
  22. };
  23. #endif