Subversion Repositories Kolibri OS

Rev

Rev 9039 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9039 Rev 9059
Line 143... Line 143...
143
align 4
143
align 4
144
.mouse:
144
.mouse:
145
        mov     eax,SF_MOUSE_GET
145
        mov     eax,SF_MOUSE_GET
146
        mov     ebx,SSF_BUTTON_EXT
146
        mov     ebx,SSF_BUTTON_EXT
147
        int     0x40
147
        int     0x40
-
 
148
        mov     byte[mousestate], 1
148
        bt      eax,8 ;left but. down
149
        bt      eax,8 ;left but. down
149
        jnc     .event
150
        jc      @f
-
 
151
        mov     byte[mousestate], 0
150
 
152
@@:
151
        mov     eax,SF_MOUSE_GET
153
        mov     eax,SF_MOUSE_GET
152
        mov     ebx,SSF_WINDOW_POSITION
154
        mov     ebx,SSF_WINDOW_POSITION
153
        int     0x40
155
        int     0x40
154
        cmp     ax, word[skinh]
156
        cmp     ax, word[skinh]
155
        jl      .event
157
        jl      .event
Line 167... Line 169...
167
        div     bx
169
        div     bx
168
        movzx   eax,ax
170
        movzx   eax,ax
169
        pop     edx
171
        pop     edx
Line 170... Line 172...
170
 
172
 
171
        mov     ebx, [esp+24h+8] ;DLGTEMPLATE* dlg
-
 
172
        cmp     dword[ebx+dlgtemplate.size], 0
-
 
173
        jne     .event ;¥á«¨ ¤¨ «®£®¢®¥ ®ª­® ­¥ áâ ­¤ àâ­®¥ (ᯨ᮪ §­ ç¥­¨©)
173
        mov     ebx, [esp+24h+8] ;DLGTEMPLATE* dlg
174
        cmp     edx, [ebx+dlgtemplate.y]
174
        cmp     edx, [ebx+dlgtemplate.y]
175
        jl      .event
175
        jl      .event
176
        cmp     eax, [ebx+dlgtemplate.x]
176
        cmp     eax, [ebx+dlgtemplate.x]
177
        jl      .event
177
        jl      .event
178
        sub     edx, [ebx+dlgtemplate.y]
178
        sub     edx, [ebx+dlgtemplate.y]
179
        sub     eax, [ebx+dlgtemplate.x]
179
        sub     eax, [ebx+dlgtemplate.x]
180
        cmp     edx, [ebx+dlgtemplate.height]
180
        cmp     edx, [ebx+dlgtemplate.height]
181
        jge     .event
181
        jge     .event
182
        cmp     eax, [ebx+dlgtemplate.width]
182
        cmp     eax, [ebx+dlgtemplate.width]
-
 
183
        jge     .event
-
 
184
        cmp     dword[ebx+dlgtemplate.size], 0
-
 
185
        je      .m_menu_end
-
 
186
        ;¥á«¨ ¤¨ «®£®¢®¥ ®ª­® ­¥ áâ ­¤ àâ­®¥ (ᯨ᮪ §­ ç¥­¨©)
-
 
187
        cmp     edx, [ebx+44]
-
 
188
        jl      @f
-
 
189
        mov     edx, [ebx+44]
183
        jge     .event
190
        dec     edx
-
 
191
@@:
-
 
192
        mov     ecx, [ebx+48]
-
 
193
        mov     ecx, [ecx]    ;¡¥à¥¬ 㪠§ â¥«ì ­  listitem[1]
-
 
194
        sub     ecx, [ebx+48] ;ecx - à §¬¥à ®¤­®£® listitem
-
 
195
        mov     [ebx+56], edx
-
 
196
        imul    edx, ecx
-
 
197
        add     edx, [ebx+48]
-
 
198
        mov     [ebx+40], edx
-
 
199
        cmp     byte[mousestate], 1
-
 
200
        jne     @f
-
 
201
        mov     [esp+28], edx ;save to eax
-
 
202
        jmp     .exit
-
 
203
@@:
-
 
204
        call    MenuDlgProc.dodraw
-
 
205
        call    draw_image
-
 
206
        jmp     .event
-
 
207
.m_menu_end:
-
 
208
        cmp     byte[mousestate], 1
184
 
209
        jne     .event
185
        add     ebx, dlgtemplate.size+12
210
        add     ebx, dlgtemplate.size+12
186
        mov     ecx, [ebx-4]
211
        mov     ecx, [ebx-4]
187
        or      ecx, ecx
212
        or      ecx, ecx
Line 191... Line 216...
191
.m_loop:
216
.m_loop:
192
        cmp     [ebx+dlgitemtemplate.type], 2 ;button
217
        cmp     [ebx+dlgitemtemplate.type], 2 ;button
193
        je      .m_comp
218
        je      .m_comp
194
        cmp     [ebx+dlgitemtemplate.type], 3 ;edit
219
        cmp     [ebx+dlgitemtemplate.type], 3 ;edit
195
        je      .m_comp
220
        je      .m_comp
196
        ;cmp     [ebx+dlgitemtemplate.type], 5 ;check
221
        cmp     [ebx+dlgitemtemplate.type], 5 ;check
197
        ;je      .m_comp
222
        je      .m_comp
198
        jmp     .m_next
223
        jmp     .m_next
199
align 4
224
align 4
200
.m_comp:
225
.m_comp:
201
        cmp     [ebx+dlgitemtemplate.x1], eax
226
        cmp     [ebx+dlgitemtemplate.x1], eax
202
        jg      .m_next
227
        jg      .m_next
Line 211... Line 236...
211
        jne      @f
236
        jne      @f
212
        mov     [esp+28+8], ebx ;save to eax
237
        mov     [esp+28+8], ebx ;save to eax
213
        pop     ecx ebx
238
        pop     ecx ebx
214
        jmp     .exit
239
        jmp     .exit
215
@@:
240
@@:
-
 
241
        cmp     [ebx+dlgitemtemplate.type], 5 ;check
-
 
242
        jne     @f
-
 
243
        xor     [ebx+dlgitemtemplate.flags], 10h
-
 
244
        mov     eax, ebx
-
 
245
        jmp     .m_new_focus
-
 
246
@@:
216
        mov     eax, [ebx+dlgitemtemplate.flags]
247
        mov     eax, [ebx+dlgitemtemplate.flags]
217
        and     eax, 4
248
        and     eax, 4
218
        jnz     .m_old_focus
249
        jnz     .m_old_focus
219
        mov     eax, ebx
250
        mov     eax, ebx
220
        jmp     .m_new_focus
251
        jmp     .m_new_focus
Line 742... Line 773...
742
;       void* variants, const char* title, unsigned flags);
773
;       void* variants, const char* title, unsigned flags);
743
menu_centered_in:
774
menu_centered_in:
744
        pushad
775
        pushad
745
        mov     ecx, 60
776
        mov     ecx, 60
746
; 40 bytes for dlgtemplate + additional:
777
; 40 bytes for dlgtemplate + additional:
747
; +40: dd cur_variant   - [???]
778
; +40: dd cur_variant   - 㪠§ â¥«ì ­  ¬ áᨢ listitem[num_variants]
748
; +44: dd num_variants  - ᪮«ìª® í«¥¬¥­â®¢ ¢« §¨â ¢ ®ª­®
779
; +44: dd num_variants  - ᪮«ìª® í«¥¬¥­â®¢ ¢ ᯨ᪥
749
; +48: dd begin_variant - [dd ..,..,???]
780
; +48: dd begin_variant - 㪠§ â¥«ì ­  listitem[0]
750
; +52: dd end_variant   - [dd ..,..,???]
781
; +52: dd end_variant   - 㪠§ â¥«ì ­  listitem[num_variants-1]
751
; +56: dd cur_variant_idx - ???
782
; +56: dd cur_variant_idx - ¨­¤¥ªá ¢ë¡à ­­®£® í«¥¬¥­â  ®â 0 ¤® num_variants-1
752
        call    xpgalloc
783
        call    xpgalloc
753
        test    eax, eax
784
        test    eax, eax
754
        jnz     @f
785
        jnz     @f
755
.ret_bad:
786
.ret_bad:
756
        popad
787
        popad
Line 1356... Line 1387...
1356
        mov     eax, [esp+8]
1387
        mov     eax, [esp+8]
1357
        dec     eax
1388
        dec     eax
1358
        jz      .draw
1389
        jz      .draw
1359
        dec     eax
1390
        dec     eax
1360
        jz      .key
1391
        jz      .key
-
 
1392
        ;sub     eax, 4
-
 
1393
        ;jz      .mouse
1361
        xor     eax, eax
1394
        xor     eax, eax
1362
        ret     16
1395
        ret     16
1363
.draw:
1396
.draw:
1364
        call    .dodraw
1397
        call    .dodraw
1365
        ret     16
1398
        ret     16
-
 
1399
;.mouse:
-
 
1400
        ;todo
-
 
1401
        ;ret     16
1366
.key:
1402
.key:
1367
; find item with focus
1403
; find item with focus
1368
        add     ebx, dlgtemplate.size+12
1404
        add     ebx, dlgtemplate.size+12
1369
        mov     ecx, [ebx-4]
1405
        mov     ecx, [ebx-4]
1370
        jecxz   .nobtns
1406
        jecxz   .nobtns
Line 1822... Line 1858...
1822
        jbe     .ret
1858
        jbe     .ret
1823
        mov     esi, [ebx+dlgitemtemplate.data]
1859
        mov     esi, [ebx+dlgitemtemplate.data]
1824
@@:
1860
@@:
1825
        lodsb
1861
        lodsb
1826
        test    al, al
1862
        test    al, al
1827
        jz      .ret
1863
        jz      .correct
1828
        stosw
1864
        stosw
1829
        loop    @b
1865
        loop    @b
-
 
1866
		ret
-
 
1867
.correct:
-
 
1868
		sub     [ebx+dlgitemtemplate.x2], ecx
1830
.ret:
1869
.ret:
1831
        ret
1870
        ret
Line 1832... Line 1871...
1832
 
1871
 
1833
align 4
1872
align 4