928c2707a965ca981c9b7d0d4a3068115c0499db
[bertos.git] / dt / editint.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
5  * -->
6  *
7  * \version $Id$
8  *
9  * \brief Integer edit (interface).
10  *
11  * \version $Id$
12  * \author Bernardo Innocenti <bernie@develer.com>
13  * \author Francesco Sacchi <batt@develer.com>
14  */
15
16 /*#*
17  *#* $Log$
18  *#* Revision 1.2  2006/07/19 12:56:26  bernie
19  *#* Convert to new Doxygen style.
20  *#*
21  *#* Revision 1.1  2005/11/04 18:26:38  bernie
22  *#* Import into DevLib.
23  *#*
24  *#* Revision 1.3  2005/06/10 15:46:09  batt
25  *#* Add EDIS_WRAP style that wrap around min and max.
26  *#*
27  *#* Revision 1.2  2005/05/26 14:44:10  batt
28  *#* Abstract widget from layer: use context.
29  *#*
30  *#* Revision 1.1  2005/05/26 08:32:53  batt
31  *#* Add new Develer widget system :)
32  *#*
33  *#*/
34
35 #ifndef DT_EDITINT_H
36 #define DT_EDITINT_H
37
38 #include <dt/dwidget.h>
39 #include <dt/dtag.h>
40 #include <drv/lcd_text.h>
41
42 #include <cfg/compiler.h>
43 #include <cfg/macros.h>
44
45
46 #define EDIS_DEFAULT        0
47 #define EDIS_CURSORLEFT     BV(0)
48 #define EDIS_WRAP           BV(1)
49
50 /** Type for edit style */
51 typedef uint16_t dstyle_t;
52
53 typedef struct DEditInt
54 {
55         DWidget widget;
56
57         int *value;
58         int min;
59         int max;
60         dstyle_t style;
61         void (*draw)(struct DEditInt *);
62
63 } DEditInt;
64
65 void editint_init(DEditInt *e, dpos_t pos, dpos_t size, dcontext_t *context, int *value, int min, int max);
66 void editint_update(DEditInt *e, dtag_t tag, dval_t val);
67 void editint_draw(DEditInt *e);
68
69 #endif