Page 1 of 1

change the ndatalines (xbrowse) on line - RESOLVED -

PostPosted: Fri May 12, 2023 1:13 pm
by Silvio.Falconi
Initially a test line in the browse consists of a single example line

WITH OBJECT oBrw
IF lmore
:nDataLines := 2
ELSE
:nDataLines := 1
ENDIF

...
END


Code: Select all  Expand view
 :bStrData := { || oDbf:Street + CRLF +oDbf:city+" "+ oDbf:state }


Image


the user by a menu popup can change the configuration and set more rows
on command of menu I made

Code: Select all  Expand view

Function oBtnMenu2(oBrw,oDbf,oParent,cSection,nRow,nCol)
   local oMenu,oItem1
  MENU oMenu POPUP
 MENUITEM oItem1 PROMPT "More Rows" ;
      ACTION (lMore := !lMore,;
                 ( IIF( lMore,oBrw:nDataLines := 2,oBrw:nDataLines := 1 ),;
                   oBrw:refresh()) )
      ENDMENU
      oItem1:SetCheck(lMore)
     ACTIVATE POPUP oMenu OF oParent AT  oBrw:nTop+nRow, oBrw:nLeft+nCol
return nil
 


Why not refresh the oBrw ?

Re: change the ndatalines (xbrowse) on lines

PostPosted: Fri May 12, 2023 8:16 pm
by Marc Venken
Silvio,

Please try : chr(13)+chr(10) in stead of CRLF

COLUMNS "ID", "FIRST+CHR(13)+CHR(10)+LAST", ;
"STREET+CHR(13)+CHR(10)+CITY+CHR(13)+CHR(10)+STATE+ '-' + ZIP" ;
HEADERS "ID", "NAME", "ADDRESS" ;

I can be wrong ))))

Re: change the ndatalines (xbrowse) on lines

PostPosted: Sat May 13, 2023 1:02 am
by nageswaragunupudi
nDataLines is used by xbrowse only while creating the browse for the first time for calculating the row height. After creation of the browse. i.e., during runtime, it is never used and changing the values does not do anything.
During runtime, you can change the data oBrw:nRowHeight.

Re: change the ndatalines (xbrowse) on lines

PostPosted: Sat May 13, 2023 1:06 am
by nageswaragunupudi
Marc Venken wrote:Silvio,

Please try : chr(13)+chr(10) in stead of CRLF

COLUMNS "ID", "FIRST+CHR(13)+CHR(10)+LAST", ;
"STREET+CHR(13)+CHR(10)+CITY+CHR(13)+CHR(10)+STATE+ '-' + ZIP" ;
HEADERS "ID", "NAME", "ADDRESS" ;

I can be wrong ))))


Not correct.
chr(13)+chr(10) or CRLF should not be inside the quotes.
Code: Select all  Expand view
     COLUMNS "ID", "FIRST+CHR(13)+CHR(10)+LAST", ;
 

is not correct
Code: Select all  Expand view
     COLUMNS "ID", "FIRST"+CHR(13)+CHR(10)+"LAST", ;
 

is correct.
You can use CRLF also.

Re: change the ndatalines (xbrowse) on lines

PostPosted: Sat May 13, 2023 9:25 am
by Silvio.Falconi
nageswaragunupudi wrote:nDataLines is used by xbrowse only while creating the browse for the first time for calculating the row height. After creation of the browse. i.e., during runtime, it is never used and changing the values does not do anything.
During runtime, you can change the data oBrw:nRowHeight.


thanks run correctly

this is only a test

one row
Image

two rows

Image