Hi all,
I have a window with a listbox on the left, a datawindow on the right and a splitbar in between. This is an MDI application. I'm trying to get the popup menu to display where the user clicked the right mouse button.
I'm using the rbuttonup event. Everything works fine, except the popup menu displays over the listbox, not the datawindow. There is no rbuttonup code in the listbox. Here's the code for rbuttonup event on the datawindow:
// Over-ride -
m_bt_rmb lm_popup
this.AcceptText()
// Create popup menu
lm_popup = create m_bt_rmb
lm_popup.of_SetParent (this)
// Popup menu
lm_popup.m_tableman.PopMenu (this.PointerX(),this.PointerY() )
destroy lm_popup
return 1
Not a show stopper, but probably needs to be fixed.
TIA,
~~~Tracy
PB2021 Build 1509
This solution works. Not really object-oriented because I did hard-code the name of the MDI frame (It hasn't changed in 25 years)... not sure how to make it object-oriented without going through the whole routine of getting the parent window, then getting the frame. That's the way I did it in the legacy code for all of the RMB popup menus. Just seems like an awful lot of code to popup a simple menu.
lm_popup.m_tableman.PopMenu (w_benchtop_frame.PointerX(), w_benchtop_frame.PointerY())
Many Thanks,
~~~Tracy
You'd probably have to assign you mdi window to some global variable when starting the application, like gw_frame in the PFC classes (if I remember well).
my_application_object.iw_my_mdi_frame = This
Then change the code in you RButtonDown event to:
m_registrant.m_records.PopMenu(my_application_object.iw_my_mdi_frame.pointerx(), my_application_object.iw_my_mdi_frame.pointery())
Regardless, glad you got it to work!