FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oDlg:Refresh() does not refresh the all component in dialog.
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
oDlg:Refresh() does not refresh the all component in dialog.
Posted: Sat Dec 06, 2008 08:34 PM
Hi,

I have a working test program as below.

One dialog box, one folder and there are three says and gets. When I press the change button first value of get set another value and odlg:Refresh should be refresh the screen in ACTION. but does not. In this condition, If I click the first get, my new value is appears in first get.

if I use oGet1:Refresh() instead of oDlg:Refresh(), it is ok. But I have 7 page in one folder, I have more then one gets and says (some of them changeable). I could not refresh all components one by one.

I try to write the All_Refresh function. It refresh all of components but there are some painting problems.

Is there any way to do refresh all components in dialog?

Thanks in advance.

#include "FiveWin.ch" 

function Main() 
LOCAL oGet1, oGet2, oGet3, oGet4, oGet5, obtnCancel, obtnChg
LOCAL oFnt, oFnt2, oDlg, oFld, oGrp, oGrp1 
LOCAL xVekNo := 11, xREFNO := SPACE(15), xNOTER := SPACE(20)
    
  DEFINE FONT oFnt NAME "Verdana" SIZE 0, -16 BOLD 
	DEFINE FONT oFnt1 NAME "Verdana" SIZE 0, -12

   DEFINE DIALOG oDlg SIZE 620, 294 FONT oFnt1 TRANSPARENT ;
   		STYLE nOr( WS_OVERLAPPEDWINDOW ) //COLOR CLR_BLACK,RGB(196,244,244)
		oDlg:SetColor(,9425383)
   
  @ 2, 3 FOLDER oFld OF oDlg SIZE 100, 100 PIXEL ; 
      PROMPTS "Page 1", "Page 2", "Page 3","Page 4","Page 5","Page 6" 

  @ 2, 3 GROUP oGrp TO 150, 150 PROMPT " Group Text " OF oFld:aDialogs[ 1 ] PIXEL TRANSPARENT;
  	FONT oFnt

	@ 15,10 SAY oSay PROMPT "No" OF oFld:aDialogs[1] PIXEL
	@ 13,68 GET oGet1 VAR xVEKNO OF oFld:aDialogs[1] PIXEL RIGHT PICT "@Z 9999999"

	@ 15,160 SAY oSay PROMPT "Referans No" OF oFld:aDialogs[1] PIXEL
	@ 13,218 GET oGet5 VAR xREFNO OF oFld:aDialogs[1] PIXEL SIZE 60,12

	@ 28,10 SAY "Remarks" OF oFld:aDialogs[1] PIXEL
	@ 26,68 GET oGet2 VAR xNOTER OF oFld:aDialogs[1] PIXEL SIZE 80,12 

	@ 100,10 BUTTON obtnChg PROMPT "&Change VEKNO to 99" OF oDlg PIXEL SIZE 100,13 ;
		ACTION (xVEKNO:=99, oDlg:Refresh())
		//All_Refresh(oDlg))

	@ 100,10 BUTTON obtnCancel PROMPT "&Cancel" OF oDlg PIXEL SIZE 50,13 ;
		ACTION oDlg:End()

  oDlg:bResized := {|| ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg) }
	ACTIVATE DIALOG oDlg CENTERED ON INIT ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg)
	
	oFnt:End()
	oFnt1:End()

return nil 

function All_Refresh(oDlg)
LOCAL i, o, l, oo, k, ooo
for i:=1 to LEN(oDlg:aControls)
	o := oDlg:aControls[i]
	If Upper(o:ClassName()) $ "TFOLDER"
		for l:=1 to LEN(o:aDialogs)
			oo := o:aDialogs[l]
			for k:=1 to len(oo:aControls)
				ooo := oo:aControls[k]
				If !Upper(ooo:ClassName()) $ "TGROUP"				
					ooo:Refresh()
				ENDIF
			next k
		next l
	else
		o:Refresh()
	endif
next i
return

PROCEDURE ONINIT_VEKALET(oDlg, oFld, oGrp, obtnCancel, obtnChg)
LOCAL i
	oFld:nHeight := oDlg:nHeight-80
	oFld:nWidth := oDlg:nWidth-29
  oFld:Refresh()
  
  oGrp:nHeight := oFld:nHeight-35
  oGrp:nWidth  := oFld:nWidth-17
  
  obtnChg:nTop  := oDlg:nHeight-70
	obtnChg:nLeft := oDlg:nWidth-350

  obtnCancel:nTop := oDlg:nHeight-70
	obtnCancel:nLeft := oDlg:nWidth-125


return


.rc file.
1 24 "WindowsXP.Manifest"
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
oDlg:Refresh() does not refresh the all component in dialog.
Posted: Sat Dec 06, 2008 10:05 PM

Try after each say and get expression use UPDATE. Then use
oDlg:update() rather then oDlg:refresh(). In the asction add .t..
It should look like this action(......., odlg:update(),.t.)

Thank you

Harvey
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
oDlg:Refresh() does not refresh the all component in dialog.
Posted: Sun Dec 07, 2008 06:04 AM

Thank you Harvey,

It works.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion