|
While developing applications with PFC,
here are some disturbing problems I have faced with the RMB menus. I have
been able to find work-arounds for some of these problems, while solution
to others still remains elusive. I am using PB 5.0.0 and PFC 5.0.0. Please
do let me know if these problems have been fixed in subsequent releases.
//rbuttonup for u_dw
.
.
.
.....
// Send rbuttonup notification to row selection
service
if IsValid (inv_rowselect) then
inv_rowselect.event pfc_rbuttonup (xpos,
ypos, row, dwo)
end if
// Popup menu
//*************Start of changes by Jiggy
*********************
Window w_parentwin
this.of_GetParentWindow (w_parentwin)
If w_parentwin.WindowType = Response! Then
lm_dw.m_table.PopMenu (w_parentwin.PointerX()
+ 5, w_parentwin.PointerY() + 10)
Else
lm_dw.m_table.PopMenu (lw_parent.PointerX()
+ 5, lw_parent.PointerY() + 10)
End If
//*******************End of changes by Jiggy
*****************
If index > 0 Then
//Clicked on a item
Pop context menu
Else
//Clicked in white space
Pop Normal PFC menu
End If
This logic would have worked fine, except that when you right click on a LV item, the rbuttonup is fired before rightclicked !! While when one right clicks in the 'White Space', first rightclicked is fired and then rbuttonup. You can verify this by using the debug service(of_SetDebug(TRUE)) to see which event is triggered first. Try it out on a plain Jane, non PFC list view.
If I have not been able to explain the problem to you, just try to implement this -
The PFC menu m_view should pop up only when the user right clicks on
space in the list view outside any item. If the user right clicks on an
item, no menu should be pop-Ed.
m_my_rmb m_pop
If index < 0 THEN
call super::rbuttonup // Normal PFC menu
Else
//Popup the properties and actions menu
m_pop = CREATE m_my_rmb
m_pop.of_SetParent(this)
m_pop.m_cat_properties.PopMenu(gnv_app.of_getframe().PointerX(),
gnv_app.of_getframe().PointerY())
End If