clos data
DEFINE POPUP scena FROM 2,5 FONT "Courier"
define bar 1 of scena prompt "\<1. KOMPLET UVNITR, OMANY UVNITR (zima)"
define bar 2 of scena prompt "\<2. GRILL UVNITR, BAR LOKALNE, OMANY VENKU (jaro)"
define bar 3 of scena prompt "\<3. GRILL VENKU, BAR LOKALNE, OMANY VENKU (leto)"
define bar 4 of scena prompt "\<4. GRILL LOKALNE, BAR LOKALNE, OMANY VENKU (masakr)"
define bar 5 of scena prompt "\<5. MANUALNI UPRAVA TISKAREN"

ON SELECT POPUP scena deactivate popup scena
ACTIVATE POPUP scena
m.aa = bar()
release popup scena
do case
case m.aa = 1
  use m.gchom_path+"prn_defy\prn_def1"
  copy to (m.gchom_path+"prn_def")
  MESSAGEBOX("SCENA 1 nastavena",1+64,"Nastaveni sceny",3333)

case m.aa = 2
  use m.gchom_path+"prn_defy\prn_def2"
  copy to (m.gchom_path+"prn_def")
  MESSAGEBOX("SCENA 2 nastavena",1+64,"Nastaveni sceny",3333)

case m.aa = 3
  use m.gchom_path+"prn_defy\prn_def3"
  copy to (m.gchom_path+"prn_def")
  MESSAGEBOX("SCENA 3 nastavena",1+64,"Nastaveni sceny",3333)

case m.aa = 4
  use m.gchom_path+"prn_defy\prn_def4"
  copy to (m.gchom_path+"prn_def")
  MESSAGEBOX("SCENA 4 nastavena",1+64,"Nastaveni sceny",3333)

case m.aa = 5
  do tiskarny
endcase
clos data
return

*!******************************************************
procedure tiskarny
USE (m.gchom_path + "prn_def")
DEFINE POPUP tiskarny FROM 1,30 PROMPT FIELD prn_no + " | " + prn_name + " | " + p_name + IIF(is_netprn, " |NET", " |LOC")  FONT "Courier"
ON SELECTION POPUP tiskarny DEACTI POPUP
PUSH KEY CLEAR
ON KEY LABEL F2  DO del_all
ON KEY LABEL F10 KEYB "{Ctrl+W}"
= FLOCK()
BROW FIELD q1 = prn_no + ": " + prn_name :H="Tiskarna", prn_no_alt :V=v_prnno() :F :H="Nahradni", q2=IIF(is_netprn, "NET", "LOC"):H="" FREEZE prn_no_alt ;
     NORMAL NODELE NOAPPE TITLE "Nastaveni nahradnich tiskaren (<F2> smaze vsechna presmerovani)"
POP KEY
RELE POPU tiskarny
CLOS DATA

*!******************************************************
FUNCTION v_prnno
old_rec = RECNO()
SCATT FIELD prn_no_alt MEMVAR
LOCATE FOR prn_no = m.prn_no_alt
IF FOUND()
  GO (m.old_rec)
ELSE
  ACTI POPU tiskarny
  GO (m.old_rec)
  REPLACE prn_no_alt WITH PROMPT()
ENDIF

*!******************************************************
PROCEDURE del_all
WAIT "Deleting . . ." WIND NOWAIT
old_rec = RECNO()
REPL ALL prn_no_alt WITH ""
GO (m.old_rec)
SKIP -1
SKIP
WAIT CLEAR