jaberwacky Posted February 24, 2013 Author Posted February 24, 2013 They look the same to me. Could you show me what you mean? 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?
Sunaj Posted February 24, 2013 Posted February 24, 2013 They look the same to me. Could you show me what you mean?Managed by myself by accident, when I put an extra ";" in the comment line it triggers a line break in the calltip which is what I was looking for. However, playing around with the system now I have another problem, if I have a#include <gui.au3>in my main.au3 and the gui.au3 contains a function called "Func gui_($method, $params = '') ; comment here" then that calltip shows up when I am editing the gui.au3 but unfortunately not when I'm editing the main.au3 (where the gui_ function is normally used). Any idea what could be going wrong? [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
Sunaj Posted February 24, 2013 Posted February 24, 2013 (edited) Managed by myself by accident, when I put an extra ";" in the comment line it triggers a line break in the calltip which is what I was looking for. However, playing around with the system now I have another problem, if I have a #include <gui.au3> in my main.au3 and the gui.au3 contains a function called "Func gui_($method, $params = '') ; comment here" then that calltip shows up when I am editing the gui.au3 but unfortunately not when I'm editing the main.au3 (where the gui_ function is normally used). Any idea what could be going wrong? Ok, found out what the problem is and here's a subtle'ish bug report: it seems the MouseHoverCallTips:OnOpen function fails to fire consecutively when loading files via SciTE.session files - hence the MouseHoverCallTips:get_includes_list doesn't get to do its job..etc. Would submit patch but I've never done any Lua work so will have to pass on this one. Update, this function patch (to CalltipsOnMouseHover.lua) partly fixes the problem with files loaded via session but the initial file displayed still does not show calltips before it has been "switched to". function MouseHoverCallTips:OnSwitchFile(file_path) if self:is_au3_file() then self:initialize_mouse_dwell() self:get_includes_list(file_path, 1) end return false end Edited February 24, 2013 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted February 24, 2013 Author Posted February 24, 2013 (edited) Also, a question, is it possible to do line breaks in Function comment/description? So as to emulate the format used by for example _ArrayDisplay and othersOK, here is what _ArrayDisplay's calltip looks like when I use the native intellisense: _ArrayDisplay (Const ByRef $avArray [, $sTitle = "Array: ListView Display" [, $iItemLimit = -1 [, $iTranspose = 0 [, $sSeparator = "" [, $sReplace = "|" [, $sHeader = ""]]]]]]) Displays given 1D or 2D array array in a listview. (Requires: #include <Array.au3>) And here is what it looks like when I use Mousehover --> Calltip: _ArrayDisplay (Const ByRef $avArray [, $sTitle = "Array: ListView Display" [, $iItemLimit = -1 [, $iTranspose = 0 [, $sSeparator = "" [, $sReplace = "|" [, $sHeader = ""]]]]]]) Displays given 1D or 2D array array in a listview. (Requires: #include <Array.au3>) I did decide to put the (requires:... section on its own line. Managed by myself by accident, when I put an extra ";" in the comment line it triggers a line break in the calltip which is what I was looking for.Are you referring to when you have a func definition with a comment on the same line?Func my_awesome_function() ; this is my awesome function.If so then you shouldn't have to put two semi colons. So I will look into that. Edit: OK, if you want an extra line feed then yes just put two semi colons. Ok, found out what the problem is and here's a subtle'ish bug report: it seems the MouseHoverCallTips:OnOpen function fails to fire consecutively when loading files via SciTE.session files - hence the MouseHoverCallTips:get_includes_list doesn't get to do its job..etc. Would submit patch but I've never done any Lua work so will have to pass on this one. Update, this function patch (to CalltipsOnMouseHover.lua) partly fixes the problem with files loaded via session but the initial file displayed still does not show calltips before it has been "switched to".function MouseHoverCallTips:OnSwitchFile(file_path) if self:is_au3_file() then self:initialize_mouse_dwell() self:get_includes_list(file_path, 1) end return false endThank you. I will look into this some more. Edit: Ok, I don't experience the issue that you describe. Maybe I have misunderstood? Edited February 24, 2013 by jaberwocky6669 Sunaj 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?
Sunaj Posted February 24, 2013 Posted February 24, 2013 Thank you. I will look into this some more.Edit: Ok, I don't experience the issue that you describe. Maybe I have misunderstood?First of all the line break thing is all fine: as you say I can put semi colons in the comment to allow for as many/few line breaks as I need.Secondarily: The session loading issue remains for me: I have two files, alpha.au3 and beta.au3 and I call a Func in alpha.au3 with the name firstfunc($ding) and that Func is located in beta.au3 (which is included in alpha.au3 of course). Now I take those two files and save them in a session when alpha.au3 is in focus (SciTE.session), next time I open the session file I do not get the calltip displayed on firstfunc($ding).I tried incl. the firstfunc($ding) function directly in alpha.au3 and then the calltip works (?!).With the patch/hack I submitted above I can let firstfunc($ding) function remain in beta.au3 and switch back and forth between the two tabs and then all is normal with the calltip inside the alpha.au3 file. This is a minor issue but it is there >_< [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted February 24, 2013 Author Posted February 24, 2013 (edited) Really I set it up just now exactly as you described with the names all the same and I saved them into a session. I then opened the session and I get a calltip every time. I'm hoping someone else will weigh in here and try it out too. Edited February 24, 2013 by jaberwocky6669 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?
Sunaj Posted February 24, 2013 Posted February 24, 2013 Sh*t, that is a bit weird, getting a bit late here but if no further clarity is reached on this I will zip up the 3 files that don't work for me tomorrow and upload them to see if that can help validate/understand the problem. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
Sunaj Posted March 2, 2013 Posted March 2, 2013 (edited) Really I set it up just now exactly as you described with the names all the same and I saved them into a session. I then opened the session and I get a calltip every time. I'm hoping someone else will weigh in here and try it out too. Thanks for taking the time, I have included my code below with comments to describe issue, also I have uninstalled/reinstalled SciTE and AutoIt to make sure that the setup isn't wonky; unfortunately still seeing issue, I don't need to use session file to see issue now (might have been same all along, sorry about that). FInal detail: I'm on Win7 32bit edition, all updated..etc. file: alpha.au3 #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1, SciTE Version : 6/10/2012 Script Function: Test CallTipsOnMouseHover.lua versus include files #ce ---------------------------------------------------------------------------- #include"beta.au3" alpha_firstfunc('testing') ; this comes up fine beta_secondfunc('testing again') ; i see no call tip here?! Func alpha_firstfunc($dang) ; here's alpha_firstfunc calltip, note the intelligent parameter ConsoleWrite('@@ (13) :(' & @MIN & ':' & @SEC & ') firstfunc(): ' & $dang & @CR) ;### Function Trace EndFunc file: beta.au3 Func beta_secondfunc($ding) ; here's beta_secondfunc calltip, note the intelligent parameter ConsoleWrite('@@ (13) :(' & @MIN & ':' & @SEC & ') firstfunc(): ' & $ding & @CR) ;### Function Trace EndFunc edit: couple of comment typos and file description clarified Edited March 2, 2013 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
Sunaj Posted March 3, 2013 Posted March 3, 2013 Ok, finally found correct solution to my problem: this function, inside CalltipsOnMouseHover.lua:function MouseHoverCallTips:get_include_from_line(line) if not line then return '' end if string.find(line, "^%s*#include%s+") then -- Anything between <, >, ', or " local include = string.match(line, "[\<\"\']%s*.+\.au3%s*[\'\"\>]") if include == nil then return '' end return string.sub(include, 2, -2) end return '' enddoes NOT do what it is intended to do unless I change this line:if string.find(line, "^%s*#include%s+") thento read:if string.find(line, "#include") theninstead.. then all is fine, I don't understand why I'm am the only one seeing this problem, tried it out on two computers so far and can replicate just fine. Anywho, I'm a happy camper now so.. over and out. [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted March 3, 2013 Author Posted March 3, 2013 (edited) Ahh, I see why now. The '+' in "^%s*#include%s+" searches for one or more spaces. I changed it to '*' to search for zero or more spaces.Thanks for the bug report! I'll include your name in the list of contributors. Edited March 3, 2013 by jaberwocky6669 Sunaj 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?
jaberwacky Posted March 3, 2013 Author Posted March 3, 2013 Latest bug fix as reported by Sunaj. 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?
Sunaj Posted March 17, 2013 Posted March 17, 2013 (edited) Another nugget spotted: if you are using a function in an included file (say include.au3) that is written in out in the mother script (main.au3) then the calltip fails to show up when browsing the include file, after a bit of debugging I noticed that the main.au3 script was not being put into the "self.IncludesTable" and hence no joy. Here's a modified version of get_includes_list that makes it work fine on my end:function MouseHoverCallTips:get_includes_list(file_path, accumulator) -- If file_path only contains a filename then prepend a file path if not string.find(file_path, "^%a:\\") then file_path = props["FileDir"] .. '\\' .. file_path end local file = io.open(file_path) if file then local include_name = '' for line in file:lines() do if string.len(line) > 0 then include_name = self:get_include_from_line(line) if string.len(include_name) > 0 then table.insert(self.IncludesTable, include_name) end end end end -- new bit start local index = file_path:match'^.*()\\' local file_clean = string.sub(file_path, index+1) if not self:table_contains(self.IncludesTable, file_clean) then table.insert(self.IncludesTable, file_clean) end -- new bit end if accumulator == #self.IncludesTable then file:close() self.IncludesTable = self:filter_duplicate_entries(self.IncludesTable) end return true endOn a side note: your code has helped me getting started with Lua, appreciated.Edit: formatting redone on code paste Edited March 18, 2013 by Sunaj [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted March 18, 2013 Author Posted March 18, 2013 I went ahead and posted your change without testing it because it looks good to me and I trust you. 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?
Sunaj Posted March 18, 2013 Posted March 18, 2013 I went ahead and posted your change without testing it because it looks good to me and I trust you. Thanks, although practically I will have to add another bit to make the whole thing work; when I posted above code last night I forgot this little helper function which is needed to do the table_contains check: function MouseHoverCallTips:table_contains(table, element) for _, value in pairs(table) do if value == element then return true end end return false end [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted March 18, 2013 Author Posted March 18, 2013 (edited) Fill out this template: -- Description: -- -- Parameters: -- table - -- element - -- Author(s): -- sunaj Sorry, been kinda busy lately with school etc. Edited March 18, 2013 by jaberwocky6669 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?
Sunaj Posted March 18, 2013 Posted March 18, 2013 Fill out this template: -- Description: -- -- Parameters: -- table - -- element - -- Author(s): -- sunaj Sorry, been kinda busy lately with school etc. Sure, here goes (filled it in with original author's name/url for transparency): -- Description: -- "table_contains" returns boolean true if the value passed to it is found in the table passed to it -- Parameters: -- table - table to check -- element - value to check for in table -- Author(s): -- Wookai (use in CalltipsOnMouseHover.lua by Sunaj) -- url: http://stackoverflow.com/questions/2282444/how-to-check-if-a-table-contains-an-element-in-lua [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list]
jaberwacky Posted March 19, 2013 Author Posted March 19, 2013 Oops, updated btw. 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?
jaberwacky Posted August 5, 2013 Author Posted August 5, 2013 I'm pleased to announce the latest exciting update! See the Updates and Changes 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?
jaberwacky Posted August 6, 2013 Author Posted August 6, 2013 *whew* Allright, NOW! I spent literally all day chasing one pipe dream after another and now I feel confident that this works. See >OP for more details on the latest feature! 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 August 6, 2013 Posted August 6, 2013 Wow, fucking great, going to give it a try right now. Thumbs up (y). http://faridaghili.ir
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