DCBROWSE EDIT and button activation

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

DCBROWSE EDIT and button activation

#1 Post by reganc »

Hi Roger

A while ago I posted a msg on the webboard about the above as follows:
If the cursor is within a get field in an editable browse, a first click on a pushbutton exits the get field but does not activate the button so a second click is then needed to activate the button...

The push button already has a CARGO "CANCEL" on it but that does nothing in this instance.

Is this known behaviour? Is there any way around it?
Your reply was:
Yes, this has been the behavior for many years because cell editing is done
in a sub loop rather than the main loop.
If I had it to do over again, I would have done it differently but I didn't
know as much back then (9 years ago) as I do now.

Tell me what version of eXpress++ you are using and I'll give you a change
to the source code that may be a sufficient workaround for you.
And now that we've updated to build 253 can you perhaps let me know what the workaround may be?

Thanks
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

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

Re: DCBROWSE EDIT and button activation

#2 Post by rdonnay »

Regan -

Here is a test program that may show you a workaround.

Roger

Code: Select all

#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"

FUNCTION Main()

LOCAL GetList[0], aDir := Directory(), i, oBrowse, oButton

@ 0,0 DCBROWSE oBrowse SIZE 10,10 FIT DATA aDir ;
      EDIT xbeBRW_ItemSelected ;
      EXIT {|a,b,c,d,e,f,g|ExitAction(g,oButton)}

FOR i := 1 TO 4
  DCBROWSECOL ELEMENT i HEADER Alltrim(Str(i)) PARENT oBrowse WIDTH 10
NEXT

@ 11,0 DCPUSHBUTTON CAPTION 'Test Button' SIZE 11 ;
       OBJECT oButton ;
       ACTION {||DC_WinAlert('Testing')} CARGO 'CANCEL'

DCREAD GUI FIT TITLE 'Cell Edit Test'

RETURN nil

PROC appsys ; return

STATIC FUNCTION ExitAction( g, oButton )

IF g == oButton
  PostAppEvent( xbeP_Activate,,,oButton )
ENDIF

RETURN nil
The eXpress train is coming - and it has more cars.

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

Re: DCBROWSE EDIT and button activation

#3 Post by reganc »

rdonnay wrote:Regan -

Here is a test program that may show you a workaround.

...
Many thanks Roger. I will give that a try when I've finished the stuff I'm working on now...
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

Post Reply