WidgetImage.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright © 2011-2020 Frictional Games
  3. *
  4. * This file is part of Amnesia: A Machine For Pigs.
  5. *
  6. * Amnesia: A Machine For Pigs is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. * Amnesia: A Machine For Pigs is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Amnesia: A Machine For Pigs. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef HPL_WIDGET_IMAGE_H
  19. #define HPL_WIDGET_IMAGE_H
  20. #include "gui/Widget.h"
  21. namespace hpl {
  22. class cGuiSkinFont;
  23. class cWidgetImage : public iWidget
  24. {
  25. public:
  26. cWidgetImage(cGuiSet *apSet, cGuiSkin *apSkin);
  27. virtual ~cWidgetImage();
  28. void SetImage(cGuiGfxElement *apGfx);
  29. cGuiGfxElement* GetImage(){ return mpGfxImage;}
  30. protected:
  31. /////////////////////////
  32. // Implemented functions
  33. void OnLoadGraphics();
  34. void OnChangeSize();
  35. void OnDraw(float afTimeStep, cGuiClipRegion *apClipRegion);
  36. bool OnMouseMove(const cGuiMessageData& aData);
  37. bool OnMouseDown(const cGuiMessageData& aData);
  38. bool OnMouseUp(const cGuiMessageData& aData);
  39. bool OnMouseEnter(const cGuiMessageData& aData);
  40. bool OnMouseLeave(const cGuiMessageData& aData);
  41. /////////////////////////
  42. // Data
  43. cGuiGfxElement *mpGfxImage;
  44. };
  45. };
  46. #endif // HPL_WIDGET_IMAGE_H