| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #include "BsGUIWindowFrame.h"
- #include "BsImageSprite.h"
- #include "BsGUIWidget.h"
- #include "BsGUISkin.h"
- #include "BsSpriteTexture.h"
- #include "BsGUILayoutOptions.h"
- #include "BsGUIMouseEvent.h"
- #include "CmApplication.h"
- #include "CmPlatform.h"
- #include "CmTexture.h"
- #include "CmRenderWindow.h"
- using namespace CamelotFramework;
- using namespace BansheeEngine;
- namespace BansheeEditor
- {
- const String& GUIWindowFrame::getGUITypeName()
- {
- static String name = "WindowFrame";
- return name;
- }
- GUIWindowFrame::GUIWindowFrame(GUIWidget& parent, const GUIElementStyle* style, const GUILayoutOptions& layoutOptions)
- :GUITexture(parent, style, HSpriteTexture(), GUIImageScaleMode::StretchToFit, layoutOptions)
- {
- }
- GUIWindowFrame::~GUIWindowFrame()
- { }
- GUIWindowFrame* GUIWindowFrame::create(GUIWidget& parent, const GUIElementStyle* style)
- {
- if(style == nullptr)
- {
- const GUISkin& skin = parent.getSkin();
- style = skin.getStyle(getGUITypeName());
- }
- return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, GUILayoutOptions::create(style));
- }
- GUIWindowFrame* GUIWindowFrame::create(GUIWidget& parent, const GUIOptions& layoutOptions, const GUIElementStyle* style)
- {
- if(style == nullptr)
- {
- const GUISkin& skin = parent.getSkin();
- style = skin.getStyle(getGUITypeName());
- }
- return new (cm_alloc<GUIWindowFrame, PoolAlloc>()) GUIWindowFrame(parent, style, GUILayoutOptions::create(layoutOptions, style));
- }
- void GUIWindowFrame::setFocused(bool focused)
- {
- if(focused)
- mActiveTexture = mStyle->focused.texture;
- else
- mActiveTexture = mStyle->normal.texture;
- markContentAsDirty();
- }
- }
|