Rev 7254 | Rev 7447 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7254 | Rev 7422 | ||
---|---|---|---|
1 | //BOX_LIB - Asper |
1 | //BOX_LIB - Asper |
2 | #ifndef INCLUDE_BOX_LIB_H |
2 | #ifndef INCLUDE_BOX_LIB_H |
3 | #define INCLUDE_BOX_LIB_H |
3 | #define INCLUDE_BOX_LIB_H |
4 | 4 | ||
5 | #ifndef INCLUDE_KOLIBRI_H |
5 | #ifndef INCLUDE_KOLIBRI_H |
6 | #include "../lib/kolibri.h" |
6 | #include "../lib/kolibri.h" |
7 | #endif |
7 | #endif |
8 | 8 | ||
9 | #ifndef INCLUDE_DLL_H |
9 | #ifndef INCLUDE_DLL_H |
10 | #include "../lib/dll.h" |
10 | #include "../lib/dll.h" |
11 | #endif |
11 | #endif |
12 | 12 | ||
13 | dword boxlib = #aEdit_box_lib; |
13 | dword boxlib = #aEdit_box_lib; |
14 | char aEdit_box_lib[]="/sys/lib/box_lib.obj"; |
14 | char aEdit_box_lib[]="/sys/lib/box_lib.obj"; |
15 | 15 | ||
16 | dword box_lib_init = #aboxlib_init; |
16 | dword box_lib_init = #aboxlib_init; |
17 | 17 | ||
18 | dword edit_box_draw = #aEdit_box_draw; |
18 | dword edit_box_draw = #aEdit_box_draw; |
19 | dword edit_box_key = #aEdit_box_key; |
19 | dword edit_box_key = #aEdit_box_key; |
20 | dword edit_box_mouse = #aEdit_box_mouse; |
20 | dword edit_box_mouse = #aEdit_box_mouse; |
21 | dword edit_box_set_text = #aEdit_box_set_text; |
21 | dword edit_box_set_text = #aEdit_box_set_text; |
22 | dword version_ed = #aVersion_ed; |
22 | dword version_ed = #aVersion_ed; |
23 | 23 | ||
24 | dword scrollbar_v_draw = #aScrollbar_v_draw; |
24 | dword scrollbar_v_draw = #aScrollbar_v_draw; |
25 | dword scrollbar_v_mouse = #aScrollbar_v_mouse; |
25 | dword scrollbar_v_mouse = #aScrollbar_v_mouse; |
26 | dword scrollbar_h_draw = #aScrollbar_h_draw; |
26 | dword scrollbar_h_draw = #aScrollbar_h_draw; |
27 | dword scrollbar_h_mouse = #aScrollbar_h_mouse; |
27 | dword scrollbar_h_mouse = #aScrollbar_h_mouse; |
28 | dword version_scrollbar = #aVersion_scrollbar; |
28 | dword version_scrollbar = #aVersion_scrollbar; |
29 | 29 | ||
30 | dword PathShow_prepare = #aPathShow_prepare; |
30 | dword PathShow_prepare = #aPathShow_prepare; |
31 | dword PathShow_draw = #aPathShow_draw; |
31 | dword PathShow_draw = #aPathShow_draw; |
32 | 32 | ||
33 | dword progressbar_draw = #aProgressbar_draw; |
33 | dword progressbar_draw = #aProgressbar_draw; |
34 | dword progressbar_progress = #aProgressbar_progress; |
34 | dword progressbar_progress = #aProgressbar_progress; |
35 | 35 | ||
36 | dword frame_draw = #aFrame_draw; |
36 | dword frame_draw = #aFrame_draw; |
37 | 37 | ||
38 | $DD 2 dup 0 |
38 | $DD 2 dup 0 |
39 | 39 | ||
40 | char aEdit_box_draw [] = "edit_box"; |
40 | char aEdit_box_draw [] = "edit_box"; |
41 | char aEdit_box_key [] = "edit_box_key"; |
41 | char aEdit_box_key [] = "edit_box_key"; |
42 | char aEdit_box_mouse[] = "edit_box_mouse"; |
42 | char aEdit_box_mouse[] = "edit_box_mouse"; |
43 | char aEdit_box_set_text[] = "edit_box_set_text"; |
43 | char aEdit_box_set_text[] = "edit_box_set_text"; |
44 | char aVersion_ed [] = "version_ed"; |
44 | char aVersion_ed [] = "version_ed"; |
45 | 45 | ||
46 | char aboxlib_init[] = "lib_init"; |
46 | char aboxlib_init[] = "lib_init"; |
47 | char aScrollbar_v_draw [] = "scrollbar_v_draw"; |
47 | char aScrollbar_v_draw [] = "scrollbar_v_draw"; |
48 | char aScrollbar_v_mouse[] = "scrollbar_v_mouse"; |
48 | char aScrollbar_v_mouse[] = "scrollbar_v_mouse"; |
49 | char aScrollbar_h_draw [] = "scrollbar_h_draw"; |
49 | char aScrollbar_h_draw [] = "scrollbar_h_draw"; |
50 | char aScrollbar_h_mouse[] = "scrollbar_h_mouse"; |
50 | char aScrollbar_h_mouse[] = "scrollbar_h_mouse"; |
51 | char aVersion_scrollbar[] = "version_scrollbar"; |
51 | char aVersion_scrollbar[] = "version_scrollbar"; |
52 | 52 | ||
53 | char aPathShow_prepare [] = "PathShow_prepare"; |
53 | char aPathShow_prepare [] = "PathShow_prepare"; |
54 | char aPathShow_draw [] = "PathShow_draw"; |
54 | char aPathShow_draw [] = "PathShow_draw"; |
55 | 55 | ||
56 | char aProgressbar_draw [] = "progressbar_draw"; |
56 | char aProgressbar_draw [] = "progressbar_draw"; |
57 | char aProgressbar_progress[] = "progressbar_progress"; |
57 | char aProgressbar_progress[] = "progressbar_progress"; |
58 | 58 | ||
59 | char aFrame_draw[] = "frame_draw"; |
59 | char aFrame_draw[] = "frame_draw"; |
60 | 60 | ||
61 | 61 | ||
62 | struct PathShow_data |
62 | struct PathShow_data |
63 | { |
63 | { |
64 | dword type; |
64 | dword type; |
65 | word start_y, |
65 | word start_y, |
66 | start_x, |
66 | start_x, |
67 | font_size_x, // 6 - for font 0, 8 - for font 1 |
67 | font_size_x, // 6 - for font 0, 8 - for font 1 |
68 | area_size_x; |
68 | area_size_x; |
69 | dword font_number, // 0 - monospace, 1 - variable |
69 | dword font_number, // 0 - monospace, 1 - variable |
70 | background_flag, |
70 | background_flag, |
71 | font_color, |
71 | font_color, |
72 | background_color, |
72 | background_color, |
73 | text_pointer, |
73 | text_pointer, |
74 | work_area_pointer, |
74 | work_area_pointer, |
75 | temp_text_length; |
75 | temp_text_length; |
76 | }; |
76 | }; |
77 | /* |
77 | /* |
78 | char temp[128]; |
78 | char temp[128]; |
79 | PathShow_data PathShow = {0, 100,20, 6, 200, 0, 1, 0x0, 0xFFFfff, #email_text, #temp, 0}; |
79 | PathShow_data PathShow = {0, 100,20, 6, 200, 0, 1, 0x0, 0xFFFfff, #email_text, #temp, 0}; |
80 | PathShow_prepare stdcall(#PathShow); |
80 | PathShow_prepare stdcall(#PathShow); |
81 | PathShow_draw stdcall(#PathShow); |
81 | PathShow_draw stdcall(#PathShow); |
82 | */ |
82 | */ |
- | 83 | ||
- | 84 | //editbox flags |
|
- | 85 | #define ed_pass 1b |
|
- | 86 | #define ed_focus 10b //focused |
|
- | 87 | #define ed_shift 100b //flag is set when Shift is pressed |
|
- | 88 | #define ed_shift_on 1000b |
|
- | 89 | #define ed_shift_bac 10000b //bif for Shift reset, if set the smth is selected |
|
- | 90 | #define ed_left_fl 100000b |
|
- | 91 | #define ed_offset_fl 1000000b |
|
- | 92 | #define ed_insert 10000000b |
|
- | 93 | #define ed_mouse_on 100000000b |
|
- | 94 | #define ed_mous_adn_b 100011000b |
|
- | 95 | #define ed_always_focus 100000000000000b |
|
- | 96 | #define ed_figure_only 1000000000000000b //symbols only |
|
- | 97 | #define ed_shift_cl 1111111111100011b |
|
- | 98 | #define ed_shift_mcl 1111111111111011b |
|
- | 99 | #define ed_shift_off 1111111111111011b |
|
- | 100 | #define ed_shift_on_off 1111111111110111b |
|
- | 101 | #define ed_shift_bac_cl 1111111111101111b |
|
- | 102 | #define ed_right_fl 1111111111011111b |
|
- | 103 | #define ed_offset_cl 1111111110111111b |
|
- | 104 | #define ed_insert_cl 1111111101111111b |
|
- | 105 | #define ed_mouse_on_off 1111111011111111b |
|
83 | 106 | ||
84 | struct edit_box{ |
107 | struct edit_box{ |
85 | dword width, |
108 | dword width, |
86 | left, |
109 | left, |
87 | top, |
110 | top, |
88 | color, |
111 | color, |
89 | shift_color, |
112 | shift_color, |
90 | focus_border_color, |
113 | focus_border_color, |
91 | blur_border_color, |
114 | blur_border_color, |
92 | text_color, |
115 | text_color, |
93 | max, |
116 | max, |
94 | text, |
117 | text, |
95 | mouse_variable, |
118 | mouse_variable, |
96 | flags, |
119 | flags, |
97 | size, |
120 | size, |
98 | pos, |
121 | pos, |
99 | offset, |
122 | offset, |
100 | cl_curs_x, |
123 | cl_curs_x, |
101 | cl_curs_y, |
124 | cl_curs_y, |
102 | shift, |
125 | shift, |
103 | shift_old, |
126 | shift_old, |
104 | ed_height, |
127 | ed_height, |
105 | ed_char_width; |
128 | ed_char_width; |
106 | }; |
129 | }; |
107 | 130 | ||
108 | struct scroll_bar |
131 | struct scroll_bar |
109 | { |
132 | { |
110 | word size_x, |
133 | word size_x, |
111 | start_x, |
134 | start_x, |
112 | size_y, |
135 | size_y, |
113 | start_y; |
136 | start_y; |
114 | dword btn_height, |
137 | dword btn_height, |
115 | type, |
138 | type, |
116 | max_area, |
139 | max_area, |
117 | cur_area, |
140 | cur_area, |
118 | position, |
141 | position, |
119 | bckg_col, |
142 | bckg_col, |
120 | frnt_col, |
143 | frnt_col, |
121 | line_col, |
144 | line_col, |
122 | redraw; |
145 | redraw; |
123 | word delta, |
146 | word delta, |
124 | delta2, |
147 | delta2, |
125 | r_size_x, |
148 | r_size_x, |
126 | r_start_x, |
149 | r_start_x, |
127 | r_size_y, |
150 | r_size_y, |
128 | r_start_y; |
151 | r_start_y; |
129 | dword m_pos, |
152 | dword m_pos, |
130 | m_pos_2, |
153 | m_pos_2, |
131 | m_keys, |
154 | m_keys, |
132 | run_size, |
155 | run_size, |
133 | position2, |
156 | position2, |
134 | work_size, |
157 | work_size, |
135 | all_redraw, |
158 | all_redraw, |
136 | ar_offset; |
159 | ar_offset; |
137 | }; |
160 | }; |
138 | 161 | ||
139 | struct progress_bar |
162 | struct progress_bar |
140 | { |
163 | { |
141 | dword |
164 | dword |
142 | value, |
165 | value, |
143 | left, |
166 | left, |
144 | top, |
167 | top, |
145 | width, |
168 | width, |
146 | height, |
169 | height, |
147 | style, |
170 | style, |
148 | min, |
171 | min, |
149 | max, |
172 | max, |
150 | back_color, |
173 | back_color, |
151 | progress_color, |
174 | progress_color, |
152 | frame_color; |
175 | frame_color; |
153 | }; |
176 | }; |
154 | 177 | ||
155 | struct frame |
178 | struct frame |
156 | { |
179 | { |
157 | dword type; |
180 | dword type; |
158 | word size_x; //start_x, size_x => Mario, WTF? Is this so complex to use x/y/w/h ? |
181 | word size_x; //start_x, size_x => Mario, WTF? Is this so complex to use x/y/w/h ? |
159 | word start_x; |
182 | word start_x; |
160 | word size_y; |
183 | word size_y; |
161 | word start_y; |
184 | word start_y; |
162 | dword ext_col; |
185 | dword ext_col; |
163 | dword int_col; |
186 | dword int_col; |
164 | dword flags; // see FR_FLAGS |
187 | dword flags; // see FR_FLAGS |
165 | dword text_pointer; |
188 | dword text_pointer; |
166 | dword text_position; // 0-up,1-bottom |
189 | dword text_position; // 0-up,1-bottom |
167 | dword font_number; // 0-monospace,1-variable |
190 | dword font_number; // 0-monospace,1-variable |
168 | dword font_size_y; |
191 | dword font_size_y; |
169 | dword font_color; |
192 | dword font_color; |
170 | dword font_backgr_color; |
193 | dword font_backgr_color; |
171 | }; |
194 | }; |
172 | 195 | ||
173 | // FR_FLAGS = [x][yyy][z] |
196 | // FR_FLAGS = [x][yyy][z] |
174 | // z - Caption |
197 | // z - Caption |
175 | // yyy - BorderStyle |
198 | // yyy - BorderStyle |
176 | // x - BackStyle |
199 | // x - BackStyle |
177 | #define FR_CAPTION 00001b // [z] |
200 | #define FR_CAPTION 00001b // [z] |
178 | #define FR_DOUBLE 00000b // [yyy] |
201 | #define FR_DOUBLE 00000b // [yyy] |
179 | #define FR_RAISED 00010b // [yyy] |
202 | #define FR_RAISED 00010b // [yyy] |
180 | #define FR_SUNKEN 00100b // [yyy] |
203 | #define FR_SUNKEN 00100b // [yyy] |
181 | #define FR_ETCHED 00110b // [yyy] |
204 | #define FR_ETCHED 00110b // [yyy] |
182 | #define FR_RIDGED 01000b // [yyy] |
205 | #define FR_RIDGED 01000b // [yyy] |
183 | #define FR_FILLED 10000b // [x] |
206 | #define FR_FILLED 10000b // [x] |
184 | 207 | ||
185 | :frame frame123 = { 0, 260, 10, 60, 16, NULL, 0xFFFfff, 1, NULL, 0, 1, 12, 0x000111, 0xCCCccc }; |
208 | :frame frame123 = { 0, 260, 10, 60, 16, NULL, 0xFFFfff, 1, NULL, 0, 1, 12, 0x000111, 0xCCCccc }; |
186 | :void DrawFrame(dword x,y,w,h,text) |
209 | :void DrawFrame(dword x,y,w,h,text) |
187 | { |
210 | { |
188 | frame123.font_color = system.color.work_text; |
211 | frame123.font_color = system.color.work_text; |
189 | frame123.ext_col = system.color.work_graph; |
212 | frame123.ext_col = system.color.work_graph; |
190 | frame123.int_col = system.color.work_light; |
213 | frame123.int_col = system.color.work_light; |
191 | frame123.font_backgr_color = system.color.work; |
214 | frame123.font_backgr_color = system.color.work; |
192 | 215 | ||
193 | frame123.start_x = x; |
216 | frame123.start_x = x; |
194 | frame123.start_y = y; |
217 | frame123.start_y = y; |
195 | frame123.size_x = w; |
218 | frame123.size_x = w; |
196 | frame123.size_y = h; |
219 | frame123.size_y = h; |
197 | frame123.text_pointer = text; |
220 | frame123.text_pointer = text; |
198 | if (!text) frame123.flags=0; else frame123.flags=FR_CAPTION; |
221 | if (!text) frame123.flags=0; else frame123.flags=FR_CAPTION; |
199 | frame_draw stdcall (#frame123); |
222 | frame_draw stdcall (#frame123); |
200 | } |
223 | } |
201 | 224 | ||
202 | 225 | ||
203 | #endif |
226 | #endif |