FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour set message to
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

set message to

Posted: Wed Oct 28, 2009 03: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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: set message to

Posted: Wed Oct 28, 2009 08:31 AM
Try

Code (fw): Select all Collapse
oWnd:oMsgBar:cMsgDef = "Changed"


EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: set message to

Posted: Wed Oct 28, 2009 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

Re: set message to

Posted: Thu Oct 29, 2009 04: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 (fw): Select all Collapse
 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: set message to

Posted: Thu Oct 29, 2009 03: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

Re: set message to

Posted: Thu Oct 29, 2009 03: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: set message to

Posted: Sun Nov 01, 2009 07: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 (fw): Select all Collapse
#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

Continue the discussion