-
Notifications
You must be signed in to change notification settings - Fork 0
/
GFrame.h
90 lines (58 loc) · 2.05 KB
/
GFrame.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#ifndef FRAME_H
#define FRAME_H
#include "GElement.h"
class GBackgroundImage;
struct ELEMENT_ATTRIBUTES;
class GFrame :public GElement {
protected:
int containing_scrollfactor_x;
int containing_scrollfactor_y;
bool containing_scrollable_x;
bool containing_scrollable_y;
int scrolled_amount_x;
int scrolled_amount_y;
int scroll_limit_x;
int scroll_limit_y;
GBackgroundImage* frame_bg;
std::list<GElement*> frame_elements;
std::vector<GElement*> frame_free_elements;
virtual void OnMouseDown_left();
virtual void OnMouseDown_right();
virtual void OnMouseUp();
virtual void OnMouseMotion_Hover();
virtual void OnMouseMotion_Clicked_left();
virtual void OnKeyPressed();
virtual void OnMouseWheel();
virtual bool CheckCursor();
public:
GFrame(std::string ID, SDL_Renderer* renderer, SDL_Rect rect);
virtual bool InitializeTextures_from_stylesheet();
void NotifyChildDimensionsChanged();
virtual bool CheckUpdated();
void AttachStylesheet(GStylesheet* stylesheet);
virtual void AddElement(GElement* element);
void ActivateElement(GElement* element);
void DeactivateElement(GElement* element);
GElement* GetElementByID(std::string ID);
virtual void AddElement(GElement* element, int index);
void AddBackground(GBackgroundImage* background);
void RemoveElement(GElement* element);
virtual void Scroll_Containing(Direction dirn, int amount);
virtual bool OnFocusLostMotion();
virtual bool OnFocusLostClick();
virtual bool OnFocusGainedMotion();
virtual bool OnFocusGainedClick();
virtual bool isFocussable_click();
GElement* GetFocussedElementMotion();
GElement* GetFocussedElementClick();
void SetFocussedElementClick(GElement* element);
void SetFocussedElementMotion(GElement* element);
virtual void DrawTexture();
virtual void PrepareTexture();
virtual bool CheckEvent(SDL_Event event);
void SetContainingScrollable(bool state_x, bool state_y);
void SetContainingScrollFactors(int factor_x, int factor_y);
~GFrame();
};
#endif