FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posts: 330
Joined: Fri May 25, 2007 09:06 PM
SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Thu Dec 20, 2012 11:22 PM

MASTER ANTONIO y Estimados colegas, tengo la siguiente duda...
tengo una ventana window oWnd. que contiene dos botones y un menu simple.
los botones y el menu tienen la clausula MESSAGE al crearlos.

El problema o duda de comportamiento es la siguiente:
cree una function que deberia entregar el valor de la message asi: MsgInfo(oWnd:oMsgBar:cMsg), con los botones funciona OK, pero por alguna razon con el MENU no.. sale en blanco MsgInfo(oWnd:oMsgBar:cMsg)

pongo aca el codigo si lo quieren compilar y probar.

include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

DEFINE WINDOW oWnd FROM 1, 5 TO 20, 70 TITLE "Testeo para cMsg BUG" ;
MENU BuildMenu()

@ 4, 4 BUTTON "Boton 1" SIZE 160, 25 OF oWnd MESSAGE " Prueba de cMsg 1";
ACTION VH()

@ 7, 4 BUTTON "Boton 2" SIZE 160, 25 OF oWnd MESSAGE " Prueba de cMsg 2";
ACTION VH()

SET MESSAGE OF oWnd TO FWVERSION + " - Menu Management Power"

ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

local oMenu

MENU oMenu
MENUITEM "Menu 1"
MENU
MENUITEM "uno" MESSAGE "Really nice MenuItems!"
MENU
MENUITEM "UNO 1" MESSAGE "Red Color" ACTION VH()
MENUITEM "UNO 2" MESSAGE "Green Color" ACTION VH()
MENUITEM "UNO 3" MESSAGE "Yellow Color" ACTION VH()
MENUITEM "UNO 4" MESSAGE "Cyan Color" ACTION VH()
MENUITEM "UNO 5" MESSAGE "Magenta Color" ACTION VH()
ENDMENU
ENDMENU
ENDMENU

return oMenu

Function VH ()

? oWnd:oMsgbar:cMsg

return Nil

//----------------------------------------------------------------------------//

Alguien podría decirme como obtengo el cMsg desde MENU

Posts: 330
Joined: Fri May 25, 2007 09:06 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Fri Dec 21, 2012 11:32 AM

..

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Fri Dec 21, 2012 12:12 PM
Code (fw): Select all Collapse
#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   DEFINE WINDOW oWnd FROM 1, 5 TO 20, 70 TITLE "Testeo para cMsg BUG" ;
          MENU BuildMenu()

   DEFINE BUTTONBAR OBAR BUTTONSIZE 49, 55 _3DLOOK  TOP  OF oWnd

   @ 4, 4 BUTTON "Boton 1" SIZE 160, 25 OF oWnd MESSAGE " Prueba de cMsg 1";
          ACTION VH()

   @ 7, 4 BUTTON "Boton 2" SIZE 160, 25 OF oWnd MESSAGE " Prueba de cMsg 2";
          ACTION VH()


   SET MESSAGE OF oWnd TO FWVERSION + " - Menu Management Power"

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu, cMensag

   MENU oMenu

      MENUITEM "Menu 1"

         MENU

         MENUITEM "uno" MESSAGE "Really nice MenuItems!"

         MENU

            MENUITEM "UNO 1" MESSAGE "Red Color"     ACTION VH("Red Color")
            MENUITEM "UNO 2" MESSAGE "Green Color"   ACTION VH("Green Color")
            MENUITEM "UNO 3" MESSAGE "Yellow Color"  ACTION VH("Yellow Color")
            MENUITEM "UNO 4" MESSAGE "Cyan Color"    ACTION VH("Cyan Color")
            MENUITEM "UNO 5" MESSAGE "Magenta Color" ACTION VH("Magenta Color")

         ENDMENU

      ENDMENU

   ENDMENU

return oMenu

Function VH( cMensa ) // pasa la mensageria por referencia...

   ? oWnd:oMsgbar:cMsg, cMensa

return Nil

//----------------------------------------------------------------------------//

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Fri Dec 21, 2012 12:30 PM
Hola

Tambien puedes hacer esto

Code (fw): Select all Collapse
MENUITEM "UNO 1" MESSAGE "Red Color"     ACTION VH( oMenuItem )

Function VH( oMenuItem )

    ? oMenuItem:cMsg

return Nil
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Fri Dec 21, 2012 01:01 PM
Hola, asi tambien podes hacerlo:
Code (fw): Select all Collapse
function BuildMenu()

local oMenu

MENU oMenu
MENUITEM "Menu 1"
MENU
MENUITEM "uno" MESSAGE "Really nice MenuItems!"
MENU
MENUITEM "UNO 1" MESSAGE "Red Color" ACTION VH(oMenuItem:cMsg)
MENUITEM "UNO 2" MESSAGE "Green Color" ACTION VH(oMenuItem:cMsg)
MENUITEM "UNO 3" MESSAGE "Yellow Color" ACTION VH(oMenuItem:cMsg)
MENUITEM "UNO 4" MESSAGE "Cyan Color" ACTION VH(oMenuItem:cMsg)
MENUITEM "UNO 5" MESSAGE "Magenta Color" ACTION VH(oMenuItem:cMsg)
ENDMENU
ENDMENU
ENDMENU

return oMenu

Function VH (cMsg)
default cMsg := oWnd:oMsgbar:cMsg
? cMsg

return Nil

Saludos
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 330
Joined: Fri May 25, 2007 09:06 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Fri Dec 21, 2012 01:05 PM

La idea colegas es: tomar el cmsg siempre de ownd. ventana padre.. asi: oWnd:oMsgBar:cMsg.

por alguna razon la clase tmenu no actualizar la data cmg de Tmsgbar,, como los otros controles,,

la idea es esa. saber pq y como corregirlo.

Posts: 330
Joined: Fri May 25, 2007 09:06 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Mon Dec 24, 2012 02:26 AM

..

Posts: 330
Joined: Fri May 25, 2007 09:06 PM
Re: SOBRE MESSAGE y la DATA oMsgBar:cMsg
Posted: Wed Dec 26, 2012 02:17 AM

.. alguna idea

Continue the discussion