Subversion Repositories Kolibri OS

Rev

Rev 2102 | Rev 3178 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1199 mario79 1
;*****************************************************************************
2
; Box_Lib - library of graphical components
3
;
4
; Authors:
5
; Alexey Teplov aka 
6
; Marat Zakiyanov aka Mario79, aka Mario
7
; Evtikhov Maxim aka Maxxxx32
8
; Eugene Grechnikov aka Diamond
9
; hidnplayr
1277 IgorA 10
; Igor Afanasiev aka IgorA
1199 mario79 11
;*****************************************************************************
1032 Lrz 12
 
13
format MS COFF
14
 
15
public EXPORTS
16
 
17
section '.flat' code readable align 16
1101 Lrz 18
include '../../../../macros.inc'
1457 IgorA 19
include '../../../../proc32.inc'
1432 mario79 20
include 'bl_sys.mac'
1372 IgorA 21
include 'box_lib.mac' ;macro which should make life easier :)
22
 
1464 IgorA 23
;-----------------------------------------------------------------------------
1489 IgorA 24
mem.alloc   dd ? ;функция для выделения памяти
25
mem.free    dd ? ;функция для освобождения памяти
26
mem.realloc dd ? ;функция для перераспределения памяти
27
dll.load    dd ?
1464 IgorA 28
 
1032 Lrz 29
;----------------------------------------------------
30
;EditBox
31
;----------------------------------------------------
1214 Lrz 32
align 16
1277 IgorA 33
use_editbox_draw	;macro reveals the function of the display.
1214 Lrz 34
align 16
1277 IgorA 35
use_editbox_key 	;macro reveals processing function of the keypad.
1214 Lrz 36
align 16
1277 IgorA 37
use_editbox_mouse	;macro reveals processing function of the mouse.
1032 Lrz 38
 
39
;----------------------------------------------------
1682 lrz 40
;CheckBox old version
1032 Lrz 41
;----------------------------------------------------
1214 Lrz 42
align 16
1277 IgorA 43
use_checkbox_draw	;macro reveals the function of the display.
1214 Lrz 44
align 16
1277 IgorA 45
use_checkbox_mouse	;macro reveals processing function of the mouse.
1032 Lrz 46
 
1682 lrz 47
;----------------------------------------------------
48
;CheckBox2
49
;----------------------------------------------------
50
align 16
2102 IgorA 51
_init_checkbox2 	;macro for init checkbox
1682 lrz 52
align 16
53
use_checkbox_draw2	;macro reveals the function of the display.
54
align 16
55
use_checkbox_mouse2	;macro reveals processing function of the mouse.
1032 Lrz 56
 
57
;--------------------------------------------------
58
;radiobutton Group
59
;--------------------------------------------------
1214 Lrz 60
align 16
1277 IgorA 61
use_optionbox_driver	;macro that control the operating modes
1214 Lrz 62
align 16
1277 IgorA 63
use_optionbox_draw	;macro reveals the function of the display.
1214 Lrz 64
align 16
1277 IgorA 65
use_optionbox_mouse	;macro reveals processing function of the mouse.
1032 Lrz 66
 
1037 mario79 67
;--------------------------------------------------
68
;scrollbar Group
69
;--------------------------------------------------
1214 Lrz 70
align 16
1037 mario79 71
use_scroll_bar
1214 Lrz 72
align 16
1037 mario79 73
use_scroll_bar_vertical
1214 Lrz 74
align 16
1037 mario79 75
use_scroll_bar_horizontal
76
 
77
;--------------------------------------------------
78
;dinamic button Group
79
;--------------------------------------------------
1214 Lrz 80
align 16
1037 mario79 81
use_dinamic_button
82
 
83
;--------------------------------------------------
84
;menubar Group
85
;--------------------------------------------------
1214 Lrz 86
align 16
1037 mario79 87
use_menu_bar
88
 
89
;--------------------------------------------------
1199 mario79 90
;filebrowser Group
91
;--------------------------------------------------
1214 Lrz 92
align 16
1199 mario79 93
use_file_browser
1285 IgorA 94
 
1199 mario79 95
;--------------------------------------------------
1285 IgorA 96
;tree list
97
;--------------------------------------------------
98
align 16
99
use_tree_list
1060 hidnplayr 100
 
1433 mario79 101
;--------------------------------------------------
102
;PathShow Group
103
;--------------------------------------------------
104
align 16
105
use_path_show
1060 hidnplayr 106
 
1457 IgorA 107
;--------------------------------------------------
108
;text editor
109
;--------------------------------------------------
1433 mario79 110
align 16
1457 IgorA 111
use_text_edit
112
 
1489 IgorA 113
;input:
114
; eax = указатель на функцию выделения памяти
115
; ebx = ... освобождения памяти
116
; ecx = ... перераспределения памяти
117
; edx = ... загрузки библиотеки (пока не используется)
1457 IgorA 118
align 16
1489 IgorA 119
lib_init:
120
	mov	[mem.alloc], eax
121
	mov	[mem.free], ebx
122
	mov	[mem.realloc], ecx
123
	mov	[dll.load], edx
1285 IgorA 124
ret
1068 Lrz 125
 
1277 IgorA 126
 
2317 IgorA 127
align 4
128
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
129
	col_0:dword, col_1:dword, col_2:dword
130
 
131
	mov esi,dword[col_1]
132
	and esi,111111101111111011111110b
133
 
134
	mov eax,13
135
	;bottom line
136
	mov edx,dword[col_2]
137
	mov ebx,dword[box_l]
138
	shl ebx,16
139
	add ebx,dword[box_w]
140
	inc ebx ;для заливки диагональных пикселей
141
	mov ecx,dword[box_t]
142
	add ecx,dword[box_h]
143
	shl ecx,16
144
	inc ecx
145
 
146
	mov edi,3 ;for cycle
147
	@@:
148
		;calculate colors
149
		and edx,111111101111111011111110b
150
		add edx,esi
151
		shr edx,1
152
		;line move up and ->...<-
153
		sub ecx,1 shl 16 ;move up
154
		add ebx,1 shl 16 ;->...
155
		sub ebx,2 ;...<-
156
		;draw line
157
		int 0x40
158
		dec edi
159
	jnz @b
160
 
161
	;right line
162
	mov edx,dword[col_2]
163
	mov ebx,dword[box_l]
164
	add ebx,dword[box_w]
165
	shl ebx,16
166
	inc ebx
167
	mov ecx,dword[box_t]
168
	shl ecx,16
169
	add ecx,dword[box_h]
170
 
171
	mov edi,3 ;for cycle
172
	@@:
173
		;calculate colors
174
		and edx,111111101111111011111110b
175
		add edx,esi
176
		shr edx,1
177
		;line move left and ...
178
		sub ebx,1 shl 16 ;move left
179
		add ecx,1 shl 16
180
		sub ecx,2
181
		;draw line
182
		int 0x40
183
		dec edi
184
	jnz @b
185
 
186
	;top line
187
	mov edx,dword[col_0]
188
	mov ebx,dword[box_l]
189
	shl ebx,16
190
	add ebx,dword[box_w]
191
	mov ecx,dword[box_t]
192
	shl ecx,16
193
	inc ecx
194
 
195
	mov edi,3 ;for cycle
196
	@@:
197
		;calculate colors
198
		and edx,111111101111111011111110b
199
		add edx,esi
200
		shr edx,1
201
		;line move down and ->...<-
202
		add ecx,1 shl 16 ;move down
203
		add ebx,1 shl 16 ;->...
204
		sub ebx,2 ;...<-
205
		;draw line
206
		int 0x40
207
		dec edi
208
	jnz @b
209
 
210
	;left line
211
	mov edx,dword[col_0]
212
	mov ebx,dword[box_l]
213
	shl ebx,16
214
	inc ebx
215
	mov ecx,dword[box_t]
216
	shl ecx,16
217
	add ecx,dword[box_h]
218
 
219
	mov edi,3 ;for cycle
220
	@@:
221
		;calculate colors
222
		and edx,111111101111111011111110b
223
		add edx,esi
224
		shr edx,1
225
		;line move left and ...
226
		add ebx,1 shl 16 ;move left
227
		add ecx,1 shl 16
228
		sub ecx,2
229
		;draw line
230
		int 0x40
231
		dec edi
232
	jnz @b
233
 
234
	ret
235
endp
236
 
237
 
1032 Lrz 238
align 16
239
EXPORTS:
240
 
241
 
1489 IgorA 242
dd	sz_init,			lib_init
1433 mario79 243
dd	sz_version,			0x00000001
1060 hidnplayr 244
 
1433 mario79 245
dd	sz_edit_box,			edit_box
246
dd	sz_edit_box_key,		edit_box_key
247
dd	sz_edit_box_mouse,		edit_box_mouse
1619 IgorA 248
dd	sz_edit_box_set_text,		edit_box_set_text
1433 mario79 249
dd	szVersion_ed,			0x00000001
1060 hidnplayr 250
 
1433 mario79 251
dd	sz_check_box_draw,		check_box_draw
252
dd	sz_check_box_mouse,		check_box_mouse
253
dd	szVersion_ch,			0x00000001
1068 Lrz 254
 
1682 lrz 255
dd	sz_init_checkbox2,		init_checkbox2
256
dd	sz_check_box_draw2,		check_box_draw2
257
dd	sz_check_box_mouse2,		check_box_mouse2
258
dd	szVersion_ch2,			0x00000002
259
 
260
 
1433 mario79 261
dd	sz_option_box_draw,		option_box_draw
262
dd	sz_option_box_mouse,		option_box_mouse
263
dd	szVersion_op,			0x00000001
1068 Lrz 264
 
1433 mario79 265
dd	sz_Scrollbar_ver_draw,		scroll_bar_vertical.draw
266
dd	sz_Scrollbar_ver_mouse, 	scroll_bar_vertical.mouse
267
dd	sz_Scrollbar_hor_draw,		scroll_bar_horizontal.draw
268
dd	sz_Scrollbar_hor_mouse, 	scroll_bar_horizontal.mouse
269
dd	szVersion_scrollbar,		0x00010001
1068 Lrz 270
 
1433 mario79 271
dd	sz_Dbutton_draw,		dinamic_button.draw
272
dd	sz_Dbutton_mouse,		dinamic_button.mouse
273
dd	szVersion_dbutton,		0x00010001
1068 Lrz 274
 
1433 mario79 275
dd	sz_Menu_bar_draw,		menu_bar.draw
276
dd	sz_Menu_bar_mouse,		menu_bar.mouse
277
dd	sz_Menu_bar_activate,		menu_bar.activate
278
dd	szVersion_menu_bar,		0x00010002
1199 mario79 279
 
1433 mario79 280
dd	sz_FileBrowser_draw,		fb_draw_panel
281
dd	sz_FileBrowser_mouse,		fb_mouse
282
dd	sz_FileBrowser_key,		fb_key
283
dd	szVersion_FileBrowser,		0x00010001
1068 Lrz 284
 
1433 mario79 285
dd	sz_tl_data_init,		tl_data_init
286
dd	sz_tl_data_clear,		tl_data_clear
287
dd	sz_tl_info_clear,		tl_info_clear
288
dd	sz_tl_key,			tl_key
289
dd	sz_tl_mouse,			tl_mouse
290
dd	sz_tl_draw,			tl_draw
291
dd	sz_tl_info_undo,		tl_info_undo
292
dd	sz_tl_info_redo,		tl_info_redo
1457 IgorA 293
dd	sz_tl_node_add, 		tl_node_add
1433 mario79 294
dd	sz_tl_node_set_data,		tl_node_set_data
295
dd	sz_tl_node_get_data,		tl_node_get_data
296
dd	sz_tl_node_delete,		tl_node_delete
297
dd	sz_tl_cur_beg,			tl_cur_beg
1457 IgorA 298
dd	sz_tl_cur_next, 		tl_cur_next
299
dd	sz_tl_cur_perv, 		tl_cur_perv
1433 mario79 300
dd	sz_tl_node_close_open,		tl_node_close_open
301
dd	sz_tl_node_lev_inc,		tl_node_lev_inc
302
dd	sz_tl_node_lev_dec,		tl_node_lev_dec
303
dd	sz_tl_node_move_up,		tl_node_move_up
304
dd	sz_tl_node_move_down,		tl_node_move_down
305
dd	sz_tl_node_poi_get_info,	tl_node_poi_get_info
306
dd	sz_tl_node_poi_get_next_info,	tl_node_poi_get_next_info
307
dd	sz_tl_node_poi_get_data,	tl_node_poi_get_data
1457 IgorA 308
dd	sz_tl_save_mem, 		tl_save_mem
309
dd	sz_tl_load_mem, 		tl_load_mem
1433 mario79 310
dd	sz_tl_get_mem_size,		tl_get_mem_size
311
dd	sz_tl_version_tree_list,	0x00000001
1068 Lrz 312
 
1433 mario79 313
dd	sz_PathShow_prepare,		path_show.prepare
314
dd	sz_PathShow_draw,		path_show.draw
315
dd	szVersion_path_show,		0x00010001
1457 IgorA 316
 
317
dd	sz_ted_but_save_file,		ted_but_save_file
318
dd	sz_ted_but_sumb_upper,		ted_but_sumb_upper
319
dd	sz_ted_but_sumb_lover,		ted_but_sumb_lover
320
dd	sz_ted_can_save,		ted_can_save
321
dd	sz_ted_clear,			ted_clear
322
dd	sz_ted_delete,			ted_delete
323
dd	sz_ted_draw,			ted_draw
324
dd	sz_ted_init,			ted_init
1458 IgorA 325
dd	sz_ted_init_scroll_bars,	ted_init_scroll_bars
1457 IgorA 326
dd	sz_ted_init_syntax_file,	ted_init_syntax_file
327
dd	sz_ted_is_select,		ted_is_select
328
dd	sz_ted_key,			ted_key
329
dd	sz_ted_mouse,			ted_mouse
330
dd	sz_ted_open_file,		ted_open_file
331
dd	sz_ted_text_add,		ted_text_add
332
dd	sz_ted_but_select_word, 	ted_but_select_word
333
dd	sz_ted_but_cut, 		ted_but_cut
334
dd	sz_ted_but_copy,		ted_but_copy
335
dd	sz_ted_but_paste,		ted_but_paste
336
dd	sz_ted_but_undo,		ted_but_undo
337
dd	sz_ted_but_redo,		ted_but_redo
338
dd	sz_ted_but_reverse,		ted_but_reverse
339
dd	sz_ted_but_find_next,		ted_but_find_next
340
dd	sz_ted_text_colored,		ted_text_colored
2102 IgorA 341
dd	sz_ted_version, 		0x00000003
1457 IgorA 342
 
1433 mario79 343
dd	0,0
1068 Lrz 344
 
1277 IgorA 345
 
1457 IgorA 346
sz_init 			db 'lib_init',0
1433 mario79 347
sz_version			db 'version',0
1277 IgorA 348
 
1433 mario79 349
sz_edit_box			db 'edit_box',0
1457 IgorA 350
sz_edit_box_key 		db 'edit_box_key',0
1433 mario79 351
sz_edit_box_mouse		db 'edit_box_mouse',0
1619 IgorA 352
sz_edit_box_set_text		db 'edit_box_set_text',0
1433 mario79 353
szVersion_ed			db 'version_ed',0
1068 Lrz 354
 
1433 mario79 355
sz_check_box_draw		db 'check_box_draw',0
356
sz_check_box_mouse		db 'check_box_mouse',0
357
szVersion_ch			db 'version_ch',0
1068 Lrz 358
 
1682 lrz 359
sz_init_checkbox2		db 'init_checkbox2',0
360
sz_check_box_draw2		db 'check_box_draw2',0
361
sz_check_box_mouse2		db 'check_box_mouse2',0
362
szVersion_ch2			db 'version_ch2',0
363
 
1433 mario79 364
sz_option_box_draw		db 'option_box_draw',0
365
sz_option_box_mouse		db 'option_box_mouse',0
366
szVersion_op			db 'version_op',0
1032 Lrz 367
 
1433 mario79 368
sz_Scrollbar_ver_draw		db 'scrollbar_v_draw',0
369
sz_Scrollbar_ver_mouse		db 'scrollbar_v_mouse',0
370
sz_Scrollbar_hor_draw		db 'scrollbar_h_draw',0
371
sz_Scrollbar_hor_mouse		db 'scrollbar_h_mouse',0
372
szVersion_scrollbar		db 'version_scrollbar',0
1068 Lrz 373
 
1277 IgorA 374
sz_Dbutton_draw 		db 'dbutton_draw',0
375
sz_Dbutton_mouse		db 'dbutton_mouse',0
376
szVersion_dbutton		db 'version_dbutton',0
1068 Lrz 377
 
1277 IgorA 378
sz_Menu_bar_draw		db 'menu_bar_draw',0
379
sz_Menu_bar_mouse		db 'menu_bar_mouse',0
1457 IgorA 380
sz_Menu_bar_activate		db 'menu_bar_activate',0
1277 IgorA 381
szVersion_menu_bar		db 'version_menu_bar',0
1068 Lrz 382
 
1277 IgorA 383
sz_FileBrowser_draw		db 'FileBrowser_draw',0
384
sz_FileBrowser_mouse		db 'FileBrowser_mouse',0
385
sz_FileBrowser_key		db 'FileBrowser_key',0
386
szVersion_FileBrowser		db 'version_FileBrowser',0
387
 
1457 IgorA 388
sz_tl_data_init 		db 'tl_data_init',0
1433 mario79 389
sz_tl_data_clear		db 'tl_data_clear',0
390
sz_tl_info_clear		db 'tl_info_clear',0
391
sz_tl_key			db 'tl_key',0
392
sz_tl_mouse			db 'tl_mouse',0
393
sz_tl_draw			db 'tl_draw',0
1457 IgorA 394
sz_tl_info_undo 		db 'tl_info_undo',0
395
sz_tl_info_redo 		db 'tl_info_redo',0
1433 mario79 396
sz_tl_node_add			db 'tl_node_add',0
397
sz_tl_node_set_data		db 'tl_node_set_data',0
398
sz_tl_node_get_data		db 'tl_node_get_data',0
399
sz_tl_node_delete		db 'tl_node_delete',0
400
sz_tl_cur_beg			db 'tl_cur_beg',0
401
sz_tl_cur_next			db 'tl_cur_next',0
402
sz_tl_cur_perv			db 'tl_cur_perv',0
403
sz_tl_node_close_open		db 'tl_node_close_open',0
404
sz_tl_node_lev_inc		db 'tl_node_lev_inc',0
405
sz_tl_node_lev_dec		db 'tl_node_lev_dec',0
406
sz_tl_node_move_up		db 'tl_node_move_up',0
407
sz_tl_node_move_down		db 'tl_node_move_down',0
1457 IgorA 408
sz_tl_node_poi_get_info 	db 'tl_node_poi_get_info',0
1433 mario79 409
sz_tl_node_poi_get_next_info	db 'tl_node_poi_get_next_info',0
1457 IgorA 410
sz_tl_node_poi_get_data 	db 'tl_node_poi_get_data',0
1433 mario79 411
sz_tl_save_mem			db 'tl_save_mem',0
412
sz_tl_load_mem			db 'tl_load_mem',0
413
sz_tl_get_mem_size		db 'tl_get_mem_size',0
1457 IgorA 414
sz_tl_version_tree_list 	db 'version_tree_list',0
1433 mario79 415
 
416
sz_PathShow_prepare		db 'PathShow_prepare',0
417
sz_PathShow_draw		db 'PathShow_draw',0
418
szVersion_path_show		db 'version_PathShow',0
1457 IgorA 419
 
420
sz_ted_but_save_file		db 'ted_but_save_file',0
421
sz_ted_but_sumb_upper		db 'ted_but_sumb_upper',0
422
sz_ted_but_sumb_lover		db 'ted_but_sumb_lover',0
423
sz_ted_can_save 		db 'ted_can_save',0
424
sz_ted_clear			db 'ted_clear',0
425
sz_ted_delete			db 'ted_delete',0
426
sz_ted_draw			db 'ted_draw',0
427
sz_ted_init			db 'ted_init',0
1458 IgorA 428
sz_ted_init_scroll_bars 	db 'ted_init_scroll_bars',0
1457 IgorA 429
sz_ted_init_syntax_file 	db 'ted_init_syntax_file',0
430
sz_ted_is_select		db 'ted_is_select',0
431
sz_ted_key			db 'ted_key',0
432
sz_ted_mouse			db 'ted_mouse',0
433
sz_ted_open_file		db 'ted_open_file',0
434
sz_ted_text_add 		db 'ted_text_add',0
435
sz_ted_but_select_word		db 'ted_but_select_word',0
436
sz_ted_but_cut			db 'ted_but_cut',0
437
sz_ted_but_copy 		db 'ted_but_copy',0
438
sz_ted_but_paste		db 'ted_but_paste',0
439
sz_ted_but_undo 		db 'ted_but_undo',0
440
sz_ted_but_redo 		db 'ted_but_redo',0
441
sz_ted_but_reverse		db 'ted_but_reverse',0
442
sz_ted_but_find_next		db 'ted_but_find_next',0
443
sz_ted_text_colored		db 'ted_text_colored',0
444
sz_ted_version			db 'version_text_edit',0