Entry
TSE: Macro: Menu: Hierarchical: How to possibly build a hierarchical menu of macros?
Apr 17th, 2005 06:53
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 18 November 2003 - 10:14 pm - 10:52 pm --------
TSE: Macro: Menu: Hierarchical: How to possibly build a hierarchical
menu of macros?
---
One possible approach is to create a hierarchical tree of menus.
---
I use this menu structure to get quick access to currently about 7000
macros.
---
You could use the operation (=verb) at the main subbranches, and then
further subdivide. This might lead to a very small tree, without
too many subbranches, starting from the root.
Operation
verb1
verb2
verb3
...
verblast
This option has been chosen here.
---
An alternative would be to choose nouns as the main subbranches.
Root
noun1
noun2
noun3
...
nounlast
---
The most frequently used menu options you approach with a
PressKey(), GetKey() or PushKey() sequence, in order
to avoid too many key presses. This reduces accessing
this frequently used menu option to about 3 keypresses.
---
A possible example of such a hierarchical tree of menus
(in order to avoid too long menus you use an alphabetical
list with a range aa..bb, cc..dd, ee..ff, ...)
---
This is the menu structure, using verbs in the main branches:
Operation
backup..compress
backup
change
check
communicate
compare
compress
convert..convert
convert
copy..exchange
copy
count
create
draw
exchange
exit..install
exit
expand
get
goto
insert
install
join..query
join
load
manage
select: mark
merge
move
query
remove..save
remove
replace
run
save
search..set
search
select
set
sort..view
sort
update
undo
view
---
So in other words the following hierarchical tree:
|
+--Operation
|
+--backup..compress
| |
| +--backup
| |
| +--change
| |
| +--check
| |
| +--communicate
| |
| +--compare
| |
| +--compress
|
+--convert..convert
| |
| +--convert
|
+--copy..exchange
| |
| +--copy
| |
| +--count
| |
| +--create
| |
| +--draw
| |
| +--exchange
|
+--exit..install
| |
| +--exit
| |
| +--expand
| |
| +--get
| |
| +--goto
| |
| +--insert
| |
| +--install
|
+--join..query
| |
| +--join
| |
| +--load
| |
| +--manage
| |
| +--select: mark
| |
| +--merge
| |
| +--move
| |
| +--query
|
+--remove..save
| |
| +--remove
| |
| +--replace
| |
| +--run
| |
| +--save
|
+--search..set
| |
| +--search
| |
| +--select
| |
| +--set
|
+--sort..view
|
+--sort
|
+--update
|
+--undo
|
+--view
---
Here you see a possible implementation of this idea.
---
In order to make the menu as compact and easy changeable as possible,
you might choose to let each option call an external macro.
So you can change whatever you want in this macro, without having to
change anything in this menu structure.
Also this menu source code is not getting too large, as you are
not including the source code of the submenu options, if you keep
this sub menu source code in separate macro files instead.
Here this approach has been used in some of the menu options, but the
price you pay is that you loose your history possibility, that is the
menu closes after you have chosen that option). So in other places no
macros but source code has been used, as you might prefer to keep the
history possibility).
But in the further subbranches (not shown here) most of the time macros
have been used.
---
MENUBAR MENUBARKnudMain()
history
"&Operation", MENUKnudOperation()
END
MENU MENUKnudOperation()
history
title = "OPERATION"
"&Operation >", ExecMacro( "qdbmenu" ), , "operation: menu"
END
// library: operation: menu (filenamemacro=qdbmenu.s)
MENU MENUQDatabaseMain()
history
title = "OPERATION"
"operation: &Backup..compress >", ExecMacro( "qdbothe1" ), , ""
"", , divide
"operation: &Convert..convert >", ExecMacro( "qdbothe2" ), , ""
"", , divide
"operation: c&Opy..exchange >", ExecMacro( "qdbothe3" ), , ""
"", , divide
"operation: e&Xit..install >", ExecMacro( "qdbothe4" ), , ""
"", , divide
"operation: &Join..query >", ExecMacro( "qdbothe5" ), , ""
"", , divide
"operation: &Remove..save >", ExecMacro( "qdbothe6" ), , ""
"", , divide
"operation: &Search..set >", ExecMacro( "qdbothe7" ), , ""
"", , divide
"operation: sor&T..view >", ExecMacro( "qdbothe8" ), , ""
END
// library: operation: main: menu (filenamemacro=qdbothe1.s)
MENU MENUQOperationOther1()
history
title = "OPERATION: OTHER"
"OPERATION: BACKUP", , divide
"operation: &Backup >", MENUQBackup(), dontclose, "operation: backup"
"OPERATION: CHANGE", , divide
"operation: &Change >", MENUQChange(), dontclose, "operation: change"
"OPERATION: CHECK", , divide
"operation: c&Heck >", MENUQCheck(), dontclose, "operation: check"
"OPERATION: COMMUNICATE", , divide
"operation: co&Mmunicate >", MENUQCommunicate(),
dontclose, "operation: communicate"
"OPERATION: COMPARE", , divide
"operation: c&Ompare >", MENUQCompare(), dontclose, "operation:
compare"
"OPERATION: COMPRESS", , divide
"operation: com&Press >", MENUQCompress(), dontclose, "operation:
compress"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe2.s)
MENU MENUQOperationOther2()
history
title = "OPERATION: OTHER"
"OPERATION: CONVERT", , divide
"operation: &Convert >", MENUQConvert(), dontclose, "operation:
convert"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe3.s)
MENU MENUQOperationOther3()
history
title = "OPERATION: OTHER"
"OPERATION: COPY", , divide
"operation: c&Opy >", MENUQCopy(), dontclose, "operation: copy"
"OPERATION: COUNT", , divide
"operation: cou&Nt >", MENUQCount(), dontclose, "operation: count"
"OPERATION: CREATE", , divide
"operation: cre&Ate >", MENUQCreate(), dontclose, "operation: create"
"OPERATION: DRAW", , divide
"operation: &Draw >", MENUQDraw(), dontclose, "operation: draw"
"OPERATION: EXCHANGE", , divide
"operation: &Exchange >", MENUQExchange(), dontclose, "operation:
exchange"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe4.s)
MENU MENUQOperationOther4()
history
title = "OPERATION: OTHER"
"OPERATION: EXIT", , divide
"operation: e&Xit >", MENUQExit(), dontclose, "operation: exit"
"OPERATION: EXPAND", , divide
"operation: ex&Pand >", MENUQExpand(), dontclose, "operation: expand"
"OPERATION: GET", , divide
"operation: g&Et >", MENUQGet(), dontclose, "operation: get"
"OPERATION: GOTO", , divide
"operation: go&To >", MENUQGoto(), dontclose, "operation: goto"
"OPERATION: INSERT", , divide
"operation: &Insert >", ExecMacro( "qinsert" ), , "operation: insert"
"OPERATION: INSTALL", , divide
"operation: in&Stall >", ExecMacro( "instamen" ), , "operation:
install"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe5.s)
MENU MENUQOperationOther5()
history
title = "OPERATION: OTHER"
"OPERATION: JOIN", , divide
"operation: &Join >", MENUQJoin(), dontclose, "operation: join"
"OPERATION: LOAD", , divide
"operation: &Load >", MENUQLoad(), dontclose, "operation: load"
"OPERATION: MANAGE", , divide
"operation: &Manage >", MENUQManage(), dontclose, "operation: manage"
"OPERATION: SELECT: MARK", , divide
"operation: select: m&Ark >", MENUQSelectMark(),
dontclose, "operation: mark"
"OPERATION: MERGE", , divide
"operation: m&Erge >", MENUQMerge(), dontclose, "operation: merge"
"OPERATION: MOVE", , divide
"operation: mo&Ve >", MENUQMove(), dontclose, "operation: move"
"OPERATION: QUERY", , divide
"operation: &Query >", MENUQQuery(), dontclose, "operation: query"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe6.s)
MENU MENUQOperationOther6()
history
title = "OPERATION: OTHER"
"OPERATION: REMOVE", , divide
"operation: &Remove >", MENUQRemove(), dontclose, "operation: remove"
"OPERATION: REPLACE", , divide
"operation: re&Place >", MENUQReplace(), dontclose, "operation:
replace"
"OPERATION: RUN", , divide
"operation: r&Un >", MENUQRun(), dontclose, "operation: run"
"OPERATION: SAVE", , divide
"operation: s&Ave >", MENUQSave(), dontclose, "operation: search"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe7.s)
MENU MENUQOperationOther7()
history
title = "OPERATION: OTHER"
"OPERATION: SEARCH", , divide
"operation: &Search >", MENUQSearch(), dontclose, "operation: search"
"OPERATION: SELECT", , divide
"operation: se&Lect >", MENUQSelect(), dontclose, "operation: select"
"OPERATION: SET", , divide
"operation: s&Et >", MENUQSet(), dontclose, "operation: set"
END
// library: database: internet: operations: menu
(filenamemacro=qdbothe8.s)
MENU MENUQOperationOther8()
history
title = "OPERATION: OTHER"
"OPERATION: SORT", , divide
"operation: s&Ort >", MENUQSort(), dontclose, "operation: sort"
"OPERATION: UPDATE", , divide
"operation: &Update >", MENUQUpdate(), dontclose, "operation: update"
"OPERATION: UNDO", , divide
"operation: u&Ndo >", MENUQUndo(), dontclose, "operation: undo"
"OPERATION: VIEW", , divide
"operation: &View >", MENUQView(), dontclose, "operation: view"
END
---
Note:
To handle this hierarchical menu tree structure itself, you could then
for example define operations like:
create sub menu
delete
move to
replace
search
...
but for the most part you can do this manually.
---
---
Internet: see also:
---
TSE: Menu: Link: Overview: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/35667/fid/1571
----------------------------------------------------------------------