CallTipsForAll v2 - 2020/07/31 - a121

Share the finished AutoHotkey v2 Scripts and libraries you made here. Please put the current version of AutoHotkey v2 you used in Square Brackets at the start of the topic title.
Helgef
Posts: 4458
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 30 May 2020, 02:59

Indeed it does, I don't know what I was doing. It works well with ; MapObject, the Object suffix is a bit long.
I get this, when I do three-finger gesture on my laptop mouse pad,

Code: Select all

---------------------------
CallTipsForAll_AHKv2.ahk
---------------------------
State: 0

... is invalid.



sc10F
---------------------------
OK   
---------------------------
F10::

Code: Select all

---------------------------
CallTipsForAll_AHKv2.ahk
---------------------------
0 / ArrayByComment / ArrayObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*ArrayObject)



0 / ArrayByFunc / ArrayObject

([\w\.]+)[ \t]*:=[ \t]*(Array\x28)



0 / ArrayByShortHand / ArrayObject

([\w\.]+)[ \t]*:=[ \t]*(\x5B)



0 / ArrayByStrSplit / ArrayObject

([\w\.]+)[ \t]*:=[ \t]*(StrSplit\x28)



0 / ArrayBySysGetIP / ArrayObject

([\w\.]+)[ \t]*:=[ \t]*(SysGetIPAddresses\x28)



0 / BasicObj / Object

([\w\.]+)[ \t]*:=[ \t]*(\x7B\x7D)



0 / BoundFuncByComment / BoundFuncObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*BoundFuncObject)



0 / BoundFuncMethod / BoundFuncObject

([\w\.]+)[ \t]*:=[ \t]*(ObjBindMethod\x28)



0 / BufferByAlloc / BufferObject

([\w\.]+)[ \t]*:=[ \t]*(BufferAlloc\x28)



0 / BufferByClipboard / BufferObject

([\w\.]+)[ \t]*:=[ \t]*(ClipboardAll\x28)



0 / BufferByComment / BufferObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*BufferObject)



0 / FileObjByComment / FileObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*FileObject)



0 / FileObjByFunc / FileObject

([\w\.]+)[ \t]*:=[ \t]*(FileOpen\x28)



0 / FuncObjByComment / FunctionObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*FunctionObject)



0 / FuncObjByFunc / FunctionObject

([\w\.]+)[ \t]*:=[ \t]*(Func\x28)



0 / GuiByComment / GuiObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*GuiObject)



0 / GuiControlByComment / GuiControlObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*GuiControlObject)



0 / GuiControlFromHwnd / GuiControlObject

([\w\.]+)[ \t]*:=[ \t]*(GuiControlFromHwnd\x28)



0 / GuiCreate / GuiObject

([\w\.]+)[ \t]*:=[ \t]*(GuiCreate\x28)



0 / GuiFromHwnd / GuiObject

([\w\.]+)[ \t]*:=[ \t]*(GuiFromHwnd\x28)



0 / InputHookByComment / InputHookObject

[\w]+\(([\w]+).*(; InputHookObject)



0 / InputHookByComment2 / InputHookObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*InputHookObject)



0 / InputHookFunc / InputHookObject

([\w\.]+)[ \t]*:=[ \t]*(InputHook\x28)



0 / MapByComment / MapObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*MapObject)



0 / MapByFunc / MapObject

([\w\.]+)[ \t]*:=[ \t]*(Map\x28)



0 / MenuByComment / MenuObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*MenuObject)



0 / MenuCreate / MenuObject

([\w\.]+)[ \t]*:=[ \t]*(MenuCreate\x28)



0 / MenuFromCallback / MenuObject

.*?,[ ]+([\w]+)\)[ ]+\x7B[ ]+(; MenuObject)$



0 / MenuFromHandle / MenuObject

([\w\.]+)[ \t]*:=[ \t]*(MenuFromHandle\x28)



0 / MenuFromVar / MenuObject

([\w\.]+)[ \t]*:=[ \t]*(A_TrayMenu)



0 / ObjByComment / Object

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*Object)



0 / RegExByComment / RegExMatchObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*RegExMatchObject)



0 / RegExMatchFunc / RegExMatchObject

[\w]+[ \t]*:=[ \t]*RegExMatch\([^,]*\,[^,]*\,([\w]+)



1 / BufferByRawRead / BufferObject

([\w\.]+)[ \t]*:=[ \t]*({FileObject}\.RawRead\x28)



1 / BufferByRawWrite / BufferObject

([\w\.]+)[ \t]*:=[ \t]*({FileObject}\.RawWrite\x28)



1 / GuiControlByItem / GuiControlObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\x5B)



