*_____________________________________________ fpz - ti1 _____________________

DEFINE CLASS stl_ti1 AS Column
 *alignment = 2
 p_datum=DATE(1950,1,1)
 typ = ''
 headerclass='hli_ti1'
 headerclasslibrary='progs\fs_tried.prg'
 width = 50
 ADD OBJECT pol as poi_ti1
ENDDEFINE

*-------------------------------------- Hlavicka stlpca --------
DEFINE CLASS hli_ti1 AS header
 
 PROCEDURE click
  
 ENDPROC
 
ENDDEFINE

*----------------------------------- Texbox ---------------------
DEFINE CLASS poi_ti1 AS textbox
 p_hod=0
 readonly = .t.
 *alignment = 2
 nulldisplay = ' '
 
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  
 ENDPROC
 PROCEDURE dblclick
  THISFORM.release
 ENDPROC


 BORDERSTYLE=0
ENDDEFINE

*_____________________________________________ Kongres_rebrík - ti1_____________________

*_____________________________________________ fpz - rebrík _____________________

DEFINE CLASS stl_fpz AS Column
 
 headerclass='hli_fpz'
 headerclasslibrary='progs\fs_tried.prg'

 ADD OBJECT pol as poi_fpz
ENDDEFINE

*-------------------------------------- Hlavicka stlpca --------
DEFINE CLASS hli_fpz AS header
 caption = '1'
 PROCEDURE click
  
 ENDPROC
 
ENDDEFINE

*----------------------------------- Texbox ---------------------
DEFINE CLASS poi_fpz AS textbox

 readonly = .t.

 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  
 ENDPROC
 PROCEDURE dblclick
  THISFORM.release
 ENDPROC


 BORDERSTYLE=0
ENDDEFINE

*_____________________________________________ Kongres_rebrík - Stlpec_____________________

DEFINE CLASS stl_kon AS Column

 p_datum=DATE(1950,1,1)
 typ = ''
 *Width=40
 
 headerclass='hli_kon'
 headerclasslibrary='progs\fs_tried.prg'
 *readonly=.f.
 ADD OBJECT pol as poi_kon
ENDDEFINE

*-------------------------------------- Kongres_rebrík - Hlavicka stlpca --------
DEFINE CLASS hli_kon AS header
 caption = '1'
 PROCEDURE click
  
*!*	  da.ip_i_kongres=st1.i_kongres
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  sy.do_form(41) && kongres
    
 ENDPROC
 
ENDDEFINE

*----------------------------------- Kongres_rebrík - Texbox ---------------------
DEFINE CLASS poi_kon AS textbox
 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
  
  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )


  SELECT * FROM dkakc ;
   WHERE TTOD(dkakc.odter) <= this.Parent.p_datum AND ;
         ttod(dkakc.doter) >= this.Parent.p_datum AND;
  		 dkakc.i_os_klien = st1.i_klient ;
   INTO cursor dkzozakc
  		 
  SELECT 'dkzozakc'
  GO top
  *brow

  da.ip_od     = dtot(this.Parent.p_datum)
  da.ip_termin = dtot(this.Parent.p_datum)
  sy.g_reub_mod = 2 && editovanie 
  sy.ip_fil = .f.

  SELECT 'dkzozakc'
  IF RECCOUNT()>1
   DO FORM fpz1 WITH 2
  ENDIF 

  *da.ip_i_akcia=dkzozakc.i_akcia

  *da.ip_i_kongres = -1 
  *da.remconnect
  *da.remselect('Select i_kongres from akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')


  da.ip_i_kongres = dkzozakc.i_kongres
  da.ip_i_klient = st1.i_klient
  da.n_klient = st1.n_klient
 
  sy.do_form(41,1,da.ip_i_kongres) && Kongres
  
 ENDPROC
 BORDERSTYLE=0
ENDDEFINE


*_____________________________________________ Akcia_rebrík - Stlpec_____________________

DEFINE CLASS stl_akc AS Column

 p_datum=DATE(1950,1,1)
 typ = ''
 *Width=this.Parent.parent.sir_lup
 
 headerclass='hli_akc'
 headerclasslibrary='progs\fs_tried.prg'
 *readonly=.f.
 ADD OBJECT pol as poi_akc
ENDDEFINE

*-------------------------------------- Akcia_rebrík - Hlavicka stlpca --------
DEFINE CLASS hli_akc AS header
 caption = '1'
 PROCEDURE click
  
*!*	  da.ip_i_kongres=st1.i_kongres
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  sy.do_form(41) && kongres
    
 ENDPROC
 
ENDDEFINE

*----------------------------------- Akcia_rebrík - Texbox ---------------------
DEFINE CLASS poi_akc AS textbox
 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
  
  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )


  SELECT * FROM dkakc ;
   WHERE TTOD(dkakc.odter) <= this.Parent.p_datum AND ;
         ttod(dkakc.doter) >= this.Parent.p_datum AND;
  		 dkakc.i_os_klien = st1.i_klient ;
   INTO cursor dkzozakc
  		 
  SELECT 'dkzozakc'
  GO top
  *brow

  da.ip_od     = dtot(this.Parent.p_datum)
  da.ip_termin = dtot(this.Parent.p_datum)
  sy.g_reub_mod = 2 && editovanie 
  sy.ip_fil = .f.

  SELECT 'dkzozakc'
  IF RECCOUNT()>1
   DO FORM fpz1 WITH 1
  ENDIF 

  da.ip_i_akcia=(dkzozakc.i_akcia)

  da.ip_i_kongres = -1 
  *da.remconnect
  da.remselect('Select i_kongres from frontsql.akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')

  SELECT 'dki_kongres'
  GO top
  da.ip_i_kongres = dki_kongres.i_kongres
  USE IN 'dki_kongres'
  da.ip_i_klient = st1.i_klient
  da.n_klient = st1.n_klient
  
  sy.do_form(65,1,da.ip_i_akcia) && Akcia
  
 ENDPROC
 
*!*	 PROCEDURE rightclick
*!*	  da.ip_i_kongrs=st1.i_kongres
*!*	  da.ip_od = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  DO sm1.mpr
*!*	 ENDPROC

 BORDERSTYLE=0
ENDDEFINE


*_____________________________________________ Priestor_rebrík - Stlpec _____________________

DEFINE CLASS stl_pri AS Column

 p_datum=DATE(1950,1,1)
 typ = ''
 *Width=40
 
 headerclass='hli_pri'
 headerclasslibrary='progs\fs_tried.prg'
 *readonly=.f.
 ADD OBJECT pol as poi_pri
ENDDEFINE

*-------------------------------------- Priestor_rebrík - Hlavicka stlpca --------
DEFINE CLASS hli_pri AS header
 caption = '1'
 PROCEDURE click
  
*!*	  da.ip_i_kongres=st1.i_kongres
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  sy.do_form(41) && kongres
    
 ENDPROC
 
ENDDEFINE

*----------------------------------- Priestor_rebrík - Texbox ---------------------
DEFINE CLASS poi_pri AS textbox

 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
  
  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )


  SELECT * FROM dkakc ;
   WHERE TTOD(dkakc.odter) <= this.Parent.p_datum AND ;
         ttod(dkakc.doter) >= this.Parent.p_datum AND;
  		 dkakc.i_priestor = st1.i_klient ;
   INTO cursor dkzozakc
  		 
  SELECT 'dkzozakc'
  GO top
  *brow

  da.ip_od     = dtot(this.Parent.p_datum)
  da.ip_termin = dtot(this.Parent.p_datum)
  sy.g_reub_mod = 2 && editovanie 
  sy.ip_fil = .f.

  SELECT 'dkzozakc'
  IF RECCOUNT()>1
   DO FORM fpz1 WITH 3
  ENDIF 

  da.ip_i_akcia=dkzozakc.i_akcia

  da.ip_i_kongres = -1 
  *da.remconnect
  da.remselect('Select i_kongres from frontsql.akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')

  SELECT 'dki_kongres'
  GO top
  da.ip_i_kongres = dki_kongres.i_kongres
  USE IN 'dki_kongres'
  da.ip_i_priestor = st1.i_klient
  da.n_priestor = st1.n_klient
   
  
 * sy.do_form(53,1,dkzozakc.i_akc_prie) && Akcia - Priestor
  SELECT 'dkzozakc'
  IF RECCOUNT()>0
    sy.do_form(53,1,dkzozakc.i_akc_prie) && Akcia - Priestor
  ELSE
    sy.do_form(53,1,-1) && Akcia - Priestor
  ENDIF   
 ENDPROC
 BORDERSTYLE=0
ENDDEFINE

*!*	 p_hod=0
*!*	 readonly = .t.
*!*	 nulldisplay = ' '
*!*	 PROCEDURE when
*!*	  *WAIT WINDOW 'when i' nowait
*!*	 ENDPROC

*!*	 PROCEDURE click
*!*	  PRIVATE lid
*!*	  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )
*!*	  lid = st1.&lst
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .f.
*!*	  
*!*	  da.ip_i_akcia = -1
*!*	  da.remselect('Select i_akcia from akc_prie where i_akc_prie = ' + ALLTRIM(STR(lid)),'dki_akcia')
*!*	  SELECT 'dki_akcia'
*!*	  GO top
*!*	  da.ip_i_akcia = dki_akcia.i_akcia
*!*	  USE IN 'dki_akcia'
*!*	   
*!*	  da.ip_i_kongres = -1 
*!*	  da.remselect('Select i_kongres from akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')
*!*	  SELECT 'dki_kongres'
*!*	  GO top
*!*	  da.ip_i_kongres = dki_kongres.i_kongres
*!*	  USE IN 'dki_kongres'
*!*	  
*!*	  sy.do_form(53,1,lid) && Akcie_priestory
*!*	  
*!*	 ENDPROC
*!*	 
*!*	 BORDERSTYLE=0
*!*	ENDDEFINE

*_____________________________________________ Sluzba_rebrík - stlpec _____________________

DEFINE CLASS stl_slu AS Column

 p_datum=DATE(1950,1,1)
 typ = ''
 *Width=40
 
 headerclass='hli_slu'
 headerclasslibrary='progs\fs_tried.prg'
 *readonly=.f.
 ADD OBJECT pol as poi_slu
ENDDEFINE

*-------------------------------------- Sluzba_rebrík - Hlavicka stlpca --------
DEFINE CLASS hli_slu AS header
 caption = '1'
 PROCEDURE click
  
*!*	  da.ip_i_kongres=st1.i_kongres
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  sy.do_form(41) && kongres
    
 ENDPROC
 
ENDDEFINE

*----------------------------------- Sluzba_rebrík - Texbox ---------------------
DEFINE CLASS poi_slu AS textbox

 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
  
  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )


  SELECT * FROM dkakc ;
   WHERE TTOD(dkakc.odter) <= this.Parent.p_datum AND ;
         ttod(dkakc.doter) >= this.Parent.p_datum AND;
  		 dkakc.i_sluzba = st1.i_klient ;
   INTO cursor dkzozakc
  		 
  SELECT 'dkzozakc'
  GO top
  *brow

  da.ip_od     = dtot(this.Parent.p_datum)
  da.ip_termin = dtot(this.Parent.p_datum)
  sy.g_reub_mod = 2 && editovanie 
  sy.ip_fil = .f.

  SELECT 'dkzozakc'
  IF RECCOUNT()>1
   DO FORM fpz1 WITH 4
  ENDIF 

  da.ip_i_akcia=dkzozakc.i_akcia

  da.ip_i_kongres = -1 
  *da.remconnect
  da.remselect('Select i_kongres from frontsql.akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')

  SELECT 'dki_kongres'
  GO top
  da.ip_i_kongres = dki_kongres.i_kongres
  USE IN 'dki_kongres'
  da.ip_i_sluzba = st1.i_klient
  da.n_sluzba = st1.n_klient
   
  
  SELECT 'dkzozakc'
  IF RECCOUNT()>0
    sy.do_form(54,1,dkzozakc.i_akc_slu) && Akcia - Sluzby
  ELSE
    sy.do_form(54,1,-1) && Akcia - Sluzby
  ENDIF   
 ENDPROC
 BORDERSTYLE=0
ENDDEFINE

*_____________________________________________ Vykona_rebrík - stlpec _____________________

DEFINE CLASS stl_vy AS Column

 p_datum=DATE(1950,1,1)
 typ = ''
 *Width=40
 
 headerclass='hli_vy'
 headerclasslibrary='progs\fs_tried.prg'
 *readonly=.f.
 ADD OBJECT pol as poi_vy
ENDDEFINE

*-------------------------------------- Vykona - Hlavicka stlpca --------
DEFINE CLASS hli_vy AS header
 caption = '1'
 PROCEDURE click
  
*!*	  da.ip_i_kongres=st1.i_kongres
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  sy.do_form(41) && kongres
    
 ENDPROC
 
ENDDEFINE

*----------------------------------- Vykona_rebrík - Texbox ---------------------
DEFINE CLASS poi_vy AS textbox

 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE when
  *WAIT WINDOW 'when i' nowait
 ENDPROC

 PROCEDURE click
  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
  
  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )

*set step ON 
  SELECT * FROM dkakc ;
   WHERE TTOD(dkakc.odter) <= this.Parent.p_datum AND ;
         ttod(dkakc.doter) >= this.Parent.p_datum AND;
  		 dkakc.i_osoba = st1.i_klient ;
   INTO cursor dkzozakc
  		 
  SELECT 'dkzozakc'
  GO top
  *brow

  da.ip_od     = dtot(this.Parent.p_datum)
  da.ip_termin = dtot(this.Parent.p_datum)
  sy.g_reub_mod = 2 && editovanie 
  sy.ip_fil = .f.

  SELECT 'dkzozakc'
  IF RECCOUNT()>1
   DO FORM fpz1 WITH 4
  ENDIF 

  da.ip_i_akcia=dkzozakc.i_akcia

  da.ip_i_kongres = -1 
  *da.remconnect
  da.remselect('Select i_kongres from frontsql.akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')

  SELECT 'dki_kongres'
  GO top
  da.ip_i_kongres = dki_kongres.i_kongres
  USE IN 'dki_kongres'
  da.ip_i_sluzba = st1.i_klient
  da.n_sluzba = st1.n_klient
   
  
  SELECT 'dkzozakc'
  IF RECCOUNT()>0
    sy.do_form(54,1,dkzozakc.i_akc_slu) && Akcia - Sluzby
  ELSE
    sy.do_form(54,1,-1) && Akcia - Sluzby
  ENDIF   
 ENDPROC
 BORDERSTYLE=0
ENDDEFINE
*_______________________________________________ceti_________________________
*!*	DEFINE CLASS st_ceti AS Column
*!*	 
*!*	 headerclass='hl_ceti'
*!*	 headerclasslibrary='progs\fs_tried.prg'

*!*	 ADD OBJECT h as te_ceti
*!*	ENDDEFINE
*!*	*-------------------------------------- Hlavicka stlpca pre ceny izieb--------
*!*	DEFINE CLASS hl_ceti AS header
*!*	 caption = ' '
*!*	 wordwrap=.t.
*!*	 alignment=6
*!*	 
*!*	 ref_id     = .null.
*!*	 ref_na     = ''
*!*	 osob       = 0
*!*	 i_cenn_so  = .null.
*!*	 n_cenn_so  = .null.
*!*	 i_dph      = .null.
*!*	 n_dph      = ''
*!*	 pridaj     = .f.
*!*	 
*!*	 
*!*	 PROCEDURE popisok
*!*	  
*!*	  IF ISNULL(this.ref_id)
*!*	   this.Caption = ''
*!*	  ELSE
*!*	   this.Caption = ALLTRIM(this.ref_na) 
*!*	   this.Caption = this.Caption  + CHR(13) + ALLTRIM(STR(this.osob))
*!*	   this.Caption = this.Caption  + CHR(13) + ALLTRIM(this.n_dph)
*!*	  ENDIF 

*!*	 ENDPROC
*!*	 

*!*	 PROCEDURE MouseWheel
*!*	 LPARAMETERS nDirection, nShift, nXCoord, nYCoord
*!*	  ENDIF 
*!*	 ENDPROC 
*!*	 PROCEDURE rightclick
*!*	  IF !this.Parent.parent.readonly
*!*	   DO FORM poc_osob WITH this.osob,this.Parent.parent.top+thisform.top,300 TO this.osob
*!*	   this.popisok()
*!*	  ENDIF 
*!*	 ENDPROC 
*!*	 

*!*	 
*!*	 PROCEDURE click
*!*	   
*!*	 IF TYPE(this.Parent.controlsource)='N' AND  !this.Parent.parent.readonly

*!*	  da.cenn_se_ti[1]= this.ref_id
*!*	  da.cenn_se_ti[2]= this.ref_na 
*!*	  da.cenn_se_ti[3]= this.osob
*!*	  da.cenn_se_ti[4]= this.i_cenn_so
*!*	  da.cenn_se_ti[5]= this.n_cenn_so
*!*	  da.cenn_se_ti[6]= this.i_dph
*!*	  da.cenn_se_ti[7]= this.n_dph
*!*	  
*!*	  da.cenn_se_ti[9]=.f. && Bola zmena

*!*	  DO case
*!*	   CASE thisform.typc =1 
*!*	    DO FORM hl_se_ti
*!*	   CASE thisform.typc =2
*!*	    DO FORM hl_se_sl
*!*	  ENDCASE   
*!*	  
*!*	  IF da.cenn_se_ti[9]=.t.
*!*	   this.ref_id     = da.cenn_se_ti[1]
*!*	   this.ref_na     = da.cenn_se_ti[2]
*!*	   this.osob       = da.cenn_se_ti[3]
*!*	   this.i_cenn_so  = da.cenn_se_ti[4]
*!*	   this.n_cenn_so  = da.cenn_se_ti[5]
*!*	   this.i_dph      = da.cenn_se_ti[6]
*!*	   this.n_dph      = da.cenn_se_ti[7]
*!*	   this.popisok()
*!*	  ENDIF 
*!*	 ENDIF 
*!*	 ENDPROC
*!*	 
*!*	ENDDEFINE
*!*	*-------------------------------------- Textbox pre ceny izieb--------
*!*	DEFINE CLASS te_ceti AS textbox

*!*	 p_hod=0
*!*	 readonly = .f.
*!*	 nulldisplay = ' '
*!*	 PROCEDURE when
*!*	  *WAIT WINDOW 'when i' nowait
*!*	 ENDPROC
*!*	ENDDEFINE 


*!*	*!*	 p_hod=0
*!*	*!*	 readonly = .t.
*!*	*!*	 nulldisplay = ' '
*!*	*!*	 PROCEDURE when
*!*	*!*	  *WAIT WINDOW 'when i' nowait
*!*	*!*	 ENDPROC

*!*	*!*	 PROCEDURE click
*!*	*!*	  PRIVATE lid
*!*	*!*	  lst = 't'+ALLTRIM(SUBSTR(this.ControlSource,6,3) )
*!*	*!*	  lid = st1.&lst
*!*	*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	*!*	  sy.ip_fil = .f.
*!*	*!*	  
*!*	*!*	  da.ip_i_akcia = -1
*!*	*!*	  da.remselect('Select i_akcia from akc_slu where i_akc_slu = ' + ALLTRIM(STR(lid)),'dki_akcia')
*!*	*!*	  SELECT 'dki_akcia'
*!*	*!*	  GO top
*!*	*!*	  da.ip_i_akcia = dki_akcia.i_akcia
*!*	*!*	  USE IN 'dki_akcia'
*!*	*!*	   
*!*	*!*	  da.ip_i_kongres = -1 
*!*	*!*	  da.remselect('Select i_kongres from akcia where i_akcia = ' + ALLTRIM(STR(da.ip_i_akcia)),'dki_kongres')
*!*	*!*	  SELECT 'dki_kongres'
*!*	*!*	  GO top
*!*	*!*	  da.ip_i_kongres = dki_kongres.i_kongres
*!*	*!*	  USE IN 'dki_kongres'
*!*	*!*	  
*!*	*!*	  sy.do_form(54,1,lid) && Akcie_priestory
*!*	*!*	  
*!*	*!*	 ENDPROC
*!*	*!*	 
*!*	*!*	*!*	 PROCEDURE rightclick
*!*	*!*	*!*	  da.ip_i_kongrs=st1.i_kongres
*!*	*!*	*!*	  da.ip_od = dtot(this.Parent.p_datum)
*!*	*!*	*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	*!*	*!*	  DO sm1.mpr
*!*	*!*	*!*	 ENDPROC

*!*	*!*	 BORDERSTYLE=0
*!*	*!*	ENDDEFINE



*!*	*_____________________________________ Ubyt / Reze - rebrík _________________________
*!*	DEFINE CLASS stl_sta AS Column

*!*	 p_datum=DATE(1950,1,1)
*!*	 typ = ''
*!*	 *Width=40
*!*	 
*!*	 headerclass='hli_sta'
*!*	 headerclasslibrary='progs\fs_tried.prg'
*!*	 *readonly=.f.
*!*	 ADD OBJECT pol as poi_sta
*!*	ENDDEFINE
*!*	*--------------------------------------

*!*	DEFINE CLASS hli_sta AS header
*!*	 caption = '1'
*!*	 PROCEDURE click
*!*	  
*!*	  da.ip_i_izba=st1.i_izba
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .t.
*!*	  IF eval(this.Parent.typ) = 200 
*!*	   sy.do_form(26) && reub
*!*	  ENDIF  
*!*	  IF eval(this.Parent.typ) = 300 
*!*	   sy.do_form(40) && ubyt
*!*	  ENDIF  

*!*	 ENDPROC
*!*	 *alignment=1
*!*	ENDDEFINE

*!*	DEFINE CLASS poi_sta AS textbox
*!*	 p_hod=0
*!*	 readonly = .t.
*!*	 nulldisplay = ' '
*!*	 PROCEDURE when
*!*	  *WAIT WINDOW 'when i' nowait
*!*	 ENDPROC

*!*	 PROCEDURE click
*!*	  *WAIT WINDOW (st1.n_izba + ' - ' + dtos(this.Parent.p_datum)) nowait
*!*	  
*!*	  da.ip_i_izba=st1.i_izba
*!*	  da.ip_od     = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  sy.g_reub_mod = 2 && editovanie 
*!*	  sy.ip_fil = .f.
*!*	  IF eval(this.Parent.typ) = 200 
*!*	   sy.do_form(26) && reub
*!*	  ENDIF  
*!*	  IF eval(this.Parent.typ) = 300 
*!*	   sy.do_form(40) && ubyt
*!*	  ENDIF  

*!*	 
*!*	 ENDPROC
*!*	 
*!*	 PROCEDURE rightclick
*!*	  da.ip_i_izba=st1.i_izba
*!*	  da.ip_od = dtot(this.Parent.p_datum)
*!*	  da.ip_termin = dtot(this.Parent.p_datum)
*!*	  DO sm1.mpr
*!*	 
*!*	 ENDPROC

*!*	 
*!*	 BORDERSTYLE=0
*!*	ENDDEFINE
*!*	*--------------------------------------------------------------------------
*!*	DEFINE CLASS pot_sta AS textbox
*!*	 p_hod=0
*!*	 nulldisplay = ' '
*!*	 PROCEDURE when
*!*	  WAIT WINDOW 'when' nowait
*!*	 ENDPROC

*!*	 PROCEDURE click
*!*	  WAIT WINDOW 'click' nowait
*!*	 ENDPROC
*!*	 

*!*	 
*!*	 BORDERSTYLE=0
*!*	ENDDEFINE


*!*	DEFINE CLASS stl_izb AS Column
*!*	 
*!*		Width=20
*!*		*BackColor=RGB(0,0,255)
*!*		headerclass='hlavagr'
*!*		headerclasslibrary='progs\ns_kniz2.prg'
*!*		*readonly=.f.
*!*		ADD OBJECT pol as polegr 
*!*	ENDDEFINE


*____________________________________ FORMULAR ______________________

DEFINE CLASS polz AS textbox
 vyh_text = ''
 borderstyle=0
 readonly = .t.
 
 nulldisplay = ' '
 PROCEDURE dblclick
  *WAIT WINDOW thisform.t_form 
  
  IF thisform.t_form = 3 && Vyberovy, cize modalny
   thisform.t_koniec = 2
   PRIVATE l_no
   l_no='fr' + ALLTRIM(STR(thisform.i_form))
   PUBLIC (l_no)
   SCATTER NAME  (l_no) MEMO
   thisform._gvyber() 
   thisform.release
  ENDIF 
 ENDPROC 
 
 PROCEDURE setfocus 
  this.vyh_text = ''
 ENDPROC 
 
 PROCEDURE keypress 
 LPARAMETERS nKeyCode, nShiftAltCtrl
  IF nKeyCode = 13 
   this.dblclick()
  ELSE  

  *WAIT WINDOW nKeyCode NOWAIT 
  DO CASE
   CASE nKeyCode = 24 OR nKeyCode = 5 OR nKeyCode = 4 OR nKeyCode = 19 OR nKeyCode = 3 OR nKeyCode = 18
    this.vyh_text = ''
   CASE nKeyCode = 6 OR nKeyCode = 1
    this.vyh_text = ''
   CASE nKeyCode = 27 OR nKeyCode = 7
    this.vyh_text = ''
   CASE nKeyCode = 127
    this.vyh_text = LEFT(this.vyh_text,LEN(this.vyh_text)-1)
   OTHERWISE 
    this.vyh_text = this.vyh_text + CHR(nKeyCode)
  ENDCASE
    WAIT WINDOW this.vyh_text NOWAIT 
   
  PRIVATE lalias,lcs
  lcs = this.parent.controlSource
  *WAIT WINDOW lcs
  TRY 
   IF !EMPTY(this.vyh_text)
    lzaz = RECNO()
    LOCATE FOR LOWER(&lcs) = LOWER(this.vyh_text) &&CHR(nKeyCode)
    IF FOUND()
     thisform.refresh()
    ELSE
     GO lzaz 
    ENDIF 
   ENDIF 
  CATCH 
  ENDTRY 
  ENDIF
 ENDPROC
 
 
ENDDEFINE 

*-------------------------------------------------------------------------
DEFINE CLASS stl_tip AS Column
 c_text = 0	
 
 *Width=40
	*BackColor=RGB(0,0,255)
		headerclass='hlaz'
		headerclasslibrary='progs\fs_tried.prg'
	*readonly=.f.
	*ADD OBJECT polz1 as polz
ENDDEFINE
*-------------------------------------------------------------------------
DEFINE CLASS stlz AS Column
 c_text = 0	
 
 *Width=40
	*BackColor=RGB(0,0,255)
		headerclass='hlaz'
		headerclasslibrary='progs\fs_tried.prg'
	*readonly=.f.
	ADD OBJECT polz1 as polz
ENDDEFINE

* -----------------------------------------------------------------------
DEFINE CLASS hlaz AS header
 mouseicon='c:\vvv\vfp\frontsql\ine\hider.ico'
 mousepointer=99

 i_text = .f.
 PROCEDURE init
  mouseicon='c:\vvv\vfp\frontsql\ine\hider.ico'
  mousepointer=99

 PRIVATE popisok
 popisok = this.caption
 IF TYPE('this.i_text')='N'
  try
  popisok = thisform.data1.atext(this.i_text)
  CATCH 
  endtry
  IF NOT EMPTY(ALLTRIM(popisok))
   this.caption= popisok
  ENDIF  
 ELSE
  TRY 
  popisok = thisform.data1.cs_atext(ALLTRIM(this.Parent.controlsource))
  CATCH 
  ENDTRY 
  IF NOT EMPTY(ALLTRIM(popisok))
   this.caption= popisok
  ENDIF 
 ENDIF  
 ENDPROC 
* ------------------------------------------------------------------------
 PROCEDURE zorad
 PARAMETERS ip_ako
 PRIVATE lstl,lcs,lal
  
  lcs = ALLTRIM(this.Parent.controlsource)
  lstl = JUSTEXT(lcs)
  lal = JUSTSTEM(lcs)

 TRY 
  SELECT (lal)
  SET ORDER TO 
  DELETE TAG ALL 
  SET INDEX TO 
  INDEX on &lcs TAG &lstl 
  IF ip_ako = 1
   SET ORDER TO &lstl ASCENDING   
  ELSE
   SET ORDER TO &lstl descending
  ENDIF  
  this.Parent.parent.refresh()
  CATCH 
  ENDTRY 
 
 ENDPROC 
 
 PROCEDURE click
 PRIVATE lstl,lcs,lal
  this.zorad(1)  
 ENDPROC
 
 PROCEDURE rightclick
 PRIVATE lstl,lcs,lal
  this.zorad(2)  
 ENDPROC

 *alignment=1
ENDDEFINE


*------------------------------
DEFINE CLASS stlv AS Column
 c_text = 0	
 readonly = .t.
 *Width=40
	*BackColor=RGB(0,0,255)
		headerclass='hlav'
		headerclasslibrary='progs\fs_tried.prg'
	*readonly=.f.
	ADD OBJECT polv as polv
ENDDEFINE


DEFINE CLASS hlav AS header

 PROCEDURE init
  PRIVATE popisok
  popisok = this.caption
  try
   popisok = thisform.data1.cs_atext(ALLTRIM(this.Parent.controlsource))
  CATCH 
  ENDTRY 
  
  IF NOT EMPTY(ALLTRIM(popisok))
   this.caption= popisok
  ENDIF 
*  this.caption = thisform.data1.atext(VAL(ALLTRIM(DBGETPROP(ALLTRIM(this.Parent.controlsource), 'Field', 'Comment')))) 
 ENDPROC 
 PROCEDURE click
  
 ENDPROC
 *alignment=1
ENDDEFINE


DEFINE CLASS polv AS textbox
 p_hod=0
 readonly = .t.
 nulldisplay = ' '
 PROCEDURE dblclick
  thisform._koniec
 ENDPROC

 PROCEDURE click
 
 ENDPROC

ENDDEFINE 


*---------------------------------------
DEFINE CLASS mlabel AS Column

 typ = ''
 Width=40
 
ENDDEFINE
*---------------------------------------
DEFINE CLASS stltip AS Column
 c_text = 0	
 
 *Width=40
	*BackColor=RGB(0,0,255)
		headerclass='hlatip'
		headerclasslibrary='progs\fs_tried.prg'
	*readonly=.f.
ENDDEFINE

* -----------------------------------------------------------------------
DEFINE CLASS hlatip AS header
 mouseicon='c:\vvv\vfp\frontsql\ine\hider.ico'
 mousepointer=99

 i_text = .f.
 PROCEDURE init
  mouseicon='c:\vvv\vfp\frontsql\ine\hider.ico'
  mousepointer=99

 PRIVATE popisok
 popisok = this.caption
 IF TYPE('this.i_text')='N'
  
  TRY 
  popisok = thisform.data1.atext(this.i_text)
  CATCH 
  ENDTRY 
  
  IF NOT EMPTY(ALLTRIM(popisok))
   this.caption= popisok
  ENDIF  
 ELSE
  try
  popisok = thisform.data1.cs_atext(ALLTRIM(this.Parent.controlsource))
  CATCH
  ENDTRY 
  IF NOT EMPTY(ALLTRIM(popisok))
   this.caption= popisok
  ENDIF 
 ENDIF  
 ENDPROC 
 ENDDEFINE
