[function] CreateTreeView
- Learning one
- Posts: 173
- Joined: 04 Oct 2013, 13:59
- Location: Croatia
- Contact:
[function] CreateTreeView
Continued from old [function] CreateTreeView thread.
My Website • Join DropBox
Re: [function] CreateTreeView
hi I am new to autohotkey and have no programing experience. author did a great job making it very easy to use and create a simple treeview gui with minimal to no experience.
I have a hard time figuring out how to make an item in a menu run an app or open file or folder on click.
gLabel thing does not seam to work and I do not understand what previous user who replied did to make it work.
could someone help me wirh this?
thanks to all in advance.
I have a hard time figuring out how to make an item in a menu run an app or open file or folder on click.
gLabel thing does not seam to work and I do not understand what previous user who replied did to make it work.
could someone help me wirh this?
thanks to all in advance.
Re: [function] CreateTreeView
I should mention I tried updated script createMenu
https://autohotkey.com/board/topic/5764 ... reatemenu/
and was able to figure out following replies how to make things run on click but I do not like mouse click menu and prefer gui treeview for what I am after.
cheers.
https://autohotkey.com/board/topic/5764 ... reatemenu/
and was able to figure out following replies how to make things run on click but I do not like mouse click menu and prefer gui treeview for what I am after.
cheers.
- Learning one
- Posts: 173
- Joined: 04 Oct 2013, 13:59
- Location: Croatia
- Contact:
Re: [function] CreateTreeView
Hi bish01, here's example;
Code: Select all
TvDefinition=
(
Apps Expand
Calculator
Notepad
Folders Expand
My Documents
Program Files
)
Gui, New, +HwndhGui
Gui %hGui%:Add, TreeView, gTreeView h200
CreateTreeView(TvDefinition)
Gui %hGui%:Show
return
GuiClose:
ExitApp
TreeView:
if (A_GuiEvent != "DoubleClick")
return
TV_GetText(DoubleClickedItemText, A_EventInfo)
if (DoubleClickedItemText="Calculator")
Run, Calc
else if (DoubleClickedItemText="Notepad")
Run, Notepad
else if (DoubleClickedItemText="My Documents")
Run, % A_MyDocuments
else if (DoubleClickedItemText="Program Files")
Run, % A_ProgramFiles
return
CreateTreeView(TreeViewDefinitionString) { ; by Learning one
IDs := {}
Loop, parse, TreeViewDefinitionString, `n, `r
{
if A_LoopField is space
continue
Item := RTrim(A_LoopField, A_Space A_Tab), Item := LTrim(Item, A_Space), Level := 0
While (SubStr(Item,1,1) = A_Tab)
Level += 1, Item := SubStr(Item, 2)
RegExMatch(Item, "([^`t]*)([`t]*)([^`t]*)", match) ; match1 = ItemName, match3 = Options
if (Level=0)
IDs["Level0"] := TV_Add(match1, 0, match3)
else
IDs["Level" Level] := TV_Add(match1, IDs["Level" Level-1], match3)
}
} ; http://www.autohotkey.com/board/topic/92863-function-createtreeview/
My Website • Join DropBox
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: ntepa and 150 guests