Doyle Whisenant wrote:

... I have used the user defined list feature to write custom tool menus, for example all of the CVS tools (for work). Is this what you want to do?


I'd be interested in this. Any example code?


Doyle, I have a better version at the office, but this should work. If I missed something, let me know and I'll post any omissions

This version requires that the tool name match the function name, which limits the name. The version I have at work builds a table of display names/function names which gives a better display (tbl["Check out"] = "co.bat") but the display order is not in the order added - does anyone have any suggestions on how to keep a table in the order the items were added?

user.properties:

command.mode.lua=subsystem:lua,quiet:yes,savebefore:no

command.name.25.*=Other Tools
command.25.*=OtherTools()
command.shortcut.25.*=Ctrl+Alt+T
command.mode.25.*=$(command.mode.lua)

lua startup script:

-- at the top, outside of any function:
local udl_ListTools = 15;

function OnUserListSelection(t,str)
  if t == udl_ListTools then
      assert(loadstring(str .. "()"))();
      return true
  else
      return false
  end
end

function OtherTools()
  local s =
      "Backup" .. udl_Separator ..
      "HexEdit"
  editor:GrabFocus()
  editor:UserListShow( udl_ListTools, s )
end

function Backup()
  ...
end

function HexEdit()
  ...
end


--
Some days you are the dog and some days you are the hydrant!


_______________________________________________
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to