BsGUIWindowFrame.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "BsGUIWindowFrame.h"
  2. #include "BsImageSprite.h"
  3. #include "BsGUIWidget.h"
  4. #include "BsGUISkin.h"
  5. #include "BsSpriteTexture.h"
  6. #include "BsGUILayoutOptions.h"
  7. #include "BsGUIMouseEvent.h"
  8. #include "CmApplication.h"
  9. #include "CmPlatform.h"
  10. #include "CmTexture.h"
  11. #include "CmRenderWindow.h"
  12. using namespace CamelotFramework;
  13. using namespace BansheeEngine;
  14. namespace BansheeEditor
  15. {
  16. const String& GUIWindowFrame::getGUITypeName()
  17. {
  18. static String name = "WindowFrame";
  19. return name;
  20. }
  21. GUIWindowFrame::GUIWindowFrame(const GUIElementStyle* style, const GUILayoutOptions& layoutOptions)
  22. :GUITexture(style, HSpriteTexture(), GUIImageScaleMode::StretchToFit, layoutOptions)
  23. {
  24. }
  25. GUIWindowFrame::~GUIWindowFrame()
  26. { }
  27. GUIWindowFrame* GUIWindowFrame::create(const GUIElementStyle* style)
  28. {
  29. return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(style, GUILayoutOptions::create(style));
  30. }
  31. GUIWindowFrame* GUIWindowFrame::create(const GUIOptions& layoutOptions, const GUIElementStyle* style)
  32. {
  33. return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(style, GUILayoutOptions::create(layoutOptions, style));
  34. }
  35. void GUIWindowFrame::setFocused(bool focused)
  36. {
  37. if(focused)
  38. mActiveTexture = _getStyle()->focused.texture;
  39. else
  40. mActiveTexture = _getStyle()->normal.texture;
  41. markContentAsDirty();
  42. }
  43. }