XBrowse Array as MULTILINE

XBrowse Array as MULTILINE

Postby fraxzi » Wed Jun 23, 2010 9:53 am

Dear All,

XBrowse an array with 200 characters as one of the element. I tried oCol:DefStyle( AL_LEFT, .F. ) but still cannot make another line using CTRL+ENTER


Any hint?


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: XBrowse Array as MULTILINE

Postby gkuhnert » Wed Jun 23, 2010 11:25 am

Frances,

try to switch the style to AL_RIGHT first and then back to AL_LEFT.
If I remember it right, I was experimenting with this feature and found this as a possible workaround.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: XBrowse Array as MULTILINE

Postby nageswaragunupudi » Wed Jun 23, 2010 2:40 pm

Please try either oBrw:nDataLines := 2 or oCol:nDataLines := 2 ( 2 or more )
Regards

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

Re: XBrowse Array as MULTILINE

Postby James Bott » Wed Jun 23, 2010 8:31 pm

I think you also need to increase the row height.

oBrw:nRowHeight := 35

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: XBrowse Array as MULTILINE

Postby fraxzi » Wed Jun 23, 2010 11:57 pm

Dear Mr. Gilbert, Mr. RAO and Mr. James,

I tried all your suggestions but still cannot add line by CTRL+ENTER.

Code: Select all  Expand view
...
oBrw:nDataLines := 4
oCol:nDataLines := 4
...


Height and width are increased.

With RDD, table->memofield works as expected.. editor-like. But in an array with 200 chars/space(200) doesn't work as multiline and cant add line.


I hope there's a workaround.


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: XBrowse Array as MULTILINE

Postby nageswaragunupudi » Thu Jun 24, 2010 4:05 pm

Mr Frances
Please try again. This works for me.
Regards

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

Re: XBrowse Array as MULTILINE

Postby nageswaragunupudi » Thu Jun 24, 2010 4:06 pm

James Bott wrote:I think you also need to increase the row height.

oBrw:nRowHeight := 35

James

XBrowse automatically calculates the browse height on the basis of number of nDataLines. There is no need to again specify oBrw:nRowHeight.
Regards

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

Re: XBrowse Array as MULTILINE

Postby reinaldocrespo » Fri Jun 25, 2010 12:46 am

Frances;

Hi. And hi everyone.

I often do this. First I calculate how many lines are needed to display the desired data by executing this inside a loop that walks through each element of the array looking at the column in question. nLines := Max( nLines, Len( a ) )

Then take the xbrowse object and change nDataLines property like this: oPcLbx:nDataLines := nLines

And that should do it.

The other thing you can do would be to show only the first line with an ellipsis at the end. Once you click on the ellipsis, show a memoedit dialog with all the data that can also be used for editing.

Hope that helps.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: XBrowse Array as MULTILINE

Postby fraxzi » Fri Jun 25, 2010 4:55 am

nageswaragunupudi wrote:Mr Frances
Please try again. This works for me.



Dear Mr. RAO,

It doen't work.. I tried all oBrw:nMarqueeStyle := 1..6 , what could be? in RDD/memo it works in Array it doesn't..
I'm using FWH v10.5 (not yet on 10.6)


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: XBrowse Array as MULTILINE

Postby fraxzi » Fri Jun 25, 2010 4:57 am

reinaldocrespo wrote:Frances;

Hi. And hi everyone.

I often do this. First I calculate how many lines are needed to display the desired data by executing this inside a loop that walks through each element of the array looking at the column in question. nLines := Max( nLines, Len( a ) )

Then take the xbrowse object and change nDataLines property like this: oPcLbx:nDataLines := nLines

And that should do it.

The other thing you can do would be to show only the first line with an ellipsis at the end. Once you click on the ellipsis, show a memoedit dialog with all the data that can also be used for editing.

Hope that helps.


Reinaldo.


Hi Mr. Reinaldo,

In RDD/memo it works without some memoedit box... I would prefer it works with array too. so user directly input the text data into the xbrowse col in multiline.


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: XBrowse Array as MULTILINE

Postby gkuhnert » Fri Jun 25, 2010 6:19 am

Frances,

could you provide us with a small self-containing example? I'd be willing to try compiling it at my pc.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: XBrowse Array as MULTILINE

Postby Otto » Fri Jun 25, 2010 6:50 am

Mr. Rao,

>XBrowse automatically calculates the browse height on the basis of number of nDataLines. There is no need to again specify oBrw:nRowHeight.

Is this only valid for multiline.
I tried with the following code and nRowHeight is working.

Best regards,
Otto


Code: Select all  Expand view
#include "fivewin.ch"
#include "xbrowse.ch"


function Main()

   local oWnd, oBrw, oDbf

   use customer
   database odbf

   define window ownd
   @ 0,0 xbrowse oBrw of oWnd ;
         object odbf  ;
         rows { 10, 5, 30, 50, 100 } // Array of record numbers
   
   oBrw:nRowHeight := 55

   oBrw:CreateFromCode()
   oWnd:oClient := oBrw

   activate window oWnd

return nil
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: XBrowse Array as MULTILINE

Postby nageswaragunupudi » Fri Jun 25, 2010 7:02 am

If we specify oBrw:nRowHeight, XBrowse does not do any calculation on its own, but just accepts the nRowHeight specified in our program. If we do not specify oBrw:nRowHeight, XBrowse calculates RowHeight on the basis of the font height and oBrw:nDataLines (or) oCol:nDataLines. XBrowse's calculation snugly fits the content in the row. In most cases, it is better to allow XBrowse to calculate row height.
Regards

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

Re: XBrowse Array as MULTILINE

Postby fraxzi » Fri Jun 25, 2010 8:38 am

Dear All,

I located the trouble or bug..

Code: Select all  Expand view

FUNCTION utest()
 LOCAL  oWnd, oBrw
 LOCAL aArray := { {Space(200), Space(200)} }

 DEFINE window oWnd

   @ 0,0 xbrowse oBrw of oWnd ;
         headers '1', '2';
         columns 1,2;
         Array aArray

   WITH OBJECT oBrw

        :nDataLines := 4
        :nMarqueeStyle := MARQSTYLE_HIGHLROWRC

        :aCols[1]:nDataLines := 4
        :aCols[1]:nEditType  := EDIT_GET
        :aCols[1]:lAutoSave  := .T.
        :aCols[1]:nWidth     := 200
        :aCols[1]:lAllowSizing := .F.
        :aCols[1]:cEditPicture := '@!'       //COMMENT THIS AND YOU CAN CTRL+ENTER FOR ANOTHER LINE...



        :aCols[2]:nDataLines := 4
        :aCols[2]:nEditType  := EDIT_GET
        :aCols[2]:lAutoSave  := .T.
        :aCols[2]:nWidth     := 200
        :aCols[2]:lAllowSizing := .F.
        :aCols[2]:cEditPicture := '@!'     //is this odd because I need all text entered by end user all upper case

   END WITH

   oBrw:CreateFromCode()

   oWnd:oClient := oBrw

   activate window oWnd
RETURN
 



The workaround is to upper( oBrw:aRow[1] )...

I think picture "@!" are to be allowed in multiline xBrowse column..

Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: XBrowse Array as MULTILINE

Postby nageswaragunupudi » Fri Jun 25, 2010 9:04 am

This is not bug. The code was intentional.
Multiline Get does not have a picture clause. When a picture clause is specified by programmer XBrowse understands that the programmer does not want Multiline edit.

Once you specify oBrw:nDataLines there is no need to specify same value as nDatalines for each column.
Regards

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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