?login_element?

Subversion Repositories NedoOS

Rev

Rev 1484 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. prwindow_edit
  2. ;hl=window DE=texteditaddr c=texteditsize
  3. ;out: CY=OK, de=filename
  4.         push de
  5.         push bc
  6.         call prwindow_text ;de=YX of last line
  7.         pop bc
  8.         pop hl
  9.         push hl
  10.         ld a,c ;a=maxsz
  11.         call editline
  12.         pop de ;de=filename
  13.         cp key_esc
  14.         ret z ;cancel
  15.         scf
  16.         ret
  17.  
  18. prwindow_waitkey
  19. ;hl=window
  20. ;out: CY=OK
  21. ;        ld (prwindow_waitkey_addr),hl; commented by demige 190511
  22.         call prwindow_text; insert by demige 190511
  23. ; comment by demige 190511: for why reprinting window after each keypress? On second print getmarkedfiles returns wrong value.
  24. prwindow_waitkey0
  25. ;prwindow_waitkey_addr=$+1 ; comment by demige 190511
  26. ;        ld hl,0 ; comment by demige 190511
  27. ;        call prwindow_text ; comment by demige 190511
  28.        if PRSTDIO
  29.         call yieldgetkeyloop
  30.        else
  31.         YIELDGETKEYLOOP
  32.        endif
  33.         ld a,c
  34.         cp key_esc
  35.         ret z
  36.         cp 'n'
  37.         ret z
  38.         ;cp 'N'
  39.         ;ret z
  40.         cp key_redraw
  41.         ret z
  42.         cp 'y'
  43.         jr z, prwindow_waitkey_keyyes
  44.         ;cp 'Y'
  45.         ;jr z, prwindow_waitkey_keyyes
  46.         cp key_enter
  47.         jr nz,prwindow_waitkey0
  48. prwindow_waitkey_keyyes
  49.         scf
  50.         ret
  51.  
  52. upwindow_text
  53.         ld a,0
  54.         jr prwindow_text0
  55.  
  56. prwindow_text
  57.         ld a,1
  58. prwindow_text0
  59. ;hl = window text
  60. ;out: ;de=YX of last line
  61.         ld e,(hl) ;x
  62.         inc hl
  63.         ld d,(hl) ;y
  64.         inc hl
  65.         ld c,(hl) ;wid
  66.         inc hl
  67.         ld b,(hl) ;hgt
  68.         inc hl
  69.  
  70.         push hl ;text
  71.  
  72.         push de
  73.         or a
  74.         call nz,prwin
  75.         pop de
  76.         inc d
  77.         inc e
  78.         inc e
  79.         call nv_setxy ;keeps de,hl,ix
  80.        
  81.         pop hl ;text
  82. prwindow_waitkey_text0
  83.         ld a,(hl)
  84.         or a
  85.         ret z
  86.         dec a;cp 1
  87.         jr z,prwindow_waitkey_textnfiles
  88.         dec a;cp 2
  89.         jr z,prwindow_waitkey_textoutertext
  90.         dec a;cp 3
  91.         jr z,prwindow_waitkey_textnextline
  92.         push de
  93.          ld c,0
  94.         call prtext
  95.         pop de
  96.         jr prwindow_waitkey_text0
  97. prwindow_waitkey_textnfiles
  98.         inc hl
  99.         push de
  100.         push hl
  101.         call getmarkedfiles;countmarkedfiles
  102.         call prdword_dehl
  103.         pop hl
  104.         pop de
  105.         jr prwindow_waitkey_text0
  106. prwindow_waitkey_textoutertext
  107.         inc hl
  108.         push de
  109.         ld e,(hl)
  110.         inc hl
  111.         ld d,(hl)
  112.         inc hl
  113.         push hl
  114.         ex de,hl
  115.          ld c,0
  116.         call prtext
  117.         pop hl
  118.         pop de
  119.         jr prwindow_waitkey_text0
  120. prwindow_waitkey_textnextline
  121.         inc hl
  122.         inc d
  123.         call nv_setxy ;keeps de,hl,ix
  124.         jr prwindow_waitkey_text0
  125.  
  126. prwin
  127. ;de=yx
  128. ;bc=hgt,wid
  129.         call setdrawtablesneeded
  130.         ld a,c
  131.         sub 2
  132.         ld (winbeginstroka_wid),a
  133.         ld (winmidstroka_wid),a
  134.         ld (winendstroka_wid),a
  135.         ld hl,winbeginstroka
  136.         call prtableline
  137.         dec b
  138.         dec b
  139. winlineN_0
  140.         inc d
  141.         ld hl,winmidstroka
  142.         call prtableline
  143.         djnz winlineN_0
  144.         inc d
  145.         ld hl,winendstroka
  146.         ;jr prtableline
  147.  
  148. prtableline
  149. ;hl=tableline data
  150. ;de=yx
  151. ;b=hgt
  152. ;keeps bc,de,ix
  153.         push bc
  154.         call nv_setxy ;keeps de,hl
  155. prtableline0
  156.         ld a,(hl)
  157.         or a
  158.         jr z,prtablelineq
  159.         inc hl
  160.         ld b,(hl)
  161.         inc hl
  162.         call prNsymbol
  163.         jr prtableline0
  164. prtablelineq
  165.         pop bc
  166.         ret
  167.  
  168. prNsymbol
  169. ;a=symbol
  170. ;b=count
  171.         push de
  172.         push hl
  173.         push ix
  174.         ld c,a
  175. prNsymbol0
  176.         push bc
  177.         ld a,c
  178.        if PRSTDIO
  179.         PRCHAR_
  180.        else
  181.         PRCHAR
  182.        endif
  183.         pop bc
  184.         djnz prNsymbol0
  185.         pop ix
  186.         pop hl
  187.         pop de
  188.         ret
  189.  
  190. winbeginstroka
  191.         db 0xc9;'г'
  192.         db 1
  193.         db 0xcd;'='
  194. winbeginstroka_wid=$
  195.         db 12;wdtcolumn1
  196.         db 0xbb;'┐'
  197.         db 1
  198.         db 0
  199.  
  200. winmidstroka
  201.         db 0xba;'│'
  202.         db 1
  203.         db ' '
  204. winmidstroka_wid=$
  205.         db 12;wdtcolumn1
  206.         db 0xba;'│'
  207.         db 1
  208.         db 0
  209.  
  210. winendstroka
  211.         db 0xc8;'L'
  212.         db 1
  213.         db 0xcd;'='
  214. winendstroka_wid=$
  215.         db 12;wdtcolumn1
  216.         db 0xbc;'-'
  217.         db 1
  218.         db 0
  219.