Selected column in xbrowse

Selected column in xbrowse

Postby Marc Vanzegbroeck » Thu Mar 19, 2009 2:50 pm

Hi,

How can i know which column is selecten in xbrowse?

Now I'am using

Code: Select all  Expand view
vkolom := brw:nColSel


but this is not working if the browse is scrolling to the right. It returns the selected column that is currently displayed. Not the real column from the complete browse.

Thanks,
Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Selected column in xbrowse

Postby Silvio » Thu Mar 19, 2009 3:22 pm

I made :
aSel:={}

.... add a column for the selection
oCol:= oApp():oGrid:AddCol()
oCol:AddResource("C_Pal")
oCol:AddResource("STATO3")
oCol:bBmpData := { || Ds_Mar(1,2)}
oCol:cHeader := ""
oCol:nWidth := 25

oApp():oGrid:bKeyDown :={|nKey| Val_nKey(nKey,oApp():oDlg)}
.....


STAT FUNC Val_nKey(nKey,oDlg)
CASE nKey==VK_F5
Selecciona()

.....



to Mark the record
STAT FUNC Ds_Mar(cBmp,cCan) // Marca
LOCAL cRet:=0
cRet:=IF((oDCli)->Status="B",cCan,cRet)
cRet:=IF(AScan(oT:aSel,(oDCli)->NumCli)<>0,cBmp,cRet)
RETURN (cRet)


STAT FUNC Selecciona() // Seleccionar registro
LOCAL x:=AScan(oT:aSel,(oDCli)->NumCli)
IF x<>0
ADel(oT:aSel,x)
ASize(oT:aSel,Len(oT:aSel)-1)
ELSE
AAdd(oT:aSel,(oDCli)->NumCli)
ENDIF
oApp():oGrid:Refresh()
RETURN (NIL)



Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Selected column in xbrowse

Postby Marc Vanzegbroeck » Thu Mar 19, 2009 5:42 pm

Thanks Silvio, but I just found an easyer solution in this forum

Code: Select all  Expand view
oBrw:ColAtPos( oBrw:nColSel ):nCreationOrder


Regards,
Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Selected column in xbrowse

Postby nageswaragunupudi » Sat Mar 21, 2009 5:59 pm

oBrw:SelectedCol() gives the column object of the column selected.

We can obtain the creation order by oBrw:SelectedCol():nCreationOrder, but there is no use knowing the creation order.

In xbrowse, the user can move the position of the columns at runtime, hide some columns and make some hidden columns visible. oBrw:aCols array at runtime is not in the creation order, but in the order of columns they appear on screen. Knowing the creation order does not help much.

What we are interested is to know what column object is selected and write some code to deal with that object.

oCol := oBrw:SelectedCol()
Write whatever code we want for this oCol. We are least concerned where this column appears on the screen.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests