Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Rehacer menu en tiempo de ejecucion
Posted: Tue Dec 25, 2018 09:27 PM
Otra posibilidad
#include "Fivewin.ch"
Static oWnd
Function Main()
DEFINE WINDOW oWnd TITLE "Change Menu " + FWVERSION MENU BuildMenu()
ACTIVATE WINDOW oWnd MAXIMIZED
Return nil
//----------------------------------------------------------------------------//
Function BuildMenu( n )
local oMenu
DEFAULT n := 1
MENU oMenu
MENUITEM "Inicio"
MENU
MENUITEM "Salir" ACTION oWnd:End()
ENDMENU
MENUITEM "Tablas"
MENU
MENUITEM "Bancos " ACTION ChangeMenu( 2 )
MENUITEM "Almacen" ACTION ChangeMenu( 1 )
ENDMENU
Do Case
Case n = 1
MENUITEM "Reportes de Inventario"
MENU
MENUITEM "Reporte Inventario"
MENUITEM "Reporte Almacen"
ENDMENU
Case n = 2
MENUITEM "Reportes de Bancos"
MENU
MENUITEM "Reporte Bancos"
MENUITEM "Reporte Cajas"
ENDMENU
EndCase
ENDMENU
Return oMenu
//----------------------------------------------------------------------------//
Function ChangeMenu( n )
oWnd:SetMenu( BuildMenu( n ) )
Return nil
//----------------------------------------------------------------------------//
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces