ObjTree will display a GUI containing your objects and its items.
Now your objects can be edited as well.
Note You will need latest AutoHotkey_L or AutoHotkey_H to use these functions.
Download ObjTree.ahk - or - ObjTree.ahk (AHK_v2 version)
Requires latest _Struct class.
Credits:
- majkinetor for Attach() - Attach() for 64-bit - Attach() for v2
- Solar for LV_SortArrow() [Optional]
- PhiLho for ToolTips in TreeView
- shajul for List Arrays/Objects easily (GUI) [Lib] [AHK_L]
- Multiple windows support
- - Enter or double click in ListView displays keys of selected object, press BackSpace to jump to parent object.
- ListViews Checkbox will be ticked if key or value is an object and can be double clicked to be displayed.
- ToolTip in TreeViw shows contents of keys and first 20 keys and values of objects.
- Optionally different ToolTipObject can be used to display custom values, see example.
- Selected key/object is highlighted in ListView when selected in TreeView
- If IsObject(Key), there will be additional child node containing its keys/values. It will have same name (address) as Key.
- - also the key will be selected in ListView rather than showing its keys/values in ListView.
- - double click on such a key in ListView will also show its items
- hwnd:=ObjTree(Object [, Title, Options, ToolTipObject])
- hwnd = ahk_id of created window- Object = object to show in Gui
- Title = Title for Gui
- Options separated by comma.
- - +/-ReadOnly[level] - level means from which depth on object will be editable.
- - Gui options
- - Font options, different to Gui options this requires Font=
- - Gui Show options, also GuiShow= is required
hwnd:=ObjTree(Object,"View My Object","-Readonly2 +AlwaysOnTop, GuiShow=w440 h240 ,Font=s12:Arial")- ToolTipObject
- - optionally you can use a different object for ToolTips, it must have the same structure as your object
- Objects and their Keys are enumerated in alphabetical order only
; Simple Example WinWaitClose % "ahk_id " ObjTree({MyObject:{"Key With Object":["a","This is a test","b",2]} ,"Another Object":{Key:["c",1,"d",2]} ,"Empty Object":[] ,"Another Object 2":["e",1,"f",2]}) ; Example with custom ToolTip and Editable values WinWaitClose % "ahk_id " ObjTree({MyObject:{"Key With Object":["a","This is a test","b",2]} ,"Another Object":{Key:["c",1,"d",2]} ,"Empty Object":[] ,"Another Object 2":["e",1,"f",2]} ,"My ObjTree Gui Title","-ReadOnly" ,{MyObject:{"Key With Object":"This is a an object`nKey is a string and value is object"} ,"Another Object":{Key:"This is an object"} ,"Empty Object":"This object is empty" ,"Another Object 2":"Another object"}) ExitApp
Enjoy
Update
11.10.2012 Version 1.0.1.0
- Fixed few issues
- Added support for multiple windows
21.03.2012 Version 1.0.0.5
- Removed autoexpanding the item when it is selected
20.03.2012 Version 1.0.0.4
- Fixed OnMessage to be used only while Gui is shown and restore back afterwards.
16.03.2012 AHKv2 Version 1.0.0.3
- Fixed Attach() and ObjTree for latest AHKv2 version.
14.03.2012 - Version 1.0.0.1
- Added Cancel option when closing Gui
- Added possibility to add custom ToolTips for items to Gui
- - Simply pass forth parameter to ObjTree having same key/object structure like your object.
01.03.2012 - Changed to use _Clone() method instead of ObjClone to support custom clone operations
18.02.2012 - Edit objects (pass -ReadOnly[depth])
13.09.2011 - Changed to use _Struct class
23.03.2011 - Added additional EditBox + some bugfixes
19.03.2011 - Enabled view of Keys if these are objects