by Silvio » Tue Feb 09, 2010 2:33 pm
Daniel,
I have rbtn on RibonBar
sample
Local aMenuRibbon := { "Favoriti","Hardware","Software","Manuali","Prestiti","Magazzino","Utilità","Aiuto" }
::obar:=TRibbonBar():New(::oWndMain, aMenuRibbon,,,,135,25 )
....
ADD GROUP oGroup[1] RIBBON ::obar TO OPTION 2 PROMPT "Gestione Hardware" width 155
@ 9,5 ADD BUTTON oBtns[1] PROMPT "Anagrafica" BITMAP "RB_HARDWARE" GROUP oGroup[1] ;
ROUND SIZE 75,70 ;
ACTION Perform("GMI110()",oItem[ 1],oBtns[ 1])
FUNCTION Perform(cModulo,oItem,oBtnB)
LOCAL oDlg, cMod, cDes, bX, oSay
LOCAL oDMod, oDPer, aMod
LOCAL oDFac, oDCom, oFnt
DEFAULT oItem:=NIL
DEFAULT oBtnB:=NIL
IF !Empty(oItem)
oItem:Disable()
ENDIF
IF !Empty(oBtnB)
oBtnB:Disable()
ENDIF
*oMOpc:=oItem
*oBBar:=oBtnB
oApp:oMOpc:=oItem
oApp:oBBar:=oBtnB
oDMod:=Apri_Dbf("Moduli")
cMod:=Upper(SubStr(cModulo,1,AT("(",cModulo)-1))
IF (oDMod)->(DbSeek(cMod)) .AND. (oDMod)->Status="*" .AND. ;
AScan({cMod+"()"},{|_1|TYPE(_1)=="U"})=0 //
CursorWait()
cDes:=(oDMod)->Descri
Chiudi_Dbf("Moduli",oDMod)
oDPer:=Apri_Dbf("Permessi")
IF ((oDPer)->(DbSeek(cUser+cMod)) .AND. (oDPer)->Permesso) ;
.OR. cUser=cMain
lABC:=IF((oDPer)->ABC="A",.T.,.F.)
Chiudi_Dbf("Permesso",oDPer)
IF cUser=cMain
lDemo:=IF(Empty(lDemo),.F.,lDemo)
lABC:=.T.
ENDIF
USE
Reg_Activ(cDes)
SysRefresh()
CursorWait()
bX:={|| &cModulo}
Eval(bX)
Memory(-1)
Sysrefresh()
CursorArrow()
ELSE
Tone(5000)
Tone(3000)
Chiudi_Dbf("Permesso",oDPer)
MsgAlert("Non hai il permesso per entrare in questo modulo.","Verifica!")
IF !Empty(oItem)
oItem:Enable()
ENDIF
IF !Empty(oBtnB)
oBtnB:Enable()
ENDIF
ENDIF
ELSE
Tone(3000)
Chiudi_Dbf("Moduli",oDMod)
MsgInfo("Il modulo "+cMod+oemtoansi(", non Š disponibile!"),"Informazioni...")
IF !Empty(oItem)
oItem:Enable()
ENDIF
IF !Empty(oBtnB)
oBtnB:Enable()
ENDIF
ENDIF
RETURN (NIL)
Best Regards, Saludos
Falconi Silvio