Find group or ID of XBP in eventhandler

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Find group or ID of XBP in eventhandler

#1 Post by jdsoft »

Hello,

A custom eventhandler is used in DCREAD.
In a browse, the F10 key adds a rown to the browse.
Now i have added a 2nd browse is the same dialog.
This second browse does not support the F10 key.

How can i test the ID or GROUP from the oXbp, so i can conditionaly suppress the F10 key ?

Code: Select all

FUNCTION MyEventHandler(nEvent,mp1,mp2,oXbp,oDlg)
LOCAL nDcGui            := DCGUI_NONE                             // Event verder afhandelen 
If nEvent = xbeP_Keyboard .and. ValType(oXbp) = "O"
   Do Case
      Case mp1 = xbeK_F10
         Do Case
            Case oXbp:IsderivedFrom("xbpbrowse")                  // F10 in browse is invoegen nieuw artikel 
               Oh_werkopdracht_Materiaal_Invoegen(oXbp)
               nDcGui := DCGUI_IGNORE
            Case oXbp:IsderivedFrom("xbpCellGroup")               // F10 in browse is invoegen nieuw artikel 
               Oh_werkopdracht_Materiaal_Invoegen(oXbp)
               nDcGui   := DCGUI_IGNORE
         Endcase 
   EndCase 
EndCase 
Return nDcGui 
Regards,
Jack Duijf

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

Re: Find group or ID of XBP in eventhandler

#2 Post by reganc »

You can use dc_getobjectid(oXbp) to get the Id.
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: Find group or ID of XBP in eventhandler

#3 Post by rdonnay »

This should give you what you want, Jack.

Code: Select all

LOCAL aGetListItem := oXbp:getList:getListArray[oXbp:getList:getListPointer]
LOCAL cId := aGetListItem[cGETLIST_ID]
LOCAL cGroup := aGetListItem[cGETLIST_GROUP]
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Find group or ID of XBP in eventhandler

#4 Post by jdsoft »

Thanks for the reply's

Dc_GetObjectId(oXbp,GetList) does the job perfectly.
Regards,
Jack Duijf

Post Reply