1 / GuiControlByMethod / GuiControlObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.Add\x28)



1 / MenuFromObj / MenuObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.MenuBar)



2 / ListViewByAdd / ListViewObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.Add\x28"ListView")



2 / ListViewByAddSpec / ListViewObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.AddListView\x28)



2 / ListViewByComment / ListViewObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*ListViewObject)



2 / StatusBarByAdd / StatusBarObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.Add\x28"StatusBar")



2 / StatusBarByAddSpec / StatusBarObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.AddStatusBar\x28)



2 / StatusBarByComment / StatusBarObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*StatusBarObject)



2 / TreeViewByAdd / TreeViewObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.Add\x28"TreeView")



2 / TreeViewByAddSpec / TreeViewObject

([\w\.]+)[ \t]*:=[ \t]*({GuiObject}\.AddTreeView\x28)



2 / TreeViewByComment / TreeViewObject

([\w\.]+)[ \t]*:=[ \t]*(.*[ \t]+;[ \t]*TreeViewObject)




---------------------------
OK   
---------------------------

f1::

Code: Select all

---------------------------
CallTipsForAll_AHKv2.ahk
---------------------------
Custom Functions:



CreateObjList / CreateObjList(curDocText)



FuncParamOutline / FuncParamOutline(sInput,ByRef funcName)



GetCustomFunctions / GetCustomFunctions(curDocArr)



GetMsgDimensions / GetMsgDimensions(sString,sFaceName,nHeight,maxW := 0)



GetParentObj / GetParentObj(phraseObj, ByRef methProp, funcName := "", curTopFunc := "")



GetTopLevelFunc / GetTopLevelFunc(sInput, curCol, ByRef funcStart, ByRef funcEnd)



StringOutline / StringOutline(sInput)



editorCtlHwnd / editorCtlHwnd(ByRef eHwnd, ByRef cType, ByRef classNN)



getCurPhrase / getCurPhrase(curLineNoStr, curCol, ByRef curPhraseStartOut)



getCurPhraseObj / getCurPhraseObj(curLineNoStr,curCol,ByRef curPhraseStartOut)



gui_click / gui_click(ctlObj,info)



iconMenu / iconMenu(ItemName, ItemPos, MenuObj)



keyPress / keyPress(iHook, VK, SC)



paramData / paramData(lineText,curCol,funcName,funcStart,paramStr)



truncateTxt / truncateTxt(x)




---------------------------
OK   
---------------------------

and

Code: Select all

---------------------------
CallTipsForAll_AHKv2.ahk
---------------------------
ObjectList:



CustomFunctions / MapByFunc / MapObject

Map(



FunctionList / MapByFunc / MapObject

Map(



IH / InputHookFunc / InputHookObject

InputHook(



KeywordList / MapByFunc / MapObject

Map(



MethPropList / MapByFunc / MapObject

Map(



ObjectCreateList / MapByFunc / MapObject

Map(



ObjectList / MapByFunc / MapObject

Map(



a / ArrayByStrSplit / ArrayObject

StrSplit(



aStr / ArrayByStrSplit / ArrayObject

StrSplit(



callTipGui / GuiCreate / GuiObject

GuiCreate(



ctl / GuiControlByMethod / GuiControlObject

callTipGui.Add(



curDescObj / MapByFunc / MapObject

Map(



curDocArr / ArrayByStrSplit / ArrayObject

StrSplit(



curLevelObj / MapByFunc / MapObject

Map(



curObj / MapByFunc / MapObject

Map(



curTitleArr / ArrayByStrSplit / ArrayObject

StrSplit(



descArr / ArrayByFunc / ArrayObject

Array(



dims / BasicObj / Object

{}



fullDescArr / MapByFunc / MapObject

Map(



funcArr / ArrayByStrSplit / ArrayObject

StrSplit(



funcBodyArr / ArrayByStrSplit / ArrayObject

StrSplit(



funcDescArr / ArrayByFunc / ArrayObject

Array(



funcList / MapByFunc / MapObject

Map(



guiObj / GuiCreate / GuiObject

GuiCreate(



iHook / InputHookByComment / InputHookObject

; InputHookObject



lineSplit / ArrayByStrSplit / ArrayObject

StrSplit(



match / RegExMatchFunc / RegExMatchObject

match



match2 / RegExMatchFunc / RegExMatchObject

match2



memDescArr / ArrayByFunc / ArrayObject

Array(



memMap / MapByFunc / MapObject

Map(



methList / MapByFunc / MapObject

Map(



methPropArr / ArrayByStrSplit / ArrayObject

StrSplit(



multiSyntaxArr / ArrayByFunc / ArrayObject

Array(



oList / MapByFunc / MapObject

Map(



obj / MapByFunc / MapObject

Map(



objDescArr / ArrayByFunc / ArrayObject

Array(



objMatchArr / ArrayByStrSplit / ArrayObject

StrSplit(



objNameArr / ArrayByStrSplit / ArrayObject

StrSplit(



paramArr / ArrayByStrSplit / ArrayObject

StrSplit(



paramList / MapByFunc / MapObject

Map(



paramObj / MapByFunc / MapObject

Map(



propList / MapByFunc / MapObject

Map(



retVal / BasicObj / Object

{}



returnObj / MapByFunc / MapObject

Map(



str / ArrayByComment / ArrayObject

"asdf ```"  \" asdf" ; ArrayObject



subMenuAutoGen / MenuCreate / MenuObject

MenuCreate(



trayMenu / MenuFromVar / MenuObject

A_TrayMenu



typeObj / MapByFunc / MapObject

Map(




---------------------------
OK   
---------------------------
Cheers.

Helgef
Posts: 4458
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 30 May 2020, 03:08

When I have this script on, I cannot type ` (back-tick), instead it becomes ´. Any idea?

Edit, I can type it normally on english layout, but not on some exotic layouts such as german, it is a dead-char on german layout.

Cheers.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 03:21

@Helgef, thanks for the feedback. That error messages relates to the InputHook I currently have implemented to try and auto-reload the function, object, and keyword lists. I've had to account for "laptop lid open / close", and apparently you found another action that is captured and not properly handled.

The output of F10 and F11 looks about right generally speaking, so that's good.

My current working version functions as follows:
  • double-click or CTRL+SHIFT+Space to invoke call tip
  • middle-click or ESC to close call tip
  • CTRL+Space to reload current document
I'm also working on auto-complete for all keywords, and for listing methods / properties for known objects.

Working version also has a GUI for settings, invoked from the tray icon, where you specify the EXE and the classNN (minus the number) to match, which greatly improves issues with switching windows quickly.

I'll post quite soon, before I implement too much else. I have a feeling that removing the InputHook will take care of your ` and ´ issue.

if you get a chance, just disable the input hook completely and see if that fixes it. Thanks for your input!
Last edited by TheArkive on 30 May 2020, 03:35, edited 1 time in total.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 03:22

Here's a rapid-fire release ... just to see if this fixes your issues for the time being.

The InputHook is still in there but not implemented so it can be commented out.

Check bottom of the OP ... zip file.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 03:29

@Helgef
*** Test version superseded by the latest release.
Last edited by TheArkive on 30 May 2020, 09:10, edited 1 time in total.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 03:57

@Helgef
I added the German keyboard layout on my system to try this, and I have the same "issue" but it doesn't behave the same way, and it happens if I'm using the script or not.

I have to press the key 2 times to get text to display, and when it does I get ´´. If i hold shift, I get ``, but again I must press it 2 times, first time seems to be invisible for some reason.

Is there anything else I can / should do to trouble-shoot this? It seems the InputHook had nothing to do with it...

Helgef
Posts: 4458
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 30 May 2020, 04:06

TheArkive wrote:
30 May 2020, 03:57
I have to press the key 2 times to get text to display, and when it does I get ´´. If i hold shift, I get ``, but again I must press it 2 times, first time seems to be invisible for some reason.
This is the expected behaviour, it doesn't behave like that when I have your script on, I didn't try with the latest version.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 04:21

@Helgef
Do you run scripts that use dead keys as hotkeys? @robodesign suggests he's experienced issues with dead keys when they are specified as hotkeys ...
EDIT: I see one issue with the InputHook, SHIFT + dead-key x 2 = ´` instead of ``... so hopefully commenting out the InputHook on your system will work well.

EDIT2: my bad, you specifically said it doesn't behave that way when the script isn't running... As far as I can tell, getting rid of the InputHook, for the time being, is the way to go.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 30 May 2020, 09:03

Update 2020/05/30
  • Reworked window / text editor detection to be more intuitive
  • Added GUI to change several user settings (in tray menu)
  • Changed ; comment support to identify objects to be shorter (check GitHub readme)
  • Changed hotkeys as follows:
  • Invoke Call Tip: CTRL+SHIFT+Space or Double-click
  • Close Call Tip: ESC or Middle button
  • any text editor that has a scintilla control or edit control as main text editing control is supported

Helgef
Posts: 4458
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by Helgef » 30 May 2020, 09:11

I get an error when I launch the latest version,

Code: Select all

---------------------------
CallTipsForAll_AHKv2.ahk
---------------------------
Error in #include file "\Lib\_Jxon_v2.ahk":
     Invalid index.

Specifically: 1

	Line#
	139: }
	141: pos += i-1
	142: }
	144: is_array ? obj.Push(val) : obj[key] := val
	145: next := obj == tree ? "" : is_array ? ",]" : ",}"
	146: }
	147: }
--->	149: Return tree[1]
	150: }
	152: {
	155: if IsObject(obj)
	155: {
	156: if (A_AhkVersion < 2)
	156: {
	162: }

The current thread will exit.
---------------------------
OK   
---------------------------


readme - todo wrote: enable #INCLUDE processing for custom functions and objects
Awesome!

Cheers

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 30 May 2020, 09:13

@Helgef
Arg! my bad .. save the following as Settings.txt and put it in the main folder.

Code: Select all

{
    "ActiveLanguage": "AHK2",
    "CallTipSelectable": "0",
    "CloseTipOnFocusChange": 1,
    "DebugToolTip": "0",
    "LoadCallTipOnClick": 1,
    "ProgClassNN": "scintilla",
    "ProgExe": "notepad++.exe",
    "bgColor": 2763306,
    "fontColor": "0xFFFF00",
    "fontFace": "Courier New",
    "fontSize": 10
}
EDIT: Added Settings.txt to repo to avoid startup error.

Helgef
Posts: 4458
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by Helgef » 30 May 2020, 09:23

I can't see user funcs now., F11 is empty.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 30 May 2020, 09:31

@Helgef
Try CTRL+Space in the text editor ... that should reload objects / functions.

I'll check the repo, make sure my push didn't get messed up

EDIT: Oh and what editor are you using? You may need to change the user settings. notepad++.exe is the default now
change settings in tray menu > Settings

EDIT2: Are any other elements showing up? Normal functions? Objects?

EDIT3: I realized that I forgot to support function style that is NOT OTB

Code: Select all

function(params*)
{ ... }
Fixing that now ...

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 31 May 2020, 08:32

@Helgef, @robodesign, and anyone else watching this project...

The only way I can think of to do includes is to either prompt the user for the base file, or to read the titlebar of the text editor.

Reading the titlebar would be a dicey approach... I think I'll need to prompt the user (once per session i guess) for the base file. I can remember the last base file, and reload the last selected base file, but any time the user switches to a new project / script, then the user will need to specify a new base file again for includes to be properly read.

I'll probably add this as a menu item in the tray icon menu...

Which behavior is preferred?

This seems to be going more and more in the direction of making a text editor to more intuitively implement some of these features ... mainly processing includes.

Edit: Current version on the repo supports classes, but this isn't too useful without also processing includes in most cases.

EDIT2: Is it normally expected for include files to have #INCLUDES as well?


User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 31 May 2020, 09:01

@Helgef
Thanks for that. That will certainly be useful. Checking it out now.

toralf
Posts: 792
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by toralf » 31 May 2020, 12:19

I have such a ‚main file“ option in the Ahk Projekt Manager, since I had the same issue.
The manager is supposed to be adjacent to the editor, similar to an extension. It works well for my environment with npp.
ciao
toralf

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 31 May 2020, 16:20

@toralf
Thanks for that ... I was thinking along the same lines already, but wanted to know other opinions. So, thanks again!

toralf
Posts: 792
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v2 (updated) / v1 (shelved)

Post by toralf » 01 Jun 2020, 01:21

my experience from my own way of working: I switch projects quite frequently. But I often code in included files, thus the title bar of the editor will very seldom be the main project file.
And to always remember to switch it in the taskbar might be too much hassle.
Another possibility would be to have a comment in the include file that names the project file.
But I would love to see an cmd line option to switch it, then it would be easier for me to include your script into AHK project manager and switch the file automatically when the user switches it in the manager. ;)
ciao
toralf

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/06/02 - For AHK v2 (updated) / v1 (shelved)

Post by TheArkive » 02 Jun 2020, 05:33

Update 2020/06/02
  • loading includes now supported
  • made minor changes to regex to identify classes properly
  • restructured code into libs for easier reading
Ok, what bugs can you find!

EDIT: I'll be back in about 1-2 hours ... going for a walk to get some fresh air! Then I'll be ready to dig into bug reports.
Last edited by TheArkive on 02 Jun 2020, 09:15, edited 1 time in total.

Post Reply

Return to “AutoHotkey v2 Scripts and Functions”