XBrowse: currently selected column position
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
XBrowse: currently selected column position
How to get the position of the selected column in XBrowse?
EMG
EMG
Re: XBrowse: currently selected column position
Look at this :
oBrw:nColSel
o:nCreationOrder
FOR i := 2 TO LEN( oBrw:aCols)
oCol := oBrw:aCols[ i ]
oCol:nEditType := EDIT_GET
oCol:bOnPostEdit := {|o, v, n| iif( (n != VK_ESCAPE .AND. oBrw:nColSel >2), (dbselectarea("EQUIP"),DBRLOCK(), FieldPut( o:nCreationOrder-1, v ), DBRUNLOCK() ), ) }
oCol:bLClickHeader := {|r,c,f,o| (DEXO(o:nCreationOrder),oBrw:refresh()) }
NEXT
oBrw:nColSel
o:nCreationOrder
FOR i := 2 TO LEN( oBrw:aCols)
oCol := oBrw:aCols[ i ]
oCol:nEditType := EDIT_GET
oCol:bOnPostEdit := {|o, v, n| iif( (n != VK_ESCAPE .AND. oBrw:nColSel >2), (dbselectarea("EQUIP"),DBRLOCK(), FieldPut( o:nCreationOrder-1, v ), DBRUNLOCK() ), ) }
oCol:bLClickHeader := {|r,c,f,o| (DEXO(o:nCreationOrder),oBrw:refresh()) }
NEXT
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Jack wrote:oBrw:nColSel
o:nCreationOrder
Sorry, nColSel is the position from the first visible column and nCreationOrder is the creation order of the column not its position. I need the real physical position of the selected column counted from the first column.
EMG
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: XBrowse: currently selected column position
Do you mean
Code: Select all | Expand
o:nAtcol(y)
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Marc Vanzegbroeck wrote:Do you meanCode: Select all | Expand
o:nAtcol(y)
nAtCol doesn't exist in XBrowse.
EMG
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Jack wrote:o:nCreationOrder
Sorry, Jack, nCreationOrder seems to be what I was looking for, thank you.
EMG
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
I spoke too fast. What I really need is to know the position of the currently selected column starting from the first column. nCreationOrder is a sort of column id. nPos is the position starting from the first visible column not from the first column.
Any help?
EMG
Any help?
EMG
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: XBrowse: currently selected column position
HI Enrico.
oCol: = oBrw: SelectedCol ()
It seem oCol: nCreationOrder () returns the correct position of a column only when the columns keep their original order of creation, but not when they are swapped or hidden.
I have checked the class and could not find the method or function you want.
Regards
oCol: = oBrw: SelectedCol ()
It seem oCol: nCreationOrder () returns the correct position of a column only when the columns keep their original order of creation, but not when they are swapped or hidden.
I have checked the class and could not find the method or function you want.
Regards
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Ok, thank you. I've checked the class myself and found nothing either. Let's wait for Rao final word.
EMG
EMG
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: XBrowse: currently selected column position
Enrico Maria Giordano wrote:How to get the position of the selected column in XBrowse?
EMG
if you want to know the current position of the selected col in the array oBrw:aCols:
Code: Select all | Expand
oSelectedCol := oBrw:SelectedCol()
nAt := AScan( oBrw:aCols, { |o| o:nCreationOrder == oSelectedCol:nCreationOrder } )
nAt is the position of the selected column object in the array oBrw:aCols.
The above approach can be used to find the ordinal position of any column object (selected column or not) in the array oBrw:aCols.
This is the simplest way of finding the position of "selected column" in the array oBrw:aCols
Code: Select all | Expand
nAt := oBrw:aDisplay[ oBrw:nColSel ]
Now, oBrw:aCols[ nAt ] is the selected column object.
But I am curious to know what is the use of this information in an application?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Thank you Rao.
Essentially, nothing. Sorry, but the application is not mine and it's evolving.![Smile :-)](./images/smilies/icon_smile.gif)
EMG
nageswaragunupudi wrote:But I am curious to know what is the use of this information in an application?
Essentially, nothing. Sorry, but the application is not mine and it's evolving.
![Smile :-)](./images/smilies/icon_smile.gif)
EMG
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: XBrowse: currently selected column position
Enrico Maria Giordano wrote:I spoke too fast. What I really need is to know the position of the currently selected column starting from the first column. nCreationOrder is a sort of column id. nPos is the position starting from the first visible column not from the first column.
Any help?
EMG
Excuse me Enrico. I'm a bit confused.
What you want to know is the position of the currently selected column, starting from column number 1, not from oBrw: display, but from column number 1 of the total number of columns that make up the browser structure?
Disculpa Enrico. Estoy un poco confundido.
Lo que deseas saber es la posición de la columna actualmente seleccionada, comenzando desde la columna número 1, no desde oBrw:display, sino desde la columna número 1 del número total de columnas que componen la estructura del navegador?
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: XBrowse: currently selected column position
Probably the question is academic now... I would want to know the physical position of the currently selected column starting from the first column of the browse, not from the first visible column.
EMG
EMG