Subversion Repositories Kolibri OS

Rev

Rev 3182 | Rev 6766 | 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
 
6763 IgorA 19
        stdcall    [edit_box_key], rect_input.left
20
        stdcall    [edit_box_key], rect_input.top
21
        stdcall    [edit_box_key], rect_input.width
22
        stdcall    [edit_box_key], rect_input.height
310 heavyiron 23
 
1098 Lrz 24
        call    read_rect
25
        call    draw_rect_on_screen
26
 
27
        jmp     .still
28
 
310 heavyiron 29
.button:
1098 Lrz 30
        get_pressed_button
310 heavyiron 31
 
1098 Lrz 32
        cmp     ah,1
33
        jne     @f
34
        btr     dword [flags],3
35
        jmp     close
310 heavyiron 36
@@:
37
 
1098 Lrz 38
        jmp     .still
310 heavyiron 39
 
40
.mouse:
1098 Lrz 41
        get_active_window
42
        cmp     eax,[set_rect_window_slot]
43
        jne     .still
310 heavyiron 44
 
6763 IgorA 45
        stdcall    [edit_box_mouse], rect_input.left
46
        stdcall    [edit_box_mouse], rect_input.top
47
        stdcall    [edit_box_mouse], rect_input.width
48
        stdcall    [edit_box_mouse], rect_input.height
310 heavyiron 49
 
1098 Lrz 50
;;;;;;;;;;;;;;;;;;;;;;
6763 IgorA 51
        stdcall    [check_box_mouse], use_rect_active_window
1098 Lrz 52
 
53
        jmp     .still
54
 
310 heavyiron 55
.draw_window:
1098 Lrz 56
        start_draw_window
310 heavyiron 57
 
1098 Lrz 58
        mov     edx,[sc.work]
59
        add     edx,0x33000000
60
        mov     edi,riw_grab_text
61
        xor     esi,esi
6763 IgorA 62
        mcall   SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
310 heavyiron 63
 
1098 Lrz 64
        draw_labels rect_input_labels,rect_input_labels_end
310 heavyiron 65
 
6763 IgorA 66
        stdcall    [edit_box_draw], rect_input.left
67
        stdcall    [edit_box_draw], rect_input.top
68
        stdcall    [edit_box_draw], rect_input.width
69
        stdcall    [edit_box_draw], rect_input.height
1098 Lrz 70
;;;;;;;;;;;;;;;;;;;;;;
6763 IgorA 71
        stdcall    [check_box_draw], use_rect_active_window
1098 Lrz 72
 
73
        call    read_rect
74
        call    draw_rect_on_screen
75
 
76
        stop_draw_window
310 heavyiron 77
ret
78
 
79
;--------------------------------------------------------------------
80
;--- Считывание облати ----------------------------------------------
81
;--------------------------------------------------------------------
82
read_rect:
1098 Lrz 83
        bt      dword [use_rect_active_window.flags],1
84
        jc      read_rect_from_active_window
310 heavyiron 85
 
1098 Lrz 86
        mov     edi,rect_input_buffer.left
87
        call    zstr_to_int
88
        cmp     ax,[scr.width]
89
        jb      @f
90
        mov     ax,[scr.width]
310 heavyiron 91
@@:
1098 Lrz 92
        mov     [rect.left],ax
310 heavyiron 93
 
1098 Lrz 94
        mov     edi,rect_input_buffer.top
95
        call    zstr_to_int
96
        cmp     ax,[scr.height]
97
        jb      @f
98
        mov     ax,[scr.height]
310 heavyiron 99
@@:
1098 Lrz 100
        mov     [rect.top],ax
310 heavyiron 101
 
1098 Lrz 102
        mov     edi,rect_input_buffer.width
103
        call    zstr_to_int
104
        mov     bx,[scr.width]
105
        sub     bx,[rect.left]
106
        cmp     ax,bx
107
        jb      @f
108
        mov     ax,bx
310 heavyiron 109
@@:
1098 Lrz 110
        mov     [rect.width],ax
310 heavyiron 111
 
1098 Lrz 112
        mov     edi,rect_input_buffer.height
113
        call    zstr_to_int
114
        mov     bx,[scr.height]
115
        sub     bx,[rect.top]
116
        cmp     ax,bx
117
        jb      @f
118
        mov     ax,bx
310 heavyiron 119
@@:
1098 Lrz 120
        mov     [rect.height],ax
310 heavyiron 121
ret
122
 
123
read_rect_from_active_window:
1098 Lrz 124
        call    get_active_window_info
310 heavyiron 125
 
1098 Lrz 126
        mov     eax,[active_app.left]
127
        mov     [rect.left],ax
128
        mov     eax,[active_app.top]
129
        mov     [rect.top],ax
130
        mov     eax,[active_app.width]
131
        inc     eax
132
        mov     [rect.width],ax
133
        mov     eax,[active_app.height]
134
        inc     eax
135
        mov     [rect.height],ax
310 heavyiron 136
ret
137
 
138
draw_rect_on_screen:
139
 
1098 Lrz 140
        xor     edx,edx
6763 IgorA 141
        mcall   SF_DRAW_RECT, 150*65536+80, 5*65536+60
310 heavyiron 142
 
1098 Lrz 143
        ;movzx   eax,word [rect.left]
144
        ;mul     word [scr.width]
145
        xor     edx,edx
146
        movzx   eax,word [scr.width]
147
        mov     ebx,80
148
        div     ebx
149
        mov     ebx,eax
310 heavyiron 150
 
1098 Lrz 151
        xor     edx,edx
152
        movzx   eax,word [rect.height]
153
        div     ebx
154
        push    ax
310 heavyiron 155
 
1098 Lrz 156
        xor     edx,edx
157
        movzx   eax,word [rect.width]
158
        div     ebx
159
        push    ax
310 heavyiron 160
 
1098 Lrz 161
        xor     edx,edx
162
        movzx   eax,word [rect.top]
163
        div     ebx
164
        push    ax
310 heavyiron 165
 
1098 Lrz 166
        xor     edx,edx
167
        movzx   eax,word [rect.left]
168
        div     ebx
169
        push    ax
310 heavyiron 170
 
1098 Lrz 171
        pop     bx
172
        add     bx,150
173
        shl    ebx,16
310 heavyiron 174
 
1098 Lrz 175
        pop     cx
176
        add     cx,5
177
        shl     ecx,16
310 heavyiron 178
 
1098 Lrz 179
        pop     bx
180
        pop     cx
310 heavyiron 181
 
6763 IgorA 182
        mcall   SF_DRAW_RECT,,,0xffffff
310 heavyiron 183
ret
184
 
1098 Lrz 185
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
186
;DATA данные
187
;Всегда соблюдать последовательность в имени.
1608 mario79 188
 
189
system_dir_Boxlib	db '/sys/lib/box_lib.obj',0
190
system_dir_ProcLib	db '/sys/lib/proc_lib.obj',0
6763 IgorA 191
system_dir_LibImg   db '/sys/lib/libimg.obj',0
1608 mario79 192
 
6763 IgorA 193
if lang eq ru
1098 Lrz 194
head_f_i:
6763 IgorA 195
head_f_l	db 'Системная ошибка',0
196
 
197
err_message_found_lib1	db 'box_lib.obj - не найдена!',0
198
err_message_found_lib2	db 'proc_lib.obj - не найдена!',0
199
err_message_found_lib3	db 'libimg.obj - не найдена!',0
200
 
201
err_message_import1	db 'box_lib.obj - ошибка импорта!',0
202
err_message_import2	db 'proc_lib.obj - ошибка импорта!',0
203
err_message_import3	db 'libimg.obj - ошибка импорта!',0
204
 
205
else
206
 
207
head_f_i:
1608 mario79 208
head_f_l	db 'System error',0
1098 Lrz 209
 
1608 mario79 210
err_message_found_lib1	db 'box_lib.obj - Not found!',0
211
err_message_found_lib2	db 'proc_lib.obj - Not found!',0
6763 IgorA 212
err_message_found_lib3	db 'libimg.obj - Not found!',0
1098 Lrz 213
 
1608 mario79 214
err_message_import1	db 'box_lib.obj - Wrong import!',0
215
err_message_import2	db 'proc_lib.obj - Wrong import!',0
6763 IgorA 216
err_message_import3	db 'libimg.obj - Wrong import!',0
217
end if
1608 mario79 218
;---------------------------------------------------------------------
219
align 4
220
ProcLib_import:
221
OpenDialog_Init		dd aOpenDialog_Init
222
OpenDialog_Start	dd aOpenDialog_Start
223
;OpenDialog__Version	dd aOpenDialog_Version
224
        dd      0
225
        dd      0
226
aOpenDialog_Init	db 'OpenDialog_init',0
227
aOpenDialog_Start	db 'OpenDialog_start',0
228
;aOpenDialog_Version	db 'Version_OpenDialog',0
229
;---------------------------------------------------------------------
230
align 4
231
Box_lib_import:
232
;init_lib		dd a_init
233
;version_lib		dd a_version
1098 Lrz 234
 
1608 mario79 235
edit_box_draw		dd aEdit_box_draw
236
edit_box_key		dd aEdit_box_key
237
edit_box_mouse		dd aEdit_box_mouse
238
;version_ed		dd aVersion_ed
1098 Lrz 239
 
1685 lrz 240
init_checkbox		dd aInit_checkbox
1608 mario79 241
check_box_draw		dd aCheck_box_draw
1685 lrz 242
check_box_mouse 	dd aCheck_box_mouse
243
;version_ch	dd	aVersion_ch
244
 
1608 mario79 245
option_box_draw	dd aOption_box_draw
246
option_box_mouse	dd aOption_box_mouse
247
;version_op		dd aVersion_op
1098 Lrz 248
 
1608 mario79 249
PathShow_prepare	dd sz_PathShow_prepare
250
PathShow_draw		dd sz_PathShow_draw
251
;Version_path_show	dd szVersion_path_show
6763 IgorA 252
			dd 0,0
1608 mario79 253
 
254
;a_init			db 'lib_init',0
255
;a_version		db 'version',0
256
 
257
aEdit_box_draw		db 'edit_box',0
258
aEdit_box_key		db 'edit_box_key',0
1685 lrz 259
aEdit_box_mouse		db 'edit_box_mouse',0
1608 mario79 260
;aVersion_ed		db 'version_ed',0
261
 
1685 lrz 262
 
263
aInit_checkbox	 db 'init_checkbox2',0
264
aCheck_box_draw  db 'check_box_draw2',0
265
aCheck_box_mouse db 'check_box_mouse2',0
266
;aVersion_ch	 db 'version_ch2',0
267
 
1608 mario79 268
aOption_box_draw	db 'option_box_draw',0
269
aOption_box_mouse	db 'option_box_mouse',0
270
;aVersion_op		db 'version_op',0
271
 
272
sz_PathShow_prepare	db 'PathShow_prepare',0
273
sz_PathShow_draw	db 'PathShow_draw',0
274
;szVersion_path_show	db 'version_PathShow',0
275
;---------------------------------------------------------------------
6763 IgorA 276
align 4
277
import_libimg:
278
	dd alib_init1
279
	img_is_img  dd aimg_is_img
280
	img_info    dd aimg_info
281
	img_from_file dd aimg_from_file
282
	img_to_file dd aimg_to_file
283
	img_from_rgb dd aimg_from_rgb
284
	img_to_rgb  dd aimg_to_rgb
285
	img_to_rgb2 dd aimg_to_rgb2
