On the ribbon I saw the method disable() or enable() of rbtn class not work correctly
any idea ?
rbtn disable
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: rbtn disable
Hello Silvio
Please post a container sample with the error
this sample working fine
Please post a container sample with the error
this sample working fine
Code: Select all | Expand
#include "fivewin.ch"
#include "ribbon.ch"
FUNCTION Main()
local oWnd
local oBtn1, oBtn2, oBtn3
DEFINE WINDOW oWnd TITLE "Testing Ribbon Button"
@ 10, 10 RBBTN oBtn1 PROMPT "Button 1" SIZE 120,20 BORDER ROUND ;
ACTION oBtn2:Disable()
@ 40, 10 RBBTN oBtn2 PROMPT "Button 2" SIZE 120,20 BORDER ROUND;
ACTION MsgInfo( "button 2" )
@ 70, 10 RBBTN oBtn3 PROMPT "Button 3" SIZE 120,20 BORDER ROUND;
ACTION oBtn2:Enable() WHEN ! oBtn2:lActive
ACTIVATE WINDOW oWnd
return nil
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: rbtn disable
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)
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
Falconi Silvio
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: rbtn disable
Hello Silvio
Could you provide a small and self contained example to reproduce it ? thanks
Could you provide a small and self contained example to reproduce it ? thanks
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: rbtn disable
oK
i FOUND THE ERRROR
i MADE A same VARIABLE PUBLIC, DATA AND LOCAL .
Sorry..
i FOUND THE ERRROR
i MADE A same VARIABLE PUBLIC, DATA AND LOCAL .
Sorry..
Best Regards, Saludos
Falconi Silvio
Falconi Silvio