Subversion Repositories Kolibri OS

Rev

Rev 1228 | Rev 1685 | 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
11
        check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc
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
 
1608 mario79 261
check_box_draw		dd aCheck_box_draw
262
check_box_mouse	dd aCheck_box_mouse
263
;version_ch		dd aVersion_ch
1098 Lrz 264
 
1608 mario79 265
option_box_draw	dd aOption_box_draw
266
option_box_mouse	dd aOption_box_mouse
267
;version_op		dd aVersion_op
1098 Lrz 268
 
1608 mario79 269
;scrollbar_ver_draw	dd aScrollbar_ver_draw
270
;scrollbar_ver_mouse	dd aScrollbar_ver_mouse
271
;scrollbar_hor_draw	dd aScrollbar_hor_draw
272
;scrollbar_hor_mouse	dd aScrollbar_hor_mouse
273
;version_scrollbar	dd aVersion_scrollbar
1098 Lrz 274
 
1608 mario79 275
;dinamic_button_draw	dd aDbutton_draw
276
;dinamic_button_mouse	dd aDbutton_mouse
277
;version_dbutton	dd aVersion_dbutton
278
 
279
;menu_bar_draw		dd aMenu_bar_draw
280
;menu_bar_mouse		dd aMenu_bar_mouse
281
;menu_bar_activate	dd aMenu_bar_activate
282
;version_menu_bar	dd aVersion_menu_bar
283
 
284
;FileBrowser_draw	dd aFileBrowser_draw
285
;FileBrowser_mouse	dd aFileBrowser_mouse
286
;FileBrowser_key	dd aFileBrowser_key
287
;Version_FileBrowser	dd aVersion_FileBrowser
288
 
289
PathShow_prepare	dd sz_PathShow_prepare
290
PathShow_draw		dd sz_PathShow_draw
291
;Version_path_show	dd szVersion_path_show
292
			dd 0
293
			dd 0
294
 
295
;a_init			db 'lib_init',0
296
;a_version		db 'version',0
297
 
298
aEdit_box_draw		db 'edit_box',0
299
aEdit_box_key		db 'edit_box_key',0
300
aEdit_box_mouse	db 'edit_box_mouse',0
301
;aVersion_ed		db 'version_ed',0
302
 
303
aCheck_box_draw	db 'check_box_draw',0
304
aCheck_box_mouse	db 'check_box_mouse',0
305
;aVersion_ch		db 'version_ch',0
306
 
307
aOption_box_draw	db 'option_box_draw',0
308
aOption_box_mouse	db 'option_box_mouse',0
309
;aVersion_op		db 'version_op',0
310
 
311
;aScrollbar_ver_draw	db 'scrollbar_v_draw',0
312
;aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
313
;aScrollbar_hor_draw	db 'scrollbar_h_draw',0
314
;aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
315
;aVersion_scrollbar	db 'version_scrollbar',0
316
 
317
;aDbutton_draw		db 'dbutton_draw',0
318
;aDbutton_mouse		db 'dbutton_mouse',0
319
;aVersion_dbutton	db 'version_dbutton',0
320
 
321
;aMenu_bar_draw		db 'menu_bar_draw',0
322
;aMenu_bar_mouse		db 'menu_bar_mouse',0
323
;aMenu_bar_activate	db 'menu_bar_activate',0
324
;aVersion_menu_bar	db 'version_menu_bar',0
325
 
326
;aFileBrowser_draw	db 'FileBrowser_draw',0
327
;aFileBrowser_mouse	db 'FileBrowser_mouse',0
328
;aFileBrowser_key	db 'FileBrowser_key',0
329
;aVersion_FileBrowser	db 'version_FileBrowser',0
330
 
331
sz_PathShow_prepare	db 'PathShow_prepare',0
332
sz_PathShow_draw	db 'PathShow_draw',0
333
;szVersion_path_show	db 'version_PathShow',0
334
;---------------------------------------------------------------------
335
 
1228 Lrz 336
;width,left,top,color,shift_color,focus_border_color,\
337
;       blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
1098 Lrz 338
 
310 heavyiron 339
rect_input:
1228 Lrz 340
.left   edit_box 35,95,5, cl_white,0,0,0,5,rect_input_buffer.left,mouse_dd1,ed_figure_only+ed_focus
341
.top    edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,mouse_dd1,ed_figure_only
342
.width  edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,mouse_dd1,ed_figure_only
343
.height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
310 heavyiron 344
rect_input_end:
1214 Lrz 345
mouse_dd1	rd 1
310 heavyiron 346
rect_input_labels:
347
.left label 10,10,0,rect_input_labels_text.left
348
.top label 10,30,0,rect_input_labels_text.top
349
.width label 10,50,0,rect_input_labels_text.width
350
.height label 10,70,0,rect_input_labels_text.height
351
rect_input_labels_end:
352
 
353
rect_input_labels_text:
354
.left db 'Отступ слева:',0
355
.top  db 'Отступ сверху:',0
1098 Lrz 356
.width  db 'Ширина:',0
310 heavyiron 357
.height db 'Высота:',0
358
 
359
riw_check_boxes:
1098 Lrz 360
use_rect_active_window check_box 10,85,5,11,cl_white,0,0,\
310 heavyiron 361
riw_check_boxes_text.1,\
362
riw_check_boxes_text.2-riw_check_boxes_text.1
363
riw_check_boxes_end:
364
 
365
riw_check_boxes_text:
366
.1 db 'Использовать область активного окна'
367
.2 db ''
368
 
369
riw_grab_text db 'Координаты и размеры области:',0