Rev 6369 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
255 | heavyiron | 1 | ;----------------------------------------------------------- |
2 | ;---load icons in memory and draw icons on panel----------- |
||
3 | ;----------------------------------------------------------- |
||
4 | load_icons: |
||
6328 | IgorA | 5 | stdcall [img_decode], panel_picture, panel_picture.end-panel_picture, 0 |
6 | mov ebx,eax |
||
7 | mov edi,[ScreenPointer] |
||
6342 | IgorA | 8 | add edi,mem_screen |
6328 | IgorA | 9 | stdcall [img_to_rgb2], ebx,edi ;преобразуем изображение к формату rgb |
10 | stdcall [img_destroy], ebx ;удаляем временный буфер с параметрами изображения |
||
6371 | IgorA | 11 | |
12 | stdcall [img_decode], panel_zoom, panel_zoom.end-panel_zoom, 0 |
||
13 | mov ebx,eax |
||
14 | add edi,mem_panel_but |
||
15 | stdcall [img_to_rgb2], ebx,edi |
||
16 | stdcall [img_destroy], ebx |
||
6328 | IgorA | 17 | ret |
255 | heavyiron | 18 | |
19 | draw_icons: |
||
6359 | IgorA | 20 | mov [Icon_X],ci_panel_x_pos+2 |
21 | mov [Icon_Y],ci_panel_y_pos+3 |
||
255 | heavyiron | 22 | |
6371 | IgorA | 23 | ;draw panel picture |
24 | mov edx,[Icon_X] |
||
25 | shl edx,16 |
||
26 | add edx,[Icon_Y] |
||
27 | mov ebx,[ScreenPointer] |
||
28 | add ebx,mem_screen |
||
29 | mov ecx,417*65536+46 |
||
30 | mcall SF_PUT_IMAGE |
||
255 | heavyiron | 31 | |
6371 | IgorA | 32 | ;draw active zoom button |
33 | add ebx,mem_panel_but |
||
34 | xor eax,eax |
||
35 | cmp [k],1 |
||
36 | je .end_calc |
||
37 | inc eax |
||
38 | cmp [k],2 |
||
39 | je @f |
||
40 | inc eax |
||
41 | cmp [k],3 |
||
42 | je @f |
||
43 | inc eax |
||
44 | cmp [k],4 |
||
45 | je @f |
||
46 | inc eax |
||
47 | cmp [k],8 |
||
48 | je @f |
||
49 | inc eax |
||
50 | cmp [k],16 |
||
51 | je @f |
||
52 | inc eax |
||
53 | @@: |
||
54 | mov edx,eax |
||
55 | imul edx,18*21*3 |
||
56 | add ebx,edx |
||
57 | .end_calc: |
||
58 | mov edx,eax |
||
59 | imul edx,18+1 |
||
60 | add edx,ci_panel_zoom_x-1 |
||
61 | shl edx,16 |
||
62 | add edx,ci_panel_but_y2-2 |
||
63 | mov ecx,18*65536+21 |
||
64 | mcall SF_PUT_IMAGE |
||
255 | heavyiron | 65 | |
6371 | IgorA | 66 | ;main buttons of instrumnts |
255 | heavyiron | 67 | |
6371 | IgorA | 68 | and [counter],0 |
69 | mov [Icon_X],ci_panel_x_pos+4 |
||
255 | heavyiron | 70 | |
71 | main_buttons: |
||
72 | |||
73 | mov ebx,[Icon_X] |
||
6359 | IgorA | 74 | mov ecx,ci_panel_but_y1 |
255 | heavyiron | 75 | dec ebx |
76 | dec ecx |
||
77 | shl ebx,16 |
||
78 | shl ecx,16 |
||
2038 | leency | 79 | add ebx,18 |
80 | add ecx,19 |
||
255 | heavyiron | 81 | mov edx,[counter] |
82 | add edx,10 |
||
83 | add edx,1000000000000000000000000000000b |
||
6357 | IgorA | 84 | mcall SF_DEFINE_BUTTON |
255 | heavyiron | 85 | |
86 | |||
87 | add [Icon_X],22 |
||
88 | |||
89 | inc [counter] |
||
90 | cmp [counter],19 |
||
91 | jne main_buttons |
||
92 | |||
93 | |||
94 | ;buttons of brushes(and lines width) |
||
95 | and [counter],0 |
||
96 | |||
6359 | IgorA | 97 | mov [Icon_X],ci_panel_x_pos+4 |
255 | heavyiron | 98 | |
99 | next_button_brush: |
||
100 | |||
101 | mov ebx,[Icon_X] |
||
6359 | IgorA | 102 | mov ecx,ci_panel_but_y2 |
255 | heavyiron | 103 | dec ebx |
104 | dec ecx |
||
105 | shl ebx,16 |
||
106 | shl ecx,16 |
||
2038 | leency | 107 | add ebx,18 |
108 | add ecx,19 |
||
255 | heavyiron | 109 | mov edx,[counter] |
110 | add edx,40 |
||
111 | add edx,1000000000000000000000000000000b |
||
6357 | IgorA | 112 | mcall SF_DEFINE_BUTTON |
255 | heavyiron | 113 | |
114 | add [Icon_X],19 |
||
115 | |||
116 | inc [counter] |
||
117 | cmp [counter],5 |
||
118 | jne next_button_brush |
||
119 | |||
120 | |||
121 | ;buttons of zoom |
||
122 | and [counter],0 |
||
123 | |||
6371 | IgorA | 124 | mov [Icon_X],ci_panel_x_pos+ci_panel_zoom_x |
255 | heavyiron | 125 | |
126 | next_button_zoom: |
||
127 | |||
128 | mov ebx,[Icon_X] |
||
6359 | IgorA | 129 | mov ecx,ci_panel_but_y2 |
255 | heavyiron | 130 | dec ebx |
131 | dec ecx |
||
132 | shl ebx,16 |
||
133 | shl ecx,16 |
||
2038 | leency | 134 | add ebx,18 |
135 | add ecx,19 |
||
255 | heavyiron | 136 | mov edx,[counter] |
137 | add edx,45 |
||
138 | add edx,1000000000000000000000000000000b |
||
6357 | IgorA | 139 | mcall SF_DEFINE_BUTTON |
255 | heavyiron | 140 | |
141 | add [Icon_X],19 |
||
142 | |||
143 | inc [counter] |
||
144 | cmp [counter],6 |
||
145 | jne next_button_zoom |
||
146 | |||
147 | |||
148 | ; button of palette |
||
6359 | IgorA | 149 | mov [Icon_X],ci_panel_x_pos+108 |
255 | heavyiron | 150 | |
151 | mov ebx,[Icon_X] |
||
6359 | IgorA | 152 | mov ecx,ci_panel_but_y2-1 |
255 | heavyiron | 153 | dec ebx |
154 | dec ecx |
||
155 | shl ebx,16 |
||
156 | shl ecx,16 |
||
157 | add ebx,20 |
||
158 | add ecx,21 |
||
159 | mov edx,51 |
||
160 | add edx,1000000000000000000000000000000b |
||
6357 | IgorA | 161 | mcall SF_DEFINE_BUTTON |
255 | heavyiron | 162 | |
163 | ; button of color |
||
6359 | IgorA | 164 | mov [Icon_X],ci_panel_x_pos+131 |
255 | heavyiron | 165 | |
166 | mov ebx,[Icon_X] |
||
6360 | IgorA | 167 | mov ecx,ci_panel_but_y2-1 |
255 | heavyiron | 168 | dec ebx |
169 | dec ecx |
||
170 | shl ebx,16 |
||
171 | shl ecx,16 |
||
172 | add ebx,20 |
||
2038 | leency | 173 | add ecx,20 |
255 | heavyiron | 174 | mov edx,52 |
175 | add edx,1000000000000000000000000000000b |
||
6357 | IgorA | 176 | mcall SF_DEFINE_BUTTON |
255 | heavyiron | 177 | |
6359 | IgorA | 178 | mcall SF_DRAW_RECT, ((ci_panel_x_pos+130) shl 16)+21,\ |
179 | ((ci_panel_y_pos+28) shl 16)+21, [Color] |
||
255 | heavyiron | 180 | |
6359 | IgorA | 181 | ret |