i have something like this
- Code: Select all Expand view
- MENUITEM "Player"
MENU
MENUITEM "Player &1" ACTION PlayNoNext(1)
MENUITEM "Player &2" ACTION PlayNoNext(2)
MENUITEM "Player &3" ACTION PlayNoNext(3)
MENUITEM "Player &4" ACTION PlayNoNext(4)
MENUITEM "Player &5" ACTION PlayNoNext(5)
MENUITEM "Player &6" ACTION PlayNoNext(6)
MENUITEM "Player &7" ACTION PlayNoNext(7)
MENUITEM "Player &8" ACTION PlayNoNext(8)
MENUITEM "Player &9" ACTION PlayNoNext(9)
ENDMENU
now i want to make this while it can be Different Layout
- Code: Select all Expand view
- MENUITEM "Player"
MENU
AddMenuPlayer()
ENDMENU
but i always get only "last" Element ...
- Code: Select all Expand view
- #include "fivewin.ch"
#define Use_Detach_Local
STATIC nRow := 3
STATIC nCol := 3
function Main()
local oWnd, oMenu
DEFINE WINDOW oWnd MENU MyMenu2()
ACTIVATE WINDOW oWnd CENTERED
return nil
function MyMenu2()
LOCAL oPopup
MENU oPopup
MENUITEM "Player"
MENU
#ifdef Use_Detach_Local
AddMenuPlayer()
#else
MENUITEM "Player &1" ACTION PlayNoNext(1)
MENUITEM "Player &2" ACTION PlayNoNext(2)
MENUITEM "Player &3" ACTION PlayNoNext(3)
MENUITEM "Player &4" ACTION PlayNoNext(4)
MENUITEM "Player &5" ACTION PlayNoNext(5)
MENUITEM "Player &6" ACTION PlayNoNext(6)
MENUITEM "Player &7" ACTION PlayNoNext(7)
MENUITEM "Player &8" ACTION PlayNoNext(8)
MENUITEM "Player &9" ACTION PlayNoNext(9)
#endif
ENDMENU
ENDMENU
RETURN oPopup
PROCEDURE PlayNoNext(nNo)
Msginfo(STR(nNo))
RETURN
PROCEDURE AddMenuPlayer()
LOCAL xx,yy,bBlock, nCount := 0
FOR yy := 1 TO nRow
xx := 1
FOR xx := 1 TO nCol
nCount++
MENUITEM "Player "+LTRIM(STR(nCount)) ACTION DoDeachLocal(nCount)
NEXT
NEXT
RETURN
FUNCTION DoDeachLocal(nNo)
LOCAL cRet := "{|| PlayNoNext(" + STR(nNo) +") }"
LOCAL bBlock := &(cRet)
EVAL(bBlock)
RETURN nil
who can help me please