Page 1 of 1

Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 4:32 am
by Dorneles
The BUTTONBAR does not update the Gets, but if you use another toobar it updates, which can be wrong?

Image

Code: Select all


DEFINE DIALOG oDlgD RESOURCE 3000 TITLE "Controle de Contas a Pagar" 

  REDEFINE PAGES oPag ID 102 OF oDlgD ;            
               DIALOGS 3001, 3002 
					 
  REDEFINE TABS oTabs ID 104 OF oDlgD ;
             PROMPT "&Emissão C.C.P.   ", "Consulta C.C.P.   " ;
				 ACTION ({oPag:setoption(oTabs:nOption)})                 
             oDlgD:oTop = oTabs

   REDEFINE DTPicker oGetCCP.dataccp    VAR aGetCCP.dataccp       ID 4004      	  OF oPag:aDialogs[ 1 ] 					            WHEN lDisable 					

ACTIVATE DIALOG oDlgD CENTERED ON MOVE(oDlgD:Center) ON INIT ( CriaBarTar1( oDlgD,oPag:aDialogs[ 1 ] ,@aGetCCP,oGetCCP ))    

dbCloseall()
oDlgD:End()
Release All
SysRefresh()

RETURN(.T.)
////////////////////////////////////////////////////////////////////////////////
STATIC FUNCTION CriaBarTar1( oDlgD,oPag1,aGetCCP,oGetCCP )
////////////////////////////////////////////////////////////////////////////////
  LOCAL oBar, oButDlg[11]
  
  
   DEFINE BUTTONBAR oBar Size 54,46 Of oPag1 3D Top 2007
          
   	    DEFINE BUTTON oButDlg[1] OF oBar                 ;
			        RESOURCE "PRIMEIRO"                       ;
			        PROMPT "primeiro" 								  ;
					  MESSAGE "Primeiro Registro"               ;
	              TOOLTIP "Primeiro Registro"               ;
					  ACTION (Primeiro(@aGetCCP,oGetCCP,@lEOF,@lBOF,oPag:aDialogs[ 1 ]),oPag:aDialogs[ 1 ]:Update(),oPag:aDialogs[ 1 ]:aEvalWhen(),oDlgD:Update()) WHEN lBotao .AND. lEOF


oBar:bRClicked := { || nil }

RETURN(.T.)
////////////////////////////////////////////////////////////////////////////////
STATIC FUNCTION Primeiro(aGetCCP,oGetCCP,lEOF,lBOF,oPag1)
////////////////////////////////////////////////////////////////////////////////

  Select CCP
  Set ORDE TO 1
  //
  lEOF := .T.
  lBOF := .T.
  //
  GO TOP
  aGetCCP := InitData()
  //
  lEOF := .F.
  //
  RefreshObj(aGetCCP,oGetCCP)
  //
  RETURN(.T.)
////////////////////////////////////////////////////////////////////////////////


Re: Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 4:59 am
by Daniel Garcia-Gil
use UPDATE clause

REDEFINE DTPicker oGetCCP.dataccp VAR aGetCCP.dataccp ID 4004 OF oPag:aDialogs[ 1 ] WHEN lDisable UPDATE

Re: Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 5:09 am
by Dorneles
Hello Daniel.
Thanks for the tip. But the problem continues.

Re: Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 5:56 am
by Daniel Garcia-Gil
try update DTPicker Object value for this way

oGetCCP.dataccp:cText( NewValue )

Re: Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 6:29 am
by Dorneles
Now it worked. Thank you!

Re: Problem with BUTTONBAR

Posted: Sun Jan 04, 2009 6:30 am
by Daniel Garcia-Gil
:D