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.

32 lines
1020 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SDL_CORE_WIDGET_HEADER__
  2. #define __SDL_CORE_WIDGET_HEADER__
  3. #include "../gui_sdl.h"
  4. #include "coreStyleTemplate.h"
  5. class sdlCoreWidget{
  6. protected:
  7. sdlCoreWidget * m_pParent;
  8. classGUI_SDL * m_pGUI;
  9. SDL_Rect m_sRect;
  10. sdlColorStyle m_sColorStyle;
  11. pWidgetVector m_vWidgets;
  12. SDL_Texture * m_pWidgetTexture;
  13. bool m_bNoDecoration;
  14. bool m_bRedraw;
  15. void requerstUpdate(void);
  16. virtual void draw(SDL_Renderer *pRenderer){};
  17. SDL_Texture * getWidgetTexture(void){ return m_pWidgetTexture; };
  18. public:
  19. explicit sdlCoreWidget(int x, int y, int width, int height, sdlCoreWidget * pParent = NULL);
  20. virtual ~sdlCoreWidget();
  21. void render(SDL_Renderer *pRenderer);
  22. SDL_Rect * getBoundRect(void){ return &m_sRect; };
  23. virtual void dispatch(SDL_Event *pEvt){};
  24. void setColorStyle(sdlColorStyle style);
  25. virtual void hide(){};
  26. void addWidget(sdlCoreWidget *tPtr);
  27. void setDecoraion(bool A){ m_bNoDecoration = !A; };
  28. };
  29. #endif