Subversion Repositories Kolibri OS

Rev

Rev 2039 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2039 Rev 8473
Line 1... Line 1...
1
#include "tp.h"
1
#include "tp.h"
2
#include 
2
#include 
Line 3... Line 3...
3
 
3
 
4
typedef unsigned short int uint16_t;
4
typedef unsigned short int uint16_t;
Line 5... Line 5...
5
typedef unsigned int uint32_t;
5
typedef unsigned int uint32_t;
Line 93... Line 93...
93
            case 2:
93
            case 2:
94
                if (key_handler.type == TP_FNC)
94
                if (key_handler.type == TP_FNC)
95
                {
95
                {
96
                    param_list = tp_list(tp); /* Prepare parameters. */
96
                    param_list = tp_list(tp); /* Prepare parameters. */
97
                    _tp_list_append(tp, param_list.list.val, self);
97
                    _tp_list_append(tp, param_list.list.val, self);
-
 
98
                    
-
 
99
                    oskey_t key;
-
 
100
                    key = get_key();
98
                    _tp_list_append(tp, param_list.list.val, tp_number(__menuet__getkey()));
101
                    _tp_list_append(tp, param_list.list.val, tp_number(key.code));
99
                    _tp_call(tp, &result, key_handler, param_list);
102
                    _tp_call(tp, &result, key_handler, param_list);
100
                }
103
                }
101
                break;
104
                break;
102
            case 3:
105
            case 3:
103
                button_id = __menuet__get_button_id();
106
                button_id = get_os_button();
104
                if (button_id == 1)
107
                if (button_id == 1)
105
                    leave = 1;
108
                    leave = 1;
106
                else if (button_handler.type == TP_FNC)
109
                else if (button_handler.type == TP_FNC)
107
                {
110
                {
108
                    param_list = tp_list(tp); /* Prepare parameters. */
111
                    param_list = tp_list(tp); /* Prepare parameters. */
Line 127... Line 130...
127
    uint16_t y = (uint16_t)tp_get(tp, self, tp_string("cury")).number.val;
130
    uint16_t y = (uint16_t)tp_get(tp, self, tp_string("cury")).number.val;
128
    uint32_t ofs;
131
    uint32_t ofs;
129
    uint32_t width = (uint32_t)tp_get(tp, self, tp_string("width")).number.val;
132
    uint32_t width = (uint32_t)tp_get(tp, self, tp_string("width")).number.val;
130
    tp_obj text = TP_TYPE(TP_STRING);
133
    tp_obj text = TP_TYPE(TP_STRING);
Line 131... Line 134...
131
 
134
 
132
    __menuet__write_text(x, y, textcolor, (char *)text.string.val, text.string.len);
135
    draw_text_sys((char *)text.string.val, x, y, text.string.len, textcolor);
133
    /* Update cursor position. */
136
    /* Update cursor position. */
134
    ofs = 6 * text.string.len;
137
    ofs = 6 * text.string.len;
135
    tp_set(tp, self, tp_string("cury"), tp_number(y + 9 * ((x + ofs) / width)));
138
    tp_set(tp, self, tp_string("cury"), tp_number(y + 9 * ((x + ofs) / width)));