Page 1 of 3

FWH_2407 oSay does not assume nHeight

Posted: Wed Aug 21, 2024 12:09 pm
by vinhesoft
good morning

via command does not assume nHeight

@ 057,376 SAY oTest PROMPT 'Test' PIXEL
? oTest:nHeight --> 22

@ 057,376 SAY oTest PROMPT 'Test' PIXEL SIZE 015,007
? oTest:nHeight --> 22

------------------------------------

via property yes

oTest:nHeight := 7
? oTest:nHeight --> 7

Re: FWH_2407 oSay does not assume nHeight

Posted: Wed Aug 21, 2024 12:42 pm
by Antonio Linares
Dear Joao,

You are overwritting the SAY object. Please test it this way and you will see it is fine:

Code: Select all | Expand

#include "FiveWin.ch"

function Main()

    local oWnd, oTest1, oTest2 

    DEFINE WINDOW oWnd 

    @ 057,376 SAY oTest1 PROMPT 'Test' PIXEL
    ? oTest1:nHeight 

    @ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007
    ? oTest2:nHeight 

    ACTIVATE WINDOW oWnd 

return nil  

Re: FWH_2407 oSay does not assume nHeight

Posted: Wed Aug 21, 2024 1:03 pm
by vinhesoft
DEFINE WINDOW oWnd

@ 057,376 SAY oTest1 PROMPT 'Test' PIXEL
? oTest1:nHeight --> 22

@ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007
? oTest2:nHeight --> 22

ACTIVATE WINDOW oWnd

Re: FWH_2407 oSay does not assume nHeight

Posted: Wed Aug 21, 2024 1:07 pm
by Antonio Linares
Here we get 16 and 11 using FWH 24.07 and bcc77 32 bits

Re: FWH_2407 oSay does not assume nHeight

Posted: Wed Aug 21, 2024 1:15 pm
by vinhesoft
DEFINE WINDOW oWnd

@ 057,376 SAY oTest1 PROMPT 'Test' PIXEL
? oTest1:nHeight --> 16

@ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007
? oTest2:nHeight --> 11

here it should be 7 ?

ACTIVATE WINDOW oWnd

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 2:17 pm
by Antonio Linares
Dear Joao,

Please use this:

@ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007
oTest2:SetSize( 15, 7 )

Class TSay does some calculations, but if you need that exact size, then use Method SetSize( nWidth, nHeight )

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 4:45 pm
by vinhesoft
Dear Antonio

@ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007

SIZE 015,007 -->> does not assume the informed standard? when we inform the pattern, oSay should follow it.

I have to use it like this ?

@ 057,376 SAY oTest2 PROMPT 'Test' PIXEL SIZE 015,007 ; oTest2:SetSize( 15, 7 )

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 4:53 pm
by Antonio Linares
You can modify the command in FiveWin.ch:

#xcommand @ <nRow>, <nCol> SAY [ <oSay> <label: PROMPT,VAR > ] <cText> ;
[ <pict: PICT, PICTURE> <cPict> ] ;
[ <dlg: OF,WINDOW,DIALOG > <oWnd> ] ;
[ FONT <oFont> ] ;
[ <lCenter: CENTERED, CENTER > ] ;
[ <lRight: RIGHT > ] ;
[ <lBorder: BORDER > [CLR <nClrBorder>] ] ;
[ [<relpix:RELATIVE>] <lPixel: PIXEL, PIXELS > ] ;
[ <color: COLOR,COLORS > <nClrText> [,<nClrBack> ] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <design: DESIGN > ] ;
[ <update: UPDATE > ] ;
[ <lShaded: SHADED, SHADOW > ] ;
[ <lBox: BOX > ] ;
[ <lRaised: RAISED > ] ;
[ <adj: ADJUST> ] ;
[ <lTrans: TRANSPARENT>];
[ <uni: UNICODE, ANSI> ] ;
[ <lVCenter: VCENTER> ] ;
[ CARGO <uCargo> ] ;
=> ;
[ <oSay> := ] TSay():New( <nRow>, <nCol>, <{cText}>,;
[<oWnd>], [<cPict>], <oFont>, <.lCenter.>, <.lRight.>, <.lBorder.>,;
<.lPixel.>, <nClrText>, <nClrBack>, <nWidth>, <nHeight>,;
<.design.>, <.update.>, <.lShaded.>, <.lBox.>, <.lRaised.>, <.adj.>,;
<.lTrans.>, [<(oSay)>], [Upper( Left( <"uni">, 1 ) ) == "U"], <.lVCenter.>, [<uCargo>], [<.relpix.>], <nClrBorder> ); [ <oSay>:SetSize( <nWidth>, <nHeight> ) ]

You are right and I agree that SIZE clause should be enough, but in the evolution of FWH along many years, Class TSay behaves like that

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 5:37 pm
by vinhesoft
ADMP0002.PRG(226) Error E0061 Implicit send operator with no WITH OBJECT in sight

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 6:47 pm
by Antonio Linares
Please compile using -p flag and review the generated ppo file

Re: FWH_2407 oSay does not assume nHeight

Posted: Thu Aug 22, 2024 8:06 pm
by vinhesoft
static aFwStack := {}
static _fwhtmp_ := nil
#line 3 "test.prg"
function Main

oWnd := TWindow():New(,,,,,,,,,,,,,,,, !.F., !.F., !.F., !.F., .F.,, "oWnd",,,, )

oTest1 := TSay():New( 057, 376, {|| "Test"},,,, .F., .F., .F., .T.,,,,, .F., .F., .F., .F., .F., .F., .F., "oTest1",, .F.,,, ) ; oTest1:SetSize(, )
WQout( { oTest1:nHeight } )

oTest2 := TSay():New( 057, 376, {|| "Test"},,,, .F., .F., .F., .T.,,, 015, 007, .F., .F., .F., .F., .F., .F., .F., "oTest2",, .F.,,, ) ; oTest2:SetSize( 015, 007 )
WQout( { oTest2:nHeight } )

oWnd:Activate(, oWnd:bLClicked, oWnd:bRClicked, oWnd:bMoved, oWnd:bResized, oWnd:bPainted, oWnd:bKeyDown, oWnd:bInit,,,,,,,,,,, oWnd:bLButtonUp, .F. )

return NIL

Re: FWH_2407 oSay does not assume nHeight

Posted: Fri Aug 23, 2024 5:37 am
by Antonio Linares
thank you

what source code do you have here ?

ADMP0002.PRG(226)

Re: FWH_2407 oSay does not assume nHeight

Posted: Fri Aug 23, 2024 3:55 pm
by vinhesoft
line 226: @ 010,010 SAY 'Código' FONT oF01_ SIZE 090,010 PIXEL TRANSPARENT

ppo: TSay():New( 010, 010, {|| "Código"},,, oF01_, .F., .F., .F., .T.,,, 090, 010, .F., .F., .F., .F., .F., .F., .T.,,, .F.,,, ) ;:SetSize( 090, 010 )

E:\Sistemas\WinADMpro>harbour admp0002 -p -n
Harbour 3.2.0dev (r2404101339)
Copyright (c) 1999-2021, https://harbour.github.io/
Compiling 'admp0002.prg' and generating preprocessed output to 'admp0002.ppo'...
admp0002.prg(226) Error E0061 Implicit send operator with no WITH OBJECT in sight

Re: FWH_2407 oSay does not assume nHeight

Posted: Fri Aug 23, 2024 4:04 pm
by Antonio Linares
Can you please confirm that you are using using this rule this way ?

[ <oSay> := ] TSay():New( <nRow>, <nCol>, <{cText}>,;
[<oWnd>], [<cPict>], <oFont>, <.lCenter.>, <.lRight.>, <.lBorder.>,;
<.lPixel.>, <nClrText>, <nClrBack>, <nWidth>, <nHeight>,;
<.design.>, <.update.>, <.lShaded.>, <.lBox.>, <.lRaised.>, <.adj.>,;
<.lTrans.>, [<(oSay)>], [Upper( Left( <"uni">, 1 ) ) == "U"], <.lVCenter.>, [<uCargo>], [<.relpix.>], <nClrBorder> ); [ <oSay>:SetSize( <nWidth>, <nHeight> ) ]

Re: FWH_2407 oSay does not assume nHeight

Posted: Fri Aug 23, 2024 5:21 pm
by vinhesoft
Yes!

Code: Select all | Expand

#xcommand @ <nRow>, <nCol> SAY [ <oSay> <label: PROMPT,VAR > ] <cText> ;
             [ <pict: PICT, PICTURE> <cPict> ] ;
             [ <dlg: OF,WINDOW,DIALOG > <oWnd> ] ;
             [ FONT <oFont> ]  ;
             [ <lCenter: CENTERED, CENTER > ] ;
             [ <lRight:  RIGHT >    ] ;
             [ <lBorder: BORDER > [CLR <nClrBorder>] ] ;
             [ [<relpix:RELATIVE>] <lPixel: PIXEL, PIXELS > ] ;
             [ <color: COLOR,COLORS > <nClrText> [,<nClrBack> ] ] ;
             [ SIZE <nWidth>, <nHeight> ] ;
             [ <design: DESIGN >  ] ;
             [ <update: UPDATE >  ] ;
             [ <lShaded: SHADED, SHADOW > ] ;
             [ <lBox:    BOX   >  ] ;
             [ <lRaised: RAISED > ] ;
             [ <adj: ADJUST> ] ;
             [ <lTrans: TRANSPARENT>];
             [ <uni: UNICODE, ANSI> ] ;
             [ <lVCenter: VCENTER> ] ;
             [ CARGO <uCargo> ] ;
      => ;
          [ <oSay> := ] TSay():New( <nRow>, <nCol>, <{cText}>,;
             [<oWnd>], [<cPict>], <oFont>, <.lCenter.>, <.lRight.>, <.lBorder.>,;
             <.lPixel.>, <nClrText>, <nClrBack>, <nWidth>, <nHeight>,;
             <.design.>, <.update.>, <.lShaded.>, <.lBox.>, <.lRaised.>, <.adj.>,;
             <.lTrans.>, [<(oSay)>], [Upper( Left( <"uni">, 1 ) ) == "U"], <.lVCenter.>, [<uCargo>], [<.relpix.>], <nClrBorder> ) ; [ <oSay>:SetSize( <nWidth>, <nHeight> ) ]
works when there is an object reference:
code: @ 057,376 SAY oTest1 PROMPT 'Test' PIXEL
oop: oTest1 := TSay():New( 057, 376, {|| "Test"},,,, .F., .F., .F., .T.,,,,, .F., .F., .F., .F., .F., .F., .F., "oTest1",, .F.,,, ) ; oTest1:SetSize(, )

does not work when there is no object reference:
code: @ 057,376 SAY 'Test' PIXEL
oop: TSay():New( 057, 376, {|| "Test"},,,, .F., .F., .F., .T.,,,,, .F., .F., .F., .F., .F., .F., .F.,,, .F.,,, ) ;:SetSize(, )

????:SetSize(, )