-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgroup.cxx
51 lines (44 loc) · 1.1 KB
/
group.cxx
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
#include "group.h"
#include <FL/Fl_Group.H>
#include "event_handler.h"
class GGroup : public EventHandler<Fl_Group> {
public:
GGroup(int x, int y, int w, int h, const char *label)
: EventHandler<Fl_Group>(x, y, w, h, label) {}
void draw_children() {
Fl_Group::draw_children();
}
};
GGroup *go_fltk_new_Group(int x, int y, int w, int h, const char *label) {
return new GGroup(x, y, w, h, label);
}
void go_fltk_Group_begin(Fl_Group *g) {
g->begin();
}
void go_fltk_Group_end(Fl_Group *g) {
g->end();
}
void go_fltk_Group_add(Fl_Group *g, Fl_Widget *w) {
g->add(w);
}
void go_fltk_Group_remove(Fl_Group *g, Fl_Widget *w) {
g->remove(w);
}
void go_fltk_Group_resizable(Fl_Group *g, Fl_Widget *w) {
g->resizable(w);
}
void go_fltk_Group_draw_children(Fl_Group *g) {
GGroup *const gg = dynamic_cast<GGroup *>(g);
if (gg != nullptr) {
gg->draw_children();
}
}
Fl_Widget* go_fltk_Group_child(Fl_Group *g, int index) {
if (index < 0 || index >= g->children()) {
return nullptr;
}
return g->child(index);
}
int go_fltk_Group_child_count(Fl_Group *g) {
return g->children();
}