FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Como usar VistaMenu con MDI?
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Como usar VistaMenu con MDI?
Posted: Tue Jan 04, 2022 06:10 PM
Como usar VistaMenu con MDI?

Code (fw): Select all Collapse
// \samples\VISTAMN1.PRG

#include "fivewin.ch"

STATIC oWnd

FUNCTION Main()

聽 聽// LOCAL oWnd
聽 聽LOCAL oVmenu
聽 聽LOCAL oItem
聽 聽LOCAL oIcon

聽 聽DEFINE ICON oIcon NAME "C5ICON"

聽 聽DEFINE WINDOW oWnd TITLE "First test VistaMenu" ICON oIcon

聽 聽oVMenu := TVistaMenu():New( 0, 0, 100, 100, oWnd )
聽 聽oVMenu:nColumns := 1
聽 聽oVMenu:nType := 2

聽 聽oItem := oVMenu:AddItem( "Sistema y mantenimiento ", ".\..\bitmaps\pngs\image1.png" )

聽 聽oItem:AddItem( "Empezar a trabajar con windows",, ;
聽 聽 聽 {|| MsgInfo( "Sistema y mantenimiento" ) } )

聽 聽oItem:AddItem( "Hacer una copia de seguridad del equipo" )

聽 聽oItem:AddItem( "Item 1 Item 1" )
聽 聽oItem:AddItem( "ItemItem2 ItemItem2" )
聽 聽oItem:AddItem( "ItemItemItem3 ItemItemItem3" )

聽 聽/*
聽 聽oItem := oVMenu:AddItem( "Tabelas ", "" )

聽 聽oItem:AddItem( "Ramo de Atividades",, ;
聽 聽 聽 {| o | o := SILVIOMDI_FWH() } )
聽 聽*/

聽 聽oItem := oVMenu:AddItem( "Seguridad", ".\..\bitmaps\pngs\image2.png" )

聽 聽oItem:AddItem( "Window MDI Usando Vista",, ;
聽 聽 聽 {| o | o := VISTA_MDI_FWH( oWnd ) } )

聽 聽/*
聽 聽oItem:AddItem( "Buscar actualizaciones" )
聽 聽*/

聽 聽oItem:AddItem( "Dejar pasar un programa a trav茅s de Firewall de Windows" )

聽 聽oItem := oVMenu:AddItem( "Redes e Internet", ".\..\bitmaps\pngs\image3.png" )

聽 聽oItem:lEnable := .F.

聽 聽oItem:AddItem( "Ver el estado y las tareas de red" )
聽 聽oItem:AddItem( "Configurar el uso compartido de archivos" )

聽 聽oItem := oVMenu:AddItem( "Hardware y sonido", ".\..\bitmaps\pngs\image4.png" )

聽 聽oItem:AddItem( "Reproducir un CD u otros archivos multimedia autom谩ticamente" )

聽 聽oItem:AddItem( "Impresora" )

聽 聽oItem:AddItem( "Mouse" )

聽 聽oItem := oVMenu:AddItem( "Programas", ".\..\bitmaps\pngs\image5.png" )

聽 聽oItem:AddItem( "Desinstalar un programa" )
聽 聽oItem:AddItem( "Cambiar programas de inicio" )

聽 聽oItem := oVMenu:AddItem( "Equipo portatil", ".\..\bitmaps\pngs\image6.png" )

聽 聽oItem:AddItem( "Cambiar la configuraci贸n de la bateria" )
聽 聽oItem:AddItem( "Ajustar parametros de configuraci贸n de movilidad de uso frecuente" )

聽 聽oItem := oVMenu:AddItem( "Cuentas de usuario", ".\..\bitmaps\pngs\image7.png" )

聽 聽oItem:AddItem( "Cambiar tipo de cuenta" )

聽 聽oItem := oVMenu:AddItem( "Opciones adicionales", ".\..\bitmaps\pngs\image12.png" )

聽 聽oItem := oVMenu:AddItem( "Apariencia y personalizaci贸n", ".\..\bitmaps\pngs\image8.png" )

聽 聽oItem:AddItem( "Cambiar fondo de escritorio" )
聽 聽oItem:AddItem( "Cambiar la combinaci贸n de colores" )
聽 聽oItem:AddItem( "Ajustar la resoluci贸n de pantalla" )

聽 聽oItem := oVMenu:AddItem( "Reloj, idioma y regi贸n", ".\..\bitmaps\pngs\image9.png" )

聽 聽oItem:AddItem( "Cambiar teclados u otros m茅todos de entrada" )
聽 聽oItem:AddItem( "Cambiar el idioma para mostrar" )

聽 聽oItem := oVMenu:AddItem( "Accesibilidad", ".\..\bitmaps\pngs\image10.png" )

聽 聽oItem:AddItem( "Permitir que Windows sugiera parametros de configuraci贸n" )
聽 聽oItem:AddItem( "Optimizar la presentaci贸n visual" )

聽 聽oWnd:oClient := oVMenu

聽 聽ACTIVATE WINDOW oWnd CENTERED MAXIMIZED

RETURN 0

FUNCTION VISTA_MDI_FWH( oWnd )

聽 聽Local oBrw,oBar, oWndClients, oMsgBar

聽 聽use customer

聽 聽DEFINE WINDOW oWndClients MDICHILD OF oWnd TITLE "Clients"

聽 聽@ 2, 0 XBROWSE oBrw OF oWndClients LINES AUTOSORT ;
聽 聽 聽 聽 聽AUTOCOLS DATASOURCE "Customer" NOBORDER

聽 聽oBrw:CreateFromCode()
聽 聽oBrw:SetFocus()

聽 聽DEFINE BUTTONBAR oBar OF oWndClients 2015 SIZE 70, 60

聽 聽oWndClients:oClient = oBrw
聽 聽oWndClients:oControl = oBrw

聽 聽DEFINE MSGBAR oMsgBar OF oWndClients 2015

聽 聽 ACTIVATE WINDOW oWndClients MAXIMIZED ;
聽 聽 聽 聽 聽VALID ( oWndClients := nil, .T. )

RETURN NIL


Regards, saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM
Re: Como usar VistaMenu con MDI?
Posted: Tue Jan 04, 2022 09:31 PM
Jo茫o, 驴es esto lo que quieres? Pru茅balo.

Las modificaciones est谩n en la funci贸n VISTA_MDI_FWH( oWnd )



Code (fw): Select all Collapse
FUNCTION VISTA_MDI_FWH( oWnd )

聽 聽Local oBrw,oBar, oWndClients, oMsgBar

聽 聽use customer new alias "Customer" //<--------ABRIR BD CON NEW ALIAS 

聽 聽DEFINE WINDOW oWndClients of oWnd TITLE "Clients" //<----- ELIMINAR MDICHILD

聽 聽@ 2, 0 XBROWSE oBrw OF oWndClients LINES AUTOSORT ;
聽 聽 聽 聽 聽AUTOCOLS DATASOURCE "Customer" NOBORDER

聽 聽oBrw:CreateFromCode()
聽 聽oBrw:SetFocus()

聽 聽DEFINE BUTTONBAR oBar OF oWndClients 2015 SIZE 70, 60

聽 聽oWndClients:oClient = oBrw
聽// 聽oWndClients:oControl = oBrw //<---- DESACTIVADO

聽 聽DEFINE MSGBAR oMsgBar OF oWndClients 2015

聽 聽 ACTIVATE WINDOW oWndClients MAXIMIZED ;
聽 聽 聽 聽 聽VALID ( oWndClients := nil, .T. )

RETURN NIL


Un saludo
FWH 20.12 BCC7
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Como usar VistaMenu con MDI?
Posted: Wed Jan 05, 2022 01:05 AM

Gracias Ram贸n, funciona perfecto.

Saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion