-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheckbox.h
More file actions
33 lines (24 loc) · 720 Bytes
/
Copy pathcheckbox.h
File metadata and controls
33 lines (24 loc) · 720 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
#pragma once
#include <GLFW/glfw3.h>
#include <functional>
#include "helper_types.h"
#include "widget.h"
class CheckBox : public Widget {
public:
using CheckPositioner = std::function<void(CheckBox*,int,int,int,int)>;
using CheckOnClick = std::function<void(CheckBox*)>;
CheckBox(Widget* parent, CheckPositioner positioner, CheckOnClick onclick);
bool rounded = false;
Color* bgcolor;
void render();
void position(int x, int y, int width, int height);
bool on_mouse_button_event(int button, int action, int mods);
bool on_mouse_move_event();
bool is_checked = false;
Color* border_color;
Color* border_color_hover;
private:
CheckPositioner POSITIONER;
CheckOnClick ONCLICK;
bool hovered;
};