-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.h
50 lines (41 loc) · 1.54 KB
/
widget.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
#ifndef _WIDGET_H
#define _WIDGET_H
#include "common.h"
#include "sheet.h"
#include "utils.h"
#include "action.h"
#include "graphic.h"
#define BUTTON 1
#define TEXTFIELD 2
#define LONGTEXTFIELD 3
struct Button
{
struct Sheet *titleSheet;
struct ActionManager *userActionManager;
char *title;
struct Sheet *backgroundSheet;
struct Sheet *sheet;
};
struct TextField
{
struct Sheet *displaySheet;
char *content;
char *displayContent;
unsigned int maxChar;
unsigned int currentSize;
struct Sheet *backgroundSheet;
struct Sheet *sheet;
unsigned int disabled;
};
struct Sheet *createLabel(struct Sheet *sheet, short x, short y, short width, short height, char *c, char color);
void setLabelText(struct Sheet *sheet, char *c, char color);
struct Sheet *createLabelWithBackground(struct Sheet *sheet, short x, short y, short width, short height, char *c, char color, char background);
struct Button *createButton(struct Sheet *sheet, short x, short y, short width, short height, char *title);
void onButtonSystemMouseLeftDown(struct Sheet *this, unsigned int x, unsigned int y);
void onButtonSystemMouseLeftUp(struct Sheet *this, unsigned int x, unsigned int y);
struct TextField *createTextField(struct Sheet *sheet, short x, short y, short width, short height, char *content);
void setTextFieldText(struct TextField *this, char *c);
void onSystemTextfieldClick();
void onSystemTextfieldKeyPress(struct Sheet *this, char c, unsigned int raw);
void onSystemTextfieldKeyUp(struct Sheet *this, char c, unsigned int raw);
#endif