set message to

set message to

Postby hag » Wed Oct 28, 2009 3:41 am

Using a set message to oWnd with a variable in the message. When the variable changes the message changes however when I mouse over the message the variable reverts back to the old variable. When I no longer mouse over it the goes to the new variable. How do I prevent it from reverting to the old variable when I mouse over the message?
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: set message to

Postby Enrico Maria Giordano » Wed Oct 28, 2009 8:31 am

Try

Code: Select all  Expand view
oWnd:oMsgBar:cMsgDef = "Changed"


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: set message to

Postby James Bott » Wed Oct 28, 2009 2:33 pm

Harvey,

This is a strange issue. I have dealt with it before and I never quite understood it. There actually two messages--I think one is supposed to be a temp message that is displayed during an activity, and the other is the previous message which is then displayed again after the activity.

This is from my notes:
----------------
The class is stange in that it contains two message vars, ::cMsg and ::cMsgDef. Here is how I got it to work:

oWnd:oMsgBar:cMsgDef:="xxx"
oWnd:oMsgBar:setMsg("yyy")

You must do both things. The message displayed is "xxx". If you don't pass something in setMsg() nothing happens, but the string you pass is not the one that is displayed.
------------

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: set message to

Postby hag » Thu Oct 29, 2009 4:14 am

James and Enrico:

This is the code I got working. Needed to set the set message before anything worked.
Also if i added 2007 to the set message it display the old variables when I moused over.

Code: Select all  Expand view
SET MESSAGE of oWnd1 TO "" COLOR CLR_WHITE,CLR_BLUE NOINSET //DATE CLOCK              
       
                 oWnd1:oMsgBar:DateOn()
                 oWnd1:oMsgBar:clockOn()  
                 oWnd1:oMsgBar:cMsgDef := "YOU ARE WORKING ON ENTITY NO. " +SUBSTR(GLD,5,3)+", "+ALLTRIM(MCOMPNAME)              
                 oWnd1:oMsgBar:setMsg("")


But it works fine just need to give up the theme on the bar.

Thank you both.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: set message to

Postby James Bott » Thu Oct 29, 2009 3:40 pm

Harvey,

>But it works fine just need to give up the theme on the bar.

So, it sounds like there may be a bug when using themes?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: set message to

Postby hag » Thu Oct 29, 2009 3:42 pm

I assume so. as soon as 2007 is added to the set message it reverts to the old variable on the mouse over.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: set message to

Postby nageswaragunupudi » Sun Nov 01, 2009 7:02 am

I suggest trying this sample program to change the default message. This works correctly and the same way whether Themed or not and whether 2007 style is used or not.
Code: Select all  Expand view
#include 'fivewin.ch'

function Main()

   local ownd

   DEFINE WINDOW oWnd

   @ 100,40 BUTTON 'ReviseMsg' SIZE 100,30 PIXEL OF oWnd ;
      MESSAGE 'Click to change MessageBar Default Message' ;
      ACTION ( oWnd:oMsgBar:cMsgDef := 'Revised Message', oWnd:oMsgBar:Refresh() )

   SET MESSAGE OF oWnd TO 'Initial Message' 2007

   ACTIVATE WINDOW oWnd

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 54 guests