Can :bRClickData coexist with :bPopUp on xBrowse?

Can :bRClickData coexist with :bPopUp on xBrowse?

Postby reinaldocrespo » Mon Nov 26, 2012 9:19 pm

Hi.

I'm looking to execute a code block when rightclicking on a specific column, as in:

Code: Select all  Expand view


   WITH OBJECT ::oGrid
      :MedRec:bRClickData   := { || ::ChngMRec(), ::oGrid:Refresh(), ::oGrid:SetFocus() }
 


But for the rest of the columns I'd like to have a popup menu, as in:
Code: Select all  Expand view

   WITH OBJECT ::oGrid
      :bPopUp := { || ::ContextMenu() }
      :MedRec:bRClickData   := { || ::ChngMRec(), ::oGrid:Refresh(), ::oGrid:SetFocus() }
 


the problem is that :bPopUp takes precedence. Is it possible to have :bPopUp execute only when :bRclickData is NIL?


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Can :bRClickData coexist with :bPopUp on xBrowse?

Postby nageswaragunupudi » Tue Nov 27, 2012 5:58 am

bPopup takes precedence over bRClickData. So for the same column, bRClickData does not work if bPopUp is defined.

For your requirement, you may assign the context menu block to all individual columns except the one for which you want bRClickData instead of to the browse object.

Code: Select all  Expand view
  WITH OBJECT ::oGrid
      :bPopUps := { || ::ContextMenu() }  // NOTE: bPopups NOT :bPopup
     
   WITH OBJECT :MedRec
      :bPopUp          := nil
      :bRClickData   := { || ::ChngMRec()
   END
END
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Can :bRClickData coexist with :bPopUp on xBrowse?

Postby reinaldocrespo » Tue Nov 27, 2012 2:35 pm

Mr. Rao;

Excellent suggestion.

Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests