-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGButton.h
More file actions
39 lines (24 loc) · 703 Bytes
/
GButton.h
File metadata and controls
39 lines (24 loc) · 703 Bytes
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
#pragma once
#ifndef BUTTON_H
#define BUTTON_H
#include "GElement.h"
class GButton: public GElement {
protected:
enum { TEXT_IMAGE };
SDL_Rect text_rect;
std::string text;
virtual void OnMouseDown_left();
virtual void OnMouseUp();
virtual void OnMouseMotion_Hover();
public:
enum { CLICKED_IMAGE = 1, IDLE_IMAGE, HIGHLIGHT_IMAGE };
GButton(std::string ID, SDL_Renderer* renderer, SDL_Rect rect);
virtual bool InitializeTextures_from_stylesheet();
void SetText(std::string text);
std::string GetText();
virtual bool OnFocusLostMotion();
virtual void operator()();
virtual bool CheckEvent(SDL_Event e);
void PrepareTexture();
};
#endif