Not working nStretchCol (xBrowse )

Post Reply
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Not working nStretchCol (xBrowse )

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Not working nStretchCol (xBrowse )

Post 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.
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Re: Not working nStretchCol (xBrowse )

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Not working nStretchCol (xBrowse )

Post 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?
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Re: Not working nStretchCol (xBrowse )

Post 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
 
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Not working nStretchCol (xBrowse )

Post 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(), ) )
 
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Re: Not working nStretchCol (xBrowse )

Post by Natter »

Thank You Mr.Rao. Work correctly
dagiayunus
Posts: 69
Joined: Wed Nov 19, 2014 1:04 pm
Contact:

Re: Not working nStretchCol (xBrowse )

Post 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.
Dagia Yunus.
Rajkot, India

FWH 17.04
User avatar
José Luis Sánchez
Posts: 484
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España
Contact:

Re: Not working nStretchCol (xBrowse )

Post by José Luis Sánchez »

Thanks Mr. Rao, I didn't know this feature of xbrowse and it is very nice !!!

Regards,
José Luis
Post Reply