*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="frm_filtru_numar.scx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment 
 	*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />

	*<PropValue>
		Name = "Dataenvironment"
	*</PropValue>

ENDDEFINE

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

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

	*<DefinedPropArrayMethod>
		*p: camp_nume
		*p: filtru
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DataSession = 1
		DoCreate = .T.
		filtru = 
		Height = 122
		Name = "Formtermin12"
		Width = 313
		Shape1.Height = 34
		Shape1.Left = -1
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 278
		Terminat1.Command1.Name = "Command1"
		Terminat1.Imbuton1.Height = 27
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 30
		Terminat1.Left = 280
		Terminat1.Name = "Terminat1"
		Terminat1.TabIndex = 3
		Terminat1.Top = 2
		Titlufrumos1.Height = 32
		Titlufrumos1.Left = 7
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.TabIndex = 4
		Titlufrumos1.Top = 4
		Titlufrumos1.Width = 221
	*</PropValue>

	ADD OBJECT 'Criteriu1' AS combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "72,0", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 28, ;
		Name = "Criteriu1", ;
		ReadOnly = .F., ;
		RowSource = "> = ,1,< = ,2, = ,3, # ,4, > ,5, < ,6", ;
		RowSourceType = 1, ;
		SpecialEffect = 2, ;
		Style = 2, ;
		TabIndex = 5, ;
		ToolTipText = "Selectati criteriul de comparare", ;
		Top = 47, ;
		Width = 55
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Criteriu2' AS combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "72,0", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 28, ;
		Name = "Criteriu2", ;
		ReadOnly = .F., ;
		RowSource = "> = ,1,< = ,2, = ,3, # ,4, > ,5, < ,6", ;
		RowSourceType = 1, ;
		SpecialEffect = 2, ;
		Style = 2, ;
		TabIndex = 6, ;
		ToolTipText = "Selectati criteriul de comparare", ;
		Top = 80, ;
		Width = 55
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Text1' AS textbox WITH ;
		Alignment = 1, ;
		Format = "k", ;
		Height = 25, ;
		InputMask = "999 999 999 999", ;
		Left = 83, ;
		Name = "Text1", ;
		TabIndex = 1, ;
		ToolTipText = "", ;
		Top = 47, ;
		Value = 0, ;
		Width = 191
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text2' AS textbox WITH ;
		Alignment = 1, ;
		Format = "k", ;
		Height = 25, ;
		InputMask = "999 999 999 999", ;
		Left = 83, ;
		Name = "Text2", ;
		TabIndex = 2, ;
		ToolTipText = "", ;
		Top = 80, ;
		Value = 0, ;
		Width = 191
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE Destroy
		WITH this 
			LOCAL lnCriteriu1, lnCriteriu2, lcNumar1, lcNumar2, lcSemn1, lcSemn2
			lnCriteriu1 = .criteriu1.Value
			lnCriteriu2 = .criteriu2.Value
			lcNumar1 = ALLTRIM(STR(.text1.value))
			lcNumar2 = ALLTRIM(STR(.text2.value))
			IF EMPTY(lnCriteriu1) AND EMPTY(lnCriteriu2)
				.filtru = ""
				RETURN 
			ENDIF
			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 
			.filtru = .camp_nume + lcsemn1 + lcNumar1 + [ and ] + .camp_nume + lcsemn2 + lcNumar2
		ENDWITH 
	ENDPROC

	PROCEDURE Init
		LPARAMETERS lcCampNume,lcTitlu,lnCriteriu1,lnCriteriu2
		
		DODEFAULT()
		lctitlu=STRTRAN(lcTitlu,'\<','')
		WITH this
			.criteriu1.value = lnCriteriu1
			.criteriu2.value = lnCriteriu2
			.camp_nume = lcCampNume
			.titlufrumos1.Caption=UPPER(lcTitlu)
		*	.text1.ToolTipText='Introduceti expresia cu care se compara ' + lower(lcTitlu)
			IF EMPTY(lccampnume)
				.text1.Enabled = .F.
				.text2.Enabled = .F.
				.criteriu1.Enabled = .F.
				.criteriu2.Enabled = .F.
			ENDIF 
		ENDWITH 
	ENDPROC

	PROCEDURE Unload
		RETURN this.filtru 
	ENDPROC

	PROCEDURE Criteriu1.InteractiveChange
		thisform.text1.SetFocus 
	ENDPROC

	PROCEDURE Criteriu2.InteractiveChange
		thisform.text2.SetFocus 
	ENDPROC

	PROCEDURE Text1.LostFocus
		thisform.text2.Value=this.Value 
	ENDPROC

	PROCEDURE Text2.LostFocus
		
		
	ENDPROC

ENDDEFINE
