xBrowse - Multiline

xBrowse - Multiline

Postby frose » Fri Feb 12, 2016 11:20 am

Hi!

is there a builtin function/shortcut to switch from a single line to a multiline xBrowse?

Background: When I was working with my datas, I unintentional switched to a multiline Browse, very nice! But I don't remember the shortcut, thats make me crazy :evil:
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: xBrowse - Multiline

Postby FranciscoA » Fri Feb 12, 2016 3:44 pm

Hi, here a Mr. Rao sample:
Code: Select all  Expand view  RUN
Function MultiLineCells()

   local oDlg, oBrw, aFont[ 3 ]
   local aData    := Array( 4, 12 )
   local n,i,j

   n  := 1
   for i := 1 to 4
      for j := 1 to 10 step 3
        // aData[ i, j ] := NToCDOW( ( n - 1 ) % 7 + 1 )
         aData[ i, j ] := SpaNumDay( ( n - 1 ) % 7 + 1 )
         aData[ i, j + 1 ] := n
         aData[ i, j + 2 ] := "Algún texto que puede tomar mas de una linea."
         n++
      next
   next

   DEFINE FONT aFont[ 1 ] NAME "TAHOMA"  SIZE 0,-16 BOLD
   DEFINE FONT aFont[ 2 ] NAME "IMPACT"  SIZE 0,-34
   DEFINE FONT aFont[ 3 ] NAME "TIMES ROMAN" SIZE 0,-12 ITALIC

   DEFINE DIALOG oDlg SIZE 700,500 PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE aData AUTOCOLS ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :nWidths    := 150
      :nRowHeight := 100
      for i := 1 to 10 STEP 3
         WITH OBJECT :aCols[ i ]
            :oDataFont     := aFont[ 1 ]
            :nDataStrAlign := AL_CENTER
         END
         WITH OBJECT :aCols[ i + 1 ]
            :oDataFont     := aFont[ 2 ]
            :nDataStrAlign := AL_CENTER
            :bClrStd       := { || { CLR_HRED, CLR_WHITE } }
         END
         WITH OBJECT :aCols[ i + 2 ]
            :oDataFont     := aFont[ 3 ]
            :nDataLines    := 2               //HERE THE TRICK
         END
         :aCols[ i ]:SetColsAsRows( i, i + 1, i + 2 )
      next
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   AEval( aFont, { |o| o:End() } )
return nil
 
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xBrowse - Multiline

Postby nageswaragunupudi » Thu Feb 18, 2016 6:19 pm

Also
1) For any browse, if you increase oBrw:nRowHeight, any text that does not fit in the present width flow as multi-line text.

2) Even at runtime, if text exceeds the width of any column, the user can increase the row height by dragging the line separator (like Excel) and automatically, the text is displayed as multi-line text.
Regards

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

Re: xBrowse - Multiline

Postby concentra » Thu Nov 14, 2019 9:59 am

Hi !

Is it possible that each row dynamically have its own height based on its content ?
Like this:

Image

Regards.
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: xBrowse - Multiline

Postby nageswaragunupudi » Thu Nov 14, 2019 10:04 am

Sorry, no.
Not yet
Regards

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

Re: xBrowse - Multiline

Postby concentra » Thu Nov 14, 2019 12:15 pm

nageswaragunupudi wrote:Sorry, no.


Ok.

Not yet


Any chance in the near future ?

[[]] Maurício Faria
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: xBrowse - Multiline

Postby nageswaragunupudi » Fri Nov 15, 2019 4:28 am

Any chance in the near future ?

Yes, but this may not be very soon unless there is demand from many users.
Regards

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

Re: xBrowse - Multiline

Postby hua » Fri Nov 15, 2019 9:58 am

concentra wrote:Hi !

Is it possible that each row dynamically have its own height based on its content ?
Like this:

Image

Regards.


+1
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: xBrowse - Multiline

Postby frose » Fri Nov 15, 2019 4:29 pm

+1
TIA
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: xBrowse - Multiline

Postby leandro » Fri Nov 15, 2019 4:50 pm

testxbr6.prg

Image
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1688
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: xBrowse - Multiline

Postby cnavarro » Fri Nov 15, 2019 5:20 pm

Leandro, creo que se está hablando de que las líneas puedan tener distintas alturas, no siempre la misma.
I think it's talking about the lines having different heights, not always the same.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xBrowse - Multiline

Postby Jimmy » Fri Nov 15, 2019 10:16 pm

hi,
concentra wrote:Is it possible that each row dynamically have its own height based on its content ?

as i can say you need Ownerdraw to get different hight as "calculation" is done by MeasureItem.
the Trick is like FranciscoA say : switch Font when "calculate"

let say you default Font are "Arial" with 10 Points. now you have 3 Lines -> 30 Point
so when WM_MEASUREITEM is fired set big Font before calculate with GetTextExtentPoint32

at WM_DRAWITEM now DRAWITEMSTRUCT->rcItem have place for 3 x Lines "10.Arial"
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

p.s. perhaps it is better to use NM_CUSTOMDRAW than WM_MEASUREITEM / WM_DRAWITEM
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: xBrowse - Multiline

Postby nageswaragunupudi » Fri Nov 15, 2019 11:46 pm

We will provide this soon.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests

cron