I have a browse with 15 columns.
The first column is a product code, the middle columns are data columns and the last column holds a tickbox for selection.
What I want to do is not allow the first or last column to be navigated to. Those cells should basically remain in the normal browse background color.
But no matter how I've tried, the focus still goes into the 1st column and the cell gets hilited when the browse 1st gets focus.
I've tried various things but I think there must be a trick to getting this to work correctly.
Can anyone point me in the right direction?
Browse manipulation
Browse manipulation
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Browse manipulation
I have now managed to get something working that is acceptable.
As a GOTFOCUS clause I added {|| oBrowse:right() } to the first column and {|| oBrowse:left() } to the last.
In the GOTFOCUS clause on the DCBROWSE itself I added oBrowse:refreshall().
The only issue I have now is that you can still click on the first or last columns and the focus stays there, so the gotfocus is not firing in this instance.
It's better than it was though.
As a GOTFOCUS clause I added {|| oBrowse:right() } to the first column and {|| oBrowse:left() } to the last.
In the GOTFOCUS clause on the DCBROWSE itself I added oBrowse:refreshall().
The only issue I have now is that you can still click on the first or last columns and the focus stays there, so the gotfocus is not firing in this instance.
It's better than it was though.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Browse manipulation
Hi Regan,
With the itemselected and then according to the column the right/left action.
With the itemselected and then according to the column the right/left action.
Re: Browse manipulation
Hi Chrisskiman wrote:Hi Regan,
With the itemselected and then according to the column the right/left action.
Sorry, I don't understand what you mean...
The DCBROWSE has an ITEMSELECTED clause and that works fine.
I am saying that a single click on the cell in the first or last column of a data row hilites that cell and does not trigger the GOTFOCUS clause of the column. As far as I can tell, it should.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Browse manipulation
Try this:
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oBrowse, aDir := Directory()
@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 50,20 FIT
DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 10 PARENT oBrowse WHEN {||.f.}
DCBROWSECOL ELEMENT 2 HEADER 'File Size' WIDTH 10 PARENT oBrowse
DCBROWSECOL ELEMENT 3 HEADER 'File Date' WIDTH 10 PARENT oBrowse
DCBROWSECOL ELEMENT 4 HEADER 'File Time' WIDTH 10 PARENT oBrowse WHEN {||.f.}
DCREAD GUI FIT EVAL {||oBrowse:right(),oBrowse:forceStable()}
RETURN nil
* --------
PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.
Re: Browse manipulation
Hi Regan,
I was thinking for a check in the itemselected, but this will work only when there is a selection, not for navigation.
I was thinking for a check in the itemselected, but this will work only when there is a selection, not for navigation.
Re: Browse manipulation
Rogerrdonnay wrote:Try this:Code: Select all
#INCLUDE "dcdialog.CH" FUNCTION Main() LOCAL GetList[0], oBrowse, aDir := Directory() @ 0,0 DCBROWSE oBrowse DATA aDir SIZE 50,20 FIT DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 10 PARENT oBrowse WHEN {||.f.} DCBROWSECOL ELEMENT 2 HEADER 'File Size' WIDTH 10 PARENT oBrowse DCBROWSECOL ELEMENT 3 HEADER 'File Date' WIDTH 10 PARENT oBrowse DCBROWSECOL ELEMENT 4 HEADER 'File Time' WIDTH 10 PARENT oBrowse WHEN {||.f.} DCREAD GUI FIT EVAL {||oBrowse:right(),oBrowse:forceStable()} RETURN nil * -------- PROC appsys ; RETURN
The last column showed a checkbox bitmap centred in the cell which I've now removed as it's not really needed now the coloring shows the selected status.
So I can see the WHEN clause does stop the first column being clicked on with the mouse, which is good.
That column now shows a product code in a 'disabled' color which in my case is pale gray writing on a white background. Oh, and in case it makes a difference, I am using OWNERDRAW using DC_XbpOwnerDrawBrowseGeneric as the subclass of the DCBROWSE.
Can this be overridden? If so, can I change it to show either the normal browse row color or my 'selected row' color?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Browse manipulation
Regan -
Can you give me some code so I can work with it?
Can you give me some code so I can work with it?
The eXpress train is coming - and it has more cars.
Re: Browse manipulation
That may take a while as I'm on a deadline to get something up and running for this at present. I'll see if time allows later. Thanks for the offer of looking at it anyway.rdonnay wrote:Regan -
Can you give me some code so I can work with it?
At present, I've got it working in a reasonable way so I'm going with that.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com