Rev 7577 | Rev 7919 | 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 | ;---------------------------------------------------- |
||
6789 | IgorA | 37 | ;CheckBox |
38 | include 'checkbox.asm' ;checkbox |
||
1032 | Lrz | 39 | |
40 | ;-------------------------------------------------- |
||
41 | ;radiobutton Group |
||
7036 | IgorA | 42 | include 'optionbox.asm' ;optionbox |
1032 | Lrz | 43 | |
1037 | mario79 | 44 | ;-------------------------------------------------- |
45 | ;scrollbar Group |
||
46 | ;-------------------------------------------------- |
||
1214 | Lrz | 47 | align 16 |
1037 | mario79 | 48 | use_scroll_bar |
1214 | Lrz | 49 | align 16 |
1037 | mario79 | 50 | use_scroll_bar_vertical |
1214 | Lrz | 51 | align 16 |
1037 | mario79 | 52 | use_scroll_bar_horizontal |
53 | |||
54 | ;-------------------------------------------------- |
||
55 | ;dinamic button Group |
||
56 | ;-------------------------------------------------- |
||
1214 | Lrz | 57 | align 16 |
1037 | mario79 | 58 | use_dinamic_button |
59 | |||
60 | ;-------------------------------------------------- |
||
61 | ;menubar Group |
||
62 | ;-------------------------------------------------- |
||
1214 | Lrz | 63 | align 16 |
1037 | mario79 | 64 | use_menu_bar |
65 | |||
66 | ;-------------------------------------------------- |
||
1199 | mario79 | 67 | ;filebrowser Group |
68 | ;-------------------------------------------------- |
||
1214 | Lrz | 69 | align 16 |
1199 | mario79 | 70 | use_file_browser |
1285 | IgorA | 71 | |
1199 | mario79 | 72 | ;-------------------------------------------------- |
1285 | IgorA | 73 | ;tree list |
7036 | IgorA | 74 | include 'tree_list.asm' ;tree_list, list_box |
1060 | hidnplayr | 75 | |
1433 | mario79 | 76 | ;-------------------------------------------------- |
77 | ;PathShow Group |
||
78 | ;-------------------------------------------------- |
||
79 | align 16 |
||
80 | use_path_show |
||
1060 | hidnplayr | 81 | |
1457 | IgorA | 82 | ;-------------------------------------------------- |
83 | ;text editor |
||
7036 | IgorA | 84 | include 't_edit.asm' ;text_editor |
85 | |||
1457 | IgorA | 86 | ;-------------------------------------------------- |
3470 | mario79 | 87 | ;Frame Group |
88 | ;-------------------------------------------------- |
||
89 | align 16 |
||
90 | use_frame |
||
3478 | 0CodErr | 91 | ;-------------------------------------------------- |
92 | ;ProgressBar |
||
93 | ;-------------------------------------------------- |
||
94 | use_progressbar |
||
1457 | IgorA | 95 | |
6689 | siemargl | 96 | ;-------------------------------------------------- |
97 | include 'tooltip.asm' ;tooltip |
||
98 | |||
1489 | IgorA | 99 | ;input: |
100 | ; eax = указатель на функцию выделения памяти |
||
101 | ; ebx = ... освобождения памяти |
||
102 | ; ecx = ... перераспределения памяти |
||
103 | ; edx = ... загрузки библиотеки (пока не используется) |
||
1457 | IgorA | 104 | align 16 |
1489 | IgorA | 105 | lib_init: |
106 | mov [mem.alloc], eax |
||
107 | mov [mem.free], ebx |
||
108 | mov [mem.realloc], ecx |
||
109 | mov [dll.load], edx |
||
1285 | IgorA | 110 | ret |
1068 | Lrz | 111 | |
1277 | IgorA | 112 | |
2317 | IgorA | 113 | align 4 |
114 | proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\ |
||
115 | col_0:dword, col_1:dword, col_2:dword |
||
116 | |||
117 | mov esi,dword[col_1] |
||
118 | and esi,111111101111111011111110b |
||
119 | |||
7036 | IgorA | 120 | mov eax,SF_DRAW_RECT |
2317 | IgorA | 121 | ;bottom line |
122 | mov edx,dword[col_2] |
||
123 | mov ebx,dword[box_l] |
||
124 | shl ebx,16 |
||
125 | add ebx,dword[box_w] |
||
126 | inc ebx ;для заливки диагональных пикселей |
||
127 | mov ecx,dword[box_t] |
||
128 | add ecx,dword[box_h] |
||
129 | shl ecx,16 |
||
130 | inc ecx |
||
131 | |||
132 | mov edi,3 ;for cycle |
||
133 | @@: |
||
134 | ;calculate colors |
||
135 | and edx,111111101111111011111110b |
||
136 | add edx,esi |
||
137 | shr edx,1 |
||
138 | ;line move up and ->...<- |
||
139 | sub ecx,1 shl 16 ;move up |
||
140 | add ebx,1 shl 16 ;->... |
||
141 | sub ebx,2 ;...<- |
||
142 | ;draw line |
||
143 | int 0x40 |
||
144 | dec edi |
||
145 | jnz @b |
||
146 | |||
147 | ;right line |
||
148 | mov edx,dword[col_2] |
||
149 | mov ebx,dword[box_l] |
||
150 | add ebx,dword[box_w] |
||
151 | shl ebx,16 |
||
152 | inc ebx |
||
153 | mov ecx,dword[box_t] |
||
154 | shl ecx,16 |
||
155 | add ecx,dword[box_h] |
||
156 | |||
157 | mov edi,3 ;for cycle |
||
158 | @@: |
||
159 | ;calculate colors |
||
160 | and edx,111111101111111011111110b |
||
161 | add edx,esi |
||
162 | shr edx,1 |
||
163 | ;line move left and ... |
||
164 | sub ebx,1 shl 16 ;move left |
||
165 | add ecx,1 shl 16 |
||
166 | sub ecx,2 |
||
167 | ;draw line |
||
168 | int 0x40 |
||
169 | dec edi |
||
170 | jnz @b |
||
171 | |||
172 | ;top line |
||
173 | mov edx,dword[col_0] |
||
174 | mov ebx,dword[box_l] |
||
175 | shl ebx,16 |
||
176 | add ebx,dword[box_w] |
||
177 | mov ecx,dword[box_t] |
||
178 | shl ecx,16 |
||
179 | inc ecx |
||
180 | |||
181 | mov edi,3 ;for cycle |
||
182 | @@: |
||
183 | ;calculate colors |
||
184 | and edx,111111101111111011111110b |
||
185 | add edx,esi |
||
186 | shr edx,1 |
||
187 | ;line move down and ->...<- |
||
188 | add ecx,1 shl 16 ;move down |
||
189 | add ebx,1 shl 16 ;->... |
||
190 | sub ebx,2 ;...<- |
||
191 | ;draw line |
||
192 | int 0x40 |
||
193 | dec edi |
||
194 | jnz @b |
||
195 | |||
196 | ;left line |
||
197 | mov edx,dword[col_0] |
||
198 | mov ebx,dword[box_l] |
||
199 | shl ebx,16 |
||
200 | inc ebx |
||
201 | mov ecx,dword[box_t] |
||
202 | shl ecx,16 |
||
203 | add ecx,dword[box_h] |
||
204 | |||
205 | mov edi,3 ;for cycle |
||
206 | @@: |
||
207 | ;calculate colors |
||
208 | and edx,111111101111111011111110b |
||
209 | add edx,esi |
||
210 | shr edx,1 |
||
211 | ;line move left and ... |
||
212 | add ebx,1 shl 16 ;move left |
||
213 | add ecx,1 shl 16 |
||
214 | sub ecx,2 |
||
215 | ;draw line |
||
216 | int 0x40 |
||
217 | dec edi |
||
218 | jnz @b |
||