Update all controls of a dialog

Update all controls of a dialog

Postby StefanHaupt » Fri Jan 20, 2006 11:27 am

Hi,

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

Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: Update all controls of a dialog

Postby Rimantas » 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.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Update all controls of a dialog

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby R.F. » Fri Jan 20, 2006 5: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.
R.F.
 
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Postby carlos vargas » Fri Jan 20, 2006 9:01 pm

I Use this modification to class in fivewin, only work with xharbour

at begin of the application
call the procedure OverrideAndExtend()

example
Code: Select all  Expand view  RUN
     function main()
         ...
         OverrideAndExtend()
         ...
     return


Code: Select all  Expand view  RUN
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
Code: Select all  Expand view  RUN
   ...
   /*refresh control in a dialog*/
   oDlg:RefreshDialog()
   /*refresh a page dialog*/
   oFolder:RefreshPages()
   ...


salu2
carlos vargas
Code: Select all  Expand view  RUN
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Postby StefanHaupt » Mon Jan 23, 2006 9:02 am

Many thanks for all tips, it´s working now javascript:emoticon(':D')
Very Happy
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests