Subversion Repositories Kolibri OS

Rev

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

Rev 7919 Rev 8346
Line 1... Line 1...
1
;*****************************************************************************
1
;*****************************************************************************
2
; Box_Lib - library of graphical components
2
; Box_Lib - library of graphical components
3
; Copyright (C) KolibriOS team 2008-2016. All rights reserved.
3
; Copyright (C) KolibriOS team 2008-2020. All rights reserved.
4
;
4
;
5
; Authors:
5
; Authors:
6
; Alexey Teplov aka 
6
; Alexey Teplov aka 
7
; Marat Zakiyanov aka Mario79, aka Mario
7
; Marat Zakiyanov aka Mario79, aka Mario
8
; Evtikhov Maxim aka Maxxxx32
8
; Evtikhov Maxim aka Maxxxx32
Line 17... Line 17...
17
 
17
 
18
section '.flat' code readable align 16
18
section '.flat' code readable align 16
19
include '../../../../macros.inc'
19
include '../../../../macros.inc'
20
include '../../../../proc32.inc'
20
include '../../../../proc32.inc'
21
include '../../../../KOSfuncs.inc'
-
 
22
include 'bl_sys.mac'
21
include '../../../../KOSfuncs.inc'
23
include 'box_lib.mac' ;macro which should make life easier :)
22
include 'box_lib.mac' ;macro which should make life easier :)
24
;include '../../../../debug.inc'
23
;include '../../../../debug.inc'
Line 25... Line 24...
25
include 'keys.inc'
24
include 'keys.inc'
Line 29... Line 28...
29
mem.free    dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
28
mem.free    dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
30
mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
29
mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
31
dll.load    dd ?
30
dll.load    dd ?
Line 32... Line 31...
32
 
31
 
33
;----------------------------------------------------
-
 
34
;EditBox
32
;----------------------------------------------------
35
include 'editbox.asm' ;editbox
-
 
36
 
-
 
37
;----------------------------------------------------
-
 
38
;CheckBox
33
include 'editbox.asm'     ;editbox
39
include 'checkbox.asm' ;checkbox
-
 
40
 
-
 
41
;--------------------------------------------------
-
 
42
;radiobutton Group
34
include 'checkbox.asm'    ;checkbox
43
include 'optionbox.asm' ;optionbox
-
 
44
 
-
 
45
;--------------------------------------------------
-
 
46
;scrollbar Group
-
 
47
;--------------------------------------------------
-
 
48
align 16
-
 
49
use_scroll_bar
-
 
50
align 16
-
 
51
use_scroll_bar_vertical
-
 
52
align 16
35
include 'optionbox.asm'   ;optionbox
53
use_scroll_bar_horizontal
-
 
54
 
-
 
55
;--------------------------------------------------
-
 
56
;dinamic button Group
-
 
57
;--------------------------------------------------
-
 
58
align 16
36
include 'scrollbar.asm'   ;scrollbar
59
use_dinamic_button
-
 
60
 
-
 
61
;--------------------------------------------------
37
include 'd_button.asm'    ;dinamic_button
62
;menubar Group
-
 
63
;--------------------------------------------------
-
 
64
align 16
-
 
65
use_menu_bar
-
 
66
 
-
 
67
;--------------------------------------------------
38
include 'menubar.asm'     ;menubar
68
;filebrowser Group
-
 
69
;--------------------------------------------------
-
 
70
align 16
-
 
71
use_file_browser
-
 
72
 
-
 
73
;--------------------------------------------------
-
 
74
;tree list
39
include 'filebrowser.asm' ;filebrowser
75
include 'tree_list.asm' ;tree_list, list_box
-
 
76
 
-
 
77
;--------------------------------------------------
-
 
78
;PathShow Group
-
 
79
;--------------------------------------------------
-
 
80
align 16
40
include 'tree_list.asm'   ;tree_list, list_box
81
use_path_show
-
 
82
 
-
 
83
;--------------------------------------------------
-
 
84
;text editor
41
include 'pathshow.asm'    ;pathshow
85
include 't_edit.asm' ;text_editor
-
 
86
 
-
 
87
;--------------------------------------------------
42
include 't_edit.asm'      ;text_editor
88
;Frame Group
-
 
89
;--------------------------------------------------
-
 
90
align 16
-
 
91
use_frame
-
 
92
;--------------------------------------------------
-
 
93
;ProgressBar
-
 
94
;--------------------------------------------------
43
include 'frame.asm'       ;frame
95
use_progressbar
-
 
96
 
-
 
97
;--------------------------------------------------
44
include 'progressbar.asm' ;progressbar
-
 
45
include 'tooltip.asm'     ;tooltip
Line 98... Line 46...
98
include 'tooltip.asm' ;tooltip
46
;--------------------------------------------------
99
 
47
 
100
;input:
48
;input:
101
; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
49
; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
Line 113... Line 61...
113
 
61
 
114
align 4
62
align 4
115
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
63
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
Line 116... Line 64...
116
        col_0:dword, col_1:dword, col_2:dword
64
        col_0:dword, col_1:dword, col_2:dword
117
 
65
 
Line 118... Line 66...
118
	mov esi,dword[col_1]
66
	mov esi,[col_1]
119
	and esi,111111101111111011111110b
67
	and esi,111111101111111011111110b
120
 
68
 
121
	mov eax,SF_DRAW_RECT
69
	mov eax,SF_DRAW_RECT
122
	;bottom line
70
	;bottom line
123
	mov edx,dword[col_2]
71
	mov edx,[col_2]
124
	mov ebx,dword[box_l]
72
	mov ebx,[box_l]
125
	shl ebx,16
73
	shl ebx,16
126
	add ebx,dword[box_w]
74
	add ebx,[box_w]
127
	inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
75
	inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
128
	mov ecx,dword[box_t]
76
	mov ecx,[box_t]
Line 129... Line 77...
129
	add ecx,dword[box_h]
77
	add ecx,[box_h]
130
	shl ecx,16
78
	shl ecx,16
Line 144... Line 92...
144
		int 0x40
92
		int 0x40
145
		dec edi
93
		dec edi
146
	jnz @b
94
	jnz @b
Line 147... Line 95...
147
 
95
 
148
	;right line
96
	;right line
149
	mov edx,dword[col_2]
97
	mov edx,[col_2]
150
	mov ebx,dword[box_l]
98
	mov ebx,[box_l]
151
	add ebx,dword[box_w]
99
	add ebx,[box_w]
152
	shl ebx,16
100
	shl ebx,16
153
	inc ebx
101
	inc ebx
154
	mov ecx,dword[box_t]
102
	mov ecx,[box_t]
155
	shl ecx,16
103
	shl ecx,16
Line 156... Line 104...
156
	add ecx,dword[box_h]
104
	add ecx,[box_h]
157
 
105
 
158
	mov edi,3 ;for cycle
106
	mov edi,3 ;for cycle
159
        @@:
107
	@@:
Line 169... Line 117...
169
		int 0x40
117
		int 0x40
170
		dec edi
118
		dec edi
171
	jnz @b
119
	jnz @b
Line 172... Line 120...
172
 
120
 
173
	;top line
121
	;top line
174
	mov edx,dword[col_0]
122
	mov edx,[col_0]
175
	mov ebx,dword[box_l]
123
	mov ebx,[box_l]
176
	shl ebx,16
124
	shl ebx,16
177
	add ebx,dword[box_w]
125
	add ebx,[box_w]
178
	mov ecx,dword[box_t]
126
	mov ecx,[box_t]
179
	shl ecx,16
127
	shl ecx,16
Line 180... Line 128...
180
	inc ecx
128
	inc ecx
181
 
129
 
Line 193... Line 141...
193
		int 0x40
141
		int 0x40
194
		dec edi
142
		dec edi
195
	jnz @b
143
	jnz @b
Line 196... Line 144...
196
 
144
 
197
	;left line
145
	;left line
198
	mov edx,dword[col_0]
146
	mov edx,[col_0]
199
	mov ebx,dword[box_l]
147
	mov ebx,[box_l]
200
	shl ebx,16
148
	shl ebx,16
201
	inc ebx
149
	inc ebx
202
	mov ecx,dword[box_t]
150
	mov ecx,[box_t]
203
	shl ecx,16
151
	shl ecx,16
Line 204... Line 152...
204
	add ecx,dword[box_h]
152
	add ecx,[box_h]
205
 
153
 
206
	mov edi,3 ;for cycle
154
	mov edi,3 ;for cycle
207
        @@:
155
	@@:
Line 233... Line 181...
233
dd	sz_edit_box_key,		edit_box_key
181
dd	sz_edit_box_key,		edit_box_key
234
dd	sz_edit_box_mouse,		edit_box_mouse
182
dd	sz_edit_box_mouse,		edit_box_mouse
235
dd	sz_edit_box_set_text,		edit_box_set_text
183
dd	sz_edit_box_set_text,		edit_box_set_text
236
dd	szVersion_ed,			0x00000001
184
dd	szVersion_ed,			0x00000001
Line 237... Line 185...
237
 
185
 
238
dd	sz_init_checkbox2,		init_checkbox2
186
dd	sz_init_checkbox,		init_checkbox
239
dd	sz_check_box_draw2,		check_box_draw2
187
dd	sz_check_box_draw,		check_box_draw
240
dd	sz_check_box_mouse2,		check_box_mouse2
188
dd	sz_check_box_mouse,		check_box_mouse
Line 241... Line 189...
241
dd	szVersion_ch2,			0x00000002
189
dd	szVersion_ch2,			0x00000002
242
 
190
 
243
dd	sz_option_box_draw,		option_box_draw
191
dd	sz_option_box_draw,		option_box_draw
Line 347... Line 295...
347
sz_edit_box_key 		db 'edit_box_key',0
295
sz_edit_box_key 		db 'edit_box_key',0
348
sz_edit_box_mouse		db 'edit_box_mouse',0
296
sz_edit_box_mouse		db 'edit_box_mouse',0
349
sz_edit_box_set_text		db 'edit_box_set_text',0
297
sz_edit_box_set_text		db 'edit_box_set_text',0
350
szVersion_ed			db 'version_ed',0
298
szVersion_ed			db 'version_ed',0
Line 351... Line 299...
351
 
299
 
352
sz_init_checkbox2		db 'init_checkbox2',0
300
sz_init_checkbox		db 'init_checkbox2',0
353
sz_check_box_draw2		db 'check_box_draw2',0
301
sz_check_box_draw		db 'check_box_draw2',0
354
sz_check_box_mouse2		db 'check_box_mouse2',0
302
sz_check_box_mouse		db 'check_box_mouse2',0
Line 355... Line 303...
355
szVersion_ch2			db 'version_ch2',0
303
szVersion_ch2			db 'version_ch2',0
356
 
304
 
357
sz_option_box_draw		db 'option_box_draw',0
305
sz_option_box_draw		db 'option_box_draw',0