// // Menu system with Dialog_Input_1() // // (as example) // // this way you can implement nested menus easily // // // ---------------- Main program with the main menu --------- // .... #1=Dialog_Input_1(5,"`Main-Menu`, 'please choose ... (ESC cancels this menu)', `[&List]`,`[&Paragraph]`,`[&etc]`", APP+CENTER,0,0) Reg_Set(99, "MENU-0") // build the label dynamically Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number Call(@(99)) // and call it // more code ... return // ================ Subroutines ================================ // --------------- Sub menus ------------------------------------ :MENU-00: // ESC key return // --------- :MENU-01: #1=Dialog_Input_1(5,"`Submenu 1: List`, '(E)numerate: Aufzählungen (I)temize: Strichlisten (D)escription: Listen mit Schlagwort (ESC cancels this menu)', `[&Enumerate]`,`[&Itemize]`,`[&Description]`", APP+CENTER,0,0) Reg_Set(99, "MENU01-B") // build the label dynamically Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number Call(@(99)) // and call it return // --------- :MENU-02: #1=Dialog_Input_1(5,"`Submenu 2: List as paragraph`, 'Asparae(n)umerate: Aufzählungen Asparai(t)em: Strichlisten Asparadescri(p)tion: Listen mit Schlagwort (ESC cancels this menu)', `[Asparae&num]`, `[Asparai&tem]`, `[As¶desc]`", APP+CENTER,0,0) Reg_Set(99, "MENU02-B") // build the label dynamically Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number Call(@(99)) // and call it return // --------- :MENU-03: #1=Dialog_Input_1(5,"`Submenu 3: etc`, 'more functions or sub menus (ESC cancels this menu)', `[Button1]`, `[Button2]`", APP+CENTER,0,0) Reg_Set(99, "MENU03-B") // build the label dynamically Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number Call(@(99)) // and call it return // ------------------ Buttons for the menus ---------------------------------------- :MENU01-B0: // ESC key return :MENU01-B1: instext("[Menu1-Button1]") return :MENU01-B2: instext("[Menu1-Button2]") return :MENU01-B3: instext("[Menu1-Button3]") return // ------ :MENU02-B0: // ESC key return :MENU02-B1: instext("[Menu2-Button1]") return :MENU02-B2: instext("[Menu2-Button2]") return :MENU02-B3: instext("[Menu2-Button3]") return // ------ :MENU03-B0: // ESC key return :MENU03-B1: instext("[Menu3-Button1]") return :MENU03-B2: instext("[Menu3-Button2]") return // --------------------------------------------------------------------------