Rev 5903 | Rev 5906 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5903 | Rev 5905 | ||
---|---|---|---|
Line 363... | Line 363... | ||
363 | 363 | ||
364 | event_key: |
364 | event_key: |
365 | mcall 2 |
365 | mcall 2 |
Line -... | Line 366... | ||
- | 366 | cmpe ah, 27, exit |
|
366 | cmpe ah, 27, exit |
367 | |
367 | 368 | cmpe ah, 13, list_item_activate |
|
368 | ; cmpe ah, 179, .go_right |
369 | cmpe ah, 179, .go_right |
369 | ; cmpe ah, 176, .go_left |
370 | cmpe ah, 176, .go_left |
370 | ; cmpe ah, 178, .go_up |
371 | cmpe ah, 178, .go_up |
371 | ; cmpe ah, 177, .go_down |
372 | cmpe ah, 177, .go_down |
372 | ; jmp update |
373 | jmp update |
- | 374 | ||
373 | ; |
375 | .go_right: |
374 | ; .go_right: |
376 | mov esi, 1 |
375 | ; jmp update |
377 | jmp .go_anyway |
- | 378 | ||
376 | ; |
379 | .go_left: |
377 | ; .go_left: |
380 | mov esi, -1 |
378 | ; jmp update |
381 | jmp .go_anyway |
- | 382 | ||
379 | ; |
383 | .go_up: |
380 | ; .go_up: |
384 | mov esi, -2 |
381 | ; jmp update |
385 | jmp .go_anyway |
- | 386 | ||
- | 387 | .go_down: |
|
- | 388 | mov esi, 2 |
|
- | 389 | ||
382 | ; |
390 | .go_anyway: |
- | 391 | ;; HIDE OLD SELECTION |
|
- | 392 | stdcall draw_item, [last_x], [last_y], 0 |
|
- | 393 | ||
- | 394 | ;; [X, Y] -> INDEX |
|
- | 395 | mov eax, [last_y] |
|
- | 396 | shl eax, 1 |
|
- | 397 | add eax, [last_x] |
|
- | 398 | mov ebx, [sb_apps.position] |
|
- | 399 | shl ebx, 1 |
|
- | 400 | add eax, ebx |
|
- | 401 | ||
- | 402 | ;; CHANGE INDEX |
|
- | 403 | add eax, esi |
|
- | 404 | ||
- | 405 | cmpl eax, [list.size], @f |
|
- | 406 | mov eax, [list.size] |
|
383 | ; .go_down: |
407 | dec eax |
384 | ; stdcall draw_item, [last_x], [last_y], 0 |
408 | @@: |
385 | ; |
409 | |
386 | ; cmpne [last_x], -1, @f |
410 | cmpge eax, 0, @f |
387 | ; mov [last_x], 0 |
411 | mov eax, 0 |
- | 412 | @@: |
|
388 | ; @@: |
413 | |
389 | ; |
414 | ;; INDEX -> [X, Y] |
390 | ; cmpne [last_y], LIST_SIZE / 2 - 1, @f |
415 | sub eax, ebx |
- | 416 | mov ebx, eax |
|
391 | ; mov eax, [sb_apps.position] |
417 | and ebx, 1b |
392 | ; add eax, LIST_SIZE / 2 |
418 | mov [last_x], ebx |
- | 419 | shr eax, 1 |
|
393 | ; shl eax, 1 |
420 | mov [last_y], eax |
394 | ; cmpge eax, [list.size], .pre |
421 | |
395 | ; inc [sb_apps.position] |
422 | cmpl [last_y], 0xFFFF, @f |
396 | ; stdcall draw_list |
423 | mov [last_y], 0 |
397 | ; invoke scrollbar.draw, sb_apps |
424 | dec [sb_apps.position] |
- | 425 | jmp .full_redraw |
|
- | 426 | @@: |
|
- | 427 | ||
398 | ; jmp update |
428 | cmpl [last_y], LIST_SIZE / 2, @f |
- | 429 | mov [last_y], LIST_SIZE / 2 - 1 |
|
399 | ; .pre: |
430 | inc [sb_apps.position] |
400 | ; dec [last_y] |
431 | jmp .full_redraw |
401 | ; @@: |
432 | @@: |
- | 433 | ||
402 | ; |
434 | ;; DRAW NEW SELECTION |
- | 435 | .partly_redraw: |
|
- | 436 | stdcall draw_item, [last_x], [last_y], 1 |
|
- | 437 | jmp update |
|
- | 438 | ||
- | 439 | .full_redraw: |
|
- | 440 | cmpge [sb_apps.position], 0, @f |
|
- | 441 | mov [sb_apps.position], 0 |
|
- | 442 | @@: |
|
- | 443 | ||
403 | ; inc [last_y] |
444 | stdcall draw_list |
Line 404... | Line 445... | ||
404 | ; stdcall draw_item, [last_x], [last_y], 1 |
445 | invoke scrollbar.draw, sb_apps |
Line 405... | Line 446... | ||
405 | jmp update |
446 | jmp update |
406 | 447 | ||
407 | ;---------------------- |
448 | ;---------------------- |
408 | 449 | ||
- | 450 | event_button: |
|
- | 451 | mcall 17 |
|
- | 452 | cmpe ah, 1, exit |
|
- | 453 | cmpe ah, 2, .opendialog |
|
- | 454 | jmp list_item_activate |
|
- | 455 | ||
- | 456 | .opendialog: |
|
- | 457 | invoke opendialog.start, opendialog |
|
- | 458 | cmpne [opendialog.status], 1, update |
|
- | 459 | mcall 70, is_openas |
|
- | 460 | ||
Line 409... | Line 461... | ||
409 | event_button: |
461 | mov edi, 0 |
410 | mcall 17 |
462 | jmp save_assoc |
411 | cmpe ah, 1, exit |
463 | |
- | 464 | ;---------------------- |
|
412 | cmpe ah, 2, .opendialog |
465 | |
413 | 466 | list_item_activate: |
|
414 | .fromlist: |
467 | mov eax, [last_y] |
415 | movzx ebx, ah |
468 | shl eax, 1 |
416 | sub ebx, 10 |
469 | add eax, [last_x] |
417 | mov ecx, [sb_apps.position] |
470 | mov ebx, [sb_apps.position] |
418 | shl ecx, 1 |
471 | shl ebx, 1 |
419 | add ebx, ecx |
472 | add eax, ebx |
420 | shl ebx, 5 |
473 | shl eax, 5 |
421 | add ebx, list |
474 | add eax, list |
- | 475 | cmpe byte [eax], 0, update |
|
422 | cmpe [ebx], byte 0, update |
476 | mov [param_a], eax |
- | 477 | invoke libini.get_str, assoc_ini, eax, assoc_ini.exec, buffer, 256, undefined |
|
Line -... | Line 478... | ||
- | 478 | cmpe byte [buffer], 0, ini_error |
|
- | 479 | mcall 70, is_openas |
|
423 | mov [param_a], ebx |
480 | |
424 | invoke libini.get_str, assoc_ini, ebx, assoc_ini.exec, buffer, 256, undefined |
481 | mov edi, 1 |
425 | cmpe [buffer], byte 0, ini_error |
482 | jmp save_assoc |
426 | mcall 70, is_openas |
483 | |
Line 427... | Line 484... | ||
427 | mov edi, 1 |
484 | ;---------------------- |
Line 437... | Line 494... | ||
437 | @@: |
494 | @@: |
Line 438... | Line 495... | ||
438 | 495 | ||
439 | invoke libini.set_str, assoc_ini, assoc_ini.sec, [param_e], buffer, 33 |
496 | invoke libini.set_str, assoc_ini, assoc_ini.sec, [param_e], buffer, 33 |
Line 440... | Line -... | ||
440 | jmp exit |
- | |
441 | - | ||
442 | .opendialog: |
- | |
443 | invoke opendialog.start, opendialog |
- | |
444 | cmpne [opendialog.status], 1, update |
- | |
445 | mcall 70, is_openas |
- | |
446 | mov edi, 0 |
- | |
447 | jmp .save_assoc |
497 | jmp exit |
Line 448... | Line 498... | ||
448 | 498 | ||
449 | ;---------------------- |
499 | ;---------------------- |
450 | 500 |