Import initial din SVN ROAAUTO/Trunk @HEAD
This commit is contained in:
103
COMUN/programe/acces_meniu2.prg
Normal file
103
COMUN/programe/acces_meniu2.prg
Normal file
@@ -0,0 +1,103 @@
|
||||
&& este versiunea pentru programele care nu au definite obiecte
|
||||
**********************************************************************************************
|
||||
Procedure verifica_drepturi2
|
||||
Lparameters tcObiectFundal,tcPageFrame,tlImagini
|
||||
dezactiveaza_obiecte_pageframe2(65,tcObiectFundal+[.]+tcPageFrame)
|
||||
If Empty(tlImagini) Or tlImagini
|
||||
dezactiveaza_imagini2(tcObiectFundal)
|
||||
Endif
|
||||
Endproc
|
||||
**********************************************************************************************
|
||||
Procedure dezactiveaza_imagini2
|
||||
Lparameters loObiect
|
||||
Local i,k,j,l,lnMinLeft
|
||||
Dimension laImaginiVizibile(20,2)
|
||||
k=0
|
||||
&& left=3 pentru prima imagine
|
||||
With &loObiect
|
||||
For i=1 To .ControlCount
|
||||
If Alltrim(Upper(.Objects(i).Class))='IMAGINE'
|
||||
k=k+1
|
||||
lcCheie=.Objects(i).ccod
|
||||
lcAcces=[1;2;3;4;5;7;]
|
||||
.Objects(i).coptiuni_active=lcAcces
|
||||
.Objects(i).Visible=.T.
|
||||
laImaginiVizibile(k,1)=i
|
||||
laImaginiVizibile(k,2)=.Objects(i).Left
|
||||
Endif
|
||||
Endfor
|
||||
If k>0
|
||||
lnLungime=.Objects(laImaginiVizibile(1,1)).Width
|
||||
For j=1 To k-1
|
||||
For l=j+1 To k
|
||||
If laImaginiVizibile(j,2)>laImaginiVizibile(l,2)
|
||||
lnPozitie=laImaginiVizibile(l,1)
|
||||
lnLeft=laImaginiVizibile(l,2)
|
||||
laImaginiVizibile(l,1)=laImaginiVizibile(j,1)
|
||||
laImaginiVizibile(l,2)=laImaginiVizibile(j,2)
|
||||
laImaginiVizibile(j,1)=lnPozitie
|
||||
laImaginiVizibile(j,2)=lnLeft
|
||||
Endif
|
||||
Endfor
|
||||
Endfor
|
||||
For j=1 To k
|
||||
.Objects(laImaginiVizibile(j,1)).Left=5+(j-1)*lnLungime
|
||||
Endfor
|
||||
Endif
|
||||
Endwith
|
||||
Endproc
|
||||
**********************************************************************************************
|
||||
Procedure dezactiveaza_obiecte_pageframe2
|
||||
Lparameters lnKey,lcPageFrame,lcTata
|
||||
Local lcKey,lcProp,lcOptiune,lnPozitie,i,j,k,l,lnObiecteActive
|
||||
Store [] To lcKey,lcProp,lcOptiune
|
||||
Store 0 To lnNivel,lnPozitie,i,j,k,l
|
||||
If Empty(lcTata)
|
||||
lcTata=Null
|
||||
ENDIF
|
||||
|
||||
LOCAL lcSetExact
|
||||
lcSetExact = SET("Exact")
|
||||
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)
|
||||
For l=1 To .ControlCount
|
||||
Do Case
|
||||
Case Alltrim(Upper(.Objects(l).Class))='PAGEFRAME'
|
||||
lcNume=lcPageFrame+'.'+Alltrim(.Name)+'.'+Alltrim(Upper(.Objects(l).Name))
|
||||
dezactiveaza_obiecte_pageframe2(65,lcNume,lcKey)
|
||||
Case Alltrim(Upper(.Objects(l).Class))='CW'
|
||||
lcOptiune=.Objects(l).label_item1.Caption
|
||||
lcCheie=lcKey+Padl(Alltrim(Str(.Objects(l).nid_cw)),2,[0])
|
||||
lcAcces=[1;2;3;4;7;]
|
||||
.Objects(l).ccheie=lcCheie
|
||||
.Objects(l).coptiuni_active=lcAcces
|
||||
.Objects(l).activeaza()
|
||||
Endcase
|
||||
Endfor
|
||||
Endwith
|
||||
lnKey=lnKey+1
|
||||
Endfor
|
||||
ENDWITH
|
||||
|
||||
SET EXACT &lcSetExact
|
||||
* Set Exact Off
|
||||
|
||||
Endproc
|
||||
**********************************************************************************************
|
||||
Procedure actualizeaza_acces_forma
|
||||
Lparameters loObiect,tcAcces
|
||||
Local lcProp
|
||||
For i=1 To Len(tcAcces)
|
||||
lcProp='this.lactiv'+Alltrim(Substr(tcAcces,i,1))
|
||||
&lcProp=.T.
|
||||
Endfor
|
||||
Endproc
|
||||
**********************************************************************************************
|
||||
Reference in New Issue
Block a user