Posted to tcl by mookie at Sun Aug 01 13:52:55 GMT 2021view pretty
namespace eval menu {
}
####
proc menu::showMenuBar { args } {
try {
set debug [lindex $args 0]
set menuBar [getFormValue about] ;#7c61626f75745f6d656e75 ~ |about_menu
;#7c61626f75745f72657475726e ~ |about_return
####
set split [lindex [split [2Base $menuBar] "|"] 1] ;# Split the value of the menuBar by |
####
;# Switch based on split to determine what we show next
;# Assign the menus to display
switch $split {
about_menu { dict create mookie system menu 1 } ;#Problematic Switch Case
about_return { dict create mookie system menu 0 }
default { set myMenuBar "[menu::about 0]"}
} ;#end switch
####
set myList [hexList "%menu" "[menu::about 1]"]
set craft [neonCrystal::getCraft neonMenu] ;# Load the craftsheet
set hex [tagSwap $craft $myList ] ;# Preform morphing of tags with values
###
ixc::returnHtml [2Base "$hex"] ;# Output final HTML layout with morphed values
#
} on error {err msg} {
set craft [neonCrystal::getCraft neonMenu]
set myList "[hexList "%menu" "$err"]"
set hex [tagSwap $craft $myList ]
#
ixc::returnHtml [2Base "$hex"]
} ;#end try
} ;#end proc
####
####
proc menu::about {menu_state} {
# depends on which menu is selected and permissions
# Switch operations to display the following:
## 0 - About Button
## 1 - Return Button
set about_menu [2Hex "|about_menu"] ;# Encode the value to |about_menu to Hex
set about_return [2Hex "|about_return"] ;# Encode the value to |about_return to Hex
switch $menu_state {
0 { return [uiButton "about" "/menu" "$about_menu" "about" "button"]} ;#Display the HTML button with parameters
1 { return [uiButton "about" "/menu" "$about_return" "return" "button"]}
} ;#end switch
} ;#end proc
####