forked from pkulchenko/ZeroBranePackage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalhelpmenu.lua
More file actions
25 lines (22 loc) · 770 Bytes
/
localhelpmenu.lua
File metadata and controls
25 lines (22 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local id = ID("localhelpmenu.localhelpmenu")
return {
name = "Local Lua help",
description = "Adds local help option to the menu.",
author = "Paul Kulchenko",
version = 0.3,
dependencies = "1.30",
onRegister = function(self)
local menu = ide:FindTopMenu("&Help")
menu:Append(id, "Lua Documentation")
ide:GetMainFrame():Connect(id, wx.wxEVT_COMMAND_MENU_SELECTED,
function (event) wx.wxLaunchDefaultBrowser(self:GetConfig().index, 0) end)
ide:GetMainFrame():Connect(id, wx.wxEVT_UPDATE_UI,
function (event) event:Enable(self:GetConfig().index ~= nil) end)
end,
onUnRegister = function(self)
ide:RemoveMenuItem(id)
end,
}
--[[ configuration example:
localhelpmenu = {index = "file:///D:/my/Lua/manual/index.html"}
--]]