AdmiralAlkex Posted June 12, 2012 Posted June 12, 2012 Pretty please .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Valik Posted June 12, 2012 Posted June 12, 2012 Here's my latest version. No major changes, just a bit of cleanup in a couple spots. expandcollapse popupMouseHoverCallTips = EventClass:new(Common) -- If you are experiencing problems with this script then set the following -- variable to true to enable diagnostic messages. MouseHoverCallTips.Debug = false -------------------------------------------------------------------------------- -- OnSwitchFile -- -------------------------------------------------------------------------------- function MouseHoverCallTips:OnSwitchFile(path) self:initialize_mouse_dwell() return false end -------------------------------------------------------------------------------- -- initialize_mouse_dwell -- -------------------------------------------------------------------------------- function MouseHoverCallTips:initialize_mouse_dwell() --if (self:IsAu3File(path)) then local mousehover_calltips_dwelltime = tonumber(props["mousehover.calltips.dwelltime"]) if (mousehover_calltips_dwelltime == nil) then mousehover_calltips_dwelltime = 700 end -- default scite.SendEditor(SCI_SETMOUSEDWELLTIME, mousehover_calltips_dwelltime) --end return true end -------------------------------------------------------------------------------- -- IsAu3File -- -------------------------------------------------------------------------------- function MouseHoverCallTips:IsAu3File(path) if (string.lower(string.sub(path, -4)) == string.lower(string.sub(props["au3"], -4))) then return true end return false end -------------------------------------------------------------------------------- -- find_instance -- -------------------------------------------------------------------------------- function MouseHoverCallTips:find_instance(source, pattern) local function find_first_instance(source, pattern, acc) if (source == '') then return 0 end if (pattern == '') then return 0 end if (acc == string.len(source)) then return 0 end if (string.sub(source, acc, acc) == pattern) then return acc else acc = acc + 1 return find_first_instance(source, pattern, acc) end end return find_first_instance(source, pattern, 1) end -------------------------------------------------------------------------------- -- get_func_def -- -------------------------------------------------------------------------------- function MouseHoverCallTips:get_func_def(line, word, style) local var = string.gsub(line, " (", '(', 1) local position = self:find_instance(var, '(') if (position ~= 0) then local func_name = string.sub(var, 1, position - 1) if (style == 14) then func_name = string.gsub(func_name, "_AutoItObject_", '') end func_name = string.lower(func_name) word = string.lower(word) if (func_name == word) then return string.gsub(line, "%)(.)", "%)n%1") end -- changed: was adding a trailing empty line in some cases. end return nil end -------------------------------------------------------------------------------- -- get_function_calltip -- -------------------------------------------------------------------------------- function MouseHoverCallTips:get_function_calltip(directory, style, word) local function_calltip = nil local file = io.open(directory, 'r') if file ~= nil then for line in file:lines() do -- filter out constants if (style == 4) then local string_end = string.sub(line, -2) for i = 1, 4 do if (string_end == '?' .. i) then break end end end function_calltip = self:get_func_def(line, word, style) if (function_calltip ~= nil) then break end end file:close() end return function_calltip end -------------------------------------------------------------------------------- -- OnDwellStart -- -------------------------------------------------------------------------------- function MouseHoverCallTips:OnDwellStart(position, word) if (word == "") then if (scite.SendEditor(SCI_CALLTIPACTIVE)) then scite.SendEditor(SCI_CALLTIPCANCEL) end return true end local style = scite.SendEditor(SCI_GETSTYLEAT, position) if (style == 4 or style == 14 or style == 15) then local directories = props["api.$(au3)"] if (directories ~= nil) then self:DebugPrint("API files: " .. directories) for directory in directories:gmatch("([^;rn]+)") do self:DebugPrint("Searching API file: " .. directory) local function_calltip = self:get_function_calltip(directory, style, word) if (function_calltip ~= nil) then self:DebugPrint("Found calltip in API file: " .. directory) scite.SendEditor(SCI_CALLTIPSHOW, position, function_calltip) break end end else self:DebugPrint("The api.$(au3) is missing or empty.") end else self:DebugPrint("Unsupported style detected.") end return true end
jaberwacky Posted September 23, 2012 Author Posted September 23, 2012 OK peoples. I'm very excited to bring you the latest update which I've been putting off forever. See the Updates spoiler in the OP for more details! Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
trancexx Posted September 23, 2012 Posted September 23, 2012 (edited) Cool! Thank you. I would just like to point that this will be valid syntax soon: Func SomeFunc(vParam = 3) Local SomeFunc = "StringVal" ConsoleWrite(VarGetType(SomeFunc) & " " & SomeFunc & @CRLF) EndFunc SomeFunc() I guess it would be too much/impossible to process that correctly. Right? Edited September 23, 2012 by trancexx ♡♡♡ . eMyvnE
jaberwacky Posted September 23, 2012 Author Posted September 23, 2012 (edited) As long as the au3 lexer can keep them separated and assign to them two different styles. Mmm, so it will be possible to use the same variable name and the same function name and not get them all confused? Edited September 23, 2012 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
czardas Posted September 24, 2012 Posted September 24, 2012 Yeah baby, it's the dog's bollocks! operator64 ArrayWorkshop
trancexx Posted September 24, 2012 Posted September 24, 2012 Yeah baby, it's the dog's bollocks! ...I'm sure people using dog's bollocks would mind. ♡♡♡ . eMyvnE
czardas Posted September 24, 2012 Posted September 24, 2012 I never heard of the mutt's nuts being used without the the. muttley operator64 ArrayWorkshop
FaridAgl Posted September 24, 2012 Posted September 24, 2012 (edited) Good job, a really really really god job.I know it's not your duty to do what others say, but I have a feature request that may be even impossible, but worth hearing!For me, I usually keep my functions in a separated file, Functions.au3 for example and include it in the main file of the project, Main.au3 for example.Would be nice if hovering the mouse cursor on the functions call in the Main.au3, shows its call tips (Functions that has been declared in Functions.au3).Hope you understand me Edited September 24, 2012 by D4RKON3 jvanegmond and Xandy 2 http://faridaghili.ir
trancexx Posted September 24, 2012 Posted September 24, 2012 I never heard of the mutt's nuts being used without the the. muttleyOur chitchat reminded me of Sandra Bullock + Stallone film Demolition Man or something, when she says "Let's blow this guy!", and Stallone says "...away! Dammit away!"So, don't make me blow you. AdmiralAlkex and jvanegmond 2 ♡♡♡ . eMyvnE
czardas Posted September 24, 2012 Posted September 24, 2012 (edited) blow your mindYou always blow my mind anyway (in a nice way).I meant that as a compliment.@LaCastiglione I like your idea BTW. Edited September 24, 2012 by czardas operator64 ArrayWorkshop
jaberwacky Posted September 24, 2012 Author Posted September 24, 2012 (edited) Good job, a really really really god job.I know it's not your duty to do what others say, but I have a feature request that may be even impossible, but worth hearing!For me, I usually keep my functions in a separated file, Functions.au3 for example and include it in the main file of the project, Main.au3 for example.Would be nice if hovering the mouse cursor on the functions call in the Main.au3, shows its call tips (Functions that has been declared in Functions.au3).Hope you understand me As long as you dont' mind waiting four to six months before I decide to get around to it. =P Kidding. I'm already thinking of a simple method.@LaCastiglione I like your idea BTW.Well, thank ye kindly. (It wasn't my idea) Edited September 24, 2012 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
MvGulik Posted September 24, 2012 Posted September 24, 2012 (edited) I personal would ditch the " -- changed: was adding a trailing empty line in some cases." comment. As the related context is long gone (the org code that was changes). Or/and: It was only intended as temporary additional modification background/reason.---czardas:... Twilight zone ... (can be anything, including real stuff) Edited September 24, 2012 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 ...
czardas Posted September 24, 2012 Posted September 24, 2012 (edited) czardas: ... Twilight zone ... (can be anything, including real stuff) I thought the distinction was important in this case, with there being a fine line between something really good and something really crude, otherwise I would have kept it zipped. Anyway, enough digression from me. I love the original series. Edited September 24, 2012 by czardas operator64 ArrayWorkshop
jaberwacky Posted September 28, 2012 Author Posted September 28, 2012 Here is a basic attempt at the feature requested by D4RKON3. See 'Updates' spoiler in OP for more details. FaridAgl 1 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
FaridAgl Posted September 28, 2012 Posted September 28, 2012 Impressive. Working fine for me as long as the file we are working on includes the other file directly. http://faridaghili.ir
jaberwacky Posted October 7, 2012 Author Posted October 7, 2012 Latest Update! Now all of the includes file of a project are searched for user defined functions! Also see update from 10/01/2012 for additional updates. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
FaridAgl Posted October 8, 2012 Posted October 8, 2012 (edited) Sounds good, going to try it now. Edit: You know, that's amazing, specially the comment part ( ; ) after the function. Good job, keep it up. Edited October 8, 2012 by D4RKON3 http://faridaghili.ir
jaberwacky Posted October 10, 2012 Author Posted October 10, 2012 Sounds good, going to try it now.Edit: You know, that's amazing, specially the comment part ( ; ) after the function.Good job, keep it up.Why thank ye kin'ly. =) Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now