Page 1 of 1

DCBROWSE EDIT and button activation

Posted: Thu Feb 18, 2010 4:49 am
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

Re: DCBROWSE EDIT and button activation

Posted: Fri Feb 19, 2010 11:29 am
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

Re: DCBROWSE EDIT and button activation

Posted: Mon Feb 22, 2010 2:44 am
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...