Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2. kfile:
  3.         test    dword [status],1
  4.         jnz     still
  5.         or      dword [status],1
  6.  
  7.         call    load_directory.copy_dir_path
  8.         cmp     [OpenDialog_path],dword 'NoKe'
  9.         je      @f
  10.        
  11.         mov     [OpenDialog_data.start_path],dword OpenDialog_path
  12.         jmp     .start_OpenDialog
  13. ;---------------------------------------------------------------------
  14. @@:
  15.         mov     ebx,open_dialog_name
  16.         mov     esi,path
  17.         mov     edi,library_path
  18.         call    copy_file_path
  19.        
  20. .start_OpenDialog:
  21.         push    dword OpenDialog_data
  22.         call    [OpenDialog_Start]
  23.         call    clear_control_key_flag
  24.         cmp     [OpenDialog_data.status],2
  25.         je      thread1_start
  26.        
  27.         cmp     [OpenDialog_data.status],1
  28.         jne     @f
  29.        
  30.         xor     dword [status],1
  31.         jmp     kopen_1
  32. ;---------------------------------------------------------------------
  33. @@:
  34.         xor     dword [status],1
  35.         jmp     still
  36. ;--------------------------------------------------------------------- 
  37. thread1_start:
  38.         call    get_memory_for_thread_stack
  39.         mov     [thread_stack],eax
  40.         mcall   51,1,thread1    ; thread_stack
  41.         jmp     still
  42. ;---------------------------------------------------------------------
  43. thread1:                        ; start of thread1
  44.         mcall   9,procinfo_threads, -1
  45.         mov     eax,[ebx+30]
  46.         mov     [PID1],eax
  47.         mcall   40,0x27
  48.         or      ecx,-1          ; get information about me
  49.         call    getappinfo
  50.         mov     esi,string
  51. ;-------------------------------------
  52.         cld
  53. @@:
  54.         lodsb
  55.         test    al,al
  56.         jne     @r
  57. ;------------------------------------- 
  58.         sub     esi,string
  59.         mov     eax,esi
  60.         dec     eax
  61.         mov     edi, edit1
  62.         mov     [edi+48], eax  ;ed_size
  63.         mov     [edi+52], eax  ;ed_pos
  64. ;-------------------------------------
  65. .red:
  66.         call    .draw_window
  67. ;-------------------------------------
  68. .still:
  69.         mcall   10              ; wait here for event
  70.  
  71.         cmp     eax,1                   ; redraw request ?
  72.         je      .red
  73.  
  74.         cmp     eax,2                   ; key in buffer ?
  75.         je      .key
  76.  
  77.         cmp     eax,3                   ; button in buffer ?
  78.         je      .button
  79.  
  80.         push    dword name_editboxes
  81.         call    [edit_box_mouse]
  82.         jmp     .still
  83. ;---------------------------------------------------------------------
  84. .key:                   ; key
  85.         mcall
  86.         cmp     ah,13
  87.         je      .close_with_open_file
  88.  
  89.         cmp     ah,27
  90.         je      .close
  91.        
  92.         push    dword name_editboxes
  93.         call    [edit_box_key]
  94.         jmp     .still
  95. ;---------------------------------------------------------------------
  96. .close_with_open_file:
  97.         mov     [open_file_flag],byte 1
  98.         jmp     .close
  99. ;---------------------------------------------------------------------
  100. .button:                        ; button
  101.         mcall   17              ; get id
  102.         cmp     ah,1                    ; button id=1 ?
  103.         jne     .still
  104. .close:
  105.         xor     dword [status],1
  106.         xor     eax,eax
  107.         mov     [PID1],eax
  108.         mcall   68,13,[thread_stack]
  109.         mcall   -1              ; close this program
  110.         jmp     .still
  111. ;---------------------------------------------------------------------
  112. ;   *********************************************
  113. ;   *******  WINDOW DEFINITIONS AND DRAW ********
  114. ;   *********************************************
  115. .draw_window:
  116.         mcall   12,1
  117.         xor     eax,eax            ; function 0 : define and draw window
  118.         xor     esi,esi
  119.         mcall   ,<100,300>,<100,80>,0x13eeeeee,,labelt1
  120.         push    dword name_editboxes
  121.         call    [edit_box_draw]
  122. ;       mcall   47,0x80000,[PID1],<200, 5>,0xffffff    
  123.         mcall   12,2
  124.         ret
  125. ;---------------------------------------------------------------------
  126.