FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Update all controls of a dialog
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Update all controls of a dialog
Posted: Fri Jan 20, 2006 11:27 AM

Hi,

how can update all controls of a dialog ? oDlg:Refresh() does not work.

Stefan

kind regards

Stefan
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: Update all controls of a dialog
Posted: Fri Jan 20, 2006 11:32 AM
StefanHaupt wrote:Hi,

how can update all controls of a dialog ? oDlg:Refresh() does not work.

Stefan


Try oDlg:Update()

Regards !
Rimantas U.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Update all controls of a dialog
Posted: Fri Jan 20, 2006 11:53 AM
StefanHaupt wrote:Hi,

how can update all controls of a dialog ? oDlg:Refresh() does not work.

Stefan


Try adding UPDATE clause to the controls you want to refresh. Or use a loop through oDlg:aControls to refresh any single control.

EMG
Posts: 840
Joined: Thu Oct 13, 2005 07:05 PM
Update all controls of a dialog
Posted: Fri Jan 20, 2006 05:32 PM
Resuming:

1) Add the UPDATE clause to all your controls in your dialog:

REDEFINE GET oGet VAr xVar blah blah blah UPDATE
REDEFINE CHECKBOX oChk blah blah blah UPDATE

2) Whenever you want perfrom an update of all the controls inside a dialog, simply do a oDlg:Update(), and you are done.

3) Rember: the oDlg:Update() only works over the controls which have the UPDATE clause included.
Saludos

R.F.
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Update all controls of a dialog
Posted: Fri Jan 20, 2006 09:01 PM
I Use this modification to class in fivewin, only work with xharbour

at begin of the application
call the procedure OverrideAndExtend()

example
     function main()
         ...
         OverrideAndExtend()
         ...
     return


PROCEDURE OverrideAndExtend()
	OVERRIDE METHOD DispBegin IN CLASS TWindow WITH KDispBegin
	OVERRIDE METHOD DispEnd   IN CLASS TWindow WITH KDispEnd

	EXTEND CLASS TFOLDER  WITH METHOD RefreshPages
	EXTEND CLASS TFOLDER  WITH METHOD GoFirstControl
	EXTEND CLASS TDIALOG  WITH METHOD RefreshDialog	
RETURN

STATIC FUNCTION KDispBegin()
	LOCAL SELF := HB_QSelf()
RETURN SELF

STATIC FUNCTION KDispEnd()
	LOCAL SELF := HB_QSelf()
RETURN NIL


STATIC FUNCTION RefreshDialog( nPos )
	LOCAl Self := HB_QSelf()

	aeval( ::aControls, { |oCtrl| oCtrl:Refresh() } )
        if nPos <> NIL .and. valtype( nPos ) = "N"
  	     ::aControls[ nPos ]:SetFocus()
        endif

RETURN NIL

STATIC FUNCTION RefreshPages()
	LOCAl Self := HB_QSelf()
	LOCAL oPage

	FOR EACH oPage IN ::aDialogs
		aeval( oPage:aControls, { |oCtrl| oCtrl:Refresh() } )
	NEXT

RETURN NIL

STATIC FUNCTION GoFirstControl()
	LOCAL SELF := HB_QSelf()
	
	::aDialogs[1]:aControls[1]:SetFocus()

RETURN NIL


example of use
   ...
   /*refresh control in a dialog*/
   oDlg:RefreshDialog()
   /*refresh a page dialog*/
   oFolder:RefreshPages()
   ...


salu2
carlos vargas
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Update all controls of a dialog
Posted: Mon Jan 23, 2006 09:02 AM

Many thanks for all tips, it´s working now javascript:emoticon(':D')
Very Happy

kind regards

Stefan

Continue the discussion