286
	img_decode  dd aimg_decode
287
	img_encode  dd aimg_encode
288
	img_create  dd aimg_create
289
	img_destroy dd aimg_destroy
290
	img_destroy_layer dd aimg_destroy_layer
291
	img_count   dd aimg_count
292
	img_lock_bits dd aimg_lock_bits
293
	img_unlock_bits dd aimg_unlock_bits
294
	img_flip    dd aimg_flip
295
	img_flip_layer dd aimg_flip_layer
296
	img_rotate  dd aimg_rotate
297
	img_rotate_layer dd aimg_rotate_layer
298
	img_draw    dd aimg_draw
299
dd 0,0
300
	alib_init1   db 'lib_init',0
301
	aimg_is_img  db 'img_is_img',0
302
	aimg_info    db 'img_info',0
303
	aimg_from_file db 'img_from_file',0
304
	aimg_to_file db 'img_to_file',0
305
	aimg_from_rgb db 'img_from_rgb',0
306
	aimg_to_rgb  db 'img_to_rgb',0
307
	aimg_to_rgb2 db 'img_to_rgb2',0
308
	aimg_decode  db 'img_decode',0
309
	aimg_encode  db 'img_encode',0
310
	aimg_create  db 'img_create',0
311
	aimg_destroy db 'img_destroy',0
312
	aimg_destroy_layer db 'img_destroy_layer',0
313
	aimg_count   db 'img_count',0
314
	aimg_lock_bits db 'img_lock_bits',0
315
	aimg_unlock_bits db 'img_unlock_bits',0
316
	aimg_flip    db 'img_flip',0
317
	aimg_flip_layer db 'img_flip_layer',0
318
	aimg_rotate  db 'img_rotate',0
319
	aimg_rotate_layer db 'img_rotate_layer',0
320
	aimg_draw    db 'img_draw',0
321
;---------------------------------------------------------------------
1228 Lrz 322
;width,left,top,color,shift_color,focus_border_color,\
323
;       blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
1098 Lrz 324
 
310 heavyiron 325
rect_input:
6763 IgorA 326
.left   edit_box 35,95,5, cl_white,0,0,0,5,rect_input_buffer.left,  mouse_dd1,ed_figure_only+ed_focus
327
.top    edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,   mouse_dd1,ed_figure_only
328
.width  edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
1228 Lrz 329
.height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
310 heavyiron 330
rect_input_end:
1214 Lrz 331
mouse_dd1	rd 1
310 heavyiron 332
rect_input_labels:
6763 IgorA 333
.left   label 10,10,0,rect_input_labels_text.left
334
.top    label 10,30,0,rect_input_labels_text.top
335
.width  label 10,50,0,rect_input_labels_text.width
310 heavyiron 336
.height label 10,70,0,rect_input_labels_text.height
337
rect_input_labels_end:
338
 
339
rect_input_labels_text:
6763 IgorA 340
if lang eq ru
310 heavyiron 341
.left db 'Отступ слева:',0
342
.top  db 'Отступ сверху:',0
1098 Lrz 343
.width  db 'Ширина:',0
310 heavyiron 344
.height db 'Высота:',0
6763 IgorA 345
else
346
.left db 'Left:',0
347
.top  db 'Top:',0
348
.width  db 'Width:',0
349
.height db 'Height:',0
350
end if
310 heavyiron 351
 
352
riw_check_boxes:
3181 hidnplayr 353
use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
3182 hidnplayr 354
riw_check_boxes_text, ch_flag_bottom
310 heavyiron 355
riw_check_boxes_end:
356
 
6763 IgorA 357
if lang eq ru
358
riw_check_boxes_text db 'Использовать область активного окна',0
359
riw_grab_text db 'Координаты и размеры области:',0
360
else
361
riw_check_boxes_text db 'Use area of the active window',0
362
riw_grab_text db 'Coordinates and size of the field:',0
363
end if