?login_element?

Subversion Repositories NedoOS

Rev

Rev 1518 | 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.         call prwindow_text0
  55.         YIELDKEEP
  56.         YIELDKEEP
  57.         ret
  58.  
  59. prwindow_text
  60.         ld a,1
  61. prwindow_text0
  62. ;hl = window text
  63. ;out: ;de=YX of last line
  64.         ld e,(hl) ;x
  65.         inc hl
  66.         ld d,(hl) ;y
  67.         inc hl
  68.         ld c,(hl) ;wid
  69.         inc hl
  70.         ld b,(hl) ;hgt
  71.         inc hl
  72.  
  73.         push hl ;text
  74.  
  75.         push de
  76.         or a
  77.         call nz,prwin
  78.         pop de
  79.         inc d
  80.         inc e
  81.         inc e
  82.         call nv_setxy ;keeps de,hl,ix
  83.        
  84.         pop hl ;text
  85. prwindow_waitkey_text0
  86.         ld a,(hl)
  87.         or a
  88.         ret z
  89.         dec a;cp 1
  90.         jr z,prwindow_waitkey_textnfiles
  91.         dec a;cp 2
  92.         jr z,prwindow_waitkey_textoutertext
  93.         dec a;cp 3
  94.         jr z,prwindow_waitkey_textnextline
  95.         push de
  96.          ld c,0
  97.         call prtext
  98.         pop de
  99.         jr prwindow_waitkey_text0
  100. prwindow_waitkey_textnfiles
  101.         inc hl
  102.         push de
  103.         push hl
  104.         call getmarkedfiles;countmarkedfiles
  105.         call prdword_dehl
  106.         pop hl
  107.         pop de
  108.         jr prwindow_waitkey_text0
  109. prwindow_waitkey_textoutertext
  110.         inc hl
  111.         push de
  112.         ld e,(hl)
  113.         inc hl
  114.         ld d,(hl)
  115.         inc hl
  116.         push hl
  117.         ex de,hl
  118.          ld c,0
  119.         call prtext
  120.         pop hl
  121.         pop de
  122.         jr prwindow_waitkey_text0
  123. prwindow_waitkey_textnextline
  124.         inc hl
  125.         inc d
  126.         call nv_setxy ;keeps de,hl,ix
  127.         jr prwindow_waitkey_text0
  128.  
  129. prwin
  130. ;de=yx
  131. ;bc=hgt,wid
  132.         call setdrawtablesneeded
  133.         ld a,c
  134.         sub 2
  135.         ld (winbeginstroka_wid),a
  136.         ld (winmidstroka_wid),a
  137.         ld (winendstroka_wid),a
  138.         ld hl,winbeginstroka
  139.         call prtableline
  140.         dec b
  141.         dec b
  142. winlineN_0
  143.         inc d
  144.         ld hl,winmidstroka
  145.         call prtableline
  146.         djnz winlineN_0
  147.         inc d
  148.         ld hl,winendstroka
  149.         ;jr prtableline
  150.  
  151. prtableline
  152. ;hl=tableline data
  153. ;de=yx
  154. ;b=hgt
  155. ;keeps bc,de,ix
  156.         push bc
  157.         call nv_setxy ;keeps de,hl
  158. prtableline0
  159.         ld a,(hl)
  160.         or a
  161.         jr z,prtablelineq
  162.         inc hl
  163.         ld b,(hl)
  164.         inc hl
  165.         call prNsymbol
  166.         jr prtableline0
  167. prtablelineq
  168.         pop bc
  169.         ret
  170.  
  171. prNsymbol
  172. ;a=symbol
  173. ;b=count
  174.         push de
  175.         push hl
  176.         push ix
  177.         ld c,a
  178. prNsymbol0
  179.         push bc
  180.         ld a,c
  181.        if PRSTDIO
  182.         PRCHAR_
  183.        else
  184.         PRCHAR
  185.        endif
  186.         pop bc
  187.         djnz prNsymbol0
  188.         pop ix
  189.         pop hl
  190.         pop de
  191.         ret
  192.  
  193. winbeginstroka
  194.         db 0xc9;'г'
  195.         db 1
  196.         db 0xcd;'='
  197. winbeginstroka_wid=$
  198.         db 12;wdtcolumn1
  199.         db 0xbb;'┐'
  200.         db 1
  201.         db 0
  202.  
  203. winmidstroka
  204.         db 0xba;'│'
  205.         db 1
  206.         db ' '
  207. winmidstroka_wid=$
  208.         db 12;wdtcolumn1
  209.         db 0xba;'│'
  210.         db 1
  211.         db 0
  212.  
  213. winendstroka
  214.         db 0xc8;'L'
  215.         db 1
  216.         db 0xcd;'='
  217. winendstroka_wid=$
  218.         db 12;wdtcolumn1
  219.         db 0xbc;'-'
  220.         db 1
  221.         db 0
  222.