rbtn disable

rbtn disable

Postby Silvio » Tue Feb 09, 2010 12:22 pm

On the ribbon I saw the method disable() or enable() of rbtn class not work correctly
any idea ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: rbtn disable

Postby Daniel Garcia-Gil » Tue Feb 09, 2010 12:43 pm

Hello Silvio

Please post a container sample with the error

this sample working fine
Code: Select all  Expand view

#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
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: rbtn disable

Postby 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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: rbtn disable

Postby Daniel Garcia-Gil » Tue Feb 09, 2010 3:04 pm

Hello Silvio

Could you provide a small and self contained example to reproduce it ? thanks
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: rbtn disable

Postby Silvio » Fri Feb 12, 2010 9:17 am

oK
i FOUND THE ERRROR
i MADE A same VARIABLE PUBLIC, DATA AND LOCAL .
Sorry..
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests