FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Clicking on a TsBrowse Column, can it execute a Function?
Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
Clicking on a TsBrowse Column, can it execute a Function?
Posted: Mon Mar 20, 2006 01:42 PM

Can I implement a function when clicking on the top of a column in a TsBrowse.
If so, how can I initate that?

In Windows apps you can click on the top of a column and it changes its sequence in alphabetical order f.i.

I use TsBrowse with great pleasure in all my apps.

Thanks for a reply.

Jules
[/b]

Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
Clicking on a TsBrowse Column, can it execute a Function?
Posted: Mon Mar 20, 2006 04:46 PM

oBrw:aActions := { {||msgstop('col 1')}, {||msgstop('col 2')}, {||msgstop('col 3')}, ... }

Regards

Hoe, email: easywin3@yahoo.com
Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
Clicking on a TsBrowse Column
Posted: Mon Mar 20, 2006 08:16 PM

TNHOE,

Thanks for respnding,
Can you give more detailed info?
Where should I place the command: oBrW:aActions
How could the Array look like ,example

Should the function: msgstop('col 1') define the order of records ?

Thanks again.

Jules

Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
Clicking on a TsBrowse Column, can it execute a Function?
Posted: Tue Mar 21, 2006 12:20 AM

select('invoice') // fields: invoice,date,custcode

REDEFINE BROWSE oBrw ALIAS "invoice" ID 101 OF oDlg

oBrw:LoadFields( .T. ) // load all fields from dbf

oBrw:aActions:={ {|| fCol('1') },{|| fCol('2') },{|| fCol('3') } }

:
:

return .t.

// Your user defined function below,

function fCol(cX)

msginfo('Header Column clicked : '+cX)

select('invoice')
do case
case cX='1'
set order to tag invoice
case cX='2'
set order to tag date
case cX='3'
set order to tag custcode
endcase
oBrw:refresh()

return .t.

Regards

Hoe, email: easywin3@yahoo.com

Continue the discussion