-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPopUp.h
43 lines (35 loc) · 1.18 KB
/
PopUp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "AppIncludes.h"
#include <Urho3D/UI/Button.h>
#include <Urho3D/UI/ScrollView.h>
#include <Urho3D/UI/Text.h>
#include <Urho3D/UI/Sprite.h>
#include <Urho3D/UI/BorderImage.h>
#include "ColorDefs.h"
using namespace Urho3D;
class URHO3D_API PopUp : public Button
{
URHO3D_OBJECT(PopUp, Button)
public:
PopUp(Context* context);
~PopUp() {};
virtual void CreateUI();
IntVector2 contentSize = IntVector2(150, 250);
IntVector2 handleSize = IntVector2(16, 16);
UIElement* trackedElement = NULL;
void UpdateOrientation();
void AddItem(UIElement* item);
UIElement* AddItemAuto(String name);
void RemoveItem(UIElement* item);
void SetContentSize(int x, int y);
void SetTrackedElement(UIElement* element);
IntVector2 GetContetSize() { IntVector2 size; (contentRegion) ? (size = contentRegion->GetSize()) : (size = IntVector2(0, 0)); return size; }
void UpdateLayout();
Button* contentRegion;
Button* handle;
Button* canvas;
ScrollView* canvasScroll;
void HandleItemDelete(StringHash eventType, VariantMap& eventData);
void HandleTrackedElementMove(StringHash eventType, VariantMap& eventData);
void HandleElementRemoved(StringHash eventType, VariantMap& eventData);
};