Code: Select all
Public Sub disableProperties()
Dim nID As Integer = Me.docPreview.Inst.Str2ID("propertiesView")
Dim view As PDFXEdit.IPXV_View = Me.docPreview.Frame.View.Panes.Active(nID)
If view IsNot Nothing Then
Dim outPtr As IntPtr
view.Obj.QueryImpl(GetType(PDFXEdit.IUIX_PropList).GUID, Nothing, outPtr)
Dim propList As PDFXEdit.IUIX_PropList = DirectCast(System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr), PDFXEdit.IUIX_PropList)
If propList IsNot Nothing Then
Dim listPtr As IntPtr
propList.Obj.QueryImpl(GetType(PDFXEdit.IUIX_List).GUID, Nothing, listPtr)
Dim list As PDFXEdit.IUIX_List = DirectCast(System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(listPtr), PDFXEdit.IUIX_List)
If list IsNot Nothing Then
'Removes general properties
list.RemoveGroups(0, 1)
End If
End If
End If
End Sub
Code: Select all
Public Sub OnEvent(pSender As PDFXEdit.IUIX_Obj, pEvent As PDFXEdit.IUIX_Event) Implements PDFXEdit.IUIX_ObjImpl.OnEvent
If pEvent.Code = CInt(&H204) Then
Dim pt As PDFXEdit.tagPOINT
pt.x = pEvent.Pos.x
pt.y = pEvent.Pos.y
Dim screenPt As PDFXEdit.tagPOINT
Dim nHitTestCode As Integer = 0
Dim annot As PDFXEdit.IPXC_Annotation = Parent.docPreview.Doc.ActiveView.PagesView.GetAnnotFromPt(pt, nHitTestCode)
If annot IsNot Nothing Then
Dim linkAnnotType As UInteger = Parent.pxsInst.StrToAtom("Link")
If annot.Type = linkAnnotType Then
pEvent.Handled = True
End If
Else
pSender.ClientPtToScreen(pt, screenPt)
Parent.RadialMenu1.ShowPopup(New Point(screenPt.x, screenPt.y))
End If
ElseIf pEvent.Code = CInt(PDFXEdit.UIX_EventCodes.e_BeforeDestroy) Then
Dispose()
ElseIf pEvent.Code = CInt(PDFXEdit.UIX_EventCodes.e_Last) Then
Dispose()
End If
End Sub
Simon