Page 1 of 1

Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 6:07 am
by Natter
I have recompiled their programs under FWH18.03 (xHarbour ) In xBrowse has stopped working option nStretchCol. In version 17.12 it's Ok

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 10:23 am
by nageswaragunupudi
StretchCol has been working in all versions including 18.03.

Sample without stretch col:

Code: Select all

   local oDlg, oBrw

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TITLE FWVERSION + " STRETCH NONE"

   @ 10,10 XBROWSE oBrw SIZE 380,130 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST","CITY","SALARY" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED
 
Image

STRETCHCOL_LAST:

Code: Select all

   local oDlg, oBrw

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TITLE FWVERSION + " STRETCHCOL_LAST"

   @ 10,10 XBROWSE oBrw SIZE 380,130 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST","CITY","SALARY" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw:nStretchCol  := STRETCHCOL_LAST
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

 
Image

STRETCHCOL_WIDEST (recommended)

Code: Select all

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TITLE FWVERSION + " STRETCHCOL_WIDEST (recommended)"

   @ 10,10 XBROWSE oBrw SIZE 380,130 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST","CITY","SALARY" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw:nStretchCol  := STRETCHCOL_WIDEST
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

 
Image

STRETCHCOL <number>

Code: Select all

   local oDlg, oBrw

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TITLE FWVERSION + " STRETCHCOL <specified>"

   @ 10,10 XBROWSE oBrw SIZE 380,130 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST","CITY","SALARY" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw:nStretchCol  := 1
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED
 
Image

It is working as expected.

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 12:10 pm
by Natter
It's all so if you do not change the width xBbrose. But if I next increase the width xBbroseб, the column width (number nStretchCol) will not change

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 12:15 pm
by nageswaragunupudi
But if I next increase the width xBbroseб, the column width (number nStretchCol) will not change
I do not understand.
Can you clearly explain, please?

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 12:23 pm
by Natter
l

Code: Select all

ocal oBrw
private oDlg

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 800,300 PIXEL TITLE FWVERSION + " STRETCHCOL_LAST"

   @ 10,10 XBROWSE oBrw SIZE 380,130 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "FIRST","CITY","SALARY" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw:nStretchCol  := STRETCHCOL_LAST
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg  ON INIT  MY_INI()  CENTERED
return NIL

procedure My_Ini
oDlg:nWidth+=100
oDlg:aControls[1]:nWidth+=100
return
 

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 12:47 pm
by nageswaragunupudi
You are right.
Thanks for pointing out.

Please re-insert this line anywhere in the class declaration of xbrowse (where the method resize is commented out):

Code: Select all

   METHOD Resize( nSizeType, nWidth, nHeight ) INLINE ( ::ColStretch(), ::Super:ReSize( nSizeType, nWidth, nHeight ), If( ::lPainted, ::Refresh(), ) )
 

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 1:43 pm
by Natter
Thank You Mr.Rao. Work correctly

Re: Not working nStretchCol (xBrowse )

Posted: Tue May 08, 2018 7:16 pm
by dagiayunus
Dear Mr.Rao

The screen resolution is vary on my desktop and laptops.

How can I autofit column (stretch or srink) according to the resolution ?

I have sent screenshot of my application to you.

Regards

Yunus.

Re: Not working nStretchCol (xBrowse )

Posted: Wed May 09, 2018 3:29 pm
by José Luis Sánchez
Thanks Mr. Rao, I didn't know this feature of xbrowse and it is very nice !!!

Regards,
José Luis