*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="cautare.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS caut_nou AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Criteriu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Criteriu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grup_optiuni_filtru1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_actiune
		*m: do_cauta
		*m: do_reset
		*m: init_numar
		*m: make_filtru
		*m: make_filtru_ora
		*m: reset_camp
		*m: selectie_camp
		*p: caction
		*p: camp_activ
		*p: camp_nume
		*p: filtru
		*p: filtru_vfp
		*p: grid
		*p: nrzec
		*p: procedura
		*p: tip_data
	*</DefinedPropArrayMethod>

	*<PropValue>
		caction = actualizeaza_grid1
		camp_activ = 0
		camp_nume = 
		filtru = 
		filtru_vfp = 
		grid = 
		Height = 81
		Name = "caut_nou"
		nrzec = 0
		procedura = 
		tip_data = 
		Width = 510
	*</PropValue>

	ADD OBJECT '_combobox1' AS _combobox WITH ;
		Height = 24, ;
		Left = 7, ;
		Name = "_combobox1", ;
		RowSourceType = 5, ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 4, ;
		Width = 109
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Caption = "Cautã", ;
		Height = 23, ;
		Left = 423, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 4, ;
		Top = 4, ;
		Width = 84
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Height = 23, ;
		Left = 422, ;
		Name = "Cmd_reset1", ;
		Top = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Criteriu' AS criteriu_text WITH ;
		Left = 121, ;
		Name = "Criteriu", ;
		TabIndex = 5, ;
		Top = 4
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="combobox" />

	ADD OBJECT 'Criteriu2' AS criteriu_text WITH ;
		Left = 121, ;
		Name = "Criteriu2", ;
		TabIndex = 6, ;
		Top = 52, ;
		Visible = .F.
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="combobox" />

	ADD OBJECT 'Grup_optiuni_filtru1' AS grup_optiuni_filtru WITH ;
		Height = 27, ;
		Left = 207, ;
		Name = "Grup_optiuni_filtru1", ;
		TabIndex = 7, ;
		Top = 24, ;
		Width = 193, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.Left = 66, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option3.Left = 134, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'Lb_simplu1' AS lb_simplu WITH ;
		Caption = "Acces rapid : CTRL + Q", ;
		Height = 17, ;
		Left = 7, ;
		Name = "Lb_simplu1", ;
		Top = 31, ;
		Width = 127, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'Text' AS _textbox WITH ;
		Format = "!KT", ;
		Height = 25, ;
		Left = 221, ;
		Name = "Text", ;
		TabIndex = 2, ;
		ToolTipText = "", ;
		Top = 4, ;
		Width = 198
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Format = "!KT", ;
		Height = 25, ;
		Left = 221, ;
		Name = "Text2", ;
		TabIndex = 3, ;
		Top = 52, ;
		Visible = .F., ;
		Width = 198
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE do_actiune
		EXTERNAL ARRAY TASC
		lcfiltru = "1=1"
		
		FOR i=1 TO ALEN(tasc,1)
			IF EMPTY(tasc[i,5])
				LOOP 
			ENDIF 	
			lcfiltru = lcfiltru + [ AND ] + ALLTRIM(tasc[i,5])	
		ENDFOR 	
			this.filtru = lcfiltru 
			
		LOCAL lcAction, lcCommand
		lcAction = this.cAction
		
		IF EMPTY(lcAction)
			RETURN
		ENDIF 
		
		IF TYPE('this.parent') = 'O' AND PEMSTATUS(this.parent,lcAction,5)
		
			lcCommand = [this.Parent.]  + lcAction + [("] + this.filtru + [")]
			&lcCommand
			lcgrid = 'this.parent.'+ this.grid
			IF TYPE(lcgrid) = 'O'
				lcCommand2 = lcgrid + [.setfocus()]
				&lcCommand2	
			ENDIF 	
		ELSE
			IF TYPE('this.parent.PARENT') = 'O' AND PEMSTATUS(this.parent.parent,lcAction,5)
				lcCommand = [this.Parent.Parent.] + lcAction + [(] + this.filtru + [)]
				&lcCommand
			ELSE
				IF PEMSTATUS(THISFORM,lcAction,5)
					lcCommand = [thisform.] + lcAction + [(] + this.filtru + [)]
					&lcCommand
				ENDIF 
			ENDIF 
		ENDIF 
		
		
	ENDPROC

	PROCEDURE do_cauta
		EXTERNAL ARRAY TASC
		Do Case
		Case This.grup_optiuni_filtru1.Value = 1
			lcIntre = ''
		Case This.grup_optiuni_filtru1.Value = 2
			lcIntre = [ AND ]
		Otherwise
			lcIntre = [ OR ]
		Endcase
		*!*		IF TYPE("pcIntre") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cIntre
		*!*			pcIntre = lcIntre
		*!*		ENDIF 
		
		
			WITH this 
				LOCAL lnCriteriu,lnCriteriu2, lcNume, lcNume2
				lnCriteriu = .criteriu.Value
				lnCriteriu2 = .criteriu2.Value	
		
				IF .tip_data='C'
					lcNume = ALLTRIM(.text.value)
					lcNume2 = ALLTRIM(.text2.value)
				ENDIF 
				
				If .tip_data = 'N'
		
					lnNrZec=.nrZec
					lcNume = Alltrim(Str(.Text.Value,MAX(20,Len(Str(.Text.Value))),.nrzec))
					lcNume2 = Alltrim(Str(.Text2.Value,MAX(20,Len(Str(.Text2.Value))),.nrzec))
		*!*				lcNumarVFP1 =lcNumar1
		*!*				lcNumarVFP2 = lcNumar2
				ENDIF 
				IF .tip_data = 'D' OR .tip_data = 'DT'
					lcNume =Alltrim(Dtos(.Text.Value))
					lcNume2 =Alltrim(Dtos(.Text2.Value))
					lcNumarVFP1=Alltrim(Dtoc(.Text.Value))
					lcNumarVFP2=Alltrim(Dtoc(.Text2.Value))
				ENDIF
				
				IF .tip_data = 'T'
					lcNume =Alltrim(Dtos(.Text.Value))
					lcNume2 =Alltrim(Dtos(.Text2.Value))
					lcNumarVFP1=Alltrim(Ttoc(.Text.Value))
					lcNumarVFP2=Alltrim(Ttoc(.Text2.Value))
				ENDIF 				
						
				
		*!*			IF TYPE("pcValoare1") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cValoare1
		*!*				pcValoare1 = lcNume
		*!*			ENDIF 
		*!*			IF TYPE("pcValoare2") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cValoare2
		*!*				pcValoare2 = lcNume2
		*!*			ENDIF 
		*!*			IF TYPE("pnCriteriu")="N"
		*!*				pnCriteriu = lnCriteriu
		*!*			ENDIF 
		*!*			IF TYPE("pnCriteriu2")="N"
		*!*				pnCriteriu2 = lnCriteriu2
		*!*			ENDIF 
					
				If Empty(lcNume) And Empty(lcNume2) AND lnCriteriu<=5
					tasc[this.camp_activ,5]=.f.
					.filtru_vfp = ""
					this.do_actiune()
					RETURN 
				ENDIF
		
			    .make_filtru_ora(lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2)
		
			ENDWITH 
		
		this.do_actiune()
		
	ENDPROC

	PROCEDURE do_reset
		EXTERNAL ARRAY TASC
		FOR i=1 TO ALEN(tasc,1)
			tasc[i,5] = .f.
		ENDFOR 	
		this.reset_camp()				
		this.do_actiune()
	ENDPROC

	PROCEDURE Init
		
		*!*	tas = EVALUATE(this.procedura)
		WITH this 
			.Height = 51
			._combobox1.RowSource="tasc"
			._combobox1.value=1
			.criteriu.Value=1
			.criteriu2.Value=1
			.selectie_camp(._COMBOBOX1.value)
		ENDWITH 	
		
		
	ENDPROC

	PROCEDURE init_numar
		LPARAMETERS lnCriteriu1,lnCriteriu2,lcNrZec,lcMask
		
		
		WITH this
		
			
			IF TYPE('lnNrZec') # 'N'
				.nrZec = 0
			ELSE 
				.nrZec = VAL(lcNrZec)
			ENDIF 
			.criteriu.RowSource="> = ,1,< = ,2, = ,3, # ,4, > ,5, < ,6"
			.criteriu2.RowSource="> = ,1,< = ,2, = ,3, # ,4, > ,5, < ,6"
			.criteriu.value = lnCriteriu1
			.criteriu2.value = lnCriteriu2
			IF !EMPTY(lcMask)
				.text.inputmask=lcMask
				.text2.inputmask=lcMask
			ELSE 
				.text.inputmask=""	
				.text2.inputmask=""
			ENDIF
			IF .tip_data='N'
				.text.InputMask = "999 999 999 999"
				.text.Value = 0
				.text2.InputMask = "999 999 999 999"		
				.text2.Value = 0
			ENDIF 	
			IF .tip_Data = 'D' OR .tip_data = 'DT'
				.text.value={}
				.text2.value={}
			ENDIF	
			IF .tip_Data = 'T'
				.text.value = { //:}	
				.text2.value = { //:}	
			ENDIF 							
				
		ENDWITH 
	ENDPROC

	PROCEDURE make_filtru
		LPARAMETERS lcNumar1,lcNumar2,lnCriteriu1,lnCriteriu2
		LOCAL llCampuri,lcListaCampuri,lcFiltru
		lcFiltru=""
		WITH THISFORM
			IF .tip_data='N'
				DO CASE
				CASE lnCriteriu1 = 1
					lcsemn1 = [>=]
				CASE lnCriteriu1 = 2
					lcsemn1 = [<=]
				CASE lnCriteriu1 = 3
					lcsemn1 = [=]
				CASE lnCriteriu1 = 4
					lcsemn1 = [<>]
				CASE lnCriteriu1 = 5
					lcsemn1 = [>]
				CASE lnCriteriu1 = 6
					lcsemn1 = [<]
				ENDCASE
				DO CASE
				CASE lnCriteriu2 = 1
					lcsemn2 = [>=]
				CASE lnCriteriu2 = 2
					lcsemn2 = [<=]
				CASE lnCriteriu2 = 3
					lcsemn2 = [=]
				CASE lnCriteriu2 = 4
					lcsemn2 = [<>]
				CASE lnCriteriu2 = 5
					lcsemn2 = [>]
				CASE lnCriteriu2 = 6
					lcsemn2 = [<]
				ENDCASE
				IF THIS.opTIONGROUP2.VALUE = 1
					.filtru_text = .camp_nume + lcsemn1 + lcNumar1 + [ and ] + .camp_nume + lcsemn2 + lcNumar2
				ELSE
					.filtru_text = [(] + .camp_nume + lcsemn1 + lcNumar1 + [ or ] + .camp_nume + lcsemn2 + lcNumar2 + [)]
				ENDIF
			
			ELSE
				Do Case
				Case lnCriteriu1 = 1
					lcSemn1=[>=]
				Case lnCriteriu1 = 2
					lcSemn1=[>]
				Endcase
				Do Case
				Case lnCriteriu2 = 1
					lcSemn2=[<=]
				Case lnCriteriu2 = 2
					lcSemn2=[<]
				Endcase
				If .opTIONGROUP1.Value = 1
					DO CASE 
					CASE .tip_data= 'D'
						.filtru_text = .camp_nume + lcSemn1 +[CTOD('] +lcNumar1 + [') AND ] + .camp_nume + lcSemn2 +[CTOD(']+lcNumar2+[')]
					CASE .tip_data= 'DT'
						.filtru_text = [TTOD(] + .camp_nume + [)] + lcSemn1 +[CTOD('] +lcNumar1 + [') AND ] + [TTOD(] + .camp_nume + [)] + lcSemn2 +[CTOD(']+lcNumar2+[')]
					CASE .tip_data= 'T'
						.filtru_text = .camp_nume + lcSemn1 +[CTOT('] +lcNumar1 + [') AND ] + .camp_nume + lcSemn2 +[CTOT(']+lcNumar2+[')]
							
					OTHERWISE 
					ENDCASE 	
								
				ELSE
					DO CASE 
					CASE .tip_data= 'D'
						.filtru_text = .camp_nume + lcSemn1 +[CTOD(']+lcNumar1 + [') OR ] + .camp_nume + lcSemn2 + [CTOD(']+lcNumar2+[')]
					CASE .tip_data= 'DT'
						.filtru_text = [TTOD(] + .camp_nume + [)] + lcSemn1 +[CTOD(']+lcNumar1 + [') OR ] + [TTOD(] + .camp_nume + [)] + lcSemn2 + [CTOD(']+lcNumar2+[')]
					CASE .tip_data= 'T'
						.filtru_text = .camp_nume + lcSemn1 +[CTOT('] +lcNumar1 + [') OR ] + .camp_nume + lcSemn2 +[CTOT(']+lcNumar2+[')]
					OTHERWISE 
					ENDCASE 	
							
				Endif		
				
			ENDIF
		ENDWITH
		
	ENDPROC

	PROCEDURE make_filtru_ora
		LPARAMETERS lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2
		EXTERNAL ARRAY TASC
		LOCAL lcFiltru
		lcFiltru=""
		
		
		WITH THIS
			IF .tip_data='C'
		
		
				DO CASE
				CASE lnCriteriu=1
					lcFiltru = [nume_camp_cautat LIKE '] + UPPER(ALLTRIM(lcNume)) + [%']
				CASE lnCriteriu=2
					lcFiltru = [nume_camp_cautat ='] + UPPER(ALLTRIM(lcNume)) + [']
				CASE lnCriteriu=3
					lcFiltru = [nume_camp_cautat !='] + UPPER(ALLTRIM(lcNume)) + [']
				CASE lnCriteriu=4
					lcFiltru = [nume_camp_cautat LIKE '%] + UPPER(ALLTRIM(lcNume)) + [%']
				CASE lnCriteriu=5
					lcFiltru = [nume_camp_cautat NOT LIKE '%] + UPPER(ALLTRIM(lcNume)) + [%']
				CASE lnCriteriu=6
					lcFiltru = [nume_camp_cautat is null]
				CASE lnCriteriu=7
					lcFiltru = [nume_camp_cautat is not null]
				ENDCASE
				IF !EMPTY(lcIntre)
					DO CASE
					CASE lnCriteriu2=1
						lcFiltru = lcFiltru + [ ] + UPPER(ALLTRIM(lcIntre)) + [ nume_camp_cautat LIKE '] + UPPER(ALLTRIM(lcNume2)) + [%']
					CASE lnCriteriu2=2
						lcFiltru = lcFiltru + [ ] + UPPER(ALLTRIM(lcIntre)) + [ nume_camp_cautat ='] + UPPER(ALLTRIM(lcNume2)) + [']
					CASE lnCriteriu2=3
						lcFiltru = lcFiltru + [ ] + UPPER(ALLTRIM(lcIntre)) + [ nume_camp_cautat !='] + UPPER(ALLTRIM(lcNume2)) + [']
					CASE lnCriteriu2=4
						lcFiltru = lcFiltru + [ ] + UPPER(ALLTRIM(lcIntre)) + [ nume_camp_cautat LIKE '%] + UPPER(ALLTRIM(lcNume2)) + [%']
					CASE lnCriteriu2=5
						lcFiltru = lcFiltru + [ ] + UPPER(ALLTRIM(lcIntre)) + [ nume_camp_cautat NOT LIKE '%] + UPPER(ALLTRIM(lcNume2)) + [%']
					CASE lnCriteriu=6
						lcFiltru = [nume_camp_cautat is null]
					CASE lnCriteriu=7
						lcFiltru = [nume_camp_cautat is not null]
					ENDCASE
				ENDIF
		*!*			.filtru = .filtru + [conditie_logica(] + STRTRAN(lcFiltru,"nume_camp_cautat",UPPER(.camp_nume)) + [)]
		*!*			.filtru = STRTRAN(.filtru,"conditie_logica"," AND ")
				lcfiltru = [conditie_logica(] + STRTRAN(lcFiltru,"nume_camp_cautat",UPPER(.camp_nume)) + [)]
				tasc[.camp_activ,5] = STRTRAN(lcfiltru,"conditie_logica"," ")
			ENDIF
		
			IF .tip_data=='N'
		
				DO CASE
				CASE lnCriteriu = 1
					lcSemn1 = [>=]
				CASE lnCriteriu = 2
					lcSemn1 = [<=]
				CASE lnCriteriu = 3
					lcSemn1 = [=]
				CASE lnCriteriu = 4
					lcSemn1 = [<>]
				CASE lnCriteriu = 5
					lcSemn1 = [>]
				CASE lnCriteriu = 6
					lcSemn1 = [<]
				ENDCASE
				DO CASE
				CASE lnCriteriu2 = 1
					lcSemn2 = [>=]
				CASE lnCriteriu2 = 2
					lcSemn2 = [<=]
				CASE lnCriteriu2 = 3
					lcSemn2 = [=]
				CASE lnCriteriu2 = 4
					lcSemn2 = [<>]
				CASE lnCriteriu2 = 5
					lcSemn2 = [>]
				CASE lnCriteriu2 = 6
					lcSemn2 = [<]
				ENDCASE
		
				DO CASE 
					CASE .gruP_OPTIUNI_FILTRU1.VALUE = 2
					lcFiltru = [nume_camp_cautat] + lcSemn1 + lcNume+ [ AND nume_camp_cautat ] + lcSemn2 + lcNume2
					CASE .gruP_OPTIUNI_FILTRU1.VALUE = 3
					lcFiltru = [nume_camp_cautat ] + lcSemn1 + lcNume+ [ OR nume_camp_cautat ] + lcSemn2 + lcNume2
					OTHERWISE 
					lcFiltru = [nume_camp_cautat ] + lcSemn1 + lcNume
				ENDCASE 
				lcfiltru = [conditie_logica(] + STRTRAN(lcFiltru,"nume_camp_cautat",UPPER(.camp_nume)) + [)]
				tasc[.camp_activ,5] = STRTRAN(lcfiltru,"conditie_logica"," ")
		
			ENDIF
		
			IF .tip_data='D' OR .tip_data='DT'
				pcDataEmpty = [1900-01-01]
				IF EMPTY(lcNumar1)
					lcNume= pcDataEmpty
				ENDIF
				IF EMPTY(lcNumar2)
					lcNume2= pcDataEmpty
				ENDIF
		
				DO CASE
				CASE lnCriteriu1 = 1
					lcNume= ['] + lcNume+ [ 00:00:00','YYYY-MM-DD HH24:MI:SS']	&& >=
				CASE lnCriteriu1 = 2
					lcNume= ['] + lcNume+ [','YYYY-MM-DD']						&& >
				ENDCASE
				DO CASE
				CASE lnCriteriu2 = 1
					lcNume2= ['] + lcNume2+ [ 23:59:59','YYYY-MM-DD HH24:MI:SS']	&& <=
				CASE lnCriteriu2 = 2
					lcNume2= ['] + lcNume2+ [','YYYY-MM-DD']						&& <
				ENDCASE
				DO CASE 
					CASE .Grup_optiuni_filtru1.VALUE = 2
					lcFiltru = [NVL(nume_camp_cautat,to_date('] + pcDataEmpty + [','YYYY-MM-DD')) between to_date(] + lcNume+ [) AND to_date(] + lcNume2+ [)]
					CASE .Grup_optiuni_filtru1.VALUE = 3
					lcFiltru = [NVL(nume_camp_cautat,to_date('] + pcDataEmpty + [','YYYY-MM-DD')) between to_date(] + lcNume+ [) OR to_date(] + lcNume2+ [)]
					OTHERWISE 
					lcFiltru = [NVL(nume_camp_cautat,to_date('] + pcDataEmpty + [','YYYY-MM-DD'))=to_date(] + lcnume + [)]
				ENDCASE 
		
		
				.filtru = .filtru + [conditie_logica(] + STRTRAN(lcFiltru,"nume_camp_cautat",UPPER(.camp_nume)) + [)]
				.filtru = STRTRAN(.filtru,"conditie_logica"," AND ")
			ENDIF
		
		ENDWITH
		
	ENDPROC

	PROCEDURE reset_camp
		WITH this 
			DO CASE 
				CASE .tip_data='N'
					.text.Value = 0
					.text2.Value = 0
				CASE .tip_Data = 'D' OR .tip_data = 'DT'
					.text.value={}
					.text2.value={}
				CASE .tip_data='C'
					.text.value=''	
					.text2.value=''
					.text.inputmask=""	
				    .text2.inputmask=""
				OTHERWISE 
			ENDCASE 	
		ENDWITH 	
	ENDPROC

	PROCEDURE selectie_camp
		LPARAMETERS tnvalue
		EXTERNAL ARRAY TASC
		lnvalue = tnvalue
		
		WITH this
		  		.camp_nume=tasc[lnvalue,1]
				.tip_data=UPPER(ALLTRIM(tasc[lnvalue,2]))
				.camp_activ = lnvalue
			IF  .tip_data='C'
		
				.criteriu.RowSource="incepe cu...,1,este...,2,nu este...,3,contine...,4,nu contine...,5,nu are valori,6,are valori,7"
				.criteriu2.RowSource="incepe cu...,1,este...,2,nu este...,3,contine...,4,nu contine...,5,nu are valori,6,are valori,7"
				.criteriu.Refresh 
				.criteriu2.Refresh 
				.grup_optiuni_filtru1.value=1
				.reset_camp()		
			ELSE
				.init_numar(1,2,tasc[lnvalue,3],tasc[lnvalue,4])		
				.criteriu.Refresh 
				.criteriu2.Refresh 
				.text.Refresh 
				.text2.Refresh 	
		 		.grup_optiuni_filtru1.value=2	
				.grup_optiuni_filtru1.Refresh 		
			ENDIF 
		
		ENDWITH 
	ENDPROC

	PROCEDURE Criteriu.InteractiveChange
		If This.Value>5
			This.Parent.Text.Value=""
			this.parent.Text.ReadOnly=.T.
		Else
			This.Parent.Text.ReadOnly=.F.
			This.Parent.Text.SetFocus
		Endif
	ENDPROC

	PROCEDURE Criteriu2.InteractiveChange
		If This.Value>5
			this.parent.Text2.Value=""
			this.parent.Text2.ReadOnly=.T.
		Else
			this.parent.Text2.ReadOnly=.F.
			this.parent.Text2.SetFocus
		Endif
	ENDPROC

	PROCEDURE Grup_optiuni_filtru1.InteractiveChange
		IF this.Value # 1
			this.Parent.Height = 81
			this.Parent.criteriu2.Visible= .T. 
			this.Parent.text2.Visible=.t.
		ELSE 
		    this.Parent.Height = 51
		    this.Parent.criteriu2.Visible=.f.
		    this.Parent.text2.Visible=.f.
		ENDIF 
		
	ENDPROC

	PROCEDURE Grup_optiuni_filtru1.ProgrammaticChange
		IF this.Value # 1
			this.Parent.Height = 81
			this.Parent.criteriu2.Visible= .T. 
			this.Parent.text2.Visible=.t.
		ELSE 
		    this.Parent.Height = 51
		    this.Parent.criteriu2.Visible=.f.
		    this.Parent.text2.Visible=.f.
		ENDIF 
		
	ENDPROC

	PROCEDURE Text.LostFocus
		this.Parent.text2.Value=this.Value 
	ENDPROC

	PROCEDURE _combobox1.Valid
		this.Parent.selectie_camp(this.Value)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_combobox AS formtermin OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ct_text" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: makef_ora
		*m: makef_vfp
		*p: camp_nume
		*p: filtru
		*p: filtru_vfp
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		filtru = 
		filtru_vfp = 
		Height = 73
		Name = "frm_combobox"
		ScrollBars = 0
		Width = 388
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 390
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 326
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 359
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 9
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 22
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 327, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ct_text' AS cb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 5, ;
		Name = "ct_text", ;
		TabIndex = 1, ;
		Top = 38, ;
		Width = 381, ;
		_cbbase1.Anchor = 10, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ColumnLines = .F., ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 140, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSourceType = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 232, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

ENDDEFINE

DEFINE CLASS frm_editbox AS formtermin OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ct_text" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: makef_ora
		*m: makef_vfp
		*p: camp_nume
		*p: filtru
		*p: filtru_vfp
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		filtru = 
		filtru_vfp = 
		Height = 204
		Name = "frm_editbox"
		ScrollBars = 0
		Width = 388
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 390
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 326
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 359
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 9
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 22
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 327, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ct_text' AS ed_tx_simplu WITH ;
		Anchor = 15, ;
		Height = 156, ;
		Left = 12, ;
		Name = "ct_text", ;
		TabIndex = 1, ;
		Top = 40, ;
		Width = 360, ;
		_edbase1.Anchor = 15, ;
		_edbase1.Height = 125, ;
		_edbase1.Left = 9, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 24, ;
		_edbase1.Width = 344, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

ENDDEFINE

DEFINE CLASS frm_filtru_text AS formtermin OF "..\..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Criteriu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Criteriu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grup_optiuni_filtru" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: makef_ora
		*m: makef_vfp
		*p: camp_nume
		*p: filtru
		*p: filtru_vfp
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		filtru = 
		filtru_vfp = 
		Height = 115
		Name = "frm_filtru_text"
		ScrollBars = 0
		Width = 320
		_shape1.Name = "_shape1"
		_shape2.Left = 286
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 290
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'Criteriu' AS criteriu_text WITH ;
		Left = 10, ;
		Name = "Criteriu", ;
		Top = 62
		*< END OBJECT: ClassLib="..\..\comun\clase\caut_ora.vcx" BaseClass="combobox" />

	ADD OBJECT 'Criteriu2' AS criteriu_text WITH ;
		Left = 10, ;
		Name = "Criteriu2", ;
		TabIndex = 6, ;
		Top = 120
		*< END OBJECT: ClassLib="..\..\comun\clase\caut_ora.vcx" BaseClass="combobox" />

	ADD OBJECT 'Grup_optiuni_filtru' AS grup_optiuni_filtru WITH ;
		Left = 94, ;
		Name = "Grup_optiuni_filtru", ;
		TabIndex = 7, ;
		Top = 90, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.Left = 66, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option3.Left = 134, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5
		*< END OBJECT: ClassLib="..\..\comun\clase\caut_ora.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'Text' AS _textbox WITH ;
		Format = "!KT", ;
		Height = 25, ;
		Left = 110, ;
		Name = "Text", ;
		TabIndex = 1, ;
		ToolTipText = "", ;
		Top = 62, ;
		Width = 198
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Format = "!KT", ;
		Height = 25, ;
		Left = 110, ;
		Name = "Text2", ;
		TabIndex = 2, ;
		Top = 120, ;
		Width = 198
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Destroy
		Do Case
		Case Thisform.grup_optiuni_filtru.Value = 1
			lcIntre = ''
		Case Thisform.grup_optiuni_filtru.Value = 2
			lcIntre = [ AND ]
		Otherwise
			lcIntre = [ OR ]
		Endcase
		
		If Type("pcIntre") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cIntre
			pcIntre = lcIntre
		Endif
		
		With This
			Local lnCriteriu,lnCriteriu2, lcNume, lcNume2
			lnCriteriu = .criteriu.Value
			lnCriteriu2 = .criteriu2.Value
		
			lcNume = Alltrim(.Text.Value)
			lcNume2 = Alltrim(.text2.Value)
		
			If Type("pcValoare1") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cValoare1
				pcValoare1 = lcNume
			Endif
			If Type("pcValoare2") = "C" && variabila privata folosita in ck_filtru_text pt a initializa proprietatea cValoare2
				pcValoare2 = lcNume2
			Endif
			If Type("pnCriteriu") = "N"
				pnCriteriu = lnCriteriu
			Endif
			If Type("pnCriteriu2") = "N"
				pnCriteriu2 = lnCriteriu2
			Endif
		
			If Empty(lcNume) And Empty(lcNume2) AND lnCriteriu<=5
				.filtru = ""
				.filtru_vfp = ""
				Return
			Endif
		
			Thisform.makef_ora(lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2)
			Thisform.makef_vfp(lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2)
			pcFiltru = .filtru
			pcFiltruVFP = .filtru_vfp
		Endwith
		*!*		Do Case
		*!*		Case lnCriteriu=1
		*!*			lcFiltru = [nume_camp_cautat LIKE '] + Upper(Alltrim(lcNume)) + [%']
		*!*		Case lnCriteriu=2
		*!*			lcFiltru = [nume_camp_cautat ='] + Upper(Alltrim(lcNume)) + [']
		*!*		Case lnCriteriu=3
		*!*			lcFiltru = [nume_camp_cautat !='] + Upper(Alltrim(lcNume)) + [']
		*!*		Case lnCriteriu=4
		*!*			lcFiltru = [nume_camp_cautat LIKE '%] + Upper(Alltrim(lcNume)) + [%']
		*!*		Case lnCriteriu=5
		*!*			lcFiltru = [nume_camp_cautat NOT LIKE '%] + Upper(Alltrim(lcNume)) + [%']
		*!*		Endcase
		*!*		If !Empty(lcIntre)
		*!*			Do Case
		*!*			Case lnCriteriu2=1
		*!*				lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat LIKE '] + Upper(Alltrim(lcNume2)) + [%']
		*!*			Case lnCriteriu2=2
		*!*				lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat ='] + Upper(Alltrim(lcNume2)) + [']
		*!*			Case lnCriteriu2=3
		*!*				lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat !='] + Upper(Alltrim(lcNume2)) + [']
		*!*			Case lnCriteriu2=4
		*!*				lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat LIKE '%] + Upper(Alltrim(lcNume2)) + [%']
		*!*			Case lnCriteriu2=5
		*!*				lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat NOT LIKE '%] + Upper(Alltrim(lcNume2)) + [%']
		*!*			Endcase
		*!*		Endif
		
		*!*		llCampuri=.F.
		*!*		lcListaCampuri=.camp_nume
		*!*		DO WHILE !EMPTY(lcListaCampuri)
		*!*			IF OCCURS(',',lcListaCampuri)>0
		*!*				lcCamp=SUBSTR(lcListaCampuri,1,AT(',',lcListaCampuri,1)-1)
		*!*				lcListaCampuri=SUBSTR(lcListaCampuri,AT(',',lcListaCampuri,1)+1)
		*!*				llCampuri=.T.
		*!*			ELSE
		*!*				lcCamp=lcListaCampuri
		*!*				lcListaCampuri=""
		*!*			ENDIF
		*!*			.filtru = .filtru + [conditie_logica(] + STRTRAN(lcFiltru,"nume_camp_cautat",UPPER(lcCamp)) + [)]
		*!*		ENDDO
		
		*!*		IF llCampuri
		*!*			.filtru = STRTRAN([ AND (] + STRTRAN(.filtru,"conditie_logica"," OR ",2) + [)],"conditie_logica","")
		*!*		ELSE
		*!*			.filtru = STRTRAN(.filtru,"conditie_logica"," AND ")
		*!*		ENDIF
	ENDPROC

	PROCEDURE Init
		Lparameters lcCampNume,lcTitlu,lnCriteriu,lnCriteriu2
		
		DoDefault()
		lcTitlu=Strtran(lcTitlu,'\<','')
		With Thisform
			.criteriu.Value = lnCriteriu
			If lnCriteriu>5
				.Text.ReadOnly=.T.
			Endif
			.criteriu2.Value = lnCriteriu2
			If lnCriteriu2>5
				.Text2.ReadOnly=.T.
			Endif
			.camp_nume = lcCampNume
			.Lb_titlu_alb_b121.Caption = UPPER(lcTitlu)
			.Text.ToolTipText='Introduceti expresia cu care se compara ' + Lower(lcTitlu)
			.text2.ToolTipText='Introduceti expresia cu care se compara ' + Lower(lcTitlu)
			If Empty(lcCampNume)
				.Text.Enabled = .F.
				.criteriu.Enabled = .F.
				.text2.Enabled = .F.
				.criteriu2.Enabled = .F.
			Endif
		Endwith
	ENDPROC

	PROCEDURE makef_ora
		Lparameters lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2
		Local llCampuri,lcListaCampuri,lcFiltru
		lcFiltru=""
		With This
			Do Case
			Case lnCriteriu=1
				lcFiltru = [nume_camp_cautat LIKE '] + Upper(Alltrim(lcNume)) + [%']
			Case lnCriteriu=2
				lcFiltru = [nume_camp_cautat ='] + Upper(Alltrim(lcNume)) + [']
			Case lnCriteriu=3
				lcFiltru = [nume_camp_cautat !='] + Upper(Alltrim(lcNume)) + [']
			Case lnCriteriu=4
				lcFiltru = [nume_camp_cautat LIKE '%] + Upper(Alltrim(lcNume)) + [%']
			Case lnCriteriu=5
				lcFiltru = [nume_camp_cautat NOT LIKE '%] + Upper(Alltrim(lcNume)) + [%']
			Case lnCriteriu=6
				lcFiltru = [nume_camp_cautat is null]
			Case lnCriteriu=7
				lcFiltru = [nume_camp_cautat is not null]
			Endcase
			If !Empty(lcIntre)
				Do Case
				Case lnCriteriu2=1
					lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat LIKE '] + Upper(Alltrim(lcNume2)) + [%']
				Case lnCriteriu2=2
					lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat ='] + Upper(Alltrim(lcNume2)) + [']
				Case lnCriteriu2=3
					lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat !='] + Upper(Alltrim(lcNume2)) + [']
				Case lnCriteriu2=4
					lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat LIKE '%] + Upper(Alltrim(lcNume2)) + [%']
				Case lnCriteriu2=5
					lcFiltru = lcFiltru + [ ] + Upper(Alltrim(lcIntre)) + [ nume_camp_cautat NOT LIKE '%] + Upper(Alltrim(lcNume2)) + [%']
				Case lnCriteriu=6
					lcFiltru = [nume_camp_cautat is null]
				Case lnCriteriu=7
					lcFiltru = [nume_camp_cautat is not null]
				Endcase
			Endif
			llCampuri=.F.
			lcListaCampuri=.camp_nume
			Do While !Empty(lcListaCampuri)
				If Occurs(',',lcListaCampuri)>0
					lcCamp=Substr(lcListaCampuri,1,At(',',lcListaCampuri,1)-1)
					lcListaCampuri=Substr(lcListaCampuri,At(',',lcListaCampuri,1)+1)
					llCampuri=.T.
				Else
					lcCamp=lcListaCampuri
					lcListaCampuri=""
				Endif
				.filtru = .filtru + [conditie_logica(] + Strtran(lcFiltru,"nume_camp_cautat",Upper(lcCamp)) + [)]
			Enddo
			If llCampuri
				.filtru = Strtran([ AND (] + Strtran(.filtru,"conditie_logica"," OR ",2) + [)],"conditie_logica","")
			Else
				.filtru = Strtran(.filtru,"conditie_logica"," AND ")
			Endif
		Endwith
	ENDPROC

	PROCEDURE makef_vfp
		Lparameters lcNume,lcNume2,lcIntre,lnCriteriu,lnCriteriu2
		Local llCampuri,lcListaCampuri,lcFiltru
		lcFiltru=""
		With This
			Do Case
			Case lnCriteriu = 1
				lcFiltru = "LIKE([" + Upper(lcNume) + "*],UPPER(nume_camp_cautat))"
			Case lnCriteriu = 2
				lcFiltru = "UPPER(nume_camp_cautat)=[" + Upper(lcNume) + "]"
			Case lnCriteriu = 3
				lcFiltru = "UPPER(nume_camp_cautat)<>[" + Upper(lcNume) + "]"
			Case lnCriteriu = 4
				lcFiltru = "LIKE([*" + Upper(lcNume) + "*],UPPER(nume_camp_cautat))"
			Case lnCriteriu = 5
		*.filtru = "upper(" + .camp_nume + ") NOT LIKE %" + UPPER(lcNume) + "%"
				lcFiltru = "!LIKE([*" + Upper(lcNume) + "*],UPPER(nume_camp_cautat))"
			Case lnCriteriu=6
				lcFiltru = [EMPTY(nume_camp_cautat)]
			Case lnCriteriu=7
				lcFiltru = [!EMPTY(nume_camp_cautat)]
			Endcase
			If !Empty(lcIntre)
				Do Case
				Case lnCriteriu2 = 1
					lcFiltru = lcFiltru + " " + Upper(Alltrim(lcIntre)) + " LIKE([" + Upper(lcNume2) + "*],UPPER(nume_camp_cautat))"
				Case lnCriteriu2 = 2
					lcFiltru = lcFiltru + " " + Upper(Alltrim(lcIntre)) + " UPPER(nume_camp_cautat)=[" + Upper(lcNume2) + "]"
				Case lnCriteriu2 = 3
					lcFiltru = lcFiltru + " " + Upper(Alltrim(lcIntre)) + " UPPER(nume_camp_cautat)<>[" + Upper(lcNume2) + "]"
				Case lnCriteriu2 = 4
					lcFiltru = lcFiltru + " " + Upper(Alltrim(lcIntre)) + " LIKE([*" + Upper(lcNume2) + "*],UPPER(nume_camp_cautat))"
				Case lnCriteriu2 = 5
					lcFiltru = lcFiltru + " " + Upper(Alltrim(lcIntre)) + " !LIKE([*" + Upper(lcNume2) + "*],UPPER(nume_camp_cautat))"
				Case lnCriteriu=6
					lcFiltru = [EMPTY(nume_camp_cautat)]
				Case lnCriteriu=7
					lcFiltru = [!EMPTY(nume_camp_cautat)]
				Endcase
			Endif
			llCampuri=.F.
			lcListaCampuri=.camp_nume
			Do While !Empty(lcListaCampuri)
				If Occurs(',',lcListaCampuri)>0
					lcCamp=Substr(lcListaCampuri,1,At(',',lcListaCampuri,1)-1)
					lcListaCampuri=Substr(lcListaCampuri,At(',',lcListaCampuri,1)+1)
					llCampuri=.T.
				Else
					lcCamp=lcListaCampuri
					lcListaCampuri=""
				Endif
				.filtru_vfp = .filtru_vfp + [conditie_logica(] + Strtran(lcFiltru,"nume_camp_cautat",Upper(lcCamp)) + [)]
			Enddo
		
			If llCampuri
				.filtru_vfp = Strtran([ AND (] + Strtran(.filtru_vfp,"conditie_logica"," OR ",2) + [)],"conditie_logica","")
			Else
				.filtru_vfp = Strtran(.filtru_vfp,"conditie_logica"," AND ")
			Endif
		Endwith
	ENDPROC

	PROCEDURE Unload
		RETURN this.filtru 
	ENDPROC

	PROCEDURE Criteriu.InteractiveChange
		If This.Value>5
			Thisform.Text.Value=""
			Thisform.Text.ReadOnly=.T.
		Else
			Thisform.Text.ReadOnly=.F.
			Thisform.Text.SetFocus
		Endif
	ENDPROC

	PROCEDURE Criteriu2.InteractiveChange
		If This.Value>5
			Thisform.Text2.Value=""
			Thisform.Text2.ReadOnly=.T.
		Else
			Thisform.Text2.ReadOnly=.F.
			Thisform.Text2.SetFocus
		Endif
	ENDPROC

	PROCEDURE Grup_optiuni_filtru.InteractiveChange
		IF this.Value # 1
			thisform.Height = 155
		ELSE 
			thisform.Height = 115
		ENDIF 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_textbox AS formtermin OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ct_text" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: makef_ora
		*m: makef_vfp
		*p: camp_nume
		*p: filtru
		*p: filtru_vfp
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		filtru = 
		filtru_vfp = 
		Height = 76
		Name = "frm_textbox"
		ScrollBars = 0
		Width = 388
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 390
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 326
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 359
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 9
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 22
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 327, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ct_text' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 5, ;
		Name = "ct_text", ;
		TabIndex = 1, ;
		Top = 39, ;
		Width = 381, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 140, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 233, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

ENDDEFINE
