Jump to content
Sign in to follow this  
jaberwacky

MouseHoverCallTips [09/25/2014]

Recommended Posts

jaberwacky

When ever you hover your mouse over a native function, user defined function, or an AutoItObject method then you will see the calltip for that function. 

Click "Like This" if you found this useful!

To use this just place the following lua file in the "...AutoIt3SciTELUA" directory. 

MouseHoverCalltips.zip

downloads:216

After you have done that then open SciTE and click 'Options' --> 'Open Lua Startup Script' and paste this line after the other lines (may require administrative rights):

LoadLuaFile("MouseHoverCallTips.lua")

Updates and changes:

[09/25/2014] Rewritten using the official AutoItGoToDefinition.lua!  Now all function and object method calltips are presented!  Most exciting update yet!

Edit: forgot to mention that this only works for those who have the latest AutoIt3 beta installed.

Edit 2: Now works for functions marked Volatile.  Also works on first open.

Edit3: Non-Volatile functions work too now again.

Edit4: Should finally work now!

[06/10/2014]  Calltips for AutoItObject methods should be a lot less error prone and much faster!

Edit: Fixed an issue with AutoItObject methods.

08/06/2013: OK.  Fixed the unexpected bugs. Damned bugs.  Now you should be able to create your AutoItObjects and then hover over their method names and properties for calltips!  For instance $oObject.MyProperty.MyMethod()  Hover over MyProperty to see what is stored there and over MyMethod to see the calltip for that function.

08/05/2013: Now you can view the function calltips for your AutoItObject Com methods and also see the value stored in your AIO COM properties!  Also fixed some inconsistencies in the code and improved other aspects etc.

08/04/2013: Added AutoItObject COM Functions!   Here are a couple of files to test the latest update: Test Files.

03/18/2013: Function "table_contains" added.

03/17/2013: Untested bug fix as reported by Sunaj.

03/02/2013: Bug fix as reported by Sunaj where the function that extracted the name of an include from a line would not work if there was not a space after "#include".

11/04/2012: I fixed it again.

10/26/2012: I breath another sigh.

10/20/2012: Fixed a bug that caused SciTE to lockup when using CTRL+J to access a native function or ALT+I to access a native include. Also, fixed a bug where if a function name was mentioned in the description for another different function then the calltip for the different function was displayed.

10/13/2012: More efficient and less code.

10/11/2012: Now when you type a new include line that include is added to the list of includes to be searched for function definitions. Also, even more efficient.

10/10/2012: No new features but a few bugs have been squashed and some inefficiencies eliminated. So, one bug was that if you have an include in the main file but not in another file and you use a function from the include in the second file then it wouldn't show the calltip though the function is in scope. That works now. Also, when the include table was generated there were a lot of duplicate entries. No longer! Behold, for they are trimmed (mostly, it's still buggy). Anyhoo, enjoy!

10/07/2012: Now all of the include files in a project are searched for user defined functions!

10/01/2012: Pattern matching allowed for the elimination of several functions. Hopefully more efficient. Also, calltips found in the api files are loaded once at startup into a table. Also, added the same thing but for the list of includes. Also, calltips now self cancel when you move the mouse again because I forgot that I was asked to make it do that.

09/27/2012: Tried my hand at implementing a basic proof of concept for finding function definitions in extralocal au3 files as requested by >D4RKON3. Consider this a beta trial and please tell me your thoughts, problems, etc. One difference now is the calltip window doesn't disappear as soon as you move your mouse. You have to click the mouse first. Also, when you define your own function then a comment at the end of the definition will be displayed as a calltip. Example:

func my_function_name(const $my_parameter) ; This is a description of the function.

Will become:

my_function_name(const $my_parameter)
This is a description of the function.

Here are a set of au3 files to test the latest update:

09/23/2012: I implemented a very basic, rudimentary implementation of a feature requested by trancexx. She wanted calltips for functions which were defined in the currently edited file. Give it a try, it might work! YAY! Using OnUpdateUI eliminates the need to switch buffers on every new session. May not be the most elegant solution. =P

Update: Valik greatly simplified and made it robust. Thank you!

Update: Back in business!

Update: Ah yes, debug statements. I should probably start using more of those.

Edited by jaberwacky
  • Like 4

Share this post


Link to post
Share on other sites
Valik

This does not belong in AutoItTools. This belongs in it's own class. AutoItTools is for simple one-shot tools.

Share this post


Link to post
Share on other sites
trancexx

Can you add a timer or something to make the tip go away after some time if mouse isn't over a function?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
wraithdu

Can you add a timer or something to make the tip go away after some time if mouse isn't over a function?

I think that's what the OnDwellEnd function is for.

Another thing I thought of though, I think there's a way to use the lexer to tell what kind of word you are hovering. You should restrict the calltips to words the lexer identifies as functions so you don't get random calltips from comments or strings, etc.

Share this post


Link to post
Share on other sites
jaberwacky

That is what onDwellEnd is for but it's either messed up or I am using it wrong (most likely). I'll look into the timer as an alternative.

I looked into that lexer and I can't make heads or tails of it. I kinda have an idea of what's going on. You find out what kind of word you're at in the file (variable, function, comment, etc) and then you give that information to the styler along with a start position which takes over from there.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites
MvGulik

Here's where the strangeness comes in: you have to switch buffers before it will work on first load.

That's the opposite of the initial behavior. (working on a file/buffer after a file open, but not after switching buffers).

Maybe you need to use both OnOpen() and OnSwitchFile().


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
jaberwacky

I tried this but nothing doing:

MouseHoverCallTips = EventClass:new(Common)



function MouseHoverCallTips:OnOpen(path)

    MouseHoverCallTips:initialize_mouse_dwell()

    return true

end



function MouseHoverCallTips:OnSwitchFile(path)

    MouseHoverCallTips:initialize_mouse_dwell()

    return true

end



function MouseHoverCallTips:initialize_mouse_dwell()

    local mousehover_calltips_dwelltime = tonumber(props["mousehover.calltips.dwelltime"])



    if (mousehover_calltips_dwelltime == nil) then

        mousehover_calltips_dwelltime = 700 -- default

    end



    scite.SendEditor(SCI_SETMOUSEDWELLTIME, mousehover_calltips_dwelltime)



    return true

end



function MouseHoverCallTips:OnDwellStart(position, word)

    if (word == "") then

        return nil

    end



    local directory = props["SciteDefaultHome"] .. "apiau3.api"



    local file = io.open(directory, "r")



    local parens_start

    local parens_end

    local char_start

    local char_end



    for line in file:lines() do

        if (string.find(line, word)) then

            -- filter out entries ending with ?4, ?3, ?2, & ?1

            for var = 1, 4 do

                char_start, char_end = string.find(line, '?' .. var)



                if (char_start ~= nil) then

                    file:close()

                    return nil

                end

            end



            parens_start, parens_end = string.find(line, "%)")

            if (parens_start ~= nil) then

                line = string.gsub(line, "%)", "%)n", 1)

            end



            file:close()



            scite.SendEditor(SCI_CALLTIPSHOW, position, line)



            return true

        end

    end



    file:close()



    return true

end



function MouseHoverCallTips:OnDwellEnd()

    scite.SendEditor(SCI_CALLTIPCANCEL)

    return true

end

Edited by LaCastiglione

Share this post


Link to post
Share on other sites
ProgAndy

I looked into that lexer and I can't make heads or tails of it. I kinda have an idea of what's going on. You find out what kind of word you're at in the file (variable, function, comment, etc) and then you give that information to the styler along with a start position which takes over from there.

You don't have to understand the lexer I think. Just read the style of the first character of your word with SCI_GETSTYLEAT

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
jaberwacky

Just read the style of the first character of your word with SCI_GETSTYLEAT

Doh! I understand now. I do that from lua. Excellent. Thank you!

Edit: Ok, I did it and it works great! OP updated.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites
MvGulik

I tried this but nothing doing: ...

It should. (CQ: working for me.)

- OnOpen(): run's on every file that's loaded while scite is starting. And on files that are user loaded after the scite startup.

But note that OnSwitchFile() is also run on the active file/buffer if its not the last loaded file at scite startup. (and not on user loaded files/buffers ... until you switch buffers of course.)

PS: is OnDwellEnd() active? ... or not yet, as its never executed.on this side.

---

(I'm not sure what behavior's are scite4autoit related or native scites related.)

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
Valik

AFAIK there is no OnDwellEnd(). OnDwellStart() is called with an empty string to signify that event according to the old documentation I read. If there is an event in later SciTE then the Events class isn't invoking it on inherited classes unless Jos caught it and added it.

Share this post


Link to post
Share on other sites
jaberwacky

Heh. You know something. I'm looking at the documentation again. I have no idea where I got onDwellEnd. Maybe my brain wished for something like that and tried to make it so.

Doh.

"OnDwellStart will receive the position of the mouse and the word under the mouse as arguments and the word will be empty when the mouse starts moving." So I updated the lua in the op.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites
MvGulik

Optional code suggestion:

-- 'if MouseHoverCallTips:IsAu3File(path) then', or 'if self:IsAu3File(path) then'.
-- Although I'm not sure if there is a significant/important differance between the two. (just to be clear)
function MouseHoverCallTips:IsAu3File(path)
    -- working, but I'm not sure if there is a better way.
    -- note: string.sub(props["au3"]), -4) ... assuming extention is 3 characters. (alt: ditch leading '*' character.)
    if (string.lower(string.sub(path, -4)) == string.lower(string.sub(props["au3"], -4))) then
        return true
    end
    return false
end

PS: Not sure if it matters. But just in case. There is no 'file:close()' after the "for line .." loop in OnDwellStart(). (for all I know the open file might be auto-closed on hitting EOF, or on exiting the function.)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
MvGulik

Roger ... Looks a little odd with those comments. ;)

Tried to see if there was a alternative way to get a hold of 'all' the API function definitions that are actively used by the current (local user) scite4autoit setup ... but no luck so far.

Anyone know if there is a other way than doing it the file:open way ?

Anyway ... extended the definition finder a bit to do it anyway. (added+changed functions only) (LC: use as you see fit.)

function MouseHoverCallTips:GetFuncDef(word, filespecList, delim)
    for filespec in string.gmatch(filespecList, "[^;]+") do
        local file = io.open(filespec, "r")
        if file ~= nil then
            local parens_start
            for line in file:lines() do
                if (string.find(line, word)) then
                    parens_start = string.find(line, "%)")
                    if (parens_start ~= nil) then
                        line = string.gsub(line, "%)(.)", "%)n%1") -- changed: was adding a trailing empty line in some cases.
                    end
                    file:close()
                    return line
                end
            end
            file:close()
        end
    end
end

function MouseHoverCallTips:OnDwellStart(position, word)
    if (word == "") then
        if (scite.SendEditor(SCI_CALLTIPACTIVE)) then
            scite.SendEditor(SCI_CALLTIPCANCEL)
        end
    end

    if (scite.SendEditor(SCI_GETSTYLEAT, position) == 4 or scite.SendEditor(SCI_GETSTYLEAT, position) == 15) then
        local funcdef = self:GetFuncDef(word, props["api.$(au3)"], ";")
        if funcdef ~= nil then
            scite.SendEditor(SCI_CALLTIPSHOW, position, funcdef)
        end
    end

    return true
end


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
jaberwacky

