Rev 3180 | Rev 3182 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
310 | heavyiron | 1 | set_rect_window: |
1098 | Lrz | 2 | mov ebx,set_rect_window_procinfo |
3 | call get_slot_n |
||
310 | heavyiron | 4 | |
1098 | Lrz | 5 | mov [set_rect_window_slot],ecx |
310 | heavyiron | 6 | |
1098 | Lrz | 7 | set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse) |
310 | heavyiron | 8 | .red: |
1098 | Lrz | 9 | edit_boxes_set_sys_color rect_input,rect_input_end,sc |
10 | labels_set_sys_color rect_input_labels,rect_input_labels_end,sc |
||
3181 | hidnplayr | 11 | check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc |
1098 | Lrz | 12 | call .draw_window |
310 | heavyiron | 13 | .still: |
1098 | Lrz | 14 | wait_event .red,.key,.button,.mouse |
310 | heavyiron | 15 | |
16 | .key: |
||
1098 | Lrz | 17 | get_key |
310 | heavyiron | 18 | |
1098 | Lrz | 19 | push dword rect_input.left |
20 | call [edit_box_key] |
||
310 | heavyiron | 21 | |
1098 | Lrz | 22 | push dword rect_input.top |
23 | call [edit_box_key] |
||
310 | heavyiron | 24 | |
1098 | Lrz | 25 | push dword rect_input.width |
26 | call [edit_box_key] |
||
310 | heavyiron | 27 | |
1098 | Lrz | 28 | push dword rect_input.height |
29 | call [edit_box_key] |
||
30 | ; key_edit_boxes rect_input,rect_input_end |
||
31 | |||
32 | call read_rect |
||
33 | call draw_rect_on_screen |
||
34 | |||
35 | jmp .still |
||
36 | |||
310 | heavyiron | 37 | .button: |
1098 | Lrz | 38 | get_pressed_button |
310 | heavyiron | 39 | |
1098 | Lrz | 40 | cmp ah,1 |
41 | jne @f |
||
42 | btr dword [flags],3 |
||
43 | jmp close |
||
310 | heavyiron | 44 | @@: |
45 | |||
1098 | Lrz | 46 | jmp .still |
310 | heavyiron | 47 | |
48 | .mouse: |
||
1098 | Lrz | 49 | get_active_window |
50 | cmp eax,[set_rect_window_slot] |
||
51 | jne .still |
||
310 | heavyiron | 52 | |
1098 | Lrz | 53 | push dword rect_input.left |
54 | call [edit_box_mouse] |
||
310 | heavyiron | 55 | |
1098 | Lrz | 56 | push dword rect_input.top |
57 | call [edit_box_mouse] |
||
310 | heavyiron | 58 | |
1098 | Lrz | 59 | push dword rect_input.width |
60 | call [edit_box_mouse] |
||
61 | |||
62 | push dword rect_input.height |
||
63 | call [edit_box_mouse] |
||
64 | |||
65 | ;;;;;;;;;;;;;;;;;;;;;; |
||
66 | push dword use_rect_active_window |
||
67 | call [check_box_mouse] |
||
68 | |||
69 | ; mouse_edit_boxes rect_input,rect_input_end |
||
70 | ; mouse_check_boxes riw_check_boxes,riw_check_boxes_end |
||
71 | |||
72 | jmp .still |
||
73 | |||
310 | heavyiron | 74 | .draw_window: |
1098 | Lrz | 75 | start_draw_window |
310 | heavyiron | 76 | |
1098 | Lrz | 77 | xor eax,eax |
78 | mov ebx,100*65536+250 |
||
79 | mov ecx,100*65536+130 |
||
80 | mov edx,[sc.work] |
||
81 | add edx,0x33000000 |
||
82 | mov edi,riw_grab_text |
||
83 | xor esi,esi |
||
84 | mcall |
||
310 | heavyiron | 85 | |
1098 | Lrz | 86 | draw_labels rect_input_labels,rect_input_labels_end |
310 | heavyiron | 87 | |
1098 | Lrz | 88 | push dword rect_input.left |
89 | call [edit_box_draw] |
||
310 | heavyiron | 90 | |
1098 | Lrz | 91 | push dword rect_input.top |
92 | call [edit_box_draw] |
||
310 | heavyiron | 93 | |
1098 | Lrz | 94 | push dword rect_input.width |
95 | call [edit_box_draw] |
||
310 | heavyiron | 96 | |
1098 | Lrz | 97 | push dword rect_input.height |
98 | call [edit_box_draw] |
||
99 | ;;;;;;;;;;;;;;;;;;;;;; |
||
100 | push dword use_rect_active_window |
||
101 | call [check_box_draw] |
||
102 | ; draw_edit_boxes rect_input,rect_input_end |
||
103 | ; draw_check_boxes riw_check_boxes,riw_check_boxes_end |
||
104 | |||
105 | call read_rect |
||
106 | call draw_rect_on_screen |
||
107 | |||
108 | stop_draw_window |
||
310 | heavyiron | 109 | ret |
110 | |||
111 | ;-------------------------------------------------------------------- |
||
112 | ;--- Считывание облати ---------------------------------------------- |
||
113 | ;-------------------------------------------------------------------- |
||
114 | read_rect: |
||
1098 | Lrz | 115 | bt dword [use_rect_active_window.flags],1 |
116 | jc read_rect_from_active_window |
||
310 | heavyiron | 117 | |
1098 | Lrz | 118 | mov edi,rect_input_buffer.left |
119 | call zstr_to_int |
||
120 | cmp ax,[scr.width] |
||
121 | jb @f |
||
122 | mov ax,[scr.width] |
||
310 | heavyiron | 123 | @@: |
1098 | Lrz | 124 | mov [rect.left],ax |
310 | heavyiron | 125 | |
1098 | Lrz | 126 | mov edi,rect_input_buffer.top |
127 | call zstr_to_int |
||
128 | cmp ax,[scr.height] |
||
129 | jb @f |
||
130 | mov ax,[scr.height] |
||
310 | heavyiron | 131 | @@: |
1098 | Lrz | 132 | mov [rect.top],ax |
310 | heavyiron | 133 | |
1098 | Lrz | 134 | mov edi,rect_input_buffer.width |
135 | call zstr_to_int |
||
136 | mov bx,[scr.width] |
||
137 | sub bx,[rect.left] |
||
138 | cmp ax,bx |
||
139 | jb @f |
||
140 | mov ax,bx |
||
310 | heavyiron | 141 | @@: |
1098 | Lrz | 142 | mov [rect.width],ax |
310 | heavyiron | 143 | |
1098 | Lrz | 144 | mov edi,rect_input_buffer.height |
145 | call zstr_to_int |
||
146 | mov bx,[scr.height] |
||
147 | sub bx,[rect.top] |
||
148 | cmp ax,bx |
||
149 | jb @f |
||
150 | mov ax,bx |
||
310 | heavyiron | 151 | @@: |
1098 | Lrz | 152 | mov [rect.height],ax |
310 | heavyiron | 153 | ret |
154 | |||
155 | read_rect_from_active_window: |
||
1098 | Lrz | 156 | call get_active_window_info |
310 | heavyiron | 157 | |
1098 | Lrz | 158 | mov eax,[active_app.left] |
159 | mov [rect.left],ax |
||
160 | mov eax,[active_app.top] |
||
161 | mov [rect.top],ax |
||
162 | mov eax,[active_app.width] |
||
163 | inc eax |
||
164 | mov [rect.width],ax |
||
165 | mov eax,[active_app.height] |
||
166 | inc eax |
||
167 | mov [rect.height],ax |
||
310 | heavyiron | 168 | ret |
169 | |||
170 | draw_rect_on_screen: |
||
171 | |||
1098 | Lrz | 172 | mov eax,13 |
173 | mov ebx,150*65536+80 |
||
174 | mov ecx,5*65536+60 |
||
175 | xor edx,edx |
||
176 | mcall |
||
310 | heavyiron | 177 | |
1098 | Lrz | 178 | ;movzx eax,word [rect.left] |
179 | ;mul word [scr.width] |
||
180 | xor edx,edx |
||
181 | movzx eax,word [scr.width] |
||
182 | mov ebx,80 |
||
183 | div ebx |
||
184 | mov ebx,eax |
||
310 | heavyiron | 185 | |
1098 | Lrz | 186 | xor edx,edx |
187 | movzx eax,word [rect.height] |
||
188 | div ebx |
||
189 | push ax |
||
310 | heavyiron | 190 | |
1098 | Lrz | 191 | xor edx,edx |
192 | movzx eax,word [rect.width] |
||
193 | div ebx |
||
194 | push ax |
||
310 | heavyiron | 195 | |
1098 | Lrz | 196 | xor edx,edx |
197 | movzx eax,word [rect.top] |
||
198 | div ebx |
||
199 | push ax |
||
310 | heavyiron | 200 | |
1098 | Lrz | 201 | xor edx,edx |
202 | movzx eax,word [rect.left] |
||
203 | div ebx |
||
204 | push ax |
||
310 | heavyiron | 205 | |
1098 | Lrz | 206 | pop bx |
207 | add bx,150 |
||
208 | shl ebx,16 |
||
310 | heavyiron | 209 | |
1098 | Lrz | 210 | pop cx |
211 | add cx,5 |
||
212 | shl ecx,16 |
||
310 | heavyiron | 213 | |
1098 | Lrz | 214 | pop bx |
215 | pop cx |
||
310 | heavyiron | 216 | |
1098 | Lrz | 217 | mov edx,0xffffff |
218 | mov eax,13 |
||
219 | mcall |
||
310 | heavyiron | 220 | ret |
221 | |||
1098 | Lrz | 222 | ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
223 | ;DATA данные |
||
224 | ;Всегда соблюдать последовательность в имени. |
||
1608 | mario79 | 225 | |
226 | system_dir_Boxlib db '/sys/lib/box_lib.obj',0 |
||
227 | system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 |
||
228 | |||
1098 | Lrz | 229 | head_f_i: |
1608 | mario79 | 230 | head_f_l db 'System error',0 |
1098 | Lrz | 231 | |
1608 | mario79 | 232 | err_message_found_lib1 db 'box_lib.obj - Not found!',0 |
233 | err_message_found_lib2 db 'proc_lib.obj - Not found!',0 |
||
1098 | Lrz | 234 | |
1608 | mario79 | 235 | err_message_import1 db 'box_lib.obj - Wrong import!',0 |
236 | err_message_import2 db 'proc_lib.obj - Wrong import!',0 |
||
1098 | Lrz | 237 | |
1608 | mario79 | 238 | ;--------------------------------------------------------------------- |
239 | align 4 |
||
240 | ProcLib_import: |
||
241 | OpenDialog_Init dd aOpenDialog_Init |
||
242 | OpenDialog_Start dd aOpenDialog_Start |
||
243 | ;OpenDialog__Version dd aOpenDialog_Version |
||
244 | dd 0 |
||
245 | dd 0 |
||
246 | aOpenDialog_Init db 'OpenDialog_init',0 |
||
247 | aOpenDialog_Start db 'OpenDialog_start',0 |
||
248 | ;aOpenDialog_Version db 'Version_OpenDialog',0 |
||
249 | ;--------------------------------------------------------------------- |
||
250 | align 4 |
||
251 | Box_lib_import: |
||
252 | ;init_lib dd a_init |
||
253 | ;version_lib dd a_version |
||
1098 | Lrz | 254 | |
255 | |||
1608 | mario79 | 256 | edit_box_draw dd aEdit_box_draw |
257 | edit_box_key dd aEdit_box_key |
||
258 | edit_box_mouse dd aEdit_box_mouse |
||
259 | ;version_ed dd aVersion_ed |
||
1098 | Lrz | 260 | |
1685 | lrz | 261 | |
262 | init_checkbox dd aInit_checkbox |
||
1608 | mario79 | 263 | check_box_draw dd aCheck_box_draw |
1685 | lrz | 264 | check_box_mouse dd aCheck_box_mouse |
265 | ;version_ch dd aVersion_ch |
||
266 | |||
267 | ;check_box_draw dd aCheck_box_draw |
||
268 | ;check_box_mouse dd aCheck_box_mouse |
||
1608 | mario79 | 269 | ;version_ch dd aVersion_ch |
1098 | Lrz | 270 | |
1608 | mario79 | 271 | option_box_draw dd aOption_box_draw |
272 | option_box_mouse dd aOption_box_mouse |
||
273 | ;version_op dd aVersion_op |
||
1098 | Lrz | 274 | |
1608 | mario79 | 275 | ;scrollbar_ver_draw dd aScrollbar_ver_draw |
276 | ;scrollbar_ver_mouse dd aScrollbar_ver_mouse |
||
277 | ;scrollbar_hor_draw dd aScrollbar_hor_draw |
||
278 | ;scrollbar_hor_mouse dd aScrollbar_hor_mouse |
||
279 | ;version_scrollbar dd aVersion_scrollbar |
||
1098 | Lrz | 280 | |
1608 | mario79 | 281 | ;dinamic_button_draw dd aDbutton_draw |
282 | ;dinamic_button_mouse dd aDbutton_mouse |
||
283 | ;version_dbutton dd aVersion_dbutton |
||
284 | |||
285 | ;menu_bar_draw dd aMenu_bar_draw |
||
286 | ;menu_bar_mouse dd aMenu_bar_mouse |
||
287 | ;menu_bar_activate dd aMenu_bar_activate |
||
288 | ;version_menu_bar dd aVersion_menu_bar |
||
289 | |||
290 | ;FileBrowser_draw dd aFileBrowser_draw |
||
291 | ;FileBrowser_mouse dd aFileBrowser_mouse |
||
292 | ;FileBrowser_key dd aFileBrowser_key |
||
293 | ;Version_FileBrowser dd aVersion_FileBrowser |
||
294 | |||
295 | PathShow_prepare dd sz_PathShow_prepare |
||
296 | PathShow_draw dd sz_PathShow_draw |
||
297 | ;Version_path_show dd szVersion_path_show |
||
298 | dd 0 |
||
299 | dd 0 |
||
300 | |||
301 | ;a_init db 'lib_init',0 |
||
302 | ;a_version db 'version',0 |
||
303 | |||
304 | aEdit_box_draw db 'edit_box',0 |
||
305 | aEdit_box_key db 'edit_box_key',0 |
||
1685 | lrz | 306 | aEdit_box_mouse db 'edit_box_mouse',0 |
1608 | mario79 | 307 | ;aVersion_ed db 'version_ed',0 |
308 | |||
1685 | lrz | 309 | |
310 | aInit_checkbox db 'init_checkbox2',0 |
||
311 | aCheck_box_draw db 'check_box_draw2',0 |
||
312 | aCheck_box_mouse db 'check_box_mouse2',0 |
||
313 | ;aVersion_ch db 'version_ch2',0 |
||
314 | |||
315 | ;aCheck_box_draw db 'check_box_draw',0 |
||
316 | ;aCheck_box_mouse db 'check_box_mouse',0 |
||
1608 | mario79 | 317 | ;aVersion_ch db 'version_ch',0 |
318 | |||
319 | aOption_box_draw db 'option_box_draw',0 |
||
320 | aOption_box_mouse db 'option_box_mouse',0 |
||
321 | ;aVersion_op db 'version_op',0 |
||
322 | |||
323 | ;aScrollbar_ver_draw db 'scrollbar_v_draw',0 |
||
324 | ;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 |
||
325 | ;aScrollbar_hor_draw db 'scrollbar_h_draw',0 |
||
326 | ;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 |
||
327 | ;aVersion_scrollbar db 'version_scrollbar',0 |
||
328 | |||
329 | ;aDbutton_draw db 'dbutton_draw',0 |
||
330 | ;aDbutton_mouse db 'dbutton_mouse',0 |
||
331 | ;aVersion_dbutton db 'version_dbutton',0 |
||
332 | |||
333 | ;aMenu_bar_draw db 'menu_bar_draw',0 |
||
334 | ;aMenu_bar_mouse db 'menu_bar_mouse',0 |
||
335 | ;aMenu_bar_activate db 'menu_bar_activate',0 |
||
336 | ;aVersion_menu_bar db 'version_menu_bar',0 |
||
337 | |||
338 | ;aFileBrowser_draw db 'FileBrowser_draw',0 |
||
339 | ;aFileBrowser_mouse db 'FileBrowser_mouse',0 |
||
340 | ;aFileBrowser_key db 'FileBrowser_key',0 |
||
341 | ;aVersion_FileBrowser db 'version_FileBrowser',0 |
||
342 | |||
343 | sz_PathShow_prepare db 'PathShow_prepare',0 |
||
344 | sz_PathShow_draw db 'PathShow_draw',0 |
||
345 | ;szVersion_path_show db 'version_PathShow',0 |
||
346 | ;--------------------------------------------------------------------- |
||
347 | |||
1228 | Lrz | 348 | ;width,left,top,color,shift_color,focus_border_color,\ |
349 | ; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos |
||
1098 | Lrz | 350 | |
310 | heavyiron | 351 | rect_input: |
1228 | Lrz | 352 | .left edit_box 35,95,5, cl_white,0,0,0,5,rect_input_buffer.left,mouse_dd1,ed_figure_only+ed_focus |
353 | .top edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,mouse_dd1,ed_figure_only |
||
354 | .width edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,mouse_dd1,ed_figure_only |
||
355 | .height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only |
||
310 | heavyiron | 356 | rect_input_end: |
1214 | Lrz | 357 | mouse_dd1 rd 1 |
310 | heavyiron | 358 | rect_input_labels: |
359 | .left label 10,10,0,rect_input_labels_text.left |
||
360 | .top label 10,30,0,rect_input_labels_text.top |
||
361 | .width label 10,50,0,rect_input_labels_text.width |
||
362 | .height label 10,70,0,rect_input_labels_text.height |
||
363 | rect_input_labels_end: |
||
364 | |||
365 | rect_input_labels_text: |
||
366 | .left db 'Отступ слева:',0 |
||
367 | .top db 'Отступ сверху:',0 |
||
1098 | Lrz | 368 | .width db 'Ширина:',0 |
310 | heavyiron | 369 | .height db 'Высота:',0 |
370 | |||
371 | riw_check_boxes: |
||
3181 | hidnplayr | 372 | use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\ |
373 | riw_check_boxes_text.1, ch_flag_bottom |
||
310 | heavyiron | 374 | riw_check_boxes_end: |
375 | |||
376 | riw_check_boxes_text: |
||
3181 | hidnplayr | 377 | db 'Использовать область активного окна',0 |
310 | heavyiron | 378 | |
3181 | hidnplayr | 379 | |
310 | heavyiron | 380 | riw_grab_text db 'Координаты и размеры области:',0 |