#ifdef __FB_WIN32__#ifdef __FB_64BIT__'#Compile -dll -x "../../AddIns/My Add-In (x64).dll" "My Add-In.rc"#else'#Compile -dll -x "../../AddIns/My Add-In (x32).dll" "My Add-In.rc"#endif#else#ifdef __FB_64BIT__'#Compile -dll -x "../../AddIns/MyAddInx64.so"#else'#Compile -dll -x "../../AddIns/MyAddInx32.so"#endif#endifEnum MessageType '...'mtInfomtWarningmtQuestionmtErrormtOtherEnd EnumEnum ButtonsTypes '...'btNonebtOKbtYesNobtYesNoCancelbtOkCancelEnd EnumEnum MessageResult '...'mrAbortmrCancelmrIgnoremrNomrOKmrRetrymrYesEnd EnumType MFFLibMsgBox As Function(ByRef MsgStr As WString, ByRef Caption As WString = "", MsgType As Integer = 0, ButtonsType As Integer = 1) As IntegerReadProperty As Function(Obj As Any Ptr, ByRef PropertyName As String) As Any PtrApplicationMainForm As Function(App As Any Ptr) As Any PtrControlByName As Function(Ctrl As Any Ptr, CtrlName As String) As Any PtrToolBarAddButtonWithImageKey As Function(tb As Any Ptr, FStyle As Integer = 16, ByRef FImageKey As WString = "", Index As Integer = -1, FClick As Any Ptr = 0, ByRef FKey As WString = "", ByRef FCaption As WString = "", ByRef FHint As WString = "", FShowHint As Boolean = False, FState As Integer = 4) As Any PtrToolBarRemoveButton As Sub(tb As Any Ptr, Index As Integer)ToolBarIndexOfButton As Function(tb As Any Ptr, btn As Any Ptr) As IntegerMenuItemAdd As Function(ParentMenuItem As Any Ptr, ByRef sCaption As WString, ByRef sImageKey As WString, sKey As String = "", eClick As Any Ptr = 0, Index As Integer = -1) As Any PtrMenuItemIndexOfKey As Function(ParentMenuItem As Any Ptr, ByRef Key As WString) As IntegerMenuItemRemove As Sub(ParentMenuItem As Any Ptr, PMenuItem As Any Ptr)MenuFindByName As Function(PMenu As Any Ptr, ByRef FName As WString) As Any PtrObjectDelete As Function(Obj As Any Ptr) As BooleanEnd TypeDim Shared mff As MFFLibDim Shared VFBEditorLib As Any PtrDim Shared VFBEditorApp As Any PtrSub LoadMFFProcs()mff.MsgBox = DyLibSymbol(VFBEditorLib, "MsgBox")mff.ReadProperty = DyLibSymbol(VFBEditorLib, "ReadProperty")mff.ApplicationMainForm = DyLibSymbol(VFBEditorLib, "ApplicationMainForm")mff.ControlByName = DyLibSymbol(VFBEditorLib, "ControlByName")mff.ToolBarAddButtonWithImageKey = DyLibSymbol(VFBEditorLib, "ToolBarAddButtonWithImageKey")mff.ToolBarRemoveButton = DyLibSymbol(VFBEditorLib, "ToolBarRemoveButton")mff.ToolBarIndexOfButton = DyLibSymbol(VFBEditorLib, "ToolBarIndexOfButton")mff.MenuItemAdd = DyLibSymbol(VFBEditorLib, "MenuItemAdd")mff.MenuItemIndexOfKey = DyLibSymbol(VFBEditorLib, "MenuItemIndexOfKey")mff.MenuItemRemove = DyLibSymbol(VFBEditorLib, "MenuItemRemove")mff.MenuFindByName = DyLibSymbol(VFBEditorLib, "MenuFindByName")mff.ObjectDelete = DyLibSymbol(VFBEditorLib, "ObjectDelete")End SubDim Shared As Any Ptr MainForm, MainReBarDim Shared As Any Ptr tbStandard, tbMyAddin, tbMyAddinSeparatorDim Shared As Any Ptr mnuService, mnuMyAddin, mnuMyAddinSeparatorDim Shared s As WString PtrFunction GetFolderPath(ByRef FileName As WString) ByRef As WStringDim Pos1 As Long = InStrRev(FileName, "\")Dim Pos2 As Long = InStrRev(FileName, "/")If Pos1 = 0 OrElse Pos2 > Pos1 Then Pos1 = Pos2If Pos1 > 0 Thens = Cast(WString Ptr, Reallocate(s, Pos1 * SizeOf(WString)))*s = Left(FileName, Pos1)Return *sEnd IfReturn ""End FunctionSub OnMyAddinButtonClick(ByRef Sender As Object)If mff.MsgBox <> 0 Thenmff.MsgBox(*Cast(WString Ptr, mff.ReadProperty(VFBEditorApp, "exefile")))End IfEnd SubSub OnBeforeCompile Alias "OnBeforeCompile" (VisualFBEditorApp As Any Ptr, ByRef CompilingProgramPath As WString) ExportIf mff.MsgBox <> 0 Thenmff.MsgBox(CompilingProgramPath)End IfEnd SubSub OnConnection Alias "OnConnection"(VisualFBEditorApp As Any Ptr, ByRef AppPath As WString) ExportVFBEditorApp = VisualFBEditorApp#ifdef __FB_WIN32__#ifdef __FB_64BIT__VFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/mff64.dll")#elseVFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/mff32.dll")#endif#elseVFBEditorLib = DyLibLoad(GetFolderPath(AppPath) & "/Controls/MyFbFramework/libmff" & Right(AppPath, 7) & ".so")#endifIf s <> 0 Then Deallocate sIf VFBEditorLib = 0 Then Exit SubLoadMFFProcsIf mff.ApplicationMainForm <> 0 ThenMainForm = mff.ApplicationMainForm(VisualFBEditorApp)If MainForm <> 0 ThenIf mff.ControlByName <> 0 ThenMainReBar = mff.ControlByName(MainForm, "MainReBar")If MainReBar <> 0 ThentbStandard = mff.ControlByName(MainReBar, "Standard")If tbStandard <> 0 AndAlso mff.ToolBarAddButtonWithImageKey <> 0 ThentbMyAddinSeparator = mff.ToolBarAddButtonWithImageKey(tbStandard, 1, "MyAddinSeparator")tbMyAddin = mff.ToolBarAddButtonWithImageKey(tbStandard, , "About", , @OnMyAddinButtonClick, "MyAddin", , "My Add-In", True)End IfEnd IfEnd IfIf mff.ReadProperty <> 0 AndAlso mff.MenuFindByName <> 0 ThenDim As Any Ptr mnuMenu = mff.ReadProperty(MainForm, "Menu")mnuService = mff.MenuFindByName(mnuMenu, "Service")If mnuService <> 0 AndAlso mff.MenuItemAdd <> 0 ThenVar IndexOfKey = mff.MenuItemIndexOfKey(mnuService, "AddIns")mnuMyAddinSeparator = mff.MenuItemAdd(mnuService, "-", "", "", , IndexOfKey + 1)mnuMyAddin = mff.MenuItemAdd(mnuService, "My Add-In", "About", , @OnMyAddinButtonClick, IndexOfKey + 2)End IfEnd IfEnd IfEnd IfEnd SubSub OnDisconnection Alias "OnDisconnection"(VisualFBEditorApp As Any Ptr) ExportIf tbStandard <> 0 AndAlso mff.ToolBarRemoveButton <> 0 AndAlso mff.ToolBarIndexOfButton <> 0 ThenIf tbMyAddinSeparator <> 0 Thenmff.ToolBarRemoveButton(tbStandard, mff.ToolBarIndexOfButton(tbStandard, tbMyAddinSeparator))If mff.ObjectDelete <> 0 Then mff.ObjectDelete(tbMyAddinSeparator)End IfIf tbMyAddin <> 0 Thenmff.ToolBarRemoveButton(tbStandard, mff.ToolBarIndexOfButton(tbStandard, tbMyAddin))If mff.ObjectDelete <> 0 Then mff.ObjectDelete(tbMyAddin)End IfEnd IfIf mnuService <> 0 AndAlso mff.MenuItemRemove <> 0 ThenIf mnuMyAddinSeparator <> 0 Thenmff.MenuItemRemove(mnuService, mnuMyAddinSeparator)If mff.ObjectDelete <> 0 Then mff.ObjectDelete(mnuMyAddinSeparator)End IfIf mnuMyAddin <> 0 Thenmff.MenuItemRemove(mnuService, mnuMyAddin)If mff.ObjectDelete <> 0 Then mff.ObjectDelete(mnuMyAddin)End IfEnd IfIf VFBEditorLib <> 0 ThenDyLibFree(VFBEditorLib)End IfEnd Sub
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型