FWH 1805: XBrowse New syntax

FWH 1805: XBrowse New syntax

Postby nageswaragunupudi » Sun Jul 08, 2018 4:18 am

An alternative syntax is now availabe for defining columns while creating XBrowse.
The syntax is explained with examples.

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

function Main()

   local oDlg, oBrw, aData

   USE CUSTOMER NEW

   DEFINE DIALOG oDlg SIZE 560,400 PIXEL TRUEPIXEL TITLE "NEW SYNTAX" RESIZABLE

   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE Alias() COLUMNS ;
         "TRIM(FIRST)+', '+TRIM(LAST) AS FullName PICTURE @! WIDTH 150 ALIGN CENTER SORT FIRST", ;
         "TRIM(STREET)+', '+TRIM(CITY) AS Address WIDTH 250 SORT CITY", ;
         "AGE PICT 999" ;
      CELL LINES NOBORDER AUTOSORT

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED NOMODAL

   GO TOP
   aData := FW_DbfToArray( "FIRST,CITY" )

   XBROWSER aData COLUMNS "1 AS FirstName", "2 AS City"

   CLOSE CUSTOMER

return nil
 


Image
Regards

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

Re: FWH 1805: XBrowse New syntax

Postby Rick Lipkin » Tue Jul 10, 2018 1:03 pm

Rao

Very impressive ... I like being able to combine data, headers, colsizes, picture in one command ... one other suggestion ... I use the xBrowse(oRs) function frequently when debugging Sql recordsets ... It would be very helpful if you could add the number of returned rows on the xBrowse footer .. Usually I already know how many rows should be returned by a query .. adding the number of return rows on the xBrowse() footer would be an easy way to confirm my logic.

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: FWH 1805: XBrowse New syntax

Postby nageswaragunupudi » Tue Jul 10, 2018 3:11 pm

Please add the clause SHOW RECID or SHOW SLNUM to the Xbrowser command.
Regards

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

Re: FWH 1805: XBrowse New syntax

Postby Mulyadi » Mon May 18, 2020 4:13 pm

Mr Rao.

where can I get a complete reference to new syntax of xbrowse ?
for example, how to write validations and button actions in the new syntax.

I try like this but not working:
Code: Select all  Expand view


@ 25,210 XBROWSE oBrwPrice SIZE -5,-5 PIXEL OF oFld:aDialogs[1] ;
 DATASOURCE orsPrice ;
  COLUMNS ...
          ...
          "price as Final Price picture '999,999,999' width 80 bitmap '.\Images\x64\calc.bmp' " + ;
            "nEditType := EDIT_GET_BUTTON transparent " + ;
            "valid if( oget:Value < 0, .F., .T. ) ", ;
          ...
  CELL FASTEDIT NOBORDER      
 


Regards

Mulyadi
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: FWH 1805: XBrowse New syntax

Postby nageswaragunupudi » Tue May 19, 2020 6:00 am

Code: Select all  Expand view

<expression> AS/HEADER <header> WIDTH <nwidth> PIC/PICT/PICTURE <cpic> ALIGN <calign> SORT/ORDER BY <csortorder>
 


<expression> has to be the first
Other clauses are all optional and can be in any order.

";" embedded in header is translated as CRLF.

Note:
XBrowse automatically decides the width, picture, align and sort order. Unless it is really necessary, it is not necessary to specify these.

nEditType, bEditValid, bitmaps are all to be assigned separately as normal.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

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