FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour new XBrowse features for next build
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
new XBrowse features for next build
Posted: Wed Mar 26, 2008 08:08 AM
Using trees from XBrowse:


Using a brush for a specific column:
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 39
Joined: Tue Jan 24, 2006 06:16 PM
new XBrowse features for next build
Posted: Wed Mar 26, 2008 09:52 AM

Antonio,

Nice work!
Can you show me the sample code part for the "Trees browse"?

Patrick

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
new XBrowse features for next build
Posted: Wed Mar 26, 2008 12:27 PM

Antonio,

I have been wanted to do trees in a browse for a long time. Nice!

I would also like to see the code.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
new XBrowse features for next build
Posted: Wed Mar 26, 2008 03:28 PM
Assuming you have grouped data and built a Tree, the code for browsing
the Tree is simple

Syntax: oBrw:SetTree( oTree, [ { resOpen, resClose [, resNoChildren ] } ], [ <bDataLink> ] )

Example:
REDEFINE XBROWSE oBrw ID <id> OF oDlg
oBrw:SetTree( oTree, { "OPEN","CLOSE","NONE" } )
ACTIVATE DIALOG oDlg


XBrowse creates one column showing the oItem:cPrompt with the bitmaps specified. Based on nLevel, the cPrompt along with bitmaps, if any, is indented within the first column.

If there is any data linked to the TreeItems that is to be shown in the
next columns, simple alternative is to assign all such data as an array
to oItem:cargo. Then columns can be created for this data.

Example:
ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] PICTURE "999" HEADER "Employees"
ADD TO oBrw DATA oBrw:oTreeItem:cargo[ 2 ] PICTURE "999,999" HEADER "Salary"


It is possible for some reason, you may not like to copy all the data into
arrays and assign to oItem:Cargo. This may be the case when the data is very large and copying all the data may be time consuming or memory intensive. In such cases, there is another alternative. You can assign to oItem:Cargo a pointer to the relavant row in the datsource. For example it can be RecNo() of DBF or AbsolutePosition of a Recordset, etc.

In such a case you need to specify a codeblock as 3rd paramter of SetTree method. The codebock can be like { |oItem| (cAlias)->( DbGoTo( oItem:Cargo ) ) }.

In that case, Browse object takes care of positioning the datasource by
evaluating the codeblock with every skip. Then you may add columns like this:

ADD TO oBrw DATA (cAlias)->EMPCOUNT PICTURE "999" HEADER "Employees"
or
ADD TO oBrw oRs:Fields("TotSalary"):Value PICTURE "999,999" HEADER "TotSalary"


Rest are cosmetics. We welcome any suggestions for further simplification :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
new XBrowse features for next build
Posted: Fri Mar 28, 2008 02:24 AM

Antonio,
Great!
Could add drag some cells like EXCEL ? a black colored area,so to copy ,delete,click ?
Regards!
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
new XBrowse features for next build
Posted: Fri Mar 28, 2008 01:02 PM

This feature is in the to-do list. But in 8.04, we can achieve same results by selecting multiple rows and hiding unwanted columns.

Methods Copy() to clipboard ( by pressing Ctrl-C ), report and export to excel work on the selected rows and visible columns only.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
new XBrowse features for next build
Posted: Fri Mar 28, 2008 02:26 PM
New display modes:

1. Entire selected line, with highlighted cell


2. Same as before, but after having selected a group of lines
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
new XBrowse features for next build
Posted: Fri Mar 28, 2008 05:13 PM

Fantastic!

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9

Continue the discussion