Browse manipulation

This forum is for eXpress++ general support.
Post Reply
Message
Author
reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Browse manipulation

#1 Post by reganc »

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?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Browse manipulation

#2 Post by reganc »

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.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

skiman
Posts: 1206
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Browse manipulation

#3 Post by skiman »

Hi Regan,

With the itemselected and then according to the column the right/left action.
Best regards,

Chris.
www.aboservice.be

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Browse manipulation

#4 Post by reganc »

skiman wrote:Hi Regan,

With the itemselected and then according to the column the right/left action.
Hi Chris

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

User avatar
rdonnay
Site Admin
Posts: 4828
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Browse manipulation

#5 Post by rdonnay »

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.

skiman
Posts: 1206
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Browse manipulation

#6 Post by skiman »

Hi Regan,

I was thinking for a check in the itemselected, but this will work only when there is a selection, not for navigation.
Best regards,

Chris.
www.aboservice.be

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Browse manipulation

#7 Post by reganc »

rdonnay 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
Roger

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

User avatar
rdonnay
Site Admin
Posts: 4828
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Browse manipulation

#8 Post by rdonnay »

Regan -

Can you give me some code so I can work with it?
The eXpress train is coming - and it has more cars.

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Browse manipulation

#9 Post by reganc »

rdonnay wrote:Regan -

Can you give me some code so I can work with it?
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.

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

Post Reply