Clicking on a TsBrowse Column, can it execute a Function?

Clicking on a TsBrowse Column, can it execute a Function?

Postby Jules de Pierre » Mon Mar 20, 2006 1: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]
Jules de Pierre
 
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Postby tnhoe » Mon Mar 20, 2006 4:46 pm

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

Hoe, email: easywin3@yahoo.com
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia

Clicking on a TsBrowse Column

Postby Jules de Pierre » Mon Mar 20, 2006 8: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
Jules de Pierre
 
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Postby tnhoe » 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
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 169 guests