Page 2 of 2

Re: Menu desde Tabla MySql

Posted: Wed Dec 12, 2018 11:08 pm
by jnavas

Code: Select all | Expand



 C5MENUITEM oDp:oItemTransaccion PROMPT oDp:cMenu04

     C5MENU COLOR    oDp:nMenuItemClrText, oDp:nMenuItemClrPane;
            COLORSEL oDp:nMenuItemSelText, oDp:nMenuItemSelPane;
            COLORBOX oDp:nMenuBoxClrText ;
            HEIGHT oDp:nMenuHeight; // SELECT 3D ;
            LOGO oDp:cBmpTransacciones ;
            LOGOCOLOR oDp:nMenuMainClrText

     aMenu:=ACLONE(aMenuTra)

     oDp:oItemTransaccion:lActive:=!EMPTY(aMENUTRA[1]) .AND. lHorario

     hacermenu(aMenu)

     C5ENDMENU

STATIC FUNCTION HACERMENU(aMenu,oMenu)
    LOCAL I:=1,lacceso:=.T.,lutilizo:=.F.,oItem,nIni:=0

    lMenuXp:=.T.

    IF EMPTY(aMenu) .OR. EMPTY(aMenu[1])
       RETURN  // .F.
    ENDIF

    For i=1 TO LEN(aMenu[1])


      IF lMenuXp

        C5MENUITEM oItem PROMPT alltrim(aMenu[1,I]);
                   FILE aMenu[12,I]
      ELSE

       MENUITEM oItem PROMPT alltrim(aMenu[1,I]);
                 FILE aMenu[12,I]

      ENDIF

      IF aMenu[13,I]=4

         IF lMenuXp
             C5SEPARATOR
         ELSE
             SEPARATOR
         ENDIF

      ENDIF

      IF aMenu[13,I]=2

          nIni++

         IF lMenuXp

           C5MENU COLOR oDp:nMenuItemClrText, oDp:nMenuItemClrPane;
           COLORSEL oDp:nMenuItemSelText, oDp:nMenuItemSelPane;
           COLORBOX oDp:nMenuBoxClrText ;
           HEIGHT oDp:nMenuHeight;
           LOGOCOLOR oDp:nMenuMainClrText

         ELSE

           MENU

         ENDIF


          LOOP

      ENDIF

      oItem:bWhen      :=aMenu[11,I]
      oItem:bAction    :=aMenu[03,I]

      IF lMenuXp
        oItem:bAuxAction :=aMenu[03,I]
      ENDIF


    NEXT I

    FOR I=1 TO nIni

       IF lMenuXp
         C5ENDMENU
       ELSE
         ENDMENU
       ENDIF

    NEXT

//    C5ENDMENU

RETURN




 

Re: Menu desde Tabla MySql

Posted: Sat Dec 15, 2018 2:28 pm
by ruben Dario
Saludos

Nunca he Usado C5MENU, esto es una libreria a alguna clase.
Gracias