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

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_grupuri"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcAcces = Alltrim(toRec.Acces)
		Endif
		
		Do Case
		Case lcActiune = "INSERT"
		Case lcActiune = "UPDATE"
			lcSql = [begin PACK_DREPTURI.grupdreptmodproc(] + Alltrim(Str(gnIdProgram))+ ;
				[,] + lcId + [,']+ lcAcces +[',]+Alltrim(Str(gnIdUtil))+[); end;]
		Case lcActiune = "DELETE"
		Endcase
		This.csql = lcSql
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_grupuri AS _frmbase 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_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.cUtil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.cUtil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_grup" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Height = 250
		Name = "frm_grupuri"
		Width = 450
		_shape1.Name = "_shape1"
		_shape1.Width = 450
		_shape2.Height = 29
		_shape2.Left = 349
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 103
		Lb_titlu_alb_b121.Caption = "Drepturi grupuri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 419
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
	*</PropValue>

	ADD OBJECT '_grid1' AS _grid WITH ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		Height = 166, ;
		Left = 7, ;
		Name = "_grid1", ;
		Panel = 1, ;
		RecordSource = "crsgrupuri", ;
		TabIndex = 3, ;
		Top = 74, ;
		Width = 425, ;
		ZOrderSet = 5, ;
		Column1.ControlSource = "grup", ;
		Column1.Name = "cUtil", ;
		Column1.Width = 395
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="grid" />

	ADD OBJECT '_grid1.cUtil.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Grup", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.cUtil.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Left = 356, ;
		Name = "But_modifica1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 275, ;
		Name = "But_nou1", ;
		Top = 1, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Left = 388, ;
		Name = "But_sterge1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_grup' AS clb_tx_simplu WITH ;
		Left = 26, ;
		Name = "Clb_grup", ;
		TabIndex = 1, ;
		Top = 36, ;
		ZOrderSet = 9, ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Grup", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 334, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 36, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters pcFiltru
		Local lcFiltru
		lcFiltru=pcFiltru
		If Empty(lcFiltru)
			lcFiltru=pogrupuri.ca_baza1.cfiltru
		Endif
		save_grid_tag(Thisform._grid1)
		pogrupuri.ca_baza1.cfiltru=lcFiltru
		pogrupuri.ca_baza1.afisare()
		restore_grid_tag(Thisform._grid1)
		If Reccount('crsgrupuri')>0
			Thisform._grid1.SetFocus()
		Else
			Thisform.clb_grup.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_adauga
		*!*	Private pniesire
		*!*	pniesire=0
		*!*	Select crsutilizatori
		*!*	Scatter Name loRec Blank
		*!*	AddProperty(loRec,"parola","")
		*!*	Do Adauga_Modifica_Inregistrare With "utilizatori",loRec,,"INSERT"
		*!*	If pniesire=1
		*!*		Thisform.actualizeaza_grid1()
		*!*	Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		*!*	lcFiltru=[id_firma=?gnIdFirma and id_prog=?gnIdProgram]
		lcFiltru=[2=2]
		lcNume=Thisform.clb_grup.text_simplu1.Value
		If !Empty(lcNume)
			lcFiltru=lcFiltru + [ and grup like '] + Alltrim(lcNume) + [%']
		Endif
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('crsgrupuri')=0
			Messagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		Endif
		Thisform.LockScreen=.F.
		Thisform.MousePointer=0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('crsgrupuri')>0
			Private pniesire
			pniesire=0
			Select crsgrupuri
			Scatter Name loRec
			AddProperty(loRec,[acces],[])
			citeste_drepturi(loRec.id_grup)
			Do Adauga_Modifica_Inregistrare With "grupuri",loRec,loRec.id_grup,"UPDATE"
			If pniesire=1
				Thisform.actualizeaza_grid1()
			Endif
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_grupuri_nou AS _frmbase 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="Clb_grup" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Oleacces1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="LB_SIMPLU1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_grupuri1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_acces
		*m: citeste_noduri
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 563
		Name = "frm_grupuri_nou"
		nid = 0
		orec = 
		Width = 554
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 552
		_shape2.Height = 29
		_shape2.Left = 482
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 70
		Lb_titlu_alb_b121.Caption = "Operator"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Left = 518
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
	*</PropValue>

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

	ADD OBJECT 'Clb_grup' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 114, ;
		Name = "Clb_grup", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 326, ;
		Text_simplu1.ControlSource = "porec.grup", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 138, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Operator", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_grupuri1' AS cus_odata_grupuri WITH ;
		Left = 36, ;
		Name = "Cus_odata_grupuri1", ;
		Top = 36
		*< END OBJECT: ClassLib="drept_grupuri.vcx" BaseClass="custom" />

	ADD OBJECT 'LB_SIMPLU1' AS lb_simplu WITH ;
		Caption = "Optiuni accesibile", ;
		Left = 13, ;
		Name = "LB_SIMPLU1", ;
		TabIndex = 10, ;
		Top = 86
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'Oleacces1' AS oleacces WITH ;
		Height = 434, ;
		Left = 22, ;
		Name = "Oleacces1", ;
		TabIndex = 6, ;
		Top = 108, ;
		Width = 516
		*< END OBJECT: ClassLib="drept_grupuri.vcx" BaseClass="olecontrol" OLEObject="c:\windows\system32\mscomctl.ocx" Value="[encoded data, 4096 characters]" />
	
	PROCEDURE actualizeaza_acces
	ENDPROC

	PROCEDURE citeste_noduri
		Local lcAcces
		lcAcces=[]
		For i=1 To Thisform.oleacces1.Nodes.Count()
			If Thisform.oleacces1.Nodes.Item(i).Children=0 And Thisform.oleacces1.Nodes.Item(i).Checked
				lcAcces=lcAcces+Thisform.oleacces1.Nodes.Item(i).Key
			Endif
		Endfor
		porec.acces=lcAcces
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Private PLRETURN
		Set Exact On
		If Upper(Alltrim(Thisform.ActiveControl.Name))='TEXT_SIMPLU1'
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		lcgrup=Alltrim(porec.grup)
		Thisform.citeste_noduri()
		lcActiune=Upper(Alltrim(Thisform.cus_odata_grupuri1.cactiune))
		PLRETURN=This.cus_odata_grupuri1.salvare(This.orec,This.nid)
		pniesire=1
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_grupuri1.cactiune = tcActiune
		If tcActiune='UPDATE'
			Thisform.clb_grup.texT_SIMPLU1.ReadOnly=.T.
			Select crsdrepturi
			Scan
				lcCheie=Alltrim(cheie)
				loNode=Thisform.oleacces1.Object.nodes.Item(lcCheie)
				loNode.Checked= .T.
				Thisform.oleacces1.nodeCheck(loNode)
			Endscan
		Endif
	ENDPROC

	PROCEDURE Oleacces1.KeyPress
		*** ActiveX Control Event ***
		Lparameters keyascii
		Do Case
		Case keyascii=6
			Thisform.KeyPress(6,2)
		Case keyascii=27
			Thisform.KeyPress(27,0)
		Otherwise
			DoDefault()
		Endcase
	ENDPROC

ENDDEFINE

DEFINE CLASS oleacces AS _olecontrol OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="olecontrol" Timestamp="" Scale="Pixels" Uniqueid="" Nombre="oleacces" Parent="" ObjName="oleacces" OLEObject="C:\WINDOWS\system32\MSCOMCTL.OCX" Value="[encoded data, 4096 characters]" />

	*<DefinedPropArrayMethod>
		*m: adauga_frunze
		*m: bifeaza_nod
		*m: citeste_meniu
		*m: citeste_pageframe
		*p: cmeniu		&& Numele meniului
		*p: cpageframe
	*</DefinedPropArrayMethod>

	*<PropValue>
		cmeniu = 
		cpageframe = 
		Height = 178
		Name = "oleacces"
		Width = 322
	*</PropValue>
	
	PROCEDURE adauga_frunze
		Lparameters lnTip,lcKey
		Do Case
		Case lnTip=0	&&	introducere
		Case lnTip=1	&&	raport
			lcProp="cnt"+lcKey
			This.AddProperty(lcProp,0)
			This.Nodes.Add(lcKey,4,lcKey+"1","Export")
			This.Nodes.Add(lcKey,4,lcKey+"2","Listare")
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"1",4,"Export",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"2",4,"Listare",lcKey)
			Endif
		Case lnTip=2	&&	registru
			lcProp="cnt"+lcKey
			This.AddProperty(lcProp,0)
			This.Nodes.Add(lcKey,4,lcKey+"1","Export")
			This.Nodes.Add(lcKey,4,lcKey+"2","Listare")
			This.Nodes.Add(lcKey,4,lcKey+"3","Modificare")
			This.Nodes.Add(lcKey,4,lcKey+"4","Refacere")
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"1",4,"Export",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"2",4,"Listare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"3",4,"Modificare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"4",4,"Refacere",lcKey)
			Endif
		Case lnTip=3	&&	balanta\inreg.
			lcProp="cnt"+lcKey
			This.AddProperty(lcProp,0)
			This.Nodes.Add(lcKey,4,lcKey+"1","Export")
			This.Nodes.Add(lcKey,4,lcKey+"2","Listare")
			This.Nodes.Add(lcKey,4,lcKey+"3","Modificare")
			This.Nodes.Add(lcKey,4,lcKey+"4","Refacere")
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"1",4,"Export",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"2",4,"Listare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"3",4,"Modificare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"4",4,"Refacere",lcKey)
			Endif
		Case lnTip=4	&&	vizualizare
			lcProp="cnt"+lcKey
			This.AddProperty(lcProp,0)
			This.Nodes.Add(lcKey,4,lcKey+"1","Export")
			This.Nodes.Add(lcKey,4,lcKey+"2","Listare")
			This.Nodes.Add(lcKey,4,lcKey+"3","Modificare")
			This.Nodes.Add(lcKey,4,lcKey+"4","Stergere")
			This.Nodes.Add(lcKey,4,lcKey+"5","Vizualizare inreg. proprii")
			This.Nodes.Add(lcKey,4,lcKey+"6","Vizualizare toate inreg.")
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"1",4,"Export",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"2",4,"Listare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"3",4,"Modificare",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"4",4,"Stergere",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"5",4,"Vizualizare inreg.proprii",lcKey)
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+"6",4,"Vizualizare tot",lcKey)
			Endif
		Endcase
	ENDPROC

	PROCEDURE bifeaza_nod
		Lparameters Node,llChecked
		Local loChild,i
		*!*	If Isnull(Node.Parent)
		*!*		loProp='this.cnt'+Node.Key
		*!*		If Node.checked
		*!*			&loProp=Node.children
		*!*		Else
		*!*			&loProp=0
		*!*		Endif
		*!*		Node.bold=Node.checked
		*!*		loChild=Node.Child.FirstSibling
		*!*		For i=1 To Node.children
		*!*			loChild.checked=Node.checked
		*!*			loChild=loChild.Next
		*!*		Endfor
		*!*	Else
		*!*		loProp='this.cnt'+Node.Parent.Key
		*!*		If Node.checked
		*!*			&loProp=&loProp+1
		*!*			Node.Parent.bold=Node.checked
		*!*			If &loProp=Node.Parent.children
		*!*				Node.Parent.checked=.T.
		*!*			Endif
		*!*		Else
		*!*			&loProp=&loProp-1
		*!*			If Node.Parent.checked
		*!*				Node.Parent.checked=.F.
		*!*			Endif
		*!*			If &loProp=0
		*!*				Node.Parent.bold=.F.
		*!*			Endif
		*!*		Endif
		*!*	Endif
		loChild=Node.Child.FirstSibling
		For i=1 To Node.children
			If loChild.children>0
				This.bifeaza_nod(loChild,llChecked)
				loChild.bold=llChecked
			Endif
			loChild.checked=llChecked
			loChild=loChild.Next
		Endfor
	ENDPROC

	PROCEDURE citeste_meniu
		Lparameters lnKey,lcNumeMeniu,lcOptiune
		lcKey=Chr(lnKey)
		This.Nodes.Add(,1,lcKey,lcOptiune)
		If plCursor
			Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey,1,lcOptiune,[ ])
		Endif
		lnKey2=65
		k=0
		Try
			lcKey2=lcKey+Chr(lnKey2)
			lnKey2=lnKey2+1
			This.Nodes.Add(lcKey,4,lcKey2,'Utile')
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2,4,[Utile],lcKey)
			Endif
			For i=1 To Cntbar('utile')
				lcOptiune=Prmbar('utile',i)
				If !Empty(lcOptiune)
					k=k+1
					This.Nodes.Add(lcKey2,4,lcKey2+Padl(Alltrim(Str(k)),2,[0]),lcOptiune)
					If plCursor
						Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2+Padl(Alltrim(Str(k)),2,[0]),4,lcOptiune,lcKey2)
					Endif
				Endif
			Endfor
		Catch
		Endtry
		k=0
		Try
			lcKey2=lcKey+Chr(lnKey2)
			lnKey2=lnKey2+1
			This.Nodes.Add(lcKey,4,lcKey2,'Initializare')
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2,4,[Initializare],lcKey)
			Endif
			For i=1 To Cntbar('initializa')
				lcOptiune=Prmbar('initializa',i)
				If !Empty(lcOptiune)
					k=k+1
					This.Nodes.Add(lcKey2,4,lcKey2+Padl(Alltrim(Str(k)),2,[0]),lcOptiune)
					If plCursor
						Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2+Padl(Alltrim(Str(k)),2,[0]),4,lcOptiune,lcKey2)
					Endif
				Endif
			Endfor
		Catch
		Endtry
		k=0
		Try
			lcKey2=lcKey+Chr(lnKey2)
			This.Nodes.Add(lcKey,4,lcKey2,'Actualizari')
			If plCursor
				Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2,4,[Actualizari],lcKey)
			Endif
			For i=1 To Cntbar('_1bs12qror')
				lcOptiune=Prmbar('_1bs12qror',i)
				If !Empty(lcOptiune)
					k=k+1
					This.Nodes.Add(lcKey2,4,lcKey2+Padl(Alltrim(Str(k)),2,[0]),lcOptiune)
					If plCursor
						Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey2+Padl(Alltrim(Str(k)),2,[0]),4,lcOptiune,lcKey2)
					Endif
				Endif
			Endfor
		Catch
		Endtry
	ENDPROC

	PROCEDURE citeste_pageframe
		Lparameters lnKey,lcPageFrame,lcTata
		Local lcKey,lcProp,lcOptiune,lnNivel,lnPozitie,i,j,k,l
		Store [] To lcKey,lcProp,lcOptiune
		Store 0 To lnNivel,lnPozitie,i,j,k,l
		If Empty(lcTata)
			lcTata=Null
			lnNivel=1
		Else
			lnNivel=4
		Endif
		Set Exact On
		With &lcPageFrame
			For i=1 To .PageCount
				For j=1 To .PageCount
					If .Pages(j).PageOrder=i
						Exit
					Endif
				Endfor
				With .Pages(j)
					lcKey=Nvl(lcTata,[])+Chr(lnKey)
					This.Nodes.Add(lcTata,lnNivel,lcKey,.Caption)
					lcProp="cnt"+lcKey
					This.AddProperty(lcProp,0)
					If plCursor
						Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey,lnNivel,.Caption,Nvl(lcTata,[ ]))
					Endif
					lcProp="cnt"+lcKey
					This.AddProperty(lcProp,0)
					Dimension copii(128,3)
					k=1
					For l=1 To .ControlCount
						Do Case
						Case  Alltrim(Upper(.Objects(l).Class))='PAGEFRAME'
							lcNume=lcPageFrame+'.'+Alltrim(.Name)+'.'+Alltrim(Upper(.Objects(l).Name))
							This.citeste_pageframe(65,lcNume,lcKey)
						Case Alltrim(Upper(.Objects(l).Class))='CW' And .Objects(l).nid_cw>0
							lcOptiune=.Objects(l).label_item1.Caption
							lnPozitie=.Objects(l).nid_cw
							copii(lnPozitie,1)=lcOptiune
							copii(lnPozitie,2)=.Objects(l).ntip
							copii(lnPozitie,3)=.Objects(l).cmeniu
							k=k+1
						Endcase
					Endfor
					For l=1 To k-1
						This.Nodes.Add(lcKey,4,lcKey+Padl(Alltrim(Str(l)),2,[0]),copii(l,1))
						If plCursor
							Insert Into CRSOBIECTE (CHEIE,NIVEL,EXPLICATIE,TATA) Values(lcKey+Padl(Alltrim(Str(l)),2,[0]),4,copii(l,1),lcKey)
						Endif
		*!*					If !Empty(copii(l,3))
		*!*						This.adauga_meniuri(copii(l,3),copii(l,2),lcKey+Padl(Alltrim(Str(l)),2,[0]))
		*!*					Else
						This.adauga_frunze(copii(l,2),lcKey+Padl(Alltrim(Str(l)),2,[0]))
		*!*					Endif
					Endfor
				Endwith
				lnKey=lnKey+1
			Endfor
		Endwith
		Set Exact Off
		
	ENDPROC

	PROCEDURE Init
		Private plCursor
		Store .F. To plCursor
		Local lnKey,lcOptiune
		This.cmeniu=[cont2000]
		This.cpageframe=[oprinc.pagefr1]
		*!*	Create Cursor CRSOBIECTE(ID_PROG N(1),CHEIE C(20),NIVEL N(2),EXPLICATIE C(100),TATA C(20),COD C(2),ID_OBIECT N(10),ID_TATA N(10))
		*!*	plCursor=.T.
		This.citeste_meniu(90,This.cmeniu,"Meniu")
		This.citeste_pageframe(65,This.cpageframe)
		*!*	Select * From CRSOBIECTE Into Table C:\OBIECTE.Dbf
		*!*	USE IN crsobiecte
		*!*	USE IN obiecte
	ENDPROC

	PROCEDURE NodeCheck
		*** ActiveX Control Event ***
		Lparameters Node
		Local loNode
		*!*	If Messagebox("Doriti sa suspendati?",4,"")==6
		*!*		Debug
		*!*		Suspend
		*!*	Endif
		llChecked=Node.checked
		If Node.children<>0
			Node.bold=llChecked
		Endif
		If Isnull(Node.Parent)
			If Node.children<>0
				This.bifeaza_nod(Node,llChecked)
			Endif
		Else
			If Node.children<>0
				This.bifeaza_nod(Node,llChecked)
			Endif
			loNode=Node
			Do While !Isnull(loNode.Parent)
				loNode=loNode.Parent
				If loNode.bold!=llChecked
					loNode.bold=llChecked
				Endif
			Enddo
		Endif
	ENDPROC

ENDDEFINE