What's weird is that OnOpen is called when SciTE is opened and when I switch between buffers. So, I removed OnSwitchFile and restarted SciTE but calltips are still not displayed when I hover over a function even after switching buffers.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • timmy2
      By timmy2
      I've noticed in several YouTube tutorials about AutoIt that every time the instructor types EndFunc a comment "<==(function name)" is automatically added. I understand that Tidy will do this after the fact but what I'm writing about happens in real time. Where's the setting for this?  Thank you.
    • Ascer
      By Ascer
      Hello,
      I've read a article about lua functions here: https://debian-administration.org/article/264/Embedding_a_scripting_language_inside_your_C/C_code
      There are two ways of include lua scripts to your AutoIt code.
      1. Run lua functions by Autoit.
      2. Register Autoit function and run as lua.
      It's even possible to apply second way to AutoIt?
      As we can see on example there a few functions to make it possible.
      It's a lua file save as average.lua
      avg, sum = average(10, 20, 30, 40, 50) print("The average is ", avg) print("The sum is ", sum) This is a C functions to run lua. Can be convert to AutoIt ofc.
      There is a problem with func lua_register(L, "average", average)
      this function is not even detected in Lua51.dll
      We can use lua_pushcclosure instead.
      #include <stdio.h> #include "lua.h" #include "lualib.h" #include "lauxlib.h" /* the Lua interpreter */ lua_State* L; /* The function we'll call from the lua script */ static int average(lua_State *L) { /* get number of arguments */ int n = lua_gettop(L); double sum = 0; int i; /* loop through each argument */ for (i = 1; i <= n; i++) { if (!lua_isnumber(L, i)) { lua_pushstring(L, "Incorrect argument to 'average'"); lua_error(L); } /* total the arguments */ sum += lua_tonumber(L, i); } /* push the average */ lua_pushnumber(L, sum / n); /* push the sum */ lua_pushnumber(L, sum); /* return the number of results */ return 2; } int main ( int argc, char *argv[] ) { /* initialize Lua */ L = lua_open(); /* load Lua base libraries */ lua_baselibopen(L); /* register our function */ lua_register(L, "average", average); /* run the script */ lua_dofile(L, "average.lua"); /* cleanup Lua */ lua_close(L); return 0; }  
       
       
    • ademon
      By ademon
      Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C.
      Can you provide an update of this bug?


    • Myicq
      By Myicq
      This may be a dumb question.. but my vertical screen space is fairly limited. I don't need (always) to see all the debug output from autoIT compiler, wrapper etc.
      Can I turn this part off: (optionally)
      >"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\temp\xx.au3" +>11:35:44 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000406 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0406) +> SciTEDir => D:\AutoIt3\SciTE UserDir => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:D:\AutoIt3 input:D:\temp\XX.au3 +>11:35:44 AU3Check ended.rc:0 >Running:(3.3.12.0):D:\AutoIt3\autoit3.exe "D:\temp\xx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop  
    • BugFix
      By BugFix
      This lua script gives you the ability, to search for selected text or word from cursor in an search engine or on an search site of your choice.You can select the engine/site from a list, that you have defined in your user properties.
      To get the right call for your search engine, open the engine and search for one word. You need the url without the searched word. Write to your properties an display name for this engine and, separated by a comma, the url. See my example in the script header.
      For the list with  search sites, you need display name and site address (without http://).
      It will searched for the full selected text or, if none selection exists, for the word touched by the cursor. You can allow in the properties, that also will recognized words with dots (like objVar.Property).
      The script uses the shell.dll. But if you don't have installed it, the browser will opened with an command line call. Thats why the command window will pop up for a short moment.
      You'll find details for installation and key bindings inside the script. Look for free command numbers in SciTE. By default installation, the numbers must be greater than 35 (max. 49).
      -- TIME_STAMP 2018-09-02 09:22:03 --[[ This script publicates two functions - InetSearch.Engine() You can search for the selected/touched text in SciTE and can select a search engine of your choice. - InetSearch.Site() You can search for the selected/touched text in SciTE with a defined search engine and can select a search site of your choice. Copy this script in your Lua scripts folder. Load this file in the Lua startup: dofile("Full\\Path\\InetSearch.lua") Add in "SciTEUser.properties" the following properties with search engines and search sites of your choice: #~ Inet Search Settings #~ List of engines. "display-name,search-url" (if not set: google.com will used) #~ If only one entry exists, the selection box will not shown. Inet.Search.Engines= \ Google,https://www.google.de/search?q=| \ MetaGer,https://metager.de/meta/meta.ger3?focus=web&eingabe=| \ Bing,https://www.bing.com/search?q=| \ Ask,https://de.ask.com/web?q=| \ Yandex,https://www.yandex.com/search/?text= #~ Engine for site based search #~ Use display name from engines list (if not set: google.com will used) Inet.Search.SearchOnSite.Engine=Google #~ List of sites for site based search. "display-name,site-url" #~ If not set, it searches without a special site. #~ If only one entry exists, the selection box will not shown. Inet.Search.SearchOnSite.Sites= \ AutoIt DE,autoit.de| \ AutoIt EN,autoitscript.com| \ MSDN,msdn.microsoft.com #~ By default, words will detected without dots. (0) #~ You can allow dots, to detect object variables with properties or methods too. Inet.Search.Allow.Punctuation=1 #~ Search commands #~ Search word from cursor with engine selection command.name.9.*=Search with engine selection command.9.*=dostring InetSearch.Engine() command.mode.9.*=subsystem:lua,savebefore:no command.shortcut.9.*=Ctrl+Shift+F8 #~ Search word from cursor with search site selection command.name.5.*=Search with site selection command.5.*=dostring InetSearch.Site() command.mode.5.*=subsystem:lua,savebefore:no command.shortcut.5.*=Ctrl+Shift+F9 --]] InetSearch = {} InetSearch.Handler = EventClass:new(Common) do ------------------------------------------------------------------------------------------------ local engineFallback = "Google,https://www.google.com/search?q=" -- default search engine: "display-name,search-url" local search_type = nil local engine_url = nil local search_item = nil local search_site = nil local tableSelection = nil local list_type = 16 ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------- Load library protected local require_protected = function(_lib) local loaded_lib if pcall(function() loaded_lib = require(_lib) end) then return loaded_lib else return nil end end --> require_protected ------------------------------------------------------------------------------------------------ local shell = require_protected("shell") -- loads the shell library if exists ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Starts the search local RunSearch = function(_item, _url, _site) local sSite = '' if _site ~= nil then sSite = "%20site:".._site end local sCmd = _url.._item..sSite if shell then shell.exec(sCmd) else os.execute('start "" "'..sCmd..'"') end end --> RunSearch ------------------------------------------------------------------------------------------------ ----------------------------------------------------------------------------- Show the user list local ShowSelectionList = function() -- create the selection list (display names from engines or sites) local sep, list = '_', tableSelection[1][1] for i = 2, #tableSelection do list = list..sep..tableSelection[i][1] end local sep_tmp = editor.AutoCSeparator editor.AutoCSeparator = string.byte(sep) editor:UserListShow(list_type, list) editor.AutoCSeparator = sep_tmp end --> ShowSelectionList ------------------------------------------------------------------------------------------------ --------------------------------------------------------------------------- Select the user list function InetSearch.Handler:OnUserListSelection(_tp, _sel) if _tp == list_type then local url for i = 1, #tableSelection do if tableSelection[i][1] == _sel then url = tableSelection[i][2] break end end if search_type == 'site' then search_site = url else search_site = nil engine_url = url end RunSearch(search_item, engine_url, search_site) end end ------------------------------------------------------------------------------------------------ --------------------------------------------------------- List of search engines from properties local GetEngines = function() local sEngines = props['Inet.Search.Engines'] -- without settings, the default search engine will used if sEngines == '' then sEngines = engineFallback end local tEngines = {} for entry in sEngines:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tEngines, {name, url}) end end return tEngines end --> GetEngines ------------------------------------------------------------------------------------------------ ----------------------------------------------------------- List of search sites from properties local GetSearchSites = function() local sSites = props['Inet.Search.SearchOnSite.Sites'] if sSites == '' then return nil end local tSites = {} for entry in sSites:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tSites, {name, url}) end end return tSites end --> GetSearchSites ------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- Get search item local GetSearchItem = function() local sSelect = editor:GetSelText() if sSelect ~= '' then return sSelect end local allowDots = false if props['Inet.Search.Allow.Punctuation'] == '1' then allowDots = true end local caret = editor.CurrentPos local iLine = editor:LineFromPosition(caret) local iZero = editor:PositionFromLine(iLine) editor:LineEnd() local iLineEnd = editor.CurrentPos editor.CurrentPos = caret editor:SetSelection(caret,caret) local iStart = editor:WordStartPosition(caret) if allowDots then while iStart > iZero and editor:textrange(iStart -1, iStart) == '.' do iStart = editor:WordStartPosition(iStart -1) end end local iEnd = editor:WordEndPosition(caret) if allowDots then while iEnd < iLineEnd and editor:textrange(iEnd, iEnd +1) == '.' do iEnd = editor:WordEndPosition(iEnd +1) end end sSelect = editor:textrange(iStart, iEnd):gsub('^([^%w]+)', ''):gsub('([^%w]+)$', '') return sSelect end --> GetSearchItem ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------- Search with engine selection local SearchEngineBased = function() search_type = 'engine' search_item = GetSearchItem() if search_item == '' then return nil end tableSelection = GetEngines() -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, tableSelection[1][2], nil) else ShowSelectionList() end end --> SearchEngineBased ------------------------------------------------------------------------------------------------ -------------------------------------------------------------- Search with search site selection local SearchSiteBased = function() search_type = 'site' search_item = GetSearchItem() if search_item == '' then return nil end -- get the default engine for site based searching for _, url in engineFallback:gmatch('([^,]+),(.+)') do engine_url = url end -- if is set, use search engine from properties local sEngine = props['Inet.Search.SearchOnSite.Engine'] if sEngine ~= '' then local tEngines = GetEngines() for i = 1, #tEngines do if tEngines[i][1] == sEngine then engine_url = tEngines[i][2] break end end end tableSelection = GetSearchSites() -- if none entries for search sites, use simple search if tableSelection == nil then RunSearch(search_item, engine_url, nil) else -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, engine_url, tableSelection[1][2]) else ShowSelectionList() end end end --> SearchSiteBased ------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------- Publicate functions InetSearch.Engine = SearchEngineBased InetSearch.Site = SearchSiteBased ------------------------------------------------------------------------------------------------ end ----------------------------------------------------------------------------------------------------  
      InetSearch.lua
×