PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Marc van Cauwenberghe on October 15, 2008, 10:12:02 AM

Title: Command Button Caption Change
Post by: Marc van Cauwenberghe on October 15, 2008, 10:12:02 AM
I can change the button caption, but it doesn't actually change until I move the mouse over it..

Can I force the change?

I was thinking redraw, but didn't know if that is the best tack to take.
Title: Re: Command Button Caption Change
Post by: TechSupport on October 15, 2008, 12:57:51 PM
Do you mean at design time (within the FireFly IDE) or run time (when your application is actually executing)?
Title: Re: Command Button Caption Change
Post by: TechSupport on October 15, 2008, 01:00:02 PM
If it is during runtime then there is something else in your code that is preventing control updates. Can you post the code where you are updating the caption? I have never encountered a situation where FF_Control_SetText does not update the caption immediately.

Title: Re: Command Button Caption Change
Post by: Marc van Cauwenberghe on October 17, 2008, 08:48:10 AM
My Bad!!  I am using the RRButton  .. I don't have this issue with the standard Button.
Title: Re: Command Button Caption Change
Post by: Marc van Cauwenberghe on October 17, 2008, 08:50:39 AM
I used the control redraw to force the update..

I assume this is the preferred method.
Title: Re: Command Button Caption Change
Post by: TechSupport on October 17, 2008, 10:45:27 AM
Hi Jim,

Yes, I guess FF_Control_Redraw would work because it simply applies a paint tot he control. Likewise, you could send the specific RRButton message, %RBM_REFRESH, to do the same thing.

i.e.
SendMessage hWndControl, %RBM_REFRESH, 0, 0

Title: Re: Command Button Caption Change
Post by: Marc van Cauwenberghe on October 17, 2008, 10:50:31 AM
I am finding I need to seperate lines in order to compile...
No biggie, but I was wondering..  BTW the more I use FF the better I like it.. :D
I find that I must put an empty line after the FF_TextBox_SetText command.

This statement generates an error
    If IsFalse Len(FF_TextBox_GetText (HWND_FORM1_TXTPC)) Then
       FF_TextBox_SetText (HWND_FORM1_TXTPC, "Select Profile")_As_Long 
     End If
Error Number = 455... End IF Expected....

This does not..

If IsFalse Len(FF_TextBox_GetText (HWND_FORM1_TXTPC)) Then
   
       FF_TextBox_SetText (HWND_FORM1_TXTPC, "Select Profile")_As_Long
        
     End If
Title: Re: Command Button Caption Change
Post by: TechSupport on October 17, 2008, 01:22:50 PM
Hi Jim,

You must be using the F8 code function popup to insert the prototype for the FF_TextBox_SetText function. When you do that, you must edit it a little bit. For example at the end of the string is "_As_Long". You need to get rid of that when you use it in code. It is there just to remind you that the function returns a Long result.


FF_TextBox_SetText (HWND_FORM1_TXTPC, "Select Profile")_As_Long 


to:


FF_TextBox_SetText (HWND_FORM1_TXTPC, "Select Profile") 

- or -

FF_TextBox_SetText HWND_FORM1_TXTPC, "Select Profile"


Title: Re: Command Button Caption Change
Post by: TechSupport on October 17, 2008, 01:24:08 PM
Quote from: Jim Padgett on October 17, 2008, 10:50:31 AM
BTW the more I use FF the better I like it.. :D

I love hearing from users that enjoy FireFly. Thanks! :)