Subversion Repositories Kolibri OS

Rev

Rev 1951 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;---------------------------------------------------------------------
  2. k_sort_directory:
  3.         test    dword [status],16
  4.         jnz     still
  5.         or      dword [status],16
  6.  
  7.         call    get_memory_for_thread_stack
  8.         mov     [thread_stack_5],eax
  9.         mcall   51,1,thread5    ; thread_stack_5
  10.         jmp     still
  11. ;---------------------------------------------------------------------
  12. thread5:                                ; start of bgrd thread
  13.         mcall   9,procinfo_threads,-1
  14.         mov     eax,[ebx+30]
  15.         mov     [PID5],eax
  16.         mcall   40,0x27
  17.         mov     eax,[sort_type]
  18.         cmp     [sort_type],dword 0
  19.         jne     @f
  20.        
  21.         mov     [option_group2],sort0
  22.         jmp     .thread5
  23. ;---------------------------------------------------------------------
  24. @@:
  25.         cmp     [sort_type],dword 2
  26.         jne     @f
  27.        
  28.         mov     [option_group2],sort2
  29.         jmp     .thread5
  30. ;---------------------------------------------------------------------
  31. @@:
  32.         cmp     [sort_type],dword 4
  33.         jne     @f
  34.        
  35.         mov     [option_group2],sort4
  36.         jmp     .thread5
  37. ;---------------------------------------------------------------------
  38. @@:
  39.         mov     [option_group2],sort6
  40. ;-----------------------------------
  41. .thread5:
  42.         mov     [sort_type_old],eax
  43.         mov     eax,[option_group2]
  44.         mov     [option_group2_old],eax
  45. ;-----------------------------------
  46. .red:
  47.         call    .draw_window
  48. ;-----------------------------------
  49. .still:
  50.         mcall   10      ; wait here for event
  51.  
  52.         cmp     eax,1   ; redraw request ?
  53.         je      .red
  54.  
  55.         cmp     eax,2   ; key in buffer ?
  56.         je      .key
  57.  
  58.         cmp     eax,3   ; button in buffer ?
  59.         je      .button
  60.  
  61.         cmp     eax,6   ; mouse in buffer ?
  62.         je      .mouse
  63.  
  64.         jmp     .still
  65. ;---------------------------------------------------------------------
  66. .mouse:
  67.         push    dword option_boxes_sort
  68.         call    [option_box_mouse]
  69.  
  70.         cmp     [option_group2],sort0
  71.         jne     @f
  72.        
  73.         mov     [sort_type],dword 0
  74.         jmp     .still
  75. ;---------------------------------------------------------------------
  76. @@:
  77.         cmp     [option_group2],sort2
  78.         jne     @f
  79.        
  80.         mov      [sort_type],dword 2
  81.         jmp     .still
  82. ;---------------------------------------------------------------------
  83. @@:
  84.         cmp     [option_group2],sort4
  85.         jne     @f
  86.        
  87.         mov     [sort_type],dword 4
  88.         jmp     .still
  89. ;---------------------------------------------------------------------
  90. @@:
  91.         cmp     [option_group2],sort6
  92.         jne     @f
  93.        
  94.         mov     [sort_type],dword 6
  95.         jmp     .still
  96. ;---------------------------------------------------------------------
  97. .key:
  98.         mcall
  99.         cmp     ah,27
  100.         je      .close
  101.  
  102.         cmp     ah,13
  103.         je      .kok
  104.  
  105.         cmp     ah,177 ;down
  106.         je      .fdn
  107.  
  108.         cmp     ah,178 ;up
  109.         jne     .still
  110.  
  111.         cmp     [sort_type],0
  112.         je      .still
  113.        
  114.         sub     [sort_type],2
  115.         jmp     .flagcont
  116. ;---------------------------------------------------------------------
  117. .fdn:
  118.         cmp     [sort_type],6
  119.         je      .still
  120.        
  121.         add     [sort_type],2
  122.        
  123. .flagcont:
  124.         cmp     [sort_type],dword 0
  125.         jne     @f
  126.        
  127.         mov     [option_group2],sort0
  128.         call    .draw_opt_boxes
  129.         jmp     .still
  130. ;---------------------------------------------------------------------
  131. @@:
  132.         cmp     [sort_type],dword 2
  133.         jne     @f
  134.        
  135.         mov     [option_group2],sort2
  136.         call    .draw_opt_boxes
  137.         jmp     .still
  138. ;---------------------------------------------------------------------
  139. @@:
  140.         cmp     [sort_type],dword 4
  141.         jne     @f
  142.        
  143.         mov     [option_group2],sort4
  144.         call    .draw_opt_boxes
  145.         jmp     .still
  146. ;---------------------------------------------------------------------
  147. @@:
  148.         cmp     [sort_type],dword 6
  149.         jne     .still  ;@f
  150.        
  151.         mov     [option_group2],sort6
  152.         call    .draw_opt_boxes
  153.         jmp     .still
  154. ;---------------------------------------------------------------------
  155. .button:                         ; button
  156.         mcall   17              ; get id
  157.         cmp     ah,1                    ; button id=1 ?
  158.         jne     .noclose
  159. ;-------------------------------
  160. .close:
  161.         mov     eax,[sort_type_old]
  162.         mov     [sort_type],eax
  163.         mov     eax,[option_group2_old]
  164.         mov     [option_group2],eax
  165. .close_1:
  166.         xor     dword [status],16
  167.         xor     eax,eax
  168.         mov     [PID5],eax
  169.         mcall   68,13,[thread_stack_5]
  170.         mcall   -1              ; close this program
  171. ;---------------------------------------------------------------------
  172. .noclose:
  173. .kok:
  174.         mov     eax,[load_directory_pointer]
  175.         cmp     [eax+4],dword 0
  176.         je      .close_1
  177.        
  178.         call    load_directory.copy_dir_path
  179.         call    load_directory.sort
  180.         mov     [sort_directory_flag],byte 1
  181.         jmp     .close_1
  182. ;---------------------------------------------------------------------
  183. ;        *********************************************
  184. ;        ******** WINDOW DEFINITIONS AND DRAW ********
  185. ;        *********************************************
  186. .draw_window:
  187.         mcall   12,1
  188.         xor     eax,eax                  ; function 0 : define and draw window
  189.         xor     esi,esi
  190.         mcall   ,<100,300>,<100,110>,0x13909090,,labelt5
  191.         mcall   8,<120,40>,<50,20>,4,0xdddddd
  192.         mcall   4,<46,28>,0xffffff,sorttext,sorttext.size
  193.         xor     ecx,ecx
  194.         mcall   ,<135,57>,,ok_btn,ok_btn.size
  195.         call    .draw_opt_boxes
  196. ;       mcall   47,0x80000,[PID5],<200, 5>,0xffffff
  197.         mcall   12,2
  198.         ret
  199. ;---------------------------------------------------------------------
  200. .draw_opt_boxes:
  201.         push    dword option_boxes_sort
  202.         call    [option_box_draw]
  203.         ret
  204. ;---------------------------------------------------------------------
  205.