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"