Hi,
I have played with properties pbEnableDB_Link, pbCM_DB_Link, pbEnableCustomIcons, pbCM_CustomIcon, pbEnableCustomProperties and pbCM_CustomProperty but I can't avoid showing this options in the context menu, so, finally, I have done the next changes in the procedure Show_Context_Menu_Main (because I never want this options)
Code:
If (bEditAllowed) Begin
//What should be visible
Set Visible of hoMenu (psCM_CreateEvent (Self)) to True
Set Visible of hoMenu (psCM_EditEvent (Self)) to True
Set Visible of hoMenu (psCM_DeleteEvent (Self)) to True
// If (pbEnableDB_Link(Self) and pbCM_DB_Link(Self)) Begin
Set Visible of hoMenu (psCM_GotoDB_Link (Self)) to False // Changed
Set Visible of hoMenu (psCM_AddDB_Link (Self)) to False // Changed
Set Visible of hoMenu (psCM_EditDB_Link (Self)) to False // Changed
Set Visible of hoMenu (psCM_RemoveDB_Link(Self)) to False // Changed
// End
// If (pbEnableCustomIcons(Self) and pbCM_CustomIcon(Self)) Begin
Set Visible of hoMenu (psCM_AddCustomIcon (Self)) to False // Changed
Set Visible of hoMenu (psCM_RemoveCustomIcon(Self)) to False // Changed
// End
// If (pbEnableCustomProperties(Self) and pbCM_CustomProperty(Self)) Begin
Set Visible of hoMenu (psCM_AddCustomProperty (Self)) to False // Changed
Set Visible of hoMenu (psCM_EditCustomProperty (Self)) to False // Changed
Set Visible of hoMenu (psCM_RemoveCustomProperty(Self)) to False // Changed
// End
Set Visible of hoMenu (psCM_RemoveException(Self)) to True
//What should be enabled
Set Enabled of hoMenu (psCM_CreateEvent(Self)) to (not(tHitTestInfo.bEventClicked))
Set Enabled of hoMenu (psCM_EditEvent (Self)) to tHitTestInfo.bEventClicked
Set Enabled of hoMenu (psCM_DeleteEvent(Self)) to tHitTestInfo.bEventClicked
If (pbEnableDB_Link(Self) and pbCM_DB_Link(Self)) Begin
Set Enabled of hoMenu (psCM_GotoDB_Link (Self)) to tHitTestInfo.tDB_Link.bDB_Link
Set Enabled of hoMenu (psCM_AddDB_Link (Self)) to (not(tHitTestInfo.tDB_Link.bDB_Link) and tHitTestInfo.bEventClicked)
Set Enabled of hoMenu (psCM_EditDB_Link (Self)) to tHitTestInfo.tDB_Link.bDB_Link
Set Enabled of hoMenu (psCM_RemoveDB_Link(Self)) to tHitTestInfo.tDB_Link.bDB_Link
End
If (pbEnableCustomIcons(Self) and pbCM_CustomIcon(Self)) Begin
Set Enabled of hoMenu (psCM_AddCustomIcon (Self)) to True
Set Enabled of hoMenu (psCM_RemoveCustomIcon(Self)) to tHitTestInfo.bHasCustomIcons
End
If (pbEnableCustomProperties(Self) and pbCM_CustomProperty(Self)) Begin
Set Enabled of hoMenu (psCM_AddCustomProperty (Self)) to True
Set Enabled of hoMenu (psCM_EditCustomProperty (Self)) to tHitTestInfo.bHasCustomProperties
Set Enabled of hoMenu (psCM_RemoveCustomProperty(Self)) to tHitTestInfo.bHasCustomProperties
End
Set Enabled of hoMenu (psCM_RemoveException(Self)) to (tHitTestInfo.bException)
End
Is this the expected way?
P.D: When I not enter in the IF I also get the options at the context menu in spite of don't execute the Set Visible of hoMenu (psCM_xxxxxx_xxxxx (Self)) to True (that I have changed to False in the previous code)
Regards.