Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. ;SayErr  int num_strings, const char* strings[],
  3. ;                      int num_buttons, const char* buttons[]);
  4.  
  5. proc SayErr num_strings:dword, strings:dword,num_buttons:dword, buttons:dword
  6.         pushad
  7.         cmp     [num_strings],1
  8.         je      @f
  9.         m2m     [errmess0], strErrorExc
  10.         jmp     .l1
  11.        @@:
  12.         mov     ebx,[strings]
  13.         m2m     [errmess0], dword [ebx]
  14.        .l1:
  15.         mcall   51,1,threadSayErr,stackDlg
  16.         popad
  17.         mov     eax,1
  18.         ret
  19. endp
  20.  
  21. proc SimpleSayErr str:dword
  22.         pushad
  23.         m2m     [errmess0],[str]
  24.         mcall   51,1,threadSayErr,stackDlg
  25.         popad
  26.         ret
  27. endp
  28.  
  29.  
  30. proc threadSayErr
  31.         mcall   40, 000111b+0C000000h
  32.  
  33. .wm_redraw:
  34.         mcall   12, 1
  35.         mcall   48, 3, sc, sizeof.system_colors
  36.         mov     edx, [sc.work]
  37.  
  38.         or      edx, 0x33000000
  39.         mcall 0, <220,420>, <220,110>, , , title
  40.  
  41.         mov     ecx,[sc.work_text]
  42.         or      ecx,90000000h
  43.         mov     edx,[errmess0]
  44.         mcall 4, <15,11>
  45.  
  46.         mcall 8, <105,100>,<45,25>,1,[sc.work_button]
  47.         mov     ecx,[sc.work_button_text]
  48.         or      ecx,90000000h
  49.         mcall 4, <147,51>, , strOk
  50.  
  51.         mcall 12, 2
  52.  
  53. .still:
  54.         mcall   10
  55.         cmp     eax, 1
  56.         je      .wm_redraw
  57.         cmp     eax, 2
  58.         je      .wm_key
  59.         cmp     eax, 3
  60.         je      .wm_button
  61.         jmp     .still
  62.  
  63. .wm_button:
  64.         mcall   17
  65.  
  66.         cmp     ah, 1
  67.         je      .exit
  68.         jmp     .still
  69.  
  70. .wm_key:
  71.         mcall   2
  72.         jmp     .still
  73. .exit:
  74.         mcall   -1
  75. endp
  76.  
  77. ;-------------------------------------------------------------------------------
  78. ;-------------------------------------------------------------------------------
  79. ;-------------------------------------------------------------------------------
  80.     ; "enter password" dialog for KFar
  81. ;password_dlg:
  82. ;        dd      1       ; use standard dialog colors
  83. ;        dd      -1      ; center window by x
  84. ;        dd      -1      ; center window by y
  85. ;.width  dd      ?       ; width (will be filled according to current console width)
  86. ;        dd      2       ; height
  87. ;        dd      4, 2    ; border size
  88. ;        dd      aEnterPasswordTitle     ; title
  89. ;        dd      ?       ; colors (will be set by KFar)
  90. ;        dd      0       ; used internally by dialog manager, ignored
  91. ;        dd      0, 0    ; reserved for DlgProc
  92. ;        dd      2       ; 2 controls
  93. ;; the string "enter password"
  94. ;        dd      1       ; type: static
  95. ;        dd      1,0     ; upper-left position
  96. ;.width1 dd      ?,0     ; bottom-right position
  97. ;        dd      aEnterPassword  ; data
  98. ;        dd      0       ; flags
  99. ;; editbox for password
  100. ;        dd      3       ; type: edit
  101. ;        dd      1,1     ; upper-left position
  102. ;.width2 dd      ?,0     ; bottom-right position
  103. ;        dd      password_data   ; data
  104. ;        dd      2Ch     ; flags
  105.  
  106.  
  107.  
  108. proc DialogBox dlgInfo:dword
  109.         pushad
  110.         mov     ebx,[dlgInfo]
  111.         mov     ebx,[ebx+25*4]
  112.         add     ebx, 12 ; password_ansi
  113.         mov     [edtPassword+9*4], ebx  ; text
  114.         mov     [stateDlg], 0
  115.         mcall   51,1,threadDialogBox,stackDlg
  116.  
  117.         ;wait thread...
  118.     @@: cmp     [stateDlg],0
  119.         jne     @f
  120.         mcall   5,1
  121.         jmp     @b
  122.      @@:
  123.         popad
  124.         cmp     [stateDlg], 1
  125.         jne     @f
  126.         xor     eax, eax
  127.         ret
  128.     @@:
  129.         or      eax, -1
  130.         ret
  131. endp
  132.  
  133. proc threadDialogBox
  134.  
  135.         mcall   40, 100111b+0C000000h
  136.         xor     eax,eax
  137.         mov     dword[edtPassword.size], eax
  138.         mov     dword[edtPassword.pos], eax
  139.  
  140. .wm_redraw:
  141.         mcall   12, 1
  142.         mcall   48, 3, sc, sizeof.system_colors
  143.         mov     edx, [sc.work]
  144.         or      edx, 0x33000000
  145.         mcall   0, <200,320>, <200,140>, , , title
  146.  
  147.         edit_boxes_set_sys_color edtPack,endEdits,sc
  148.         stdcall [edit_box_draw],edtPassword
  149.  
  150.  
  151.         mov     ecx,[sc.work_text]
  152.         or      ecx,90000000h
  153.         mcall 4, <56,12>, , strGetPass
  154.  
  155.         mcall 8, <70,80>,<74,22>,2,[sc.work_button]
  156.         mov     ecx,[sc.work_button_text]
  157.         or      ecx,90000000h
  158.         mcall 4, <103,79>, , strOk
  159.  
  160.         mcall 8, <165,80>,<74,22>,1,[sc.work_button]
  161.         mov     ecx,[sc.work_button_text]
  162.         or      ecx,90000000h
  163.         mcall 4, <182,79>, , strCancel
  164.  
  165.  
  166.         mcall 12, 2
  167.  
  168. .still:
  169.         mcall   10
  170.         cmp     eax, 1
  171.         je      .wm_redraw
  172.         cmp     eax, 2
  173.         je      .wm_key
  174.         cmp     eax, 3
  175.         je      .wm_button
  176.         cmp     eax, 6
  177.         je      .wm_mouse
  178.  
  179.         jmp     .still
  180.  
  181. .wm_key:
  182.         mcall   2
  183.         stdcall [edit_box_key],edtPassword
  184.         jmp     .still
  185.  
  186.  
  187. .wm_button:
  188.         mcall   17
  189.  
  190.         cmp     ah, 2           ;OK
  191.         jne     @f
  192.         mov     [stateDlg],1
  193.         jmp     .exit
  194.     @@:
  195.  
  196.         cmp     ah, 1           ;Close window or Cancel
  197.         jne      .still
  198.         mov     [stateDlg],2
  199.         jmp     .exit
  200.  
  201. .wm_mouse:
  202.         stdcall [edit_box_mouse],edtPassword
  203.  
  204.  
  205.         jmp     .still
  206.  
  207. .exit:
  208.         mcall   -1
  209. endp
  210.