FWH_2407 oSay does not assume nHeight

Re: FWH_2407 oSay does not assume nHeight

Postby Antonio Linares » Sat Aug 24, 2024 9:33 am

[ Eval( { | oSay, nWidth, nHeight | If( ! Empty( oSay ) .and. ! Empty( nWidth ), oSay:SetSize( nWidth, nHeight ),) }, <oSay>, <nWidth>, <nHeight> ) ]

Working! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH_2407 oSay does not assume nHeight

Postby vinhesoft » Sat Aug 24, 2024 12:03 pm

Working! with DEFINE WINDOW
Code: Select all  Expand view
function Main()

    local oWnd, oTest1, oTest2

    DEFINE WINDOW oWnd

    @ 057,376 SAY oTest1 PROMPT 'Test1' PIXEL
    ? oTest1:nWidth,oTest1:nHeight // 28,16

    @ 087,376 SAY oTest2 PROMPT 'Test2' PIXEL SIZE 015,007
    ? oTest2:nWidth,oTest2:nHeight // 15,07

    oTest1:SetText('** Test1 **')
    ? oTest1:nWidth,oTest1:nHeight // 28,16

    oTest2:SetText('** Test2 **')
    ? oTest2:nWidth,oTest2:nHeight // 15,07

    oTest1:refresh()
    ? oTest1:nWidth,oTest1:nHeight // 28,16

    oTest2:refresh()
    ? oTest2:nWidth,oTest2:nHeight //15,07

    ACTIVATE WINDOW oWnd

return nil


not Working! with DEFINE DIALOG
Code: Select all  Expand view
function Test()

    local oWnd, oTest1, oTest2

    DEFINE DIALOG oWnd

    @ 057,376 SAY oTest1 PROMPT 'Test1' PIXEL
    ? oTest1:nWidth,oTest1:nHeight // 37,16

    @ 087,376 SAY oTest2 PROMPT 'Test2' PIXEL SIZE 015,007
    ? oTest2:nWidth,oTest2:nHeight // 1,1

    oTest1:SetText('** Test1 **')
    ? oTest1:nWidth,oTest1:nHeight // 27,16

    oTest2:SetText('** Test2 **')
    ? oTest2:nWidth,oTest2:nHeight // 1,1

    oTest1:refresh()
    ? oTest1:nWidth,oTest1:nHeight // 37,16

    oTest2:refresh()
    ? oTest2:nWidth,oTest2:nHeight //1,1

    ACTIVATE DIALOG oWnd

return nil


I believe that the best solution would be to change the Tsay class so as not to calculate nWidth/nHeigth when these values ​​are defined by the user
João Carlos
VinheSoft Informatica
BCC 7.7 - FHW 24.07 - Harbour 3.2.0dev (r2404101339) for BCC 7.7
vinhesoft
 
Posts: 36
Joined: Sat Sep 03, 2016 3:11 pm
Location: Campinas/SP-Brasil

Re: FWH_2407 oSay does not assume nHeight

Postby Antonio Linares » Sat Aug 24, 2024 12:09 pm

You are right as controls in dialogboxes don't exist until the dialog is activated

Could you please explain us what do you need this for ?

Maybe there is another way of doing it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH_2407 oSay does not assume nHeight

Postby richard-service » Sat Aug 24, 2024 5:43 pm

Dear Antonio,

I want to move Say object position. I add 1400 not work. FWH2404 version only add 120 work fine.

FWH2407
Image
Code: Select all  Expand view

if nStyle < 2007
         @ nRow, nCol + 1400 SAY ::oPage PROMPT FWString( "Page number:" ) + ;
           LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;
           LTrim( Str( Len( ::oDevice:aMeta ) ) ) ;
           SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont
         ::oPage:lTransparent = .T.
endif
 


FWH2404
Image
Code: Select all  Expand view

if nStyle < 2007
         @ nRow, nCol + 120 SAY ::oPage PROMPT FWString( "Page number:" ) + ;
           LTrim( Str( ::nPage, 4, 0 ) ) + " / " + ;
           LTrim( Str( Len( ::oDevice:aMeta ) ) ) ;
           SIZE 180, 15 PIXEL OF ::oBar FONT ::oFont
         ::oPage:lTransparent = .T.
endif
 
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Sun Aug 25, 2024 1:09 pm

vinhesoft wrote: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


Working correctly for me.
Please try this program.
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oWnd, oSay1, oSay2, oBtn, aInfo

   DEFINE WINDOW oWnd FROM 0,0 TO 500,500 PIXEL TITLE FWVERSION

   @  20,20 SAY oSay1 PROMPT "30 PIXEL HEIGHT" SIZE 200,30 PIXEL OF oWnd
   ? oSay1:nHeight // --> 31

   @  60,20 SAY oSay2 PROMPT "50 PIXEL HEIGHT" SIZE 200,50 PIXEL OF oWnd
   ? oSay2:nHeight // --> 51

   @ 350,20 BTNBMP oBtn PROMPT "CHECK SIZES" + CRLF + "60 PIX HEIGHT" ;
      SIZE 200,60 PIXEL OF oWnd FLAT ACTION ( ;
      aInfo := {}, ;
      AEval( oWnd:aControls, ;
         { |o| AAdd( aInfo, { o:ClassName(), o:nHeight } ) } ), ;
      XBrowse( aInfo ) )

   ACTIVATE WINDOW oWnd CENTERED

return nil
 


Image

Note: There is always 1 pixel difference for some controls/windows. I will explain this in detail in a separate post. Otherwise oCtrl:nHeight gives wthe correct value.
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Sun Aug 25, 2024 1:54 pm

not Working! with DEFINE DIALOG


This is working for me here:
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oSay1, oSay2, oBtn, aInfo

   DEFINE DIALOG oDlg SIZE 500,500 PIXEL TRUEPIXEL TITLE FWVERSION

   @  20,20 SAY oSay1 PROMPT "30 PIXEL HEIGHT" SIZE 200,30 PIXEL OF oDlg
   ? oSay1:nHeight // --> 31

   @  60,20 SAY oSay2 PROMPT "50 PIXEL HEIGHT" SIZE 200,50 PIXEL OF oDlg
   ? oSay2:nHeight // --> 51

   @ 350,20 BTNBMP oBtn PROMPT "CHECK SIZES" + CRLF + "60 PIX HEIGHT" ;
      SIZE 200,60 PIXEL OF oDlg FLAT ACTION ( ;
      aInfo := {}, ;
      AEval( oDlg:aControls, ;
         { |o| AAdd( aInfo, { o:ClassName(), o:nHeight } ) } ), ;
      XBrowse( aInfo ) )

   ACTIVATE DIALOG oDlg CENTERED

return nil

Please run this also and see.
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Sun Aug 25, 2024 3:47 pm

I want to move Say object position. I add 1400 not work. FWH2404 version only add 120 work fine.


Adding 1400 pixels may move it outside the size of the Bar
Does it work if you add 120 pixels?
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby richard-service » Mon Aug 26, 2024 5:21 pm

nageswaragunupudi wrote:
I want to move Say object position. I add 1400 not work. FWH2404 version only add 120 work fine.


Adding 1400 pixels may move it outside the size of the Bar
Does it work if you add 120 pixels?


Adding 1400 and 120 always stay here not move.
FWH2407
Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Tue Aug 27, 2024 9:38 am

How can you help us to test this at our end?
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby vinhesoft » Wed Aug 28, 2024 3:15 pm

Dear Antonio

FHW_1912
Image

FWH_2407
Image

DEFINE WINDOW --> ok

DEFINE DIALOG --> not working
João Carlos
VinheSoft Informatica
BCC 7.7 - FHW 24.07 - Harbour 3.2.0dev (r2404101339) for BCC 7.7
vinhesoft
 
Posts: 36
Joined: Sat Sep 03, 2016 3:11 pm
Location: Campinas/SP-Brasil

Re: FWH_2407 oSay does not assume nHeight

Postby Antonio Linares » Wed Aug 28, 2024 3:21 pm

Many thanks for your feedback

We are working to fix it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Wed Aug 28, 2024 3:24 pm

Please provide one small sample program which we can test here with different versions with Window and dialog
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby richard-service » Thu Aug 29, 2024 2:23 am

nageswaragunupudi wrote:How can you help us to test this at our end?


Mr.RAO
Thinking about FWH2404 working and FWH2407 not work. I just modify same code and Chinese word within rpreview.prg
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Thu Aug 29, 2024 6:10 am

richard-service wrote:
nageswaragunupudi wrote:How can you help us to test this at our end?


Mr.RAO
Thinking about FWH2404 working and FWH2407 not work. I just modify same code and Chinese word within rpreview.prg


I have tried changing this here on my PC.
This is the original code in rpreview.prg:
Code: Select all  Expand view
@ nRow, nCol + 100 SAY ::oPage PROMPT FWString( "Page number:" ) + ;

Without any changes this is how the preview bar looks like:
Image

Now, I changed +100 as +300 like this:
Code: Select all  Expand view
@ nRow, nCol + 300 SAY ::oPage PROMPT FWString( "Page number:" ) + ;

With this change, the Say is moved to the right by 200 pixels and looks like this:
Image

Then I changed it to +600 like this:
Code: Select all  Expand view
@ nRow, nCol + 600 SAY ::oPage PROMPT FWString( "Page number:" ) + ;

Then the Say moved by 300 pixels more to the right and looked like this:
Image

So, this is working correctly for me here.
Regards

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

Re: FWH_2407 oSay does not assume nHeight

Postby nageswaragunupudi » Thu Aug 29, 2024 7:16 am

Mr. João Carlos,

Yes, we see the problem. We regret the inconvenience and also thank your for bringing the issue to our notice.

Can you make two small fixes to "say.prg" and use it to rebuild your application?

FIX:
1) Please locate these two lines. (lines 137 and 138)
Code: Select all  Expand view
  ::nBottom   = ::nTop + nHeight
   ::nRight    = ::nLeft + nWidth


Change these two lines as:
Code: Select all  Expand view
  ::nBottom   = ::nTop + nHeight - 1
   ::nRight    = ::nLeft + nWidth - 1


2. Please locate this line of code (line 151)
Code: Select all  Expand view
  ::CalcSize( ::nTop, ::nLeft, @nWidth, @nHeight, lRelPix )

Please comment out this line, like this
Code: Select all  Expand view
// ::CalcSize( ::nTop, ::nLeft, @nWidth, @nHeight, lRelPix )


These changes should resolve your issues.
Please provide your feed back.
Regards

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

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