FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse Array as MULTILINE
Posts: 811
Joined: Tue May 06, 2008 04:28 AM

XBrowse Array as MULTILINE

Posted: Wed Jun 23, 2010 09: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
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM

Re: XBrowse Array as MULTILINE

Posted: 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBrowse Array as MULTILINE

Posted: Wed Jun 23, 2010 02:40 PM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: XBrowse Array as MULTILINE

Posted: Wed Jun 23, 2010 08:31 PM

I think you also need to increase the row height.

oBrw:nRowHeight := 35

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 811
Joined: Tue May 06, 2008 04:28 AM

Re: XBrowse Array as MULTILINE

Posted: 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 (fw): Select all Collapse
...
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBrowse Array as MULTILINE

Posted: Thu Jun 24, 2010 04:05 PM

Mr Frances
Please try again. This works for me.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBrowse Array as MULTILINE

Posted: Thu Jun 24, 2010 04: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
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM

Re: XBrowse Array as MULTILINE

Posted: 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.

Posts: 811
Joined: Tue May 06, 2008 04:28 AM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 04: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
Posts: 811
Joined: Tue May 06, 2008 04:28 AM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 04: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
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 06: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
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 06: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 (fw): Select all Collapse
#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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 07: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
Posts: 811
Joined: Tue May 06, 2008 04:28 AM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 08:38 AM
Dear All,

I located the trouble or bug..

Code (fw): Select all Collapse
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: XBrowse Array as MULTILINE

Posted: Fri Jun 25, 2010 09: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