Subversion Repositories Kolibri OS

Rev

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