How to perform a refresh of msgbar?

How to perform a refresh of msgbar?

Postby MarcoBoschi » Tue Mar 21, 2017 9:45 am

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"
 
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: How to perform a refresh of msgbar?

Postby Enrico Maria Giordano » Tue Mar 21, 2017 9:53 am

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
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How to perform a refresh of msgbar?

Postby MarcoBoschi » Tue Mar 21, 2017 10:04 am

:D
Gracias!
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano, nageswaragunupudi and 10 guests