Page 1 of 1

How to perform a refresh of msgbar?

PostPosted: Tue Mar 21, 2017 9:45 am
by MarcoBoschi
Hi,
I have to change in oMsgBar the string from "STRING" to "SET" not only If I click in the string "CLICK" but even IF a Select the menu Set global password.
The string must change based on the value of public variable lPsw.
I do not know if I have to refresh()....

Please any hints?

Marco



Code: Select all  Expand view
#include "fivewin.ch"
FUNCTION MAIN

LOCAL oMain
LOCAL oItem
LOCAL oMenu

PUBLIC lPsw := .F.



MENU oMenu 2007

  MENUITEM "&File"

     MENU 2007
        MENUITEM "Set Global Password"       ACTION  GlobalPsw()
        MENUITEM "Global Password?"          ACTION  MsgInfo( M->lPsw )
        MENUITEM "Global Password False"     ACTION  ( M->lPsw := .F. , oItem:refresh() )

     ENDMENU

ENDMENU

DEFINE WINDOW oMain  MENU oMenu

SET MESSAGE OF oMain TO "MyMsgMar"  CENTERED DATE KEYBOARD 2007

oItem := TMsgItem():New( oMain:oMsgBar, "CLICK" , 50, , , , .T., { || oItem:SetText( GlobalPsw() ) } ,,, "" )

ACTIVATE WINDOW oMain


RETURN NIL


FUNCTION GLOBALPSW()
M->lPsw := .T.

RETURN  "SET"
 

Re: How to perform a refresh of msgbar?

PostPosted: Tue Mar 21, 2017 9:53 am
by Enrico Maria Giordano
Code: Select all  Expand view
#include "fivewin.ch"
FUNCTION MAIN

LOCAL oMain
LOCAL oItem
LOCAL oMenu

PUBLIC lPsw := .F.



MENU oMenu 2007

  MENUITEM "&File"

     MENU 2007
        MENUITEM "Set Global Password"       ACTION  oItem:SetText( GlobalPsw() )
        MENUITEM "Global Password?"          ACTION  MsgInfo( M->lPsw )
        MENUITEM "Global Password False"     ACTION  ( M->lPsw := .F. , oItem:SetText( "CLICK" ) )

     ENDMENU

ENDMENU

DEFINE WINDOW oMain  MENU oMenu

SET MESSAGE OF oMain TO "MyMsgMar"  CENTERED DATE KEYBOARD 2007

oItem := TMsgItem():New( oMain:oMsgBar, "CLICK" , 50, , , , .T., { || oItem:SetText( GlobalPsw() ) } ,,, "" )

ACTIVATE WINDOW oMain


RETURN NIL


FUNCTION GLOBALPSW()
M->lPsw := .T.

RETURN  "SET"


EMG

Re: How to perform a refresh of msgbar?

PostPosted: Tue Mar 21, 2017 10:04 am
by MarcoBoschi
:D
Gracias!