DC_ACHOICE has an argument "nInitialItem" to select the item to highlight in the window on startup.
For DC_BROWSE is there a similar way to highlight a row so that the first row at the top of the browse is not the one highlighted when the browse is started?
DCBrowse Row First Highlighted
Re: DCBrowse Row First Highlighted
You would need to use the navigation methods of the browse object to do this.
This will highlight the 3rd row.
Code: Select all
oBrowse:down()
oBrowse:down()
oBrowse:down()
oBrowse:forceStable()
The eXpress train is coming - and it has more cars.
Re: DCBrowse Row First Highlighted
Or even the 4th row.rdonnay wrote:You would need to use the navigation methods of the browse object to do this.
This will highlight the 3rd row.Code: Select all
oBrowse:down() oBrowse:down() oBrowse:down() oBrowse:forceStable()

Gene, you can put the code in the eval codeblock of either the DCBROWSE or the DCREAD.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: DCBrowse Row First Highlighted
Alternative: If you're browsing a database, just move to the record to be highlighted inside the EVAL clause of DCREAD, put an oBrowse:RefreshAll() behind. If you're browsing an array, set the pointer value in oBrowse:ArrayElement (iVar), also refresh afterwards. But: this may force the browse to scroll.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCBrowse Row First Highlighted
What worked the best was an EVAL in the DCREAD, with three oBrowse:down() commands and a refresh.
I did discover that I had to initially define the pointer as 1 to make it work.
I am using this for users to enter a list of items to print price tags. If I use MODE DCGUI_BROWSE_EDITACROSSDOWN_APPEND in DCBROWSE, the touch typists can enter the items quickly without reaching for a mouse. However, the browse begins on the first row and when the enter key is pressed after entering the first item the browse scrolls upward making the item just entered move upwards out of the visible browse screen. Beginning four lines down eliminated a lot of complaints.
If there is a better way to 'handle' this I would like to hear it, but this seems to work.
Thanks to everyone for their input.
GeneB
I did discover that I had to initially define the pointer as 1 to make it work.
I am using this for users to enter a list of items to print price tags. If I use MODE DCGUI_BROWSE_EDITACROSSDOWN_APPEND in DCBROWSE, the touch typists can enter the items quickly without reaching for a mouse. However, the browse begins on the first row and when the enter key is pressed after entering the first item the browse scrolls upward making the item just entered move upwards out of the visible browse screen. Beginning four lines down eliminated a lot of complaints.
If there is a better way to 'handle' this I would like to hear it, but this seems to work.
Thanks to everyone for their input.
GeneB
Re: DCBrowse Row First Highlighted
I stopped using the POINTER clause of DCBROWSE. If you need an array pointer, use DC_BrowseRow() instead. It seems to me more reliable.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCBrowse Row First Highlighted
oBrowse:arrayElement reliably returns the array pointer.
oBrowse:dataSource[oBrowse:arrayElement] will return an array with the contents of the current row.
oBrowse:dataSource[oBrowse:arrayElement] will return an array with the contents of the current row.
The eXpress train is coming - and it has more cars.