Error of text on a dialog- RESOLVED!!

Error of text on a dialog- RESOLVED!!

Postby Silvio.Falconi » Sun Jun 28, 2020 5:05 pm

I can't refresh a text created with a say control


Image

I put "UPDATE" con control say and I used settext funcion to refresh the text

why not run ok ?


this is the test
try to select two days

Code: Select all  Expand view  RUN
#include "Fivewin.ch"
#include "dtpicker.ch"

static dfirst,dLast

Function test()
local oDlg, oFont,oLarge,oBold
local oFolder,oFld
local oDtpFirst, oDtpLast
local dStagioneMin,dStagioneMax
local nGiorni:= 1,oGiorni,oGiornitext

SET DATE ITALIAN
    SET CENTURY ON
   dFirst       := date()
   dLast        := date()
   dStagioneMin := ctod("17/06/2020")
   dStagioneMax := ctod("20/09/2020")

 DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16
   DEFINE FONT oBold NAME "Segoe UI" SIZE 0,-14  BOLD
   DEFINE FONT oLarge NAME "VERDANA" SIZE 0,-24 BOLD

   DEFINE DIALOG oDlg SIZE 1130,650  PIXEL  FONT oFont ;
      TITLE "Test"   ;
        STYLE nOR(  WS_CAPTION, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )



      @  1, 0 FOLDEREX oFolder OF oDlg SIZE oDlg:nWidth-585,oDlg:nHeight-390 PIXEL  ;
        PROMPT "Prenotazioni","Pagamenti","Familiari"

@ 6,120 SAY "Dal :"  SIZE 20,11 PIXEL OF oFolder:aDialogs[1]  TRANSPARENT FONT oBold
    @ 23,120 SAY "al :"  SIZE 20,11 PIXEL OF oFolder:aDialogs[1]   TRANSPARENT FONT oBold

  @  3, 145 DTPICKER oDtpFirst VAR dFirst SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy" UPDATE;
      ON CHANGE ( oDtpLast:SetRange( dFirst ), oDlg:Update() )

    WITH OBJECT oDtpFirst
      :lNoToday         := .t.
      :lNoTodayCircle   := .t.
      :SetRange( dStagioneMin,dStagioneMax )
   END


     @  22,145 DTPICKER oDtpLast VAR dLast SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy"  UPDATE ;
      ON CHANGE  Rinfresca(@oGiorni,@oGiorniText,dFirst,dLast)




 @ 08.6,300 SAY oGiorni Prompt nGiorni  SIZE 38,20 PIXEL OF oFolder:aDialogs[1];
                FONT oLarge color RGB( 165, 186, 204 ) center UPDATE

    @ 08.6,300 SAY oGiornitext  Prompt (if( nGiorni>1,"giorni","giorno")) ;
                  SIZE 50,16 PIXEL OF oFolder:aDialogs[1] FONT oLarge;
                  color RGB( 165, 186, 204 ) UPDATE


                  oDlg:bResized  := <||
                     oRect                := oDlg:GetCliRect()
                     oFolder:nWidth       := oRect:nRight-2
                     oFolder:nHeight      := oRect:nBottom-160
                     oGiorni:nTop       :=  oFolder:ntop +4
                     oGiorni:nLeft      :=  oFolder:nleft+480
                     oGiorniText:nTop   :=  oFolder:ntop +44
                     oGiorniText:nLeft  :=  oFolder:nleft+480

                      return nil
                            >

ACTIVATE DIALOG oDlg CENTERED
return nil
//-------------------------------------------------------------------//


Function Rinfresca(oGiorni,oGiorniText,dFirst,dLast)

local nGiorni:=(dLast-dFirst)+1
oGiorni:Settext(ltrim(str(nGiorni)))
               oGiorni:refresh()
               oGiornitext:Settext(if( nGiorni>1,"giorni","giorno"))
               oGiornitext:refresh()


return nil


 
Last edited by Silvio.Falconi on Fri Jul 03, 2020 11:25 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Error of text on a dialog

Postby alerchster » Sun Jun 28, 2020 5:42 pm

Hi

Delete this two lines
Code: Select all  Expand view  RUN
Function Rinfresca(oGiorni,oGiorniText,dFirst,dLast)

local nGiorni:=(dLast-dFirst)+1
oGiorni:Settext(ltrim(str(nGiorni)))
 //              oGiorni:refresh()
               oGiornitext:Settext(if( nGiorni>1,"giorni","giorno"))
 //              oGiornitext:refresh()


return nil
 
Regards

Ing. Anton Lerchster
User avatar
alerchster
 
Posts: 95
Joined: Mon Oct 22, 2012 4:43 pm

Re: Error of text on a dialog

Postby Otto » Sun Jun 28, 2020 5:47 pm

Hello Silvio,
I myself noticed problems with settext.

Try
Code: Select all  Expand view  RUN

Function Rinfresca(oGiorni,oGiorniText,dFirst,dLast)

   local nGiorni:=(dLast-dFirst)+1
     //  oGiorni:Settext(ltrim(str(nGiorni)))
   oGiorni:cTitle(ltrim(str(nGiorni)))
   //     oGiorni:refresh()
   oGiornitext:Settext(if( nGiorni>1,"giorni","giorno"))
   oGiornitext:refresh()
return nil


 


Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Error of text on a dialog

Postby Otto » Sun Jun 28, 2020 6:50 pm

Hallo Anton,
ich hoffe du hast den "Lock-Down" gut überstande.
Vielleicht gelingt es doch, dass wir uns einmal persönlich kennen lernen.


We have to find out why
METHOD Refresh() INLINE If( ::bGet != nil, ::SetText( Eval( ::bGet ) ),)
does not read ::cCaption of :settext() method.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Error of text on a dialog

Postby Silvio.Falconi » Mon Jun 29, 2020 11:07 am

alerchster wrote:Hi

Delete this two lines
Code: Select all  Expand view  RUN
Function Rinfresca(oGiorni,oGiorniText,dFirst,dLast)

local nGiorni:=(dLast-dFirst)+1
oGiorni:Settext(ltrim(str(nGiorni)))
 //              oGiorni:refresh()
               oGiornitext:Settext(if( nGiorni>1,"giorni","giorno"))
 //              oGiornitext:refresh()


return nil
 

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Error of text on a dialog

Postby nageswaragunupudi » Tue Jun 30, 2020 5:20 am

Code: Select all  Expand view  RUN

   @  3, 145 DTPICKER oDtpFirst VAR dFirst SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy" UPDATE;
      ON CHANGE ( oDtpLast:SetRange( dFirst ), oDlg:Update() )

   WITH OBJECT oDtpFirst
      :lNoToday         := .t.
      :lNoTodayCircle   := .t.
      :SetRange( dStagioneMin,dStagioneMax )
   END

   @  22,145 DTPICKER oDtpLast VAR dLast SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy"  UPDATE ;
      ON CHANGE  oDlg:Update()  //Rinfresca(@oGiorni,@oGiorniText,dFirst,dLast) : Remove this function

   @ 08.6,300 SAY { || nGiorni := dLast - dFirst + 1 } SIZE 38,20 PIXEL OF oFolder:aDialogs[1];
                FONT oLarge color RGB( 165, 186, 204 ) center UPDATE

   @ 08.6,300 SAY { || If( nGiorni>1,"giorni","giorno") } ;
                  SIZE 50,16 PIXEL OF oFolder:aDialogs[1] FONT oLarge;
                  color RGB( 165, 186, 204 ) UPDATE
 


function Rinfresca is not required.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10659
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Error of text on a dialog

Postby Silvio.Falconi » Tue Jun 30, 2020 7:16 am

nageswaragunupudi wrote:
Code: Select all  Expand view  RUN

   @  3, 145 DTPICKER oDtpFirst VAR dFirst SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy" UPDATE;
      ON CHANGE ( oDtpLast:SetRange( dFirst ), oDlg:Update() )

   WITH OBJECT oDtpFirst
      :lNoToday         := .t.
      :lNoTodayCircle   := .t.
      :SetRange( dStagioneMin,dStagioneMax )
   END

   @  22,145 DTPICKER oDtpLast VAR dLast SIZE 90,12 PIXEL OF oFolder:aDialogs[1] ;
      PICTURE "ddd dd mmm yyyy"  UPDATE ;
      ON CHANGE  oDlg:Update()  //Rinfresca(@oGiorni,@oGiorniText,dFirst,dLast) : Remove this function

   @ 08.6,300 SAY { || nGiorni := dLast - dFirst + 1 } SIZE 38,20 PIXEL OF oFolder:aDialogs[1];
                FONT oLarge color RGB( 165, 186, 204 ) center UPDATE

   @ 08.6,300 SAY { || If( nGiorni>1,"giorni","giorno") } ;
                  SIZE 50,16 PIXEL OF oFolder:aDialogs[1] FONT oLarge;
                  color RGB( 165, 186, 204 ) UPDATE
 


function Rinfresca is not required.



Nages,
Why the bchange of datepick Is execute before on anothers function Is on odlg init ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Error of text on a dialog

Postby Otto » Tue Jun 30, 2020 9:11 am

Dear Mr. Rao,
is
METHOD Refresh() INLINE If( ::bGet != nil, ::SetText( Eval( ::bGet ) ),)
reading ::cCaption of :settext() method.
Thank you in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests