Subversion Repositories Kolibri OS

Rev